[U-Boot] [PATCH v2 4/6] dm: pinctrl: Add pinctrl_decode_pin_config_dm().

Christoph Müllner christoph.muellner at theobroma-systems.com
Mon Dec 17 11:35:54 UTC 2018


> On 13.12.2018, at 23:33, Philipp Tomsich <philipp.tomsich at theobroma-systems.com> wrote:
>> On 12.12.2018, at 01:57, Christoph Muellner <christoph.muellner at theobroma-systems.com> wrote:
>> 
>> pinctrl_decode_pin_config_dm() is basically a feature-equivalent
>> implementation of pinctrl_decode_pin_config(), which operates
>> on struct udevice devices and uses the dev_read_*() API.
> 
> Can’t we use pinctrl_generic_set_state and then simply pass a 
> struct pinconf_param?  I am not convinced that we need to have
> yet-another mechanism in addition to what’s already there...

Hi Philipp,

the rockchip pinctrl syntax differs from the generic one:
doc/device-tree-bindings/pinctrl/pinctrl-bindings.txt
doc/device-tree-bindings/pinctrl/rockchip,pinctrl.txt

Therefore we can't simply use pinctrl_generic_set_state().

Instead we need to parse the "rockchip,pins" property and
evaluate banknum, index, muxval, and the pinconf phandle.
Afterwards we need to extract the pinconf settings (i.e. iterate
over pinconf properties and do strcmp()).

We could in theory reuse pinconf_prop_name_to_param() from
the generic driver, but that would mean, that we need two
pinctrl drivers enabled in our config. Also using the generic driver's static functions
is not possible. We either have to make them non-static or call the code via
pinctrl_generic_set_state().

I could move pinctrl_decode_pin_config_dm() into
pinctrl_rk3399.c, but I thought it is valuable enough
to be shared with others.

In other words:
I think there are enough good reasons to keep the patch like it is.

BR
Christoph


More information about the U-Boot mailing list