* [U-Boot] [PATCH] dm: core: device: set pinctrl state for pinctrl device
@ 2016-03-12 5:17 Peng Fan
2016-03-13 2:51 ` Simon Glass
0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2016-03-12 5:17 UTC (permalink / raw)
To: u-boot
We may have pinmux settings for pinctrl device, like the following
example:
"
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog_1>;
imx6ul-evk {
pinctrl_hog_1: hoggrp-1 {
fsl,pins = <
MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x80000000
>;
};
[......]
};
"
We should not only select pinctrl state for non pinctrl devices, we
need also to handle pin mux settings such as pinctrl_log for pinctrl
devices.
So at the end of probing process of pinctrl device, select the default
state of pinctrl device.
Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
---
drivers/core/device.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/core/device.c b/drivers/core/device.c
index cb24a61..6b1ba22 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -332,6 +332,9 @@ int device_probe(struct udevice *dev)
if (ret)
goto fail_uclass;
+ if (dev->parent && device_get_uclass_id(dev) == UCLASS_PINCTRL)
+ pinctrl_select_state(dev, "default");
+
return 0;
fail_uclass:
if (device_remove(dev)) {
--
2.6.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: core: device: set pinctrl state for pinctrl device
2016-03-12 5:17 [U-Boot] [PATCH] dm: core: device: set pinctrl state for pinctrl device Peng Fan
@ 2016-03-13 2:51 ` Simon Glass
2016-03-31 5:26 ` Peng Fan
0 siblings, 1 reply; 4+ messages in thread
From: Simon Glass @ 2016-03-13 2:51 UTC (permalink / raw)
To: u-boot
+Masahiro
On 11 March 2016 at 22:17, Peng Fan <van.freenix@gmail.com> wrote:
> We may have pinmux settings for pinctrl device, like the following
> example:
> "
> &iomuxc {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_hog_1>;
> imx6ul-evk {
> pinctrl_hog_1: hoggrp-1 {
> fsl,pins = <
> MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
> MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
> MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
> MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x80000000
> >;
> };
> [......]
> };
> "
>
> We should not only select pinctrl state for non pinctrl devices, we
> need also to handle pin mux settings such as pinctrl_log for pinctrl
> devices.
>
> So at the end of probing process of pinctrl device, select the default
> state of pinctrl device.
>
> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
> drivers/core/device.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/core/device.c b/drivers/core/device.c
> index cb24a61..6b1ba22 100644
> --- a/drivers/core/device.c
> +++ b/drivers/core/device.c
> @@ -332,6 +332,9 @@ int device_probe(struct udevice *dev)
> if (ret)
> goto fail_uclass;
>
> + if (dev->parent && device_get_uclass_id(dev) == UCLASS_PINCTRL)
> + pinctrl_select_state(dev, "default");
> +
> return 0;
> fail_uclass:
> if (device_remove(dev)) {
> --
> 2.6.2
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: core: device: set pinctrl state for pinctrl device
2016-03-13 2:51 ` Simon Glass
@ 2016-03-31 5:26 ` Peng Fan
2016-04-06 2:45 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2016-03-31 5:26 UTC (permalink / raw)
To: u-boot
Hi Simon,
On Sat, Mar 12, 2016 at 07:51:47PM -0700, Simon Glass wrote:
>+Masahiro
>
>On 11 March 2016 at 22:17, Peng Fan <van.freenix@gmail.com> wrote:
>> We may have pinmux settings for pinctrl device, like the following
>> example:
>> "
>> &iomuxc {
>> pinctrl-names = "default";
>> pinctrl-0 = <&pinctrl_hog_1>;
>> imx6ul-evk {
>> pinctrl_hog_1: hoggrp-1 {
>> fsl,pins = <
>> MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
>> MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
>> MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
>> MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x80000000
>> >;
>> };
>> [......]
>> };
>> "
>>
>> We should not only select pinctrl state for non pinctrl devices, we
>> need also to handle pin mux settings such as pinctrl_log for pinctrl
>> devices.
>>
>> So at the end of probing process of pinctrl device, select the default
>> state of pinctrl device.
>>
>> Signed-off-by: Peng Fan <van.freenix@gmail.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> ---
>> drivers/core/device.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/core/device.c b/drivers/core/device.c
>> index cb24a61..6b1ba22 100644
>> --- a/drivers/core/device.c
>> +++ b/drivers/core/device.c
>> @@ -332,6 +332,9 @@ int device_probe(struct udevice *dev)
>> if (ret)
>> goto fail_uclass;
>>
>> + if (dev->parent && device_get_uclass_id(dev) == UCLASS_PINCTRL)
>> + pinctrl_select_state(dev, "default");
>> +
>> return 0;
>> fail_uclass:
>> if (device_remove(dev)) {
>> --
>> 2.6.2
>>
>
>Reviewed-by: Simon Glass <sjg@chromium.org>
Will you pick up this patch?
Thanks,
Peng.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: core: device: set pinctrl state for pinctrl device
2016-03-31 5:26 ` Peng Fan
@ 2016-04-06 2:45 ` Masahiro Yamada
0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2016-04-06 2:45 UTC (permalink / raw)
To: u-boot
Hi.
I missed this patch. Sorry for chiming in late.
2016-03-31 14:26 GMT+09:00 Peng Fan <van.freenix@gmail.com>:
> Hi Simon,
>
> On Sat, Mar 12, 2016 at 07:51:47PM -0700, Simon Glass wrote:
>>+Masahiro
>>
>>On 11 March 2016 at 22:17, Peng Fan <van.freenix@gmail.com> wrote:
>>> We may have pinmux settings for pinctrl device, like the following
>>> example:
>>> "
>>> &iomuxc {
>>> pinctrl-names = "default";
>>> pinctrl-0 = <&pinctrl_hog_1>;
>>> imx6ul-evk {
>>> pinctrl_hog_1: hoggrp-1 {
>>> fsl,pins = <
>>> MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
>>> MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
>>> MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
>>> MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x80000000
>>> >;
>>> };
>>> [......]
>>> };
>>> "
>>>
>>> We should not only select pinctrl state for non pinctrl devices, we
>>> need also to handle pin mux settings such as pinctrl_log for pinctrl
>>> devices.
>>>
>>> So at the end of probing process of pinctrl device, select the default
>>> state of pinctrl device.
>>>
>>> Signed-off-by: Peng Fan <van.freenix@gmail.com>
>>> Cc: Simon Glass <sjg@chromium.org>
>>> ---
>>> drivers/core/device.c | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/core/device.c b/drivers/core/device.c
>>> index cb24a61..6b1ba22 100644
>>> --- a/drivers/core/device.c
>>> +++ b/drivers/core/device.c
>>> @@ -332,6 +332,9 @@ int device_probe(struct udevice *dev)
>>> if (ret)
>>> goto fail_uclass;
>>>
>>> + if (dev->parent && device_get_uclass_id(dev) == UCLASS_PINCTRL)
>>> + pinctrl_select_state(dev, "default");
>>> +
I think "dev->parent && " is for making sure that it is not the root node,
while pinctrl devices never become the root.
Can we simplify the code like follows?
>>> + if (device_get_uclass_id(dev) == UCLASS_PINCTRL)
>>> + pinctrl_select_state(dev, "default");
>>> +
Otherwise, feel free to add my
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-06 2:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-12 5:17 [U-Boot] [PATCH] dm: core: device: set pinctrl state for pinctrl device Peng Fan
2016-03-13 2:51 ` Simon Glass
2016-03-31 5:26 ` Peng Fan
2016-04-06 2:45 ` Masahiro Yamada
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.