summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
Commit message (Collapse)AuthorAgeFilesLines
* gpio-davinci: gpio get should return 0 or 1Jan Luebbe2015-06-011-1/+1
| | | | | | | | Returning other values causes problems for client code which wants to perform calculations with the returned value. Signed-off-by: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of-device-id'Sascha Hauer2015-05-066-20/+20
|\
| * of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-306-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: Add driver for 74x164 compatible shift-registersSebastian Hesselbarth2015-04-273-0/+140
| | | | | | | | | | | | | | | | | | A 74x164 shift register can be seen as a SPI attached GPIO expander. This adds a driver for those poor-man expanders based on the Linux driver. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: orion: Convert to platform_driverSebastian Hesselbarth2015-04-201-6/+1
| | | | | | | | | | | | | | | | | | With support for deferred probing, we can now relax driver registration for Marvell Orion GPIO driver from postcore_initcall() to normal platform_driver. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: Return -EPROBE_DEFER on gpio_get_num()Sebastian Hesselbarth2015-04-171-1/+4
|/ | | | | | | | | | GPIO drivers can be registered quite late in registration process causing dependant devices to fail probing. If we know gpio_get_num will be called with a non-NULL device, return -EPROBE_DEFER instead of -ENODEV to allow re-probing later. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: MXS: Make gpio a driverSascha Hauer2015-01-283-0/+190
| | | | | | This turns the MXS gpio support into a driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: clps711x: Add missing includeSascha Hauer2014-11-271-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-167-13/+23
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let request_iomem_region return an error pointerSascha Hauer2014-09-161-2/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_get_resource_by_name return an error pointerSascha Hauer2014-09-161-3/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/i2c'Sascha Hauer2014-08-073-0/+502
|\
| * gpio: add driver for PCA95[357]x, PCA9698, TCA64xx, and MAX7310 SMBus I/O ↵Antony Pavlov2014-07-143-0/+502
| | | | | | | | | | | | | | expanders Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: add driver for Canon DIGICAntony Pavlov2014-07-293-0/+185
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add jz4740-gpio driver for Ingenic MIPS SoCsAntony Pavlov2014-06-273-0/+147
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add Malta CBUS FPGA I2C driverAntony Pavlov2014-06-243-0/+197
| | | | | | | | | | | This driver provides common support for accessing the CBUS FPGA I2C lines through the gpio library. Additional i2c bitbang driver must be enabled in order to use the functionality of the i2c controller. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: rename "gpiolib" -> "gpioinfo"Holger Schurig2014-05-151-5/+3
| | | | | Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2014-05-051-13/+7
|\ | | | | | | | | | | | | | | Conflicts: arch/arm/dts/tegra20-colibri.dtsi arch/arm/dts/tegra20-paz00.dts arch/arm/dts/tegra20.dtsi drivers/clk/tegra/clk-periph.c
| * gpio: tegra: add Tegra3 setupLucas Stach2014-04-231-0/+9
| | | | | | | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: tegra: remove dead codeLucas Stach2014-04-231-15/+0
| | | | | | | | | | | | | | | | Tegra is DT only, so remove platform code. While at it remove unused struct. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/ioresource'Sascha Hauer2014-05-051-2/+2
|\ \
| * | common: Allow for I/O mapped I/OMichel Stam2014-04-081-2/+2
| |/ | | | | | | | | | | | | | | Rework the current framework so that I/O mapped I/O resources are also possible. Signed-off-by: Michel Stam <michel@reverze.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / GPIO: i.MX: Implement get_direction()Alexander Shiyan2014-04-081-0/+10
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add driver for TI DaVinci SoCsAntony Pavlov2014-03-183-0/+219
| | | | | | | This driver is dts-only version of driver from Linux v3.14-rc5. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/gpio'Sascha Hauer2014-02-031-7/+19
|\
| * gpiolib: gpiolib command: show label only for requested pinsAntony Pavlov2014-01-101-1/+1
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpiolib: gpio_free: clear gpio's "label" field tooAntony Pavlov2014-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | If an error occured during gpio_request_array() then we can get not requested gpio with nonempty garbage "label" field value. Afterward the "gpiolib" command can try to use this nonempty garbage value. This patch prevents this error situation. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpiolib: gpio_request(): print message on errorAntony Pavlov2014-01-101-6/+17
| | | | | | | | | | | | | | Just copy gpiod_request() function logic from linux-v3.13-rc7. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: clps711x: Update driverAlexander Shiyan2014-01-241-14/+25
|/ | | | | | | | | This patch updates the CLPS711X GPIO driver. The update adds support for use with devicetree and optimizes "probe" a bit. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2013-12-061-2/+0
|\
| * gpio: tegra: remove leftover debug codeLucas Stach2013-12-041-2/+0
| | | | | | | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/omap-drivers'Sascha Hauer2013-12-063-0/+197
|\ \
| * | gpio: omap: Add devicetree probe supportSascha Hauer2013-11-271-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | This adds devicetree probe support for the OMAP gpio ports and also makes sure the corresponding platform_devices don't get registered when they are already present from devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | gpio: omap: move to drivers/gpio/Sascha Hauer2013-11-273-0/+160
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2013-12-061-0/+1
|\ \ | | | | | | | | | | | | Conflicts: scripts/Makefile
| * | treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| |/ | | | | | | | | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpiolib: import gpio_request_array() from linux 3.7Antony Pavlov2013-11-221-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also import related functions gpio_request_one() and gpio_free_array(). This commit imports code from linux 3.7 as the more recent linux kernel versions use gpiolib descriptors, see this commit for details: commit 372e722ea4dd4ca11c3d04845e11cbc15f32144c Author: Alexandre Courbot <acourbot@nvidia.com> Date: Sun Feb 3 01:29:29 2013 +0900 gpiolib: use descriptors internally Make sure gpiolib works internally with descriptors and (chip, offset) pairs instead of using the global integer namespace. This prepares the ground for the removal of the global gpio_desc[] array and the introduction of the descriptor-based GPIO API. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: unify gpio direction macros names with Linux kernelAntony Pavlov2013-11-222-2/+2
| | | | | | | | | | | | | | | | See linux.git/include/linux/gpio.h and linux.git/Documentation/gpio.txt for details. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: dw: add get_direction callbackSebastian Hesselbarth2013-11-111-0/+9
| | | | | | | | | | | | | | | | This adds a callback function to read the current state of a GPIOs in/out direction. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpiolib: make gpiolib command more verboseSebastian Hesselbarth2013-11-111-3/+21
|/ | | | | | | | | | This adds some more printf information to gpiolib command, like the gpiochip handling a specific gpio. Also, current direction and value of the gpio are printed, if the gpiochip provides the corresponding callbacks. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: Add designware gpio controller supportSascha Hauer2013-09-103-0/+166
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* GPIO: add Marvell Orion/MVEBU SoC GPIO driverSebastian Hesselbarth2013-07-053-0/+141
| | | | | | | | This adds a DT only driver for the GPIO controller found on Marvell Orion/MVEBU SoCs (Armada 370/XP, Dove, Kirkwood, MV78x00, Orion5x). Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: i.MX: initialize earlierSascha Hauer2013-06-181-1/+1
| | | | | | | The i.MX gpio driver doesn't have dependencies, so initialize it in a core_initcall to have the gpio functions available earlier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* GPIO: Add gpio_to_desc helperAlexander Shiyan2013-05-171-44/+51
| | | | | | | | Patch adds gpio_to_desc helper for validate GPIO. A bit optimization is performed (about -160 bytes on ARM). Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2013-05-063-0/+222
|\
| * tegra: add GPIO controller driverLucas Stach2013-04-143-0/+222
| | | | | | | | | | | | | | | | Taken from the Linux kernel, simplified and reworked to match barebox. Signed-off-by: Lucas Stach <dev@lynxeye.de> Tested-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX: Move GPIO driver to drivers/gpioAlexander Shiyan2013-04-223-0/+211
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | GPIO: Rename "drivers/gpio.c" to "drivers/gpiolib.c"Alexander Shiyan2013-04-222-1/+2
|/ | | | | | | | Rename "drivers/gpio.c" to "drivers/gpiolib.c". Reason is for understand functionality of driver. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>