From: Maxime Ripard Date: Fri, 18 Apr 2014 18:12:50 +0000 (+0200) Subject: pinctrl: sunxi: Move Allwinner A20 pinctrl driver to a driver of its own X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2519859418fbf82b5cc7213afdc5dd0d9d54eb80;p=linux-beck.git 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 --- 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 similarity index 97% rename from drivers/pinctrl/sunxi/pinctrl-sunxi-pins.h rename to 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 * @@ -10,8 +10,11 @@ * warranty of any kind, whether express or implied. */ -#ifndef __PINCTRL_SUNXI_PINS_H -#define __PINCTRL_SUNXI_PINS_H +#include +#include +#include +#include +#include #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 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 "); -MODULE_DESCRIPTION("Allwinner A1X pinctrl driver"); -MODULE_LICENSE("GPL");