]> asedeno.scripts.mit.edu Git - linux.git/commit
gpio: rcar: select General Output Register to set output states
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Fri, 18 Jan 2019 08:53:43 +0000 (10:53 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 21 Jan 2019 13:59:50 +0000 (14:59 +0100)
commit3ae4f3aac05ab9cc7d93ef3e87bb0bd159cb6bfa
tree60489f26103ceeab411b26b0b3e67c78b9b5e724
parentb597c3a939ecc58d69aadd188515fa9549be3144
gpio: rcar: select General Output Register to set output states

R-Car GPIO controller provides two interfaces to set GPIO line output
signal state, and for a particular GPIO line the selected interface is
determined by OUTDTSEL bit value.

At the moment the driver supports only one of two interfaces, namely
OUTDT General Output Register is used to control the output signal.

While this selection is the default one on reset, it is not explicitly
configured on probe, thus it might be possible that kernel and userspace
consumers of a GPIO won't be able to set the wanted GPIO output signal.

Below is a simple test case to reproduce the described problem and
verify this fix in the kernel on H3 ULCB by setting non-default OUTDTSEL
configuration from a bootloader:

  u-boot    > mw.l 0xe6055440 0x3000 1
  ...
  userspace > echo default-on > /sys/devices/platform/leds/leds/led5/trigger
  userspace > echo default-on > /sys/devices/platform/leds/leds/led6/trigger

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-rcar.c