aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-04-18 14:12:50 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2014-05-04 03:04:49 -0400
commit2519859418fbf82b5cc7213afdc5dd0d9d54eb80 (patch)
treef76d321c3d9a7869eae2da71aff1a0983c78cbed /drivers/pinctrl
parent16c675f9893fffd8a4fd408c42d9ff050e022e58 (diff)
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
7obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun5i-a13.o 7obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun5i-a13.o
8obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun6i-a31.o 8obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun6i-a31.o
9obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun6i-a31-r.o 9obj-$(CONFIG_PINCTRL_SUNXI) += pinctrl-sun6i-a31-r.o
10obj-$(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 @@
1/* 1/*
2 * Allwinner A1X SoCs pinctrl driver. 2 * Allwinner A20 SoCs pinctrl driver.
3 * 3 *
4 * Copyright (C) 2012 Maxime Ripard 4 * Copyright (C) 2014 Maxime Ripard
5 * 5 *
6 * Maxime Ripard <maxime.ripard@free-electrons.com> 6 * Maxime Ripard <maxime.ripard@free-electrons.com>
7 * 7 *
@@ -10,8 +10,11 @@
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12 12
13#ifndef __PINCTRL_SUNXI_PINS_H 13#include <linux/module.h>
14#define __PINCTRL_SUNXI_PINS_H 14#include <linux/platform_device.h>
15#include <linux/of.h>
16#include <linux/of_device.h>
17#include <linux/pinctrl/pinctrl.h>
15 18
16#include "pinctrl-sunxi.h" 19#include "pinctrl-sunxi.h"
17 20
@@ -1035,4 +1038,28 @@ static const struct sunxi_pinctrl_desc sun7i_a20_pinctrl_data = {
1035 .npins = ARRAY_SIZE(sun7i_a20_pins), 1038 .npins = ARRAY_SIZE(sun7i_a20_pins),
1036}; 1039};
1037 1040
1038#endif /* __PINCTRL_SUNXI_PINS_H */ 1041static int sun7i_a20_pinctrl_probe(struct platform_device *pdev)
1042{
1043 return sunxi_pinctrl_init(pdev,
1044 &sun7i_a20_pinctrl_data);
1045}
1046
1047static struct of_device_id sun7i_a20_pinctrl_match[] = {
1048 { .compatible = "allwinner,sun7i-a20-pinctrl", },
1049 {}
1050};
1051MODULE_DEVICE_TABLE(of, sun7i_a20_pinctrl_match);
1052
1053static struct platform_driver sun7i_a20_pinctrl_driver = {
1054 .probe = sun7i_a20_pinctrl_probe,
1055 .driver = {
1056 .name = "sun7i-a20-pinctrl",
1057 .owner = THIS_MODULE,
1058 .of_match_table = sun7i_a20_pinctrl_match,
1059 },
1060};
1061module_platform_driver(sun7i_a20_pinctrl_driver);
1062
1063MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com");
1064MODULE_DESCRIPTION("Allwinner A20 pinctrl driver");
1065MODULE_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 @@
31 31
32#include "../core.h" 32#include "../core.h"
33#include "pinctrl-sunxi.h" 33#include "pinctrl-sunxi.h"
34#include "pinctrl-sunxi-pins.h"
35 34
36static struct sunxi_pinctrl_group * 35static struct sunxi_pinctrl_group *
37sunxi_pinctrl_find_group_by_name(struct sunxi_pinctrl *pctl, const char *group) 36sunxi_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)
673 } 672 }
674} 673}
675 674
676static struct of_device_id sunxi_pinctrl_match[] = {
677 { .compatible = "allwinner,sun7i-a20-pinctrl", .data = (void *)&sun7i_a20_pinctrl_data },
678 {}
679};
680MODULE_DEVICE_TABLE(of, sunxi_pinctrl_match);
681
682static int sunxi_pinctrl_add_function(struct sunxi_pinctrl *pctl, 675static int sunxi_pinctrl_add_function(struct sunxi_pinctrl *pctl,
683 const char *name) 676 const char *name)
684{ 677{
@@ -930,28 +923,3 @@ pinctrl_error:
930 pinctrl_unregister(pctl->pctl_dev); 923 pinctrl_unregister(pctl->pctl_dev);
931 return ret; 924 return ret;
932} 925}
933
934static int sunxi_pinctrl_probe(struct platform_device *pdev)
935{
936 const struct of_device_id *device;
937
938 device = of_match_device(sunxi_pinctrl_match, &pdev->dev);
939 if (!device)
940 return -ENODEV;
941
942 return sunxi_pinctrl_init(pdev, device->data);
943}
944
945static struct platform_driver sunxi_pinctrl_driver = {
946 .probe = sunxi_pinctrl_probe,
947 .driver = {
948 .name = "sunxi-pinctrl",
949 .owner = THIS_MODULE,
950 .of_match_table = sunxi_pinctrl_match,
951 },
952};
953module_platform_driver(sunxi_pinctrl_driver);
954
955MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
956MODULE_DESCRIPTION("Allwinner A1X pinctrl driver");
957MODULE_LICENSE("GPL");