linux/drivers/gpio
Dmitry Torokhov 25487533ff gpio / ACPI: ignore GpioInt() GPIOs when requesting GPIO_OUT_*
When firmware does not use _DSD properties that allow properly name GPIO
resources, the kernel falls back on parsing _CRS resources, and will
return entries described as GpioInt() as general purpose GPIOs even
though they are meant to be used simply as interrupt sources for the
device:

Device (ETSA)
{
	Name (_HID, "ELAN0001")
	...

	Method(_CRS, 0x0, NotSerialized)
	{
		Name(BUF0,ResourceTemplate ()
		{
			I2CSerialBus(
				0x10,                     /* SlaveAddress */
				ControllerInitiated,      /* SlaveMode */
				400000,                   /* ConnectionSpeed */
				AddressingMode7Bit,       /* AddressingMode */
				"\\_SB.I2C1",             /* ResourceSource */
			)
			GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
				 "\\_SB.GPSW") { BOARD_TOUCH_GPIO_INDEX }
		} )
		Return (BUF0)
	}
...
}

This gives troubles with drivers such as Elan Touchscreen driver
(elants_i2c) that uses devm_gpiod_get to look up "reset" GPIO line and
decide whether the driver is responsible for powering up and resetting
the device, or firmware is. In the above case the lookup succeeds, we
map GPIO as output and later fail to request client->irq interrupt that
is mapped to the same GPIO.

Let's ignore resources described as GpioInt() while parsing _CRS when
requesting output GPIOs (but allow them when requesting GPIOD_ASIS or
GPIOD_IN as some drivers, such as i2c-hid, do request GPIO as input and
then map it to interrupt with gpiod_to_irq).

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-04-08 10:10:08 +02:00
..
devres.c gpio: Propagate all errors in devm_get_gpiod_from_child() 2016-02-25 10:04:25 +01:00
gpio-74x164.c gpio: 74x164: use gpiochip data pointer 2016-01-05 11:21:01 +01:00
gpio-74xx-mmio.c gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:19:42 +05:30
gpio-104-dio-48e.c gpio: 104-dio-48e: Use devm_request_region 2016-02-16 00:19:51 +01:00
gpio-104-idi-48.c gpio: 104-idi-48: Use devm_request_region 2016-02-16 00:19:51 +01:00
gpio-104-idio-16.c gpio: 104-idio-16: Use devm_request_region 2016-02-16 00:19:52 +01:00
gpio-adnp.c gpio: adnp: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:19:46 +05:30
gpio-adp5520.c gpio: adp5520: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:34:06 +05:30
gpio-adp5588.c gpio: adp5588: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:34:24 +05:30
gpio-altera.c gpio: gpio-altera: Remove gpiochip on probe failure. 2016-01-27 10:50:22 +01:00
gpio-amd8111.c gpio: amd8111: Use devm_request_region 2016-02-16 00:19:52 +01:00
gpio-amdpt.c gpio: amdpt: use gpiochip data pointer 2016-01-05 11:21:02 +01:00
gpio-arizona.c gpio: arizona: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:34:29 +05:30
gpio-ath79.c gpio: ath79: Check valid gpio count for both DT and non-DT cases 2016-02-25 15:20:43 +01:00
gpio-bcm-kona.c gpio: bcm-kona: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:13 +05:30
gpio-brcmstb.c gpio: brcmstb: Use list_for_each_entry at appropriate places 2016-02-25 15:20:43 +01:00
gpio-bt8xx.c gpio: bt8xx: use gpiochip data pointer 2016-01-05 11:21:03 +01:00
gpio-clps711x.c gpio: clps711x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:27 +05:30
gpio-crystalcove.c gpio: crystalcove: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:27 +05:30
gpio-cs5535.c gpio: cs5535: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:28 +05:30
gpio-da9052.c gpio: da9052: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:29 +05:30
gpio-da9055.c gpio: da9055: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:29 +05:30
gpio-davinci.c Merge branch 'devel' into for-next 2016-02-22 13:47:49 +01:00
gpio-dln2.c gpio: dln2: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:30 +05:30
gpio-dwapb.c gpio: generic: factor into gpio_chip struct 2016-01-05 11:21:00 +01:00
gpio-em.c gpio: em: use gpiochip data pointer 2016-01-05 11:21:05 +01:00
gpio-ep93xx.c gpio: ep93xx: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:30 +05:30
gpio-etraxfs.c gpio: generic: factor into gpio_chip struct 2016-01-05 11:21:00 +01:00
gpio-f7188x.c gpio: f7188x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:31 +05:30
gpio-ge.c gpio: ge: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:31 +05:30
gpio-generic.c gpio: generic: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:32 +05:30
gpio-grgpio.c gpio: generic: factor into gpio_chip struct 2016-01-05 11:21:00 +01:00
gpio-ich.c gpio: ich: Use devm_request_region 2016-02-16 00:19:53 +01:00
gpio-intel-mid.c gpio: intel-mid: use gpiochip data pointer 2016-01-05 11:21:05 +01:00
gpio-iop.c gpio: iop: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:32 +05:30
gpio-it87.c gpio: it87: use gpiochip data pointer 2016-01-05 11:21:06 +01:00
gpio-janz-ttl.c gpio: janz-ttl: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:33 +05:30
gpio-kempld.c gpio: kempld: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:34 +05:30
gpio-ks8695.c gpio: ks8695: remove irq_to_gpio function 2016-02-19 00:20:30 +01:00
gpio-loongson.c gpio: convert remaining users to gpiochip_add_data() 2016-01-05 11:21:20 +01:00
gpio-lp3943.c Revert "gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free" 2016-03-09 22:00:27 +07:00
gpio-lpc18xx.c gpio: lpc18xx: use gpiochip data pointer 2016-01-05 11:21:06 +01:00
gpio-lpc32xx.c gpio: lpc32xx: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:35 +05:30
gpio-lynxpoint.c gpio: lynxpoint: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:35 +05:30
gpio-max730x.c gpio: max730x: use gpiochip data pointer 2016-01-05 11:21:07 +01:00
gpio-max732x.c gpio: max732x: use gpiochip data pointer 2016-01-05 11:21:07 +01:00
gpio-max7300.c gpio: Drop owner assignment from i2c_driver 2015-11-30 09:31:00 +01:00
gpio-max7301.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
gpio-mb86s7x.c gpio: mb86s7x: use gpiochip data pointer 2016-01-05 11:21:07 +01:00
gpio-mc9s08dz60.c gpio: mc9s08dz60: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:36 +05:30
gpio-mc33880.c gpio: mc33880: use gpiochip data pointer 2016-01-05 11:21:07 +01:00
gpio-mcp23s08.c gpio: mcp23s08: Fix clearing of interrupt. 2016-03-16 13:41:59 +01:00
gpio-menz127.c gpio: menz127: Drop lock field from struct men_z127_gpio 2016-03-30 10:39:39 +02:00
gpio-ml-ioh.c gpio: ml-ioh: use gpiochip data pointer 2016-01-05 11:21:08 +01:00
gpio-mm-lantiq.c gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs() 2016-01-13 10:21:06 +01:00
gpio-moxart.c Merge branch 'devm-gpiochip-add-data' into devel 2016-03-08 14:41:41 +07:00
gpio-mpc8xxx.c gpio: mpc8xxx: Slightly update the code for better readability 2016-03-09 10:44:13 +07:00
gpio-mpc5200.c gpio: Include linux/gpio.h instead of asm/gpio.h 2016-02-16 00:20:03 +01:00
gpio-msic.c gpio: msic: use gpiochip data pointer 2016-01-05 11:21:09 +01:00
gpio-mvebu.c gpio: mvebu: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:37 +05:30
gpio-mxc.c gpio: mxc: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:37 +05:30
gpio-mxs.c gpio: generic: factor into gpio_chip struct 2016-01-05 11:21:00 +01:00
gpio-octeon.c gpio: octeon: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:38 +05:30
gpio-omap.c gpio: omap: drop dev field from gpio_bank structure 2016-03-09 18:07:14 +07:00
gpio-palmas.c gpio: palmas: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:40 +05:30
gpio-pca953x.c gpio: pca953x: Fix pca953x_gpio_set_multiple() on 64-bit 2016-03-16 13:03:14 +01:00
gpio-pcf857x.c gpio: pcf857x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:39 +05:30
gpio-pch.c gpio: pch: Optimize pch_gpio_get() 2016-01-05 15:46:34 +01:00
gpio-pisosr.c gpio: pisosr: Use gpiod_set_value_cansleep in pisosr_gpio_refresh() 2016-02-25 15:20:46 +01:00
gpio-pl061.c gpio: pl061: use gpiochip data pointer 2016-01-05 11:21:11 +01:00
gpio-pxa.c gpio: pxa: use gpiochip data pointer 2016-01-05 11:21:12 +01:00
gpio-rc5t583.c gpio: rc5t583: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:40 +05:30
gpio-rcar.c gpio: rcar: Add Runtime PM handling for interrupts 2016-02-25 10:06:01 +01:00
gpio-rdc321x.c gpio: rdc321x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:41 +05:30
gpio-sa1100.c gpio: convert remaining users to gpiochip_add_data() 2016-01-05 11:21:20 +01:00
gpio-sch311x.c gpio: sch311x: Use devm_request_region 2016-02-16 00:19:53 +01:00
gpio-sch.c gpio: sch: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:41 +05:30
gpio-sodaville.c gpio: generic: factor into gpio_chip struct 2016-01-05 11:21:00 +01:00
gpio-spear-spics.c gpio: spear-spics: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:42 +05:30
gpio-sta2x11.c gpio: sta2x11: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:42 +05:30
gpio-stmpe.c gpio: stmpe: use gpiochip data pointer 2016-01-05 11:21:14 +01:00
gpio-stp-xway.c gpio: stp-xway: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:43 +05:30
gpio-sx150x.c gpio: sx150x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:43 +05:30
gpio-syscon.c gpio: syscon: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:44 +05:30
gpio-tb10x.c gpio: tb10x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:44 +05:30
gpio-tc3589x.c gpio: tc3589x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:45 +05:30
gpio-tegra.c gpio: tegra: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:46 +05:30
gpio-timberdale.c gpio: timberdale: Switch to devm_ioremap_resource() 2016-03-08 15:56:33 +07:00
gpio-tpic2810.c gpio: tpic2810: Make tpic2810_direction_output set proper output level 2016-02-16 15:56:51 +01:00
gpio-tps6586x.c gpio: tps6586x: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:47 +05:30
gpio-tps65086.c gpio: tps65086: Add GPO driver for the TPS65086 PMIC 2016-03-16 08:50:33 +00:00
gpio-tps65218.c gpio: tps65218: remove unused #include 2016-02-19 09:22:41 +01:00
gpio-tps65910.c gpio: tps65910: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:47 +05:30
gpio-tps65912.c gpio: tps65912: fix bad merge 2016-03-09 22:02:52 +07:00
gpio-ts4800.c gpio: ts4800: Drop redundant code to set already initialized gpio_chip fields 2016-02-25 15:20:44 +01:00
gpio-ts5500.c gpio: ts5500: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:49 +05:30
gpio-twl4030.c gpio: twl4030: use gpiochip data pointer 2016-01-05 11:21:16 +01:00
gpio-twl6040.c gpio: twl6040: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:50 +05:30
gpio-tz1090-pdc.c gpio: tz1090-pdc: use gpiochip data pointer 2016-01-05 11:21:16 +01:00
gpio-tz1090.c gpio: tz1090: use gpiochip data pointer 2016-01-05 11:21:16 +01:00
gpio-ucb1400.c gpio: ucb1400: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:50 +05:30
gpio-vf610.c gpio: vf610: use gpiochip data pointer 2016-01-05 11:21:17 +01:00
gpio-viperboard.c gpio: viperboard: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:51 +05:30
gpio-vr41xx.c gpio: convert remaining users to gpiochip_add_data() 2016-01-05 11:21:20 +01:00
gpio-vx855.c gpio: vx855: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:51 +05:30
gpio-wm831x.c gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:52 +05:30
gpio-wm8350.c gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:52 +05:30
gpio-wm8994.c gpio: wm8994: Use devm_gpiochip_add_data() for gpio registration 2016-02-23 20:35:53 +05:30
gpio-ws16c48.c gpio: ws16c48: Use devm_request_region 2016-02-16 00:19:54 +01:00
gpio-xgene-sb.c gpio: xgene: fix type of variable containing error codes 2016-02-25 15:20:45 +01:00
gpio-xgene.c gpio: xgene: Prevent NULL pointer dereference 2016-03-30 10:39:39 +02:00
gpio-xilinx.c gpio: xilinx: Do not use gpiochip_get_data() in xgpio_save_regs() 2016-01-07 10:06:56 +01:00
gpio-xlp.c gpio: xlp: use gpiochip data pointer 2016-01-05 11:21:19 +01:00
gpio-xtensa.c gpio: convert remaining users to gpiochip_add_data() 2016-01-05 11:21:20 +01:00
gpio-zevio.c gpio: zevio: use gpiochip data pointer 2016-01-05 11:21:19 +01:00
gpio-zx.c gpio: zx: use gpiochip data pointer 2016-01-05 11:21:19 +01:00
gpio-zynq.c gpio: zynq: use gpiochip data pointer 2016-01-05 11:21:20 +01:00
gpiolib-acpi.c gpio: move the pin ranges into gpio_device 2016-02-16 00:20:02 +01:00
gpiolib-legacy.c gpiolib: Split GPIO flags parsing and GPIO configuration 2015-10-16 22:46:46 +02:00
gpiolib-of.c gpio: of: provide optional of_mm_gpiochip_add_data() function 2016-01-05 11:20:12 +01:00
gpiolib-sysfs.c gpio: fix abi regression in sysfs 2016-02-25 16:08:45 +01:00
gpiolib.c gpio / ACPI: ignore GpioInt() GPIOs when requesting GPIO_OUT_* 2016-04-08 10:10:08 +02:00
gpiolib.h gpio: store reflect the label to userspace 2016-02-19 09:48:41 +01:00
Kconfig - New Drivers 2016-03-18 10:15:11 -07:00
Makefile - New Drivers 2016-03-18 10:15:11 -07:00