Skip to content

Commit

Permalink
pinctrl: imx1-core populate subdevices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Pargmann authored and Linus Walleij committed Nov 25, 2013
1 parent b9f2f2e commit 31d610f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,25 @@ Required properties for pin configuration node:
CONFIG can be 0 or 1, meaning Pullup disable/enable.


The iomux controller has gpio child nodes which are embedded in the iomux
control registers. They have to be defined as child nodes of the iomux device
node. If gpio subnodes are defined "#address-cells", "#size-cells" and "ranges"
properties for the iomux device node are required.

Example:

iomuxc: iomuxc@10015000 {
compatible = "fsl,imx27-iomuxc";
reg = <0x10015000 0x600>;
#address-cells = <1>;
#size-cells = <1>;
ranges;

gpio1: gpio@10015000 {
...
};

...

uart {
pinctrl_uart1: uart-1 {
Expand All @@ -83,6 +96,15 @@ The above example using macros:
iomuxc: iomuxc@10015000 {
compatible = "fsl,imx27-iomuxc";
reg = <0x10015000 0x600>;
#address-cells = <1>;
#size-cells = <1>;
ranges;

gpio1: gpio@10015000 {
...
};

...

uart {
pinctrl_uart1: uart-1 {
Expand Down
7 changes: 7 additions & 0 deletions drivers/pinctrl/pinctrl-imx1-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,13 @@ int imx1_pinctrl_core_probe(struct platform_device *pdev,
return -EINVAL;
}

ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
if (ret) {
pinctrl_unregister(ipctl->pctl);
dev_err(&pdev->dev, "Failed to populate subdevices\n");
return ret;
}

dev_info(&pdev->dev, "initialized IMX pinctrl driver\n");

return 0;
Expand Down

0 comments on commit 31d610f

Please sign in to comment.