[PATCH v2] arm: gpio: Add set_flags callback to the Tegra gpio driver
Svyatoslav Ryhel
clamor95 at gmail.com
Fri Sep 26 13:59:28 CEST 2025
пн, 22 вер. 2025 р. о 17:16 Lukasz Majewski <lukma at nabladev.com> пише:
>
> This patch adds support for the .set_flags callback.
> For now following flags are supported:
> - GPIOD_IS_AF (i.e. "alternate function").
> - GPIOD_IS_IN
> - GPIOD_IS_OUT
>
> Currently, the .set_flags in gpio-uclass.c (function dm_gpio_set_value())
> is used before .set_value callback, so functionally replaces it.
> As a result the corresponding tegra_gpio_set_value() can be removed.
>
> Signed-off-by: Lukasz Majewski <lukma at nabladev.com>
> ---
>
> Changes for v2:
> - Fix the format specifier for flags in debug() function
> - Update commit message
> - Remove tegra_gpio_set_value() method (as it is functionally replaced by
> set_value()
> - Prevent from returning errors when flags = 0 (problem with e.g. I2C GPIO
> support)
> ---
> drivers/gpio/tegra_gpio.c | 39 +++++++++++++++++++++++----------------
> 1 file changed, 23 insertions(+), 16 deletions(-)
>
Lukasz, thank you for this change I would really like to see it in
mainline. ATM I have no capabilities to debug this and I will return
to it but that may not be soon unfortunately. In case you really need
switch GPIO back to SFIO and Linux cannot handle this, you an use
dm_gpio_free to release gpios in board_preboot_os in the board as a
temporary measure.
Overall issue you are describing is not u-boot's it is kernels, kernel
must reconfigure gpios for proper work regardless of their previous
state. If it is not the case, then kernel device configuration is
incomplete or wrong.
More information about the U-Boot
mailing list