Re: [PATCH] input:Add clk api support for w90p910 touchscreen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear  Trilok ,


2009/7/8 Trilok Soni <soni.trilok@xxxxxxxxx>:
> Hi Wan ZongShun,
>
>>
>> ---
>>  drivers/input/touchscreen/w90p910_ts.c |   25 ++++++++++++-------------
>>  1 files changed, 12 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c
>> index 6071f58..7bef19e 100644
>> --- a/drivers/input/touchscreen/w90p910_ts.c
>> +++ b/drivers/input/touchscreen/w90p910_ts.c
>> @@ -13,6 +13,7 @@
>>  #include <linux/module.h>
>>  #include <linux/platform_device.h>
>>  #include <linux/io.h>
>> +#include <linux/clk.h>
>>  #include <linux/input.h>
>>  #include <linux/interrupt.h>
>>
>> @@ -47,8 +48,8 @@ enum ts_state {
>>  struct w90p910_ts {
>>        struct input_dev *input;
>>        struct timer_list timer;
>> +       struct clk *clk;
>>        int irq_num;
>> -       void __iomem *clocken;
>>        void __iomem *ts_reg;
>>        spinlock_t lock;
>>        enum ts_state state;
>> @@ -166,8 +167,7 @@ static int w90p910_open(struct input_dev *dev)
>>        unsigned long val;
>>
>>        /* enable the ADC clock */
>> -       val = __raw_readl(w90p910_ts->clocken);
>> -       __raw_writel(val | ADC_CLK_EN, w90p910_ts->clocken);
>> +       clk_enable(w90p910_ts->clk);
>>
>>        __raw_writel(ADC_RST1, w90p910_ts->ts_reg);
>>        msleep(1);
>> @@ -211,8 +211,8 @@ static void w90p910_close(struct input_dev *dev)
>>        del_timer_sync(&w90p910_ts->timer);
>>
>>        /* stop the ADC clock */
>> -       val = __raw_readl(w90p910_ts->clocken);
>> -       __raw_writel(val & ~ADC_CLK_EN, w90p910_ts->clocken);
>> +       clk_disable(w90p910_ts->clk);
>> +       clk_put(w90p910_ts->clk);
>
>
> why you are doing clk_put on _close? I think you are calling clk_get
> only on _probe, so there is a mismatch here. Also I don't see
> clk_disable/clk_put in driver remove function.

Just imitate the method from pxa27x_keypad.c.
Do you mean  there is no need to free the clock source here?

> --
> ---Trilok Soni
> http://triloksoni.wordpress.com
> http://www.linkedin.com/in/triloksoni
>



-- 
Wan z.s
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux