linux-stable/drivers/pinctrl
Hans de Goede 30b969392c pinctrl: cherryview: Fix irq_valid_mask calculation
[ Upstream commit 63bdef6cd6 ]

Commit 03c4749dd6 ("gpio / ACPI: Drop unnecessary ACPI GPIO to Linux
GPIO translation") has made the cherryview gpio numbers sparse, to get
a 1:1 mapping between ACPI pin numbers and gpio numbers in Linux.

This has greatly simplified things, but the code setting the
irq_valid_mask was not updated for this, so the valid mask is still in
the old "compressed" numbering with the gaps in the pin numbers skipped,
which is wrong as irq_valid_mask needs to be expressed in gpio numbers.

This results in the following error on devices using pin 24 (0x0018) on
the north GPIO controller as an ACPI event source:

[    0.422452] cherryview-pinctrl INT33FF:01: Failed to translate GPIO to IRQ

This has been reported (by email) to be happening on a Caterpillar CAT T20
tablet and I've reproduced this myself on a Medion Akoya e2215t 2-in-1.

This commit uses the pin number instead of the compressed index into
community->pins to clear the correct bits in irq_valid_mask for GPIOs
using GPEs for interrupts, fixing these errors and in case of the
Medion Akoya e2215t also fixing the LID switch not working.

Cc: stable@vger.kernel.org
Fixes: 03c4749dd6 ("gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-12 19:21:19 +01:00
..
actions This is the bulk of pin control changes for v4.19: 2018-08-14 12:31:27 -07:00
aspeed pinctrl: aspeed: Fix documentation 2018-06-28 16:13:12 +02:00
bcm pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable() 2019-11-10 11:27:17 +01:00
berlin pinctrl: berlin: fix 'pctrl->functions' allocation in berlin_pinctrl_build_state 2018-08-03 19:28:15 +02:00
cirrus pinctrl: madera: Fix possible NULL pointer with pdata config 2018-08-29 14:02:47 +02:00
freescale pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show() 2018-08-01 23:01:07 +02:00
intel pinctrl: cherryview: Fix irq_valid_mask calculation 2019-11-12 19:21:19 +01:00
mediatek pinctrl: mediatek: Update cur_mask in mask/mask ops 2019-07-21 09:03:11 +02:00
meson pinctrl: meson-gxbb: Fix wrong pinning definition for uart_c 2019-10-07 18:57:00 +02:00
mvebu pinctrl: armada-37xx: swap polarity on LED group 2019-10-29 09:20:06 +01:00
nomadik pinctrl: nomadik: silence uninitialized variable warning 2018-08-10 23:14:04 +02:00
pxa pinctrl: pxa: pxa2xx: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2017-11-30 14:42:04 +01:00
qcom pinctrl: ssbi-gpio: Fix pm8xxx_pin_config_get() to be compliant 2018-11-13 11:08:29 -08:00
samsung pinctrl: samsung: fix leaked of_node references 2019-05-31 06:46:17 -07:00
sh-pfc This is the bulk of pin control changes for v4.19: 2018-08-14 12:31:27 -07:00
sirf treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
spear treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
sprd pinctrl: sprd: Use define directive for sprd_pinconf_params values 2019-10-01 08:26:07 +02:00
stm32 pinctrl: stm32: add syscfg mask parameter 2018-07-29 22:14:59 +02:00
sunxi pinctrl: sunxi: Correct number of IRQ banks on H6 main pin controller 2019-02-15 08:10:11 +01:00
tegra pinctrl: tegra: Fix write barrier placement in pmx_writel 2019-10-07 18:56:52 +02:00
ti treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
uniphier Char/Misc driver patches for 4.19-rc1 2018-08-18 11:04:51 -07:00
vt8500 treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
zte pinctrl: zte: fix leaked of_node references 2019-05-31 06:46:09 -07:00
core.c pinctrl: core: make sure strcmp() doesn't get a null parameter 2019-04-20 09:16:01 +02:00
core.h pinctrl: core: Remove broken remove_last group and pinmux functions 2018-07-17 10:49:49 +02:00
devicetree.c pinctrl: Support stopping deferred probe after initcalls 2018-07-10 17:22:35 +02:00
devicetree.h
Kconfig - New Drivers 2018-08-20 15:38:44 -07:00
Makefile Immutable branch (mfd, chrome) due for the v4.19 window 2018-07-27 08:11:37 +01:00
pinconf-generic.c pinctrl: Add skew-delay pin config and bindings 2017-11-08 13:49:45 +01:00
pinconf.c pinctrl: check ops->pin_config_set in pinconf_set_config() 2017-08-14 15:01:59 +02:00
pinconf.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
pinctrl-amd.c pinctrl: amd: disable spurious-firing GPIO IRQs 2019-10-07 18:56:55 +02:00
pinctrl-amd.h pinctrl/amd: fix gpio irq level in debugfs 2018-07-29 22:20:15 +02:00
pinctrl-artpec6.c pinctrl: artpec-6: Add smaller groups for uarts 2018-03-01 17:04:09 +01:00
pinctrl-as3722.c
pinctrl-at91-pio4.c pinctrl: at91-pio4: Remove redundant return value check 2018-07-16 14:46:11 +02:00
pinctrl-at91.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
pinctrl-at91.h
pinctrl-axp209.c pinctrl: axp209: Fix NULL pointer dereference after allocation 2018-08-10 23:12:43 +02:00
pinctrl-coh901.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
pinctrl-coh901.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pinctrl-da850-pupd.c
pinctrl-digicolor.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
pinctrl-falcon.c
pinctrl-gemini.c pinctrl: gemini: Mask properly 2018-06-26 09:51:42 +02:00
pinctrl-ingenic.c pinctrl: ingenic: Fix group & function error checking 2018-08-29 13:43:36 +02:00
pinctrl-lantiq.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
pinctrl-lantiq.h
pinctrl-lpc18xx.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
pinctrl-max77620.c pinctrl: max77620: Use define directive for max77620_pinconf_param values 2019-02-27 10:09:03 +01:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: Fix add_data and irqchip_add_nested call order 2019-07-21 09:03:08 +02:00
pinctrl-ocelot.c pinctrl: ocelot: add support for interrupt controller 2018-08-06 13:00:17 +02:00
pinctrl-oxnas.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
pinctrl-palmas.c pinctrl: palmas: Delete an error message for a failed memory allocation in palmas_pinctrl_probe() 2018-01-03 08:46:49 +01:00
pinctrl-pic32.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
pinctrl-pic32.h
pinctrl-pistachio.c pinctrl: pistachio: fix leaked of_node references 2019-05-31 06:46:16 -07:00
pinctrl-rk805.c pinctrl: Add pinctrl driver for the RK805 PMIC 2017-08-21 08:54:46 +01:00
pinctrl-rockchip.c pinctrl: rockchip: fix leaked of_node references 2019-07-31 07:26:57 +02:00
pinctrl-rza1.c pinctrl: rza1: Fix selector use for groups and functions 2018-07-17 10:49:33 +02:00
pinctrl-single.c This is the bulk of pin control changes for v4.19: 2018-08-14 12:31:27 -07:00
pinctrl-st.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
pinctrl-sx150x.c pinctrl: sx150x: handle failure case of devm_kstrdup 2019-02-12 19:47:06 +01:00
pinctrl-tb10x.c pinctrl: tb10x: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:41:40 +02:00
pinctrl-u300.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
pinctrl-utils.c pinctrl: utils: Delete an error message for a failed memory allocation in pinctrl_utils_add_map_configs() 2018-01-03 08:46:53 +01:00
pinctrl-utils.h
pinctrl-xway.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
pinctrl-zynq.c pinctrl: zynq: Fix warnings in the driver 2017-08-14 15:01:01 +02:00
pinmux.c pinctrl: pinmux: Return selector to the pinctrl driver 2018-07-17 10:48:47 +02:00
pinmux.h pinctrl: core: Remove broken remove_last group and pinmux functions 2018-07-17 10:49:49 +02:00