1 From 3cb13f9992ae1948b6ca05c88d2bd25cf9e7cd41 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Thu, 8 Mar 2012 11:22:03 +0100
4 Subject: [PATCH 30/70] MIPS: lantiq: convert falcon gpio to clkdev api
6 The falcon gpio clocks used to be enabled when registering the platform device.
7 Move this code into the driver and use clkdev api.
9 Signed-off-by: John Crispin <blogic@openwrt.org>
11 arch/mips/lantiq/falcon/devices.c | 5 -----
12 arch/mips/lantiq/falcon/gpio.c | 10 ++++++++++
13 2 files changed, 10 insertions(+), 5 deletions(-)
15 diff --git a/arch/mips/lantiq/falcon/devices.c b/arch/mips/lantiq/falcon/devices.c
16 index 4f47b44..6cd7a88 100644
17 --- a/arch/mips/lantiq/falcon/devices.c
18 +++ b/arch/mips/lantiq/falcon/devices.c
19 @@ -111,9 +111,6 @@ falcon_register_gpio(void)
20 falcon_gpio1_res, ARRAY_SIZE(falcon_gpio1_res));
21 platform_device_register_simple("falcon_gpio", 2,
22 falcon_gpio2_res, ARRAY_SIZE(falcon_gpio2_res));
23 - ltq_sysctl_activate(SYSCTL_SYS1, ACTS_PADCTRL1 | ACTS_P1);
24 - ltq_sysctl_activate(SYSCTL_SYSETH, ACTS_PADCTRL0 |
25 - ACTS_PADCTRL2 | ACTS_P0 | ACTS_P2);
29 @@ -123,6 +120,4 @@ falcon_register_gpio_extra(void)
30 falcon_gpio3_res, ARRAY_SIZE(falcon_gpio3_res));
31 platform_device_register_simple("falcon_gpio", 4,
32 falcon_gpio4_res, ARRAY_SIZE(falcon_gpio4_res));
33 - ltq_sysctl_activate(SYSCTL_SYS1,
34 - ACTS_PADCTRL3 | ACTS_PADCTRL4 | ACTS_P3 | ACTS_P4);
36 diff --git a/arch/mips/lantiq/falcon/gpio.c b/arch/mips/lantiq/falcon/gpio.c
37 index a44f71b..4147d61 100644
38 --- a/arch/mips/lantiq/falcon/gpio.c
39 +++ b/arch/mips/lantiq/falcon/gpio.c
41 #include <linux/interrupt.h>
42 #include <linux/slab.h>
43 #include <linux/export.h>
44 +#include <linux/err.h>
45 #include <linux/platform_device.h>
47 #include <lantiq_soc.h>
48 @@ -71,6 +72,7 @@ struct falcon_gpio_port {
50 unsigned int irq_base;
51 unsigned int chained_irq;
55 static struct falcon_gpio_port ltq_gpio_port[MAX_PORTS];
56 @@ -332,6 +334,14 @@ falcon_gpio_probe(struct platform_device *pdev)
60 + gpio_port->clk = clk_get(&pdev->dev, NULL);
61 + if (IS_ERR(gpio_port->clk)) {
62 + dev_err(&pdev->dev, "Could not get clock\n");
63 + ret = PTR_ERR(gpio_port->clk);;
66 + clk_enable(gpio_port->clk);
69 /* irq_chip support */
70 gpio_port->gpio_chip.to_irq = falcon_gpio_to_irq;