gpio: add generic single-register fixed-direction GPIO driver
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 31 Aug 2016 07:49:44 +0000 (08:49 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 24 Mar 2017 13:04:46 +0000 (14:04 +0100)
commit380639c7cc786ec663e43eb3896ccf9172a46900
treeb51574a49f52ff542c8c915a582450ac06de68b8
parentc65d1fd350fa28de79e86e18ef73b902a67c791a
gpio: add generic single-register fixed-direction GPIO driver

Add a simple, generic, single register fixed-direction GPIO driver.
This is able to support a single register with a mixture of inputs
and outputs.

This is different from gpio-mmio and gpio-74xx-mmio:
* gpio-mmio doesn't allow a fixed direction, it assumes there is always
  a direction register.
* gpio-74xx-mmio only supports all-in or all-out setups
* gpio-74xx-mmio is DT only, this needs to support legacy too
* they don't double-read when getting the GPIO value, as required by
  some implementations that this driver supports
* we need to always do 32-bit reads, which bgpio doesn't guarantee
* the current output state may not be readable from the hardware
  register - reading may reflect input status but not output status.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/gpio-reg.c [new file with mode: 0644]
include/linux/gpio/gpio-reg.h [new file with mode: 0644]