]> git.baikalelectronics.ru Git - kernel.git/commit
gpio/aspeed-sgpio: enable access to all 80 input & output sgpios
authorJeremy Kerr <jk@codeconstruct.com.au>
Fri, 11 Sep 2020 01:51:04 +0000 (09:51 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 24 Sep 2020 13:10:40 +0000 (15:10 +0200)
commitf902e56e5c2437c93543e2fc032b5004ec8c1998
tree5977cfff449597ba7f19811654b20b36c9c1d5c5
parent1fd8784aff9a2c2a0799446462230a5cd676f34d
gpio/aspeed-sgpio: enable access to all 80 input & output sgpios

Currently, the aspeed-sgpio driver exposes up to 80 GPIO lines,
corresponding to the 80 status bits available in hardware. Each of these
lines can be configured as either an input or an output.

However, each of these GPIOs is actually an input *and* an output; we
actually have 80 inputs plus 80 outputs.

This change expands the maximum number of GPIOs to 160; the lower half
of this range are the input-only GPIOs, the upper half are the outputs.
We fix the GPIO directions to correspond to this mapping.

This also fixes a bug when setting GPIOs - we were reading from the
input register, making it impossible to set more than one output GPIO.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Fixes: fe8e2fb5f64e ("gpio: aspeed: Add SGPIO driver")
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Documentation/devicetree/bindings/gpio/sgpio-aspeed.txt
drivers/gpio/gpio-aspeed-sgpio.c