[U-Boot] [PATCH v2] Add single register pin controller driver

Masahiro Yamada yamada.masahiro at socionext.com
Wed Feb 8 15:27:16 UTC 2017


Hi.


>> 2017-02-07 22:30 GMT+09:00 Felix Brack <fb at ltec.ch>:
>>
>>> +
>>> +static int single_set_state_simple(struct udevice *dev,
>>> +                                  struct udevice *periph)
>>> +{
>>> +       const void *fdt = gd->fdt_blob;
>>> +       const struct single_fdt_pin_cfg *prop;
>>> +       int len;
>>> +
>>> +       prop = fdt_getprop(fdt, periph->of_offset, "pinctrl-single,pins", &len);
>>
>>
>> This seems wrong to me.
>>
>>
>> The "periph" is a peripheral device (like UART, eMMC, USB, etc.).
>>
>
> In the case above 'dev' represents the pin controller node of the DT and
> 'periph' represents the DT node holding the pin configuration
> information for a specific peripheral like i2c0, not the peripheral
> itself.


I recommend you to read pinctrl-uclass.c once again.


Did you track how "periph" was passed across the following function calls?

device_probe()
  -> pinctrl_select_state()
      -> pinctrl_select_state_simple()
          -> ops->set_state_simple()







-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list