linux-stable/drivers/gpio
Mika Westerberg 77c2d7929d gpiolib: Allow GPIO chips to request their own GPIOs
Sometimes it is useful to allow GPIO chips themselves to request GPIOs they
own through gpiolib API. One use case is ACPI ASL code that should be able
to toggle GPIOs through GPIO operation regions.

We can't use gpio_request() because it will pin the module to the kernel
forever (it calls try_module_get()). To solve this we move module refcount
manipulation to gpiod_request() and let __gpiod_request() handle the actual
request. This changes the sequence a bit as now try_module_get() is called
outside of gpio_lock (I think this is safe, try_module_get() handles
serialization it needs already).

Then we provide gpiolib internal functions gpiochip_request/free_own_desc()
that do the same as gpio_request() but don't manipulate module refrence
count. This allows the GPIO chip driver to request and free descriptors it
owns without being pinned to the kernel forever.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-13 10:32:18 +01:00
..
devres.c gpiolib: devres: add missing headers 2013-10-29 18:26:14 -07:00
gpio-74x164.c gpio: 74x164: Driver cleanup 2013-12-12 14:28:12 +01:00
gpio-adnp.c Merge branch 'mark-irqs' into devel 2013-12-04 14:48:17 +01:00
gpio-adp5520.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-adp5588.c gpio: adp5588 - add support for gpio names 2014-02-13 13:52:44 +01:00
gpio-amd8111.c gpio: remove DEFINE_PCI_DEVICE_TABLE macro 2013-12-03 13:16:09 +01:00
gpio-arizona.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-bcm-kona.c gpio: bcm281xx: Use "unsigned gpio" consistently throughout the code 2014-02-06 10:33:47 +01:00
gpio-bt8xx.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-clps711x.c gpio: clps711x: Add missing .owner to struct gpio_chip 2014-02-06 10:33:48 +01:00
gpio-cs5535.c
gpio-da9052.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-da9055.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-davinci.c gpio: davinci: fix gpio selection for OF 2014-03-11 11:14:19 +01:00
gpio-dwapb.c gpio: add a driver for the Synopsys DesignWare APB GPIO block 2014-03-05 08:59:45 +08:00
gpio-em.c Merge branch 'mark-irqs' into devel 2013-12-04 14:48:17 +01:00
gpio-ep93xx.c gpio: ep93xx: get rid of bogus __raw* accessors 2013-10-16 09:59:54 +02:00
gpio-f7188x.c gpio: f7188x: set can_sleep attribute 2014-01-07 19:02:01 +01:00
gpio-ge.c
gpio-generic.c gpio: generic: clamp retured value to [0,1] 2014-02-06 10:33:48 +01:00
gpio-grgpio.c
gpio-ich.c gpio: ich: Add output levels cache support 2014-02-12 16:12:22 +01:00
gpio-intel-mid.c gpio: intel-mid: comments cleanup 2014-02-03 09:11:58 +01:00
gpio-iop.c ARM: plat-iop: pass physical base for GPIO 2013-09-20 23:05:19 +02:00
gpio-it8761e.c
gpio-janz-ttl.c gpio: use dev_get_platdata() 2013-08-16 15:24:35 +02:00
gpio-kempld.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-ks8695.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-lp3943.c gpio: lp3943: Remove redundant of_match_ptr helper 2014-01-21 08:29:00 +00:00
gpio-lpc32xx.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-lynxpoint.c Merge branch 'mark-irqs' into devel 2013-12-04 14:48:17 +01:00
gpio-max730x.c gpio: max730x: Remove redundant dev_set_drvdata 2014-01-02 13:54:34 +01:00
gpio-max732x.c gpio: max732x: Fix possible NULL pointer dereference on i2c_new_dummy error 2014-03-12 14:50:51 +01:00
gpio-max7300.c
gpio-max7301.c gpio: max7301: Reverting "Do not force SPI speed when using OF Platform" 2013-08-23 19:44:28 +02:00
gpio-mc9s08dz60.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-mc33880.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-mcp23s08.c gpio: mcp23s08: trivial: fixed coding style issues 2014-03-12 14:52:14 +01:00
gpio-ml-ioh.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-mm-lantiq.c
gpio-moxart.c gpio: moxart: remove redundant dev_err call in moxart_gpio_probe() 2013-12-20 10:22:19 +01:00
gpio-mpc8xxx.c powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536 2013-12-03 13:10:48 +01:00
gpio-mpc5200.c
gpio-msic.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-msm-v1.c
gpio-msm-v2.c GPIO tree bulk changes for v3.14 2014-01-21 10:09:12 -08:00
gpio-mvebu.c gpio: mvebu: use chained_irq_{enter,exit} for GIC compatibility 2014-02-12 16:23:58 +01:00
gpio-mxc.c gpio: mxc: Do not hard code return value 2014-01-02 13:55:53 +01:00
gpio-mxs.c gpio: gpio-mxs: Remove unneeded dt checks 2013-11-06 10:51:24 +01:00
gpio-octeon.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-omap.c gpio: omap: Use devm_ioremap_resource() 2014-02-24 14:44:43 +01:00
gpio-palmas.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-pca953x.c gpio: pca953x: Fix gpio_base may not default to -1 2014-02-13 14:04:30 +01:00
gpio-pcf857x.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-pch.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-pl061.c gpio: gpio-pl061: Use %pa to print 'resource_size_t' 2014-03-07 09:19:38 +08:00
gpio-pxa.c gpio: pxa: clamp gpio get value to [0,1] 2014-01-15 08:56:20 +01:00
gpio-rc5t583.c gpio: rc5t583: Remove redundant check 2014-02-24 14:51:49 +01:00
gpio-rcar.c GPIO tree bulk changes for v3.14 2014-01-21 10:09:12 -08:00
gpio-rdc321x.c gpio: use dev_get_platdata() 2013-08-16 15:24:35 +02:00
gpio-sa1100.c ARM: 7841/1: sa1100: remove complex GPIO interface 2013-10-29 11:01:02 +00:00
gpio-samsung.c ARM: S5P[v210|c100|64x0]: Fix build error 2014-01-15 13:48:06 +01:00
gpio-sch.c
gpio-sch311x.c gpio: sch311x: fix compilation error 2013-12-23 18:12:48 +01:00
gpio-sodaville.c gpio: sodaville: fix some error return code on error path 2013-12-20 10:23:18 +01:00
gpio-spear-spics.c drivers/gpio: simplify use of devm_ioremap_resource 2013-08-16 17:16:31 +02:00
gpio-sta2x11.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-stmpe.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-stp-xway.c
gpio-sx150x.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-tb10x.c gpio: tb10x: Remove redundant of_match_ptr helper 2014-01-02 14:03:22 +01:00
gpio-tc3589x.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-tegra.c gpio: tegra: add missing error handling to probe 2013-12-11 13:37:48 +01:00
gpio-timberdale.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-tps6586x.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-tps65910.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-tps65912.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-ts5500.c gpio: use dev_get_platdata() 2013-08-16 15:24:35 +02:00
gpio-twl4030.c GPIO tree bulk changes for v3.14 2014-01-21 10:09:12 -08:00
gpio-twl6040.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-tz1090-pdc.c
gpio-tz1090.c gpio-tz1090: Replace commas with semi-colons 2014-03-07 11:57:00 +08:00
gpio-ucb1400.c Linux 3.13-rc3 2013-12-09 14:04:37 +01:00
gpio-viperboard.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-vr41xx.c
gpio-vx855.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-wm831x.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-wm8350.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-wm8994.c gpio/pinctrl: make gpio_chip members typed boolean 2013-12-04 14:42:46 +01:00
gpio-xilinx.c
gpio-xtensa.c gpio: driver for Xtensa GPIO32 2013-12-12 14:33:14 +01:00
gpio-zevio.c gpio: New driver for LSI ZEVIO SoCs 2014-02-27 10:30:42 +01:00
gpiolib-acpi.c gpiolib: ACPI: remove gpio_to_desc() usage 2014-02-12 17:15:46 +01:00
gpiolib-of.c gpio: gpiolib-of: Use PTR_ERR_OR_ZERO 2014-02-06 10:33:46 +01:00
gpiolib.c gpiolib: Allow GPIO chips to request their own GPIOs 2014-03-13 10:32:18 +01:00
gpiolib.h gpiolib: Allow GPIO chips to request their own GPIOs 2014-03-13 10:32:18 +01:00
Kconfig gpio: Spelling s/than/that/ 2014-03-12 15:54:54 +01:00
Makefile gpio: remove obsolete tnetv107x driver 2014-03-05 10:44:44 +08:00