diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-01-13 14:03:30 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-18 11:56:35 +0300 |
commit | ad9ec4ecee6889321ae1752ce8793524a8cdfa7a (patch) | |
tree | 3db527cd0ad1da68a344ee2404c9715f48f3e25a /drivers/pinctrl/mvebu/pinctrl-armada-xp.c | |
parent | 44aa9d0604f578cdd839d2f5295a9d920fb54999 (diff) | |
download | linux-ad9ec4ecee6889321ae1752ce8793524a8cdfa7a.tar.xz |
pinctrl: mvebu: switch drivers to generic simple mmio
Move the mvebu pinctrl drivers over to the generic simple mmio
implementation, saving a substantial number of lines of code in
the process.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mvebu/pinctrl-armada-xp.c')
-rw-r--r-- | drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c index a777925e0f34..63e1bd506983 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c @@ -30,21 +30,8 @@ #include "pinctrl-mvebu.h" -static void __iomem *mpp_base; static u32 *mpp_saved_regs; -static int armada_xp_mpp_ctrl_get(struct mvebu_mpp_ctrl_data *data, - unsigned pid, unsigned long *config) -{ - return default_mpp_ctrl_get(mpp_base, pid, config); -} - -static int armada_xp_mpp_ctrl_set(struct mvebu_mpp_ctrl_data *data, - unsigned pid, unsigned long config) -{ - return default_mpp_ctrl_set(mpp_base, pid, config); -} - enum armada_xp_variant { V_MV78230 = BIT(0), V_MV78260 = BIT(1), @@ -381,7 +368,7 @@ static const struct of_device_id armada_xp_pinctrl_of_match[] = { }; static const struct mvebu_mpp_ctrl mv78230_mpp_controls[] = { - MPP_FUNC_CTRL(0, 48, NULL, armada_xp_mpp_ctrl), + MPP_FUNC_CTRL(0, 48, NULL, mvebu_mmio_mpp_ctrl), }; static struct pinctrl_gpio_range mv78230_mpp_gpio_ranges[] = { @@ -390,7 +377,7 @@ static struct pinctrl_gpio_range mv78230_mpp_gpio_ranges[] = { }; static const struct mvebu_mpp_ctrl mv78260_mpp_controls[] = { - MPP_FUNC_CTRL(0, 66, NULL, armada_xp_mpp_ctrl), + MPP_FUNC_CTRL(0, 66, NULL, mvebu_mmio_mpp_ctrl), }; static struct pinctrl_gpio_range mv78260_mpp_gpio_ranges[] = { @@ -400,7 +387,7 @@ static struct pinctrl_gpio_range mv78260_mpp_gpio_ranges[] = { }; static const struct mvebu_mpp_ctrl mv78460_mpp_controls[] = { - MPP_FUNC_CTRL(0, 66, NULL, armada_xp_mpp_ctrl), + MPP_FUNC_CTRL(0, 66, NULL, mvebu_mmio_mpp_ctrl), }; static struct pinctrl_gpio_range mv78460_mpp_gpio_ranges[] = { @@ -419,7 +406,7 @@ static int armada_xp_pinctrl_suspend(struct platform_device *pdev, nregs = DIV_ROUND_UP(soc->nmodes, MVEBU_MPPS_PER_REG); for (i = 0; i < nregs; i++) - mpp_saved_regs[i] = readl(mpp_base + i * 4); + mpp_saved_regs[i] = readl(soc->control_data[0].base + i * 4); return 0; } @@ -433,7 +420,7 @@ static int armada_xp_pinctrl_resume(struct platform_device *pdev) nregs = DIV_ROUND_UP(soc->nmodes, MVEBU_MPPS_PER_REG); for (i = 0; i < nregs; i++) - writel(mpp_saved_regs[i], mpp_base + i * 4); + writel(mpp_saved_regs[i], soc->control_data[0].base + i * 4); return 0; } @@ -443,17 +430,11 @@ static int armada_xp_pinctrl_probe(struct platform_device *pdev) struct mvebu_pinctrl_soc_info *soc = &armada_xp_pinctrl_info; const struct of_device_id *match = of_match_device(armada_xp_pinctrl_of_match, &pdev->dev); - struct resource *res; int nregs; if (!match) return -ENODEV; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mpp_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(mpp_base)) - return PTR_ERR(mpp_base); - soc->variant = (unsigned) match->data & 0xff; switch (soc->variant) { @@ -501,7 +482,7 @@ static int armada_xp_pinctrl_probe(struct platform_device *pdev) pdev->dev.platform_data = soc; - return mvebu_pinctrl_probe(pdev); + return mvebu_pinctrl_simple_mmio_probe(pdev); } static struct platform_driver armada_xp_pinctrl_driver = { |