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>
This commit is contained in:
Maxime Ripard 2014-04-18 20:12:50 +02:00
parent 16c675f989
commit 2519859418
3 changed files with 33 additions and 37 deletions

View file

@ -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

View file

@ -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");

View file

@ -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 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
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");