linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Nikita Shubin <nikita.shubin@maquefel.me>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] Input: ep93xx_keypad: Prepare clock before using it
Date: Tue, 15 Jun 2021 09:46:51 +0200	[thread overview]
Message-ID: <9bf87ee0e1c2a97b0a1b98734e34e456f84ea3d7.camel@gmail.com> (raw)
In-Reply-To: <YMfQR8iM9be5Qg8+@google.com>

Hello Dmitry!

On Mon, 2021-06-14 at 14:55 -0700, Dmitry Torokhov wrote:
> > Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> > to Common Clock Framework.
> 
> Can this be merged standalone?

In principle, yes, but I thought it would be easier if the patches
would go via the same path as CCF conversion.

> > Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> > ---
> >   drivers/input/keyboard/ep93xx_keypad.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
> > index c8194333d612..e0e931e796fa 100644
> > --- a/drivers/input/keyboard/ep93xx_keypad.c
> > +++ b/drivers/input/keyboard/ep93xx_keypad.c
> > @@ -157,7 +157,7 @@ static int ep93xx_keypad_open(struct input_dev *pdev)
> >   
> >         if (!keypad->enabled) {
> >                 ep93xx_keypad_config(keypad);
> > -               clk_enable(keypad->clk);
> > +               clk_prepare_enable(keypad->clk);
> >                 keypad->enabled = true;
> >         }
> >   
> > @@ -169,7 +169,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
> >         struct ep93xx_keypad *keypad = input_get_drvdata(pdev);
> >   
> >         if (keypad->enabled) {
> > -               clk_disable(keypad->clk);
> > +               clk_disable_unprepare(keypad->clk);
> >                 keypad->enabled = false;
> 
> While we are at it, I wonder about handling suspend/resume. I see that
> we disable the clock even if keyboard is configured as a wakeup source.
> Is it really capable of waking up the system when clock is off?

That what "EP93xx User’s Guide" says:

26.2.4 Low Power Mode
The key scanning block also supports a low power wake-up mode. In this mode, a key press
generates a wake up interrupt. The key scan interrupt should be masked. Because the wake
up interrupt is asynchronous, and depends on external keypad lines which may have a large
capacitance value, glitches may occur on the interrupt when transitioning to low power mode.
After transitioning, all clocks to the key scanning circuitry can be shut down.

-- 
Alexander Sverdlin.



  reply	other threads:[~2021-06-15  7:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 23:30 [PATCH 0/7] Prepare EP93xx drivers for Common Clock Framework Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 1/7] iio: ep93xx: Prepare clock before using it Alexander Sverdlin
2021-06-14 10:50   ` Jonathan Cameron
2021-06-14 10:59     ` Alexander Sverdlin
2021-08-02  7:30     ` Alexander Sverdlin
2021-08-08 13:58       ` Jonathan Cameron
2021-06-13 23:30 ` [PATCH 2/7] spi: spi-ep93xx: " Alexander Sverdlin
2021-06-14 10:34   ` Mark Brown
2021-06-13 23:30 ` [PATCH 3/7] Input: ep93xx_keypad: " Alexander Sverdlin
2021-06-14 21:55   ` Dmitry Torokhov
2021-06-15  7:46     ` Alexander Sverdlin [this message]
2021-06-20  3:23       ` Dmitry Torokhov
2021-08-02  7:28         ` Alexander Sverdlin
2021-09-13 21:29         ` Alexander Sverdlin
2021-10-12  1:43           ` Dmitry Torokhov
2021-10-12  7:44             ` Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 4/7] video: ep93xx: " Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 5/7] dmaengine: " Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 6/7] ASoC: cirrus: i2s: " Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 7/7] pwm: ep93xx: " Alexander Sverdlin
2021-06-14  7:22   ` Uwe Kleine-König
2021-06-14  7:30     ` Alexander Sverdlin
2021-09-13 21:46     ` Alexander Sverdlin
2021-09-14  7:58       ` Uwe Kleine-König
2021-09-14 10:15         ` Alexander Sverdlin
2021-09-14 10:19           ` Uwe Kleine-König
2021-06-14  7:15 ` [PATCH 0/7] Prepare EP93xx drivers for Common Clock Framework Uwe Kleine-König

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=9bf87ee0e1c2a97b0a1b98734e34e456f84ea3d7.camel@gmail.com \
    --to=alexander.sverdlin@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikita.shubin@maquefel.me \
    /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).