linux-sg2042/drivers/pinctrl/aspeed
Andrew Jeffery 7aeb353802 pinctrl: aspeed: Fix GPIO requests on pass-through banks
Commit 6726fbff19 ("pinctrl: aspeed: Fix GPI only function problem.")
fixes access to GPIO banks T and U on the AST2600. Both banks contain
input-only pins and the GPIO pin function is named GPITx and GPIUx
respectively. Unfortunately the fix had a negative impact on GPIO banks
D and E for the AST2400 and AST2500 where the GPIO pass-through
functions take similar "GPI"-style names. The net effect on the older
SoCs was that when the GPIO subsystem requested a pin in banks D or E be
muxed for GPIO, they were instead muxed for pass-through mode.
Mistakenly muxing pass-through mode e.g. breaks booting the host on
IBM's Witherspoon (AC922) platform where GPIOE0 is used for FSI.

Further exploit the names in the provided expression structure to
differentiate pass-through from pin-specific GPIO modes.

This follow-up fix gives the expected behaviour for the following tests:

Witherspoon BMC (AST2500):

1. Power-on the Witherspoon host
2. Request GPIOD1 be muxed via /sys/class/gpio/export
3. Request GPIOE1 be muxed via /sys/class/gpio/export
4. Request the balls for GPIOs E2 and E3 be muxed as GPIO pass-through
   ("GPIE2" mode) via a pinctrl hog in the devicetree

Rainier BMC (AST2600):

5. Request GPIT0 be muxed via /sys/class/gpio/export
6. Request GPIU0 be muxed via /sys/class/gpio/export

Together the tests demonstrate that all three pieces of functionality
(general GPIOs via 1, 2 and 3, input-only GPIOs via 5 and 6, pass-through
mode via 4) operate as desired across old and new SoCs.

Fixes: 9b92f5c51e ("pinctrl: aspeed: Fix GPI only function problem.")
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Tested-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Cc: Billy Tsai <billy_tsai@aspeedtech.com>
Cc: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20201126063337.489927-1-andrew@aj.id.au
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2020-12-08 09:23:51 +01:00
..
Kconfig pinctrl: aspeed: Add AST2600 pinmux support 2019-08-05 12:41:18 +02:00
Makefile pinctrl: aspeed: Add AST2600 pinmux support 2019-08-05 12:41:18 +02:00
pinctrl-aspeed-g4.c pinctrl: aspeed: Use masks to describe pinconf bitfields 2019-12-13 09:40:37 +01:00
pinctrl-aspeed-g5.c pinctrl: aspeed: Use masks to describe pinconf bitfields 2019-12-13 09:40:37 +01:00
pinctrl-aspeed-g6.c pinctrl: aspeed-g6: Add bias controls for 1.8V GPIO banks 2020-09-29 14:38:44 +02:00
pinctrl-aspeed.c pinctrl: aspeed: Fix GPIO requests on pass-through banks 2020-12-08 09:23:51 +01:00
pinctrl-aspeed.h pinctrl: aspeed-g6: Add AST2600 pinconf support 2019-12-13 09:41:01 +01:00
pinmux-aspeed.c pinctrl: aspeed: Fix spurious mux failures on the AST2500 2019-09-12 00:08:27 +01:00
pinmux-aspeed.h pinctrl: aspeed: Fix GPIO requests on pass-through banks 2020-12-08 09:23:51 +01:00