summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-04-18 20:12:50 +0200
committerMaxime Ripard <maxime.ripard@free-electrons.com>2014-05-04 00:04:49 -0700
commit2519859418fbf82b5cc7213afdc5dd0d9d54eb80 (patch)
treef76d321c3d9a7869eae2da71aff1a0983c78cbed /drivers/pinctrl
parent16c675f9893fffd8a4fd408c42d9ff050e022e58 (diff)
downloadlinux-2519859418fbf82b5cc7213afdc5dd0d9d54eb80.tar.gz
linux-2519859418fbf82b5cc7213afdc5dd0d9d54eb80.tar.bz2
linux-2519859418fbf82b5cc7213afdc5dd0d9d54eb80.zip
pinctrl: sunxi: Move Allwinner A20 pinctrl driver to a driver of its own
Move the pin description to a driver specific to be. This is the final step toward retiring pinctrl-sunxi-pins.h that used to define all the pins for all the Allwinner SoCs in a single header, that would have in turn result in having these structures in the final binary as many times as the header was included. We can finally remove that header, and remove all the driver part of the pinctrl-sunxi core. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/sunxi/Makefile1
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c (renamed from drivers/pinctrl/sunxi/pinctrl-sunxi-pins.h)37
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sunxi.c32
3 files changed, 33 insertions, 37 deletions
diff --git a/drivers/pinctrl/sunxi/Makefile b/drivers/pinctrl/sunxi/Makefile
index df22956ea680..19dc3dab37c0 100644
--- a/drivers/pinctrl/sunxi/Makefile
+++ b/drivers/pinctrl/sunxi/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun5i-a10s.o
obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun5i-a13.o
obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun6i-a31.o
obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun6i-a31-r.o
+obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun7i-a20.o
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi-pins.h b/drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c
index 13ec0172145b..d8577ce5f1a4 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi-pins.h
+++ b/drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c
@@ -1,7 +1,7 @@
/*
- * Allwinner A1X SoCs pinctrl driver.
+ * Allwinner A20 SoCs pinctrl driver.
*
- * Copyright (C) 2012 Maxime Ripard
+ * Copyright (C) 2014 Maxime Ripard
*
* Maxime Ripard <maxime.ripard@free-electrons.com>
*
@@ -10,8 +10,11 @@
* warranty of any kind, whether express or implied.
*/
-#ifndef __PINCTRL_SUNXI_PINS_H
-#define __PINCTRL_SUNXI_PINS_H
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/pinctrl/pinctrl.h>
#include "pinctrl-sunxi.h"
@@ -1035,4 +1038,28 @@ static const struct sunxi_pinctrl_desc sun7i_a20_pinctrl_data = {
.npins = ARRAY_SIZE(sun7i_a20_pins),
};
-#endif /* __PINCTRL_SUNXI_PINS_H */
+static int sun7i_a20_pinctrl_probe(struct platform_device *pdev)
+{
+ return sunxi_pinctrl_init(pdev,
+ &sun7i_a20_pinctrl_data);
+}
+
+static struct of_device_id sun7i_a20_pinctrl_match[] = {
+ { .compatible = "allwinner,sun7i-a20-pinctrl", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, sun7i_a20_pinctrl_match);
+
+static struct platform_driver sun7i_a20_pinctrl_driver = {
+ .probe = sun7i_a20_pinctrl_probe,
+ .driver = {
+ .name = "sun7i-a20-pinctrl",
+ .owner = THIS_MODULE,
+ .of_match_table = sun7i_a20_pinctrl_match,
+ },
+};
+module_platform_driver(sun7i_a20_pinctrl_driver);
+
+MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com");
+MODULE_DESCRIPTION("Allwinner A20 pinctrl driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index bf56cd3feec2..2c3fb92b8972 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -31,7 +31,6 @@
#include "../core.h"
#include "pinctrl-sunxi.h"
-#include "pinctrl-sunxi-pins.h"
static struct sunxi_pinctrl_group *
sunxi_pinctrl_find_group_by_name(struct sunxi_pinctrl *pctl, const char *group)
@@ -673,12 +672,6 @@ static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
}
}
-static struct of_device_id sunxi_pinctrl_match[] = {
- { .compatible = "allwinner,sun7i-a20-pinctrl", .data = (void *)&sun7i_a20_pinctrl_data },
- {}
-};
-MODULE_DEVICE_TABLE(of, sunxi_pinctrl_match);
-
static int sunxi_pinctrl_add_function(struct sunxi_pinctrl *pctl,
const char *name)
{
@@ -930,28 +923,3 @@ pinctrl_error:
pinctrl_unregister(pctl->pctl_dev);
return ret;
}
-
-static int sunxi_pinctrl_probe(struct platform_device *pdev)
-{
- const struct of_device_id *device;
-
- device = of_match_device(sunxi_pinctrl_match, &pdev->dev);
- if (!device)
- return -ENODEV;
-
- return sunxi_pinctrl_init(pdev, device->data);
-}
-
-static struct platform_driver sunxi_pinctrl_driver = {
- .probe = sunxi_pinctrl_probe,
- .driver = {
- .name = "sunxi-pinctrl",
- .owner = THIS_MODULE,
- .of_match_table = sunxi_pinctrl_match,
- },
-};
-module_platform_driver(sunxi_pinctrl_driver);
-
-MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
-MODULE_DESCRIPTION("Allwinner A1X pinctrl driver");
-MODULE_LICENSE("GPL");