WSL2-Linux-Kernel/drivers/pinctrl
Mario Limonciello 6a5d6096ae pinctrl: amd: Use amd_pinconf_set() for all config options
[ Upstream commit 635a750d95 ]

On ASUS TUF A16 it is reported that the ITE5570 ACPI device connected to
GPIO 7 is causing an interrupt storm.  This issue doesn't happen on
Windows.

Comparing the GPIO register configuration between Windows and Linux
bit 20 has been configured as a pull up on Windows, but not on Linux.
Checking GPIO declaration from the firmware it is clear it *should* have
been a pull up on Linux as well.

```
GpioInt (Level, ActiveLow, Exclusive, PullUp, 0x0000,
	 "\\_SB.GPIO", 0x00, ResourceConsumer, ,)
{   // Pin list
0x0007
}
```

On Linux amd_gpio_set_config() is currently only used for programming
the debounce. Actually the GPIO core calls it with all the arguments
that are supported by a GPIO, pinctrl-amd just responds `-ENOTSUPP`.

To solve this issue expand amd_gpio_set_config() to support the other
arguments amd_pinconf_set() supports, namely `PIN_CONFIG_BIAS_PULL_DOWN`,
`PIN_CONFIG_BIAS_PULL_UP`, and `PIN_CONFIG_DRIVE_STRENGTH`.

Reported-by: Nik P <npliashechnikov@gmail.com>
Reported-by: Nathan Schulte <nmschulte@gmail.com>
Reported-by: Friedrich Vock <friedrich.vock@gmx.de>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217336
Reported-by: dridri85@gmail.com
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217493
Link: https://lore.kernel.org/linux-input/20230530154058.17594-1-friedrich.vock@gmx.de/
Tested-by: Jan Visser <starquake@linuxeverywhere.org>
Fixes: 2956b5d94a ("pinctrl / gpio: Introduce .set_config() callback for GPIO chips")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230705133005.577-3-mario.limonciello@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:46:59 +02:00
..
actions
aspeed pinctrl: aspeed: Fix confusing types in return value 2023-02-14 19:18:02 +01:00
bcm pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors 2023-07-23 13:47:10 +02:00
berlin
cirrus
freescale
intel pinctrl: cherryview: Return correct value if pin in push-pull mode 2023-07-23 13:47:12 +02:00
mediatek pinctrl: mediatek: Initialize variable *buf to zero 2023-03-10 09:39:25 +01:00
meson pinctrl: meson-axg: add missing GPIOA_18 gpio group 2023-06-14 11:13:07 +02:00
mvebu
nomadik
nuvoton gpio: use raw spinlock for gpio chip shadowed data 2023-02-01 08:27:08 +01:00
pxa
qcom pinctrl: qcom: lpass-lpi: set output value before enabling output 2023-05-11 23:00:17 +09:00
ralink
renesas pinctrl: renesas: r8a779a0: Remove incorrect AVB[01] pinmux configuration 2023-05-11 23:00:37 +09:00
samsung
spear
sprd
stm32 pinctrl: stm32: Fix refcount leak in stm32_pctrl_get_irq_domain 2023-03-10 09:39:21 +01:00
sunxi
tegra
ti
uniphier
visconti
vt8500
Kconfig
Makefile
core.c
core.h
devicetree.c
devicetree.h
pinconf-generic.c pinctrl: pinconf-generic: add missing of_node_put() 2022-12-31 13:14:12 +01:00
pinconf.c
pinconf.h
pinctrl-amd.c pinctrl: amd: Use amd_pinconf_set() for all config options 2023-07-27 08:46:59 +02:00
pinctrl-amd.h pinctrl: amd: Detect internal GPIO0 debounce handling 2023-07-23 13:47:46 +02:00
pinctrl-artpec6.c
pinctrl-as3722.c
pinctrl-at91-pio4.c pinctrl: at91-pio4: check return value of devm_kasprintf() 2023-07-23 13:47:13 +02:00
pinctrl-at91.c pinctrl: at91: use devm_kasprintf() to avoid potential leaks 2023-03-10 09:39:54 +01:00
pinctrl-at91.h
pinctrl-axp209.c
pinctrl-bm1880.c
pinctrl-da850-pupd.c
pinctrl-da9062.c
pinctrl-digicolor.c
pinctrl-equilibrium.c
pinctrl-equilibrium.h
pinctrl-falcon.c
pinctrl-gemini.c
pinctrl-ingenic.c
pinctrl-k210.c pinctrl: k210: call of_node_put() 2022-12-31 13:14:11 +01:00
pinctrl-keembay.c
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-max77620.c
pinctrl-mcp23s08.c
pinctrl-mcp23s08.h
pinctrl-mcp23s08_i2c.c
pinctrl-mcp23s08_spi.c
pinctrl-microchip-sgpio.c pinctrl: microchip-sgpio: check return value of devm_kasprintf() 2023-07-23 13:47:13 +02:00
pinctrl-ocelot.c pinctrl: ocelot: Fix alt mode for ocelot 2023-04-05 11:24:58 +02:00
pinctrl-oxnas.c
pinctrl-palmas.c
pinctrl-pic32.c
pinctrl-pic32.h
pinctrl-pistachio.c
pinctrl-rk805.c
pinctrl-rockchip.c pinctrl: rockchip: Fix refcount leak in rockchip_pinctrl_parse_groups 2023-03-10 09:39:21 +01:00
pinctrl-rockchip.h pinctrl/rockchip: add error handling for pull/drive register getters 2023-02-01 08:27:09 +01:00
pinctrl-single.c pinctrl: single: fix potential NULL dereference 2023-02-14 19:18:02 +01:00
pinctrl-st.c
pinctrl-stmfx.c
pinctrl-sx150x.c
pinctrl-tb10x.c
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c
pinctrl-zynq.c
pinctrl-zynqmp.c
pinmux.c
pinmux.h