linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trilok Soni <soni.trilok@gmail.com>
To: Wan ZongShun <mcuos.com@gmail.com>
Cc: Eric miao <eric.y.miao@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: [PATCH] input:Add clk api support for w90p910 touchscreen
Date: Wed, 8 Jul 2009 19:51:57 +0530	[thread overview]
Message-ID: <5d5443650907080721rce02d6kd39e848cd44e98e3@mail.gmail.com> (raw)
In-Reply-To: <e68bb3470907080706l68a0c635v10527a3e36365cbc@mail.gmail.com>

Hi Wan ZongShun,

On Wed, Jul 8, 2009 at 7:36 PM, Wan ZongShun<mcuos.com@gmail.com> wrote:
> Dear  Trilok ,
>
>
> 2009/7/8 Trilok Soni <soni.trilok@gmail.com>:
>> 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?
>

I don't see clk_put in pxa27x_keypad.c _close function, which driver
you are referring too?

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/input/keyboard/pxa27x_keypad.c;h=0d2fc64a5e1cead895be0a0c22cd96a500faf1c0;hb=HEAD

clk_put is not needed in _close function. You should instead update
_remove method of your driver with clk_disable + clk_put.

-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-07-08 14:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 14:28 [PATCH] input:Add clk api support for w90p910 touchscreen Wan ZongShun
2009-07-07 17:19 ` Trilok Soni
2009-07-08  5:22   ` Wan ZongShun
2009-07-08  6:51     ` Dmitry Torokhov
2009-07-08  7:10       ` Wan ZongShun
2009-07-08 10:34         ` Trilok Soni
2009-07-08 14:06           ` Wan ZongShun
2009-07-08 14:21             ` Trilok Soni [this message]
2009-07-08 14:31               ` Wan ZongShun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d5443650907080721rce02d6kd39e848cd44e98e3@mail.gmail.com \
    --to=soni.trilok@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eric.y.miao@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-input@vger.kernel.org \
    --cc=mcuos.com@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).