summaryrefslogtreecommitdiff
path: root/include/asm-generic/gpio.h
Commit message (Collapse)AuthorAgeLines
* dm: gpio: Add a function to read an ID from a list of GPIOsSimon Glass2014-11-21-1/+10
| | | | | | | | | | | For board IDs a common approach is to set aside several GPIOs for use in determining the board ID. This can provide information about board features and the revision. Add a function that turns a list of GPIOs into an integer by assigning each GPIO to a single bit. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-dmTom Rini2014-10-26-3/+67
|\ | | | | | | | | | | | | | | | | Fix a trivial conflict over adding <dm.h> Conflicts: arch/arm/cpu/armv7/omap3/board.c Signed-off-by: Tom Rini <trini@ti.com>
| * dm: gpio: Remove unused get_state() uclass methodSimon Glass2014-10-23-2/+0
| | | | | | | | | | | | This is no longer used so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: gpio: Add gpio_requestf() helper for printf() stringsSimon Glass2014-10-23-0/+10
| | | | | | | | | | | | | | Add a helper which permits a printf()-style format string for the requester string. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: Move the function for getting GPIO status into the uclassSimon Glass2014-10-23-0/+18
| | | | | | | | | | | | This function can be more easily tested if it is in the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: gpio: Add gpio_get_function() and friendsSimon Glass2014-10-23-1/+33
| | | | | | | | | | | | Add helpers to the uclass to allow finding out the pin function. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: gpio: Implement GPIO reservation in the uclassSimon Glass2014-10-23-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | We have several GPIO drivers now and all are doing similar things to record which GPIOs are reserved. Move this logic into the uclass to make the drivers similar. We retain the request()/free() methods since currently one driver does use these for setting up the pin. Signed-off-by: Simon Glass <sjg@chromium.org>
* | gpio: add protype for name_to_gpioJeroen Hofstee2014-10-25-0/+2
|/ | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* gpio: header file comment spelling fixesMarcel Ziswiler2014-10-22-5/+5
| | | | | | Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* dm: gpio: Enhance gpio command to show only active GPIOsSimon Glass2014-08-31-2/+13
| | | | | | | | | | | | The GPIO list is very long in many cases and most of them are not used. By default, show only the GPIOs that are in use, and provide a flag to show all of them. This makes the 'gpio status' command much more pleasant. In order to do this, driver model now exposes a method for obtaining the 'function' of a GPIO, which describes whether it is an input or output, for example. Implementation of this method is optional. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: rename device struct to udeviceHeiko Schocher2014-05-27-11/+11
| | | | | | | | | | | | using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we use linux code (MTD/UBI/UBIFS some USB code,...) and cannot change the linux "struct device" Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
* dm: Add GPIO support and testsSimon Glass2014-03-04-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | Add driver model support for GPIOs. Since existing GPIO drivers do not use driver model, this feature must be enabled by CONFIG_DM_GPIO. After all GPO drivers are converted over we can perhaps remove this config. Tests are provided for the sandbox implementation, and are a sufficient sanity check for basic operation. The GPIO uclass understands the concept of named banks of GPIOs, with each GPIO device providing a single bank. Within each bank the GPIOs are numbered using an offset from 0 to n-1. For example a bank named 'b' with 20 offsets will provide GPIOs named b0 to b19. Anonymous GPIO banks are also supported, and are just numbered without any prefix. Each time a GPIO driver is added to the uclass, the GPIOs are renumbered accordinging, so there is always a global GPIO numbering order. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* gpio: remove duplicate function signatureNikita Kiryanov2012-12-11-13/+4
| | | | | | | gpio_request() appears twice in asm-generic/gpio.h Remove one of the definitions. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
* Add gpio_request() to asm-generic headerSimon Glass2012-09-21-0/+9
| | | | | | This function should also be part of the GPIO API, so add it. Signed-off-by: Simon Glass <sjg@chromium.org>
* gpio: Modify common gpio.h to more closely match LinuxJoe Hershberger2012-01-09-9/+32
| | | | | | | | | Change "int gp" to "unsigned gpio" Add request and free entry-points Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Joe Hershberger <joe.hershberger@gmail.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
* Add generic gpio.h in asm-genericSimon Glass2011-10-17-0/+74
Since we want want to have a standard GPIO interface, this adds a definition for this into include/asm-generic/gpio.h. Signed-off-by: Simon Glass <sjg@chromium.org>