Skip to content

Commit

Permalink
dm: core: device: set pinctrl state for pinctrl device
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Simon Glass <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Reviewed-by: Masahiro Yamada <[email protected]>
  • Loading branch information
MrVan authored and sjg20 committed Apr 14, 2016
1 parent ff6552e commit c3ab985
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/core/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit c3ab985

Please sign in to comment.