]> git.baikalelectronics.ru Git - uboot.git/commit
GPIO: CREG: improve flexibility of hsdk-creg-gpio driver
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Fri, 8 Jun 2018 14:58:23 +0000 (17:58 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Tue, 31 Jul 2018 04:49:47 +0000 (07:49 +0300)
commitf3752dd2ee41d7168605f877b6d03b34bf7fc5f0
treeeef4673ed546cf04f1546c8517c6b035b060d0ef
parentbf0709f34c3ea63f84bc92ea6e40d8736cadd9c2
GPIO: CREG: improve flexibility of hsdk-creg-gpio driver

CREG GPIO is a driver for weird soc-specific output ports, which are
controlled by some fields in memory mapped register.

Example:

31                 9        7        5           0   < bit number
|                  |        |        |           |
[     not used     | gpio-1 | gpio-0 | <-shift-> ]   < 32 bit register
                       ^        ^
                       |        |
                write 0x2 == set output to "1" (activate)
                write 0x3 == set output to "0" (deactivate)

As of tooday we only support fixed (hardcoded) bit per gpio line,
activate / deactivatei and shift values. Fix that by read them from
device tree to be able to use this driver for other boards.

Remove "hsdk" prefix from compatible string as this driver can be
used with different boards like HSDK, AXS101, AXS103, etc.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
arch/arc/dts/hsdk.dts
drivers/gpio/hsdk-creg-gpio.c