[U-Boot] [PATCH v2] Add single register pin controller driver
James Balean
james at balean.com.au
Sat Feb 18 12:16:42 UTC 2017
Hi All,
2017-02-10 13:35 GMT+09:00 Masahiro Yamada <yamada.masahiro at socionext.com>:
> That's right.
> Then, the "dev" in device_probe() represents
> the peripheral, such as i2c.
>
> Not a pin-config node, like i2c0_pins.
Masahiro, have a look at the call to set_state_simple from pinctrl_select_state_simple (in drivers/pinctrl/pinctrl-uclass.c). It is at this point that the pinctrl node becomes the 'dev' parameter, and the former 'dev' then becomes the second 'periph' parameter.
---
/*
* For simplicity, assume the first device of PINCTRL uclass
* is the correct one. This is most likely OK as there is
* usually only one pinctrl device on the system.
*/
ret = uclass_get_device(UCLASS_PINCTRL, 0, &pctldev);
if (ret)
return ret;
ops = pinctrl_get_ops(pctldev);
if (!ops->set_state_simple) {
dev_dbg(dev, "set_state_simple op missing\n");
return -ENOSYS;
}
return ops->set_state_simple(pctldev, dev);
---
Reviewed-by: James Balean <james at balean.com.au>
--
Kind regards,
James Balean
More information about the U-Boot
mailing list