From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: balbi@ti.com
Cc: Illia Smyrnov <illia.smyrnov@ti.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org
Subject: Re: [PATCH v3 1/3] Input: omap-keypad: Enable wakeup capability for keypad.
Date: Mon, 29 Jul 2013 11:59:45 -0700 [thread overview]
Message-ID: <7605900.g1IUvSbegi@dtor-d630.eng.vmware.com> (raw)
In-Reply-To: <20130729180441.GF4964@radagast>
On Monday, July 29, 2013 09:04:41 PM Felipe Balbi wrote:
> Hi,
>
> On Mon, Jul 29, 2013 at 07:45:09PM +0300, Illia Smyrnov wrote:
> > Enable/disable IRQ wake in suspend/resume handlers
> > to make the keypad wakeup capable.
> >
> > Signed-off-by: Illia Smyrnov <illia.smyrnov@ti.com>
> > ---
> >
> > drivers/input/keyboard/omap4-keypad.c | 43
> > +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
> >
> > diff --git a/drivers/input/keyboard/omap4-keypad.c
> > b/drivers/input/keyboard/omap4-keypad.c index 0244262..feab00f 100644
> > --- a/drivers/input/keyboard/omap4-keypad.c
> > +++ b/drivers/input/keyboard/omap4-keypad.c
> > @@ -74,6 +74,7 @@ struct omap4_keypad {
> >
> > struct input_dev *input;
> >
> > void __iomem *base;
> >
> > + bool irq_wake_enabled;
>
> this flag is a bit weird... but I can't find a better way to handle this
> situation. In one way, you shouldn't prevent system suspend, so you can
> error out in case enable_irq_wake() fails, otoh if enable_irq_wake()
> fails and you return 0, on resume disable_irq_wake() will throw
> unbalanced calls warning. Maybe someone else has a better idea.
>
> > @@ -439,12 +444,50 @@ static const struct of_device_id
> > omap_keypad_dt_match[] = {>
> > MODULE_DEVICE_TABLE(of, omap_keypad_dt_match);
> > #endif
> >
> > +#ifdef CONFIG_PM_SLEEP
> > +static int omap4_keypad_suspend(struct device *dev)
> > +{
> > + struct platform_device *pdev = to_platform_device(dev);
>
> you don't need to access the platform_device...
>
> > + struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
>
> ... since this can become:
>
> struct omap4_keypad *keypad_data = dev_get_drvdata(dev);
No, please use correct accessors for the objects. Platform drivers deal
with platform devices and I prefer using platform_get_drvdata() on them.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2013-07-29 18:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 16:45 [PATCH v3 0/3] Input: omap-keypad: Wakeup capability and w/a for i689 errata Illia Smyrnov
2013-07-29 16:45 ` [PATCH v3 1/3] Input: omap-keypad: Enable wakeup capability for keypad Illia Smyrnov
2013-07-29 18:04 ` Felipe Balbi
2013-07-29 18:59 ` Dmitry Torokhov [this message]
2013-07-29 19:13 ` Felipe Balbi
2013-07-29 19:59 ` Dmitry Torokhov
2013-07-29 20:36 ` Felipe Balbi
2013-07-29 20:40 ` Dmitry Torokhov
2013-07-31 9:49 ` Felipe Balbi
2013-07-29 16:45 ` [PATCH v3 2/3] Input: omap-keypad: errata i689: Correct debounce time Illia Smyrnov
2013-07-29 18:08 ` Felipe Balbi
2013-07-29 16:45 ` [PATCH v3 3/3] Input: omap-keypad: Setup irq type from DT Illia Smyrnov
2013-07-29 18:09 ` Felipe Balbi
2013-08-27 10:08 ` [PATCH v3 0/3] Input: omap-keypad: Wakeup capability and w/a for i689 errata Illia Smyrnov
2013-08-29 16:34 ` Dmitry Torokhov
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=7605900.g1IUvSbegi@dtor-d630.eng.vmware.com \
--to=dmitry.torokhov@gmail.com \
--cc=balbi@ti.com \
--cc=illia.smyrnov@ti.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/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