Commit 855f80cd authored by Lee Jones's avatar Lee Jones Committed by Arnd Bergmann

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: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 76f901eb
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of_device.h>
#include <linux/pinctrl/pinctrl.h> #include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h> #include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/pinconf.h> #include <linux/pinctrl/pinconf.h>
...@@ -1688,18 +1689,34 @@ static struct pinctrl_desc nmk_pinctrl_desc = { ...@@ -1688,18 +1689,34 @@ static struct pinctrl_desc nmk_pinctrl_desc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static const struct of_device_id nmk_pinctrl_match[] = {
{
.compatible = "stericsson,nmk_pinctrl",
.data = (void *)PINCTRL_NMK_DB8500,
},
{},
};
static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) static int __devinit nmk_pinctrl_probe(struct platform_device *pdev)
{ {
const struct platform_device_id *platid = platform_get_device_id(pdev); const struct platform_device_id *platid = platform_get_device_id(pdev);
struct device_node *np = pdev->dev.of_node;
struct nmk_pinctrl *npct; struct nmk_pinctrl *npct;
unsigned int version = 0;
int i; int i;
npct = devm_kzalloc(&pdev->dev, sizeof(*npct), GFP_KERNEL); npct = devm_kzalloc(&pdev->dev, sizeof(*npct), GFP_KERNEL);
if (!npct) if (!npct)
return -ENOMEM; return -ENOMEM;
if (platid)
version = platid->driver_data;
else if (np)
version = (unsigned int)
of_match_device(nmk_pinctrl_match, &pdev->dev)->data;
/* Poke in other ASIC variants here */ /* Poke in other ASIC variants here */
if (platid->driver_data == PINCTRL_NMK_DB8500) if (version == PINCTRL_NMK_DB8500)
nmk_pinctrl_db8500_init(&npct->soc); nmk_pinctrl_db8500_init(&npct->soc);
/* /*
...@@ -1758,6 +1775,7 @@ static struct platform_driver nmk_pinctrl_driver = { ...@@ -1758,6 +1775,7 @@ static struct platform_driver nmk_pinctrl_driver = {
.driver = { .driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "pinctrl-nomadik", .name = "pinctrl-nomadik",
.of_match_table = nmk_pinctrl_match,
}, },
.probe = nmk_pinctrl_probe, .probe = nmk_pinctrl_probe,
.id_table = nmk_pinctrl_id, .id_table = nmk_pinctrl_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment