diff options
author | Sergiu Moga | 2022-09-01 17:22:41 +0300 |
---|---|---|
committer | Eugen Hristev | 2022-09-19 09:51:04 +0300 |
commit | 2ed96a87d2c7f22fe2649f6e041cc3884a0dbea7 (patch) | |
tree | 3093ba59302781f0ac253d862034437dbc9eb0c4 /drivers/pinctrl/pinctrl-at91.c | |
parent | f02e52b7e68eeebca1d9e2c4bfccff9bd647e393 (diff) |
pinctrl: at91-pio4: Bind GPIO driver to the pinctrl DT node
This has been done in order to align the DT of U-Boot with the DT
of Linux. In Linux, a phandle from a '-gpio' DT property is linked
to the pinctrl driver, a single driver that handles both pinctrl
settings and offers GPIO API to callers. On the other hand,
U-Boot redirects such phandle to a corresponding UCLASS_GPIO
driver, because U-Boot offers two different types of drivers
in this case: UCLASS_PINCTRL which handles pin functions and
UCLASS_GPIO which handles gpio requests as a gpio provider.
Due to this, we have two drivers in Uboot, but the Devicetree
has a single node. Thus, just one of the drivers can be probed
for the DT node during platform initialization, before relocation.
Our previous solution in U-Boot was to have a different devicetree:
the gpio node has a subnode for the pinctrl driver, which
is not compliant with Linux ABI. Furthermore, our documentation
for this type of nodes mentions no such gpio compatible.
After this patch, we can no longer add nodes with a gpio
compatible in the DT. Thus, in order to link the pinctrl driver to
the gpio one, a hook to the bind method of the former in U-Boot has
been added and the GPIO related compatibles have been removed to
avoid conflict when compatibles are enumerated and bound to drivers
during platform start before relocation. The bind method will attach
the GPIO driver to the pinctrl DT node so that every phandle coming
from '-gpio' DT properties will be redirected to a valid driver
attached to the pinctrl DT node.
Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
Diffstat (limited to 'drivers/pinctrl/pinctrl-at91.c')
0 files changed, 0 insertions, 0 deletions