summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-samsung.c
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2012-10-11 10:11:13 +0200
committerLinus Walleij <linus.walleij@linaro.org>2012-10-15 09:10:11 +0200
commitab663789d69760d2735402f66501f20b60312a3d (patch)
tree67483cfb29a5d3bc6c4c1e23dc77f5bede862414 /drivers/pinctrl/pinctrl-samsung.c
parenta7a8241540c3168965588d313f46b14f79e86753 (diff)
pinctrl: samsung: Match pin banks with their device nodes
This patch is a preparation for converting the pinctrl-samsung driver to one GPIO chip and IRQ domain per bank. It binds banks defined by internal driver data with bank nodes in device tree. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-samsung.c')
-rw-r--r--drivers/pinctrl/pinctrl-samsung.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index 94e13780a6a6..f266710a1b04 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -794,6 +794,7 @@ static struct samsung_pin_ctrl *samsung_pinctrl_get_soc_data(
int id;
const struct of_device_id *match;
const struct device_node *node = pdev->dev.of_node;
+ struct device_node *np;
struct samsung_pin_ctrl *ctrl;
struct samsung_pin_bank *bank;
int i;
@@ -816,6 +817,18 @@ static struct samsung_pin_ctrl *samsung_pinctrl_get_soc_data(
}
}
+ for_each_child_of_node(node, np) {
+ if (!of_find_property(np, "gpio-controller", NULL))
+ continue;
+ bank = ctrl->pin_banks;
+ for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
+ if (!strcmp(bank->name, np->name)) {
+ bank->of_node = np;
+ break;
+ }
+ }
+ }
+
ctrl->base = pin_base;
pin_base += ctrl->nr_pins;