[lantiq] bump kernel to 3.2.12
[openwrt.git] / target / linux / lantiq / patches-3.2 / 0029-MIPS-lantiq-convert-gpio_stp-driver-to-clkdev-api.patch
1 From 81cf50fd6cfff13e06cd587094f5094dec32d57d Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Thu, 8 Mar 2012 11:21:33 +0100
4 Subject: [PATCH 29/70] MIPS: lantiq: convert gpio_stp driver to clkdev api
5
6 Update from old pmu_{dis,en}able() to ckldev api.
7
8 Signed-off-by: John Crispin <blogic@openwrt.org>
9 ---
10  arch/mips/lantiq/xway/gpio_stp.c |   12 +++++++++---
11  1 files changed, 9 insertions(+), 3 deletions(-)
12
13 diff --git a/arch/mips/lantiq/xway/gpio_stp.c b/arch/mips/lantiq/xway/gpio_stp.c
14 index e6b4809..da91c5e 100644
15 --- a/arch/mips/lantiq/xway/gpio_stp.c
16 +++ b/arch/mips/lantiq/xway/gpio_stp.c
17 @@ -15,6 +15,8 @@
18  #include <linux/mutex.h>
19  #include <linux/io.h>
20  #include <linux/gpio.h>
21 +#include <linux/clk.h>
22 +#include <linux/err.h>
23  
24  #include <lantiq_soc.h>
25  
26 @@ -78,8 +80,10 @@ static struct gpio_chip ltq_stp_chip = {
27         .owner = THIS_MODULE,
28  };
29  
30 -static int ltq_stp_hw_init(void)
31 +static int ltq_stp_hw_init(struct device *dev)
32  {
33 +       struct clk *clk;
34 +
35         /* sane defaults */
36         ltq_stp_w32(0, LTQ_STP_AR);
37         ltq_stp_w32(0, LTQ_STP_CPU0);
38 @@ -105,7 +109,9 @@ static int ltq_stp_hw_init(void)
39          */
40         ltq_stp_w32_mask(0, LTQ_STP_ADSL_SRC, LTQ_STP_CON0);
41  
42 -       ltq_pmu_enable(PMU_LED);
43 +       clk = clk_get(dev, NULL);
44 +       WARN_ON(IS_ERR(clk));
45 +       clk_enable(clk);
46         return 0;
47  }
48  
49 @@ -138,7 +144,7 @@ static int __devinit ltq_stp_probe(struct platform_device *pdev)
50         }
51         ret = gpiochip_add(&ltq_stp_chip);
52         if (!ret)
53 -               ret = ltq_stp_hw_init();
54 +               ret = ltq_stp_hw_init(&pdev->dev);
55  
56         return ret;
57  }
58 -- 
59 1.7.7.1
60