diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-05-26 01:09:29 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-05-31 20:03:25 -0400 |
commit | 855f80cd1683179b251b01d232b3ae228c614766 (patch) | |
tree | 0fb0d209c5e3ec073368c396515c262814da397c /drivers/pinctrl/pinctrl-nomadik.c | |
parent | 76f901eb4659779ecacd0e4eba49f55442daef53 (diff) |
pinctrl-nomadik: Allow Device Tree driver probing
The Nomadik GPIO controller now relies on Nomadik pinctrl, however
the pinctrl driver is not currently started by any ux500 platform.
This is requred or GPIOs do not work at all.
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index b8e01c3eaa95..b26395d16347 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
25 | #include <linux/irqdomain.h> | 25 | #include <linux/irqdomain.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/of_device.h> | ||
27 | #include <linux/pinctrl/pinctrl.h> | 28 | #include <linux/pinctrl/pinctrl.h> |
28 | #include <linux/pinctrl/pinmux.h> | 29 | #include <linux/pinctrl/pinmux.h> |
29 | #include <linux/pinctrl/pinconf.h> | 30 | #include <linux/pinctrl/pinconf.h> |
@@ -1688,18 +1689,34 @@ static struct pinctrl_desc nmk_pinctrl_desc = { | |||
1688 | .owner = THIS_MODULE, | 1689 | .owner = THIS_MODULE, |
1689 | }; | 1690 | }; |
1690 | 1691 | ||
1692 | static const struct of_device_id nmk_pinctrl_match[] = { | ||
1693 | { | ||
1694 | .compatible = "stericsson,nmk_pinctrl", | ||
1695 | .data = (void *)PINCTRL_NMK_DB8500, | ||
1696 | }, | ||
1697 | {}, | ||
1698 | }; | ||
1699 | |||
1691 | static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) | 1700 | static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) |
1692 | { | 1701 | { |
1693 | const struct platform_device_id *platid = platform_get_device_id(pdev); | 1702 | const struct platform_device_id *platid = platform_get_device_id(pdev); |
1703 | struct device_node *np = pdev->dev.of_node; | ||
1694 | struct nmk_pinctrl *npct; | 1704 | struct nmk_pinctrl *npct; |
1705 | unsigned int version = 0; | ||
1695 | int i; | 1706 | int i; |
1696 | 1707 | ||
1697 | npct = devm_kzalloc(&pdev->dev, sizeof(*npct), GFP_KERNEL); | 1708 | npct = devm_kzalloc(&pdev->dev, sizeof(*npct), GFP_KERNEL); |
1698 | if (!npct) | 1709 | if (!npct) |
1699 | return -ENOMEM; | 1710 | return -ENOMEM; |
1700 | 1711 | ||
1712 | if (platid) | ||
1713 | version = platid->driver_data; | ||
1714 | else if (np) | ||
1715 | version = (unsigned int) | ||
1716 | of_match_device(nmk_pinctrl_match, &pdev->dev)->data; | ||
1717 | |||
1701 | /* Poke in other ASIC variants here */ | 1718 | /* Poke in other ASIC variants here */ |
1702 | if (platid->driver_data == PINCTRL_NMK_DB8500) | 1719 | if (version == PINCTRL_NMK_DB8500) |
1703 | nmk_pinctrl_db8500_init(&npct->soc); | 1720 | nmk_pinctrl_db8500_init(&npct->soc); |
1704 | 1721 | ||
1705 | /* | 1722 | /* |
@@ -1758,6 +1775,7 @@ static struct platform_driver nmk_pinctrl_driver = { | |||
1758 | .driver = { | 1775 | .driver = { |
1759 | .owner = THIS_MODULE, | 1776 | .owner = THIS_MODULE, |
1760 | .name = "pinctrl-nomadik", | 1777 | .name = "pinctrl-nomadik", |
1778 | .of_match_table = nmk_pinctrl_match, | ||
1761 | }, | 1779 | }, |
1762 | .probe = nmk_pinctrl_probe, | 1780 | .probe = nmk_pinctrl_probe, |
1763 | .id_table = nmk_pinctrl_id, | 1781 | .id_table = nmk_pinctrl_id, |