[PATCH v2] gpio: search gpio-line-names property in dm_gpio_lookup_name
    Tom Rini 
    trini at konsulko.com
       
    Tue Oct 21 19:08:07 CEST 2025
    
    
  
On Thu, Oct 16, 2025 at 11:23:55AM +0200, Rasmus Villemoes wrote:
> In scripts as well as interactively, it's much nicer to be able to
> refer to GPIOs via their names defined in the device tree property
> "gpio-line-names", instead of the rather opaque names derived from the
> bank name with a _xx suffix. E.g.
> 
>   gpio read factory_reset FACTORY_RESET
>   if test $factory_reset = 1 ; then ...
> 
> versus
> 
>   gpio read factory_reset gpio at 481ac000_16
>   if test $factory_reset = 1 ; then ...
> 
> This is also consistent with the move on the linux/userspace side towards
> using line names instead of legacy chip+offset or the even more legacy
> global gpio numbering in sysfs.
> 
> As this seems to only add about ~50 bytes of code to U-Boot proper,
> and dm_gpio_lookup_name() most often ends up being GC'ed for SPL, so
> adds no overhead there, adding yet another config knob (or two, if it
> also needed an SPL variant) for this does not seem warranted.
> 
> Signed-off-by: Rasmus Villemoes <ravi at prevas.dk>
> ---
> 
> v2: guard the the dev_read_stringlist_search() call by
> CONFIG_IS_ENABLED(OF_CONTROL) to avoid link failure on !OF_CONTROL
> platforms.
Frustratingly this is still a failure to build for imx28_btt3 and
imx28_xea, in SPL.
-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20251021/73c27a9d/attachment.sig>
    
    
More information about the U-Boot
mailing list