[U-Boot] [PATCH v2 0/9] Add pinmux command

Simon Glass sjg at chromium.org
Thu Oct 4 01:13:24 UTC 2018


Hi Patrice,

On 1 October 2018 at 05:59, Patrice Chotard <patrice.chotard at st.com> wrote:
>
> For debug purpose, it's useful to know the pins muxing
> to check if a pin is configured as a GPIO or as an alternate
> function and to get information about this alternate function
> configuration. For this purpose a new command pinmux is implemented.
>
> This series adds:
>   - Add get_pin_muxing ops to UCLASS pinctrl
>   - Add pinmux command
>   - Add get_function() support to stm32 gpio driver
>   - Add get_pins_count() support to stm32 pinctrl driver
>   - Add get_pin_name() support to stm32 pinctrl driver
>   - Add get_pin_muxing() support to stm32 pinctrl driver
>
> Changes in v2:
>  - Replace pinmux_show ops which displayed the complete pin-controller
>    muxing by get_pin_muxing ops which displays the muxing of one pin
>  - In order to make pin muxing display less SoC specific,
>    use pinctrl_pins_count(), pinctrl_get_pin_name() and
>    pinctrl_get_pin_muxing() methods instead of
>    previous pinctrl_pinmux_show() method.

This looks good to me. The only think I don't like is using static
char for the string.

Can we instead pass

char *buf, int size

to each method and have it snprintf() the text directly into that
buffer? The methods can then return 0 if all is well, -ve on error.

Regards,
Simon


More information about the U-Boot mailing list