diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2013-11-11 13:19:47 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-11-25 03:08:30 -0500 |
commit | 31d610f19670825a0058b70f44570e9ab21a0011 (patch) | |
tree | 875478feb2815006f39dbc8405eaa686d78ba67b | |
parent | b9f2f2ecce737910be1333609d43c8fbbfe8e68f (diff) |
pinctrl: imx1-core populate subdevices
Support gpio devicetree subnodes to allow a more detailed DT hardware
description.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt | 22 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-imx1-core.c | 7 |
2 files changed, 29 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt index 353eca0efbf8..d1706ea82572 100644 --- a/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt | |||
@@ -52,12 +52,25 @@ Required properties for pin configuration node: | |||
52 | CONFIG can be 0 or 1, meaning Pullup disable/enable. | 52 | CONFIG can be 0 or 1, meaning Pullup disable/enable. |
53 | 53 | ||
54 | 54 | ||
55 | The iomux controller has gpio child nodes which are embedded in the iomux | ||
56 | control registers. They have to be defined as child nodes of the iomux device | ||
57 | node. If gpio subnodes are defined "#address-cells", "#size-cells" and "ranges" | ||
58 | properties for the iomux device node are required. | ||
55 | 59 | ||
56 | Example: | 60 | Example: |
57 | 61 | ||
58 | iomuxc: iomuxc@10015000 { | 62 | iomuxc: iomuxc@10015000 { |
59 | compatible = "fsl,imx27-iomuxc"; | 63 | compatible = "fsl,imx27-iomuxc"; |
60 | reg = <0x10015000 0x600>; | 64 | reg = <0x10015000 0x600>; |
65 | #address-cells = <1>; | ||
66 | #size-cells = <1>; | ||
67 | ranges; | ||
68 | |||
69 | gpio1: gpio@10015000 { | ||
70 | ... | ||
71 | }; | ||
72 | |||
73 | ... | ||
61 | 74 | ||
62 | uart { | 75 | uart { |
63 | pinctrl_uart1: uart-1 { | 76 | pinctrl_uart1: uart-1 { |
@@ -83,6 +96,15 @@ The above example using macros: | |||
83 | iomuxc: iomuxc@10015000 { | 96 | iomuxc: iomuxc@10015000 { |
84 | compatible = "fsl,imx27-iomuxc"; | 97 | compatible = "fsl,imx27-iomuxc"; |
85 | reg = <0x10015000 0x600>; | 98 | reg = <0x10015000 0x600>; |
99 | #address-cells = <1>; | ||
100 | #size-cells = <1>; | ||
101 | ranges; | ||
102 | |||
103 | gpio1: gpio@10015000 { | ||
104 | ... | ||
105 | }; | ||
106 | |||
107 | ... | ||
86 | 108 | ||
87 | uart { | 109 | uart { |
88 | pinctrl_uart1: uart-1 { | 110 | pinctrl_uart1: uart-1 { |
diff --git a/drivers/pinctrl/pinctrl-imx1-core.c b/drivers/pinctrl/pinctrl-imx1-core.c index f77914ac081a..17aecde1b51d 100644 --- a/drivers/pinctrl/pinctrl-imx1-core.c +++ b/drivers/pinctrl/pinctrl-imx1-core.c | |||
@@ -638,6 +638,13 @@ int imx1_pinctrl_core_probe(struct platform_device *pdev, | |||
638 | return -EINVAL; | 638 | return -EINVAL; |
639 | } | 639 | } |
640 | 640 | ||
641 | ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); | ||
642 | if (ret) { | ||
643 | pinctrl_unregister(ipctl->pctl); | ||
644 | dev_err(&pdev->dev, "Failed to populate subdevices\n"); | ||
645 | return ret; | ||
646 | } | ||
647 | |||
641 | dev_info(&pdev->dev, "initialized IMX pinctrl driver\n"); | 648 | dev_info(&pdev->dev, "initialized IMX pinctrl driver\n"); |
642 | 649 | ||
643 | return 0; | 650 | return 0; |