]> git.ipfire.org Git - thirdparty/u-boot.git/commit
gpio: pca953x_gpio: Support label setting from DT
authorMario Six <mario.six@gdsys.cc>
Thu, 1 Mar 2018 13:45:04 +0000 (14:45 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 5 Mar 2018 15:06:05 +0000 (10:06 -0500)
commit1e5f89881af7054c1a30991a922a8ed609a4c050
tree2db522ad229299c0bbe0467c59a7953121849c0d
parentb432b1ebdf3422caa3b714ef5a417a4e8864fad6
gpio: pca953x_gpio: Support label setting from DT

The PCA953x driver uses "gpio@%x_" as the GPIO bank name, where "%x" is
instantiated with the I2C address of the chip. While this works, it
becomes very confusing if a board has multiple PCAs with the same
address on different I2C busses, and it also becomes an issue when a
GPIO's value is to be set via the 'gpio' command, because this command
only ever sets the value of the first device it encounters, leaving the
other devices inaccessible to the command.

As to not break boards that rely on this naming scheme, we introduce a
new device tree string property "label" for the driver. If it exists, it
is used to build a bank name of the form "%s@%x_" (where %x is still
instantiated with the I2C address). If it does not exist, the legacy
labeling scheme is used.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
drivers/gpio/pca953x_gpio.c