diff mbox series

[V1] elan_i2c: Increment wakeup count if wake source.

Message ID 20190513220610.177489-1-ravisadineni@chromium.org (mailing list archive)
State Mainlined
Commit 145b11d1baa3462ba211bd845ecf94057b7d10e1
Headers show
Series [V1] elan_i2c: Increment wakeup count if wake source. | expand

Commit Message

Ravi Chandra Sadineni May 13, 2019, 10:06 p.m. UTC
Notify the PM core that this dev is the wake source. This helps
userspace daemon tracking the wake source to identify the origin of the
wake.

Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
---
 drivers/input/mouse/elan_i2c_core.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Dmitry Torokhov May 13, 2019, 11:29 p.m. UTC | #1
Hi Ravi,

On Mon, May 13, 2019 at 3:06 PM Ravi Chandra Sadineni
<ravisadineni@chromium.org> wrote:
>
> Notify the PM core that this dev is the wake source. This helps
> userspace daemon tracking the wake source to identify the origin of the
> wake.

I wonder if we could do that form the i2c core instead of individual drivers?

>
> Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
> ---
>  drivers/input/mouse/elan_i2c_core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> index f9525d6f0bfe..2c0561e20b7f 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -981,6 +981,8 @@ static irqreturn_t elan_isr(int irq, void *dev_id)
>         if (error)
>                 goto out;
>
> +       pm_wakeup_event(dev, 0);
> +
>         switch (report[ETP_REPORT_ID_OFFSET]) {
>         case ETP_REPORT_ID:
>                 elan_report_absolute(data, report);
> --
> 2.20.1
>

Thanks.
Ravi Chandra Sadineni May 15, 2019, 4:17 p.m. UTC | #2
Hi Dmitry,

On Mon, May 13, 2019 at 4:29 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hi Ravi,
>
> On Mon, May 13, 2019 at 3:06 PM Ravi Chandra Sadineni
> <ravisadineni@chromium.org> wrote:
> >
> > Notify the PM core that this dev is the wake source. This helps
> > userspace daemon tracking the wake source to identify the origin of the
> > wake.
>
> I wonder if we could do that form the i2c core instead of individual drivers?
I am sorry, I don't see a way how this could be done.
>
> >
> > Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
> > ---
> >  drivers/input/mouse/elan_i2c_core.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> > index f9525d6f0bfe..2c0561e20b7f 100644
> > --- a/drivers/input/mouse/elan_i2c_core.c
> > +++ b/drivers/input/mouse/elan_i2c_core.c
> > @@ -981,6 +981,8 @@ static irqreturn_t elan_isr(int irq, void *dev_id)
> >         if (error)
> >                 goto out;
> >
> > +       pm_wakeup_event(dev, 0);
> > +
> >         switch (report[ETP_REPORT_ID_OFFSET]) {
> >         case ETP_REPORT_ID:
> >                 elan_report_absolute(data, report);
> > --
> > 2.20.1
> >
>
> Thanks.
>
> --
> Dmitry

Thanks,
Ravi
Dmitry Torokhov May 15, 2019, 11:15 p.m. UTC | #3
On Wed, May 15, 2019 at 09:17:59AM -0700, Ravi Chandra Sadineni wrote:
> Hi Dmitry,
> 
> On Mon, May 13, 2019 at 4:29 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Ravi,
> >
> > On Mon, May 13, 2019 at 3:06 PM Ravi Chandra Sadineni
> > <ravisadineni@chromium.org> wrote:
> > >
> > > Notify the PM core that this dev is the wake source. This helps
> > > userspace daemon tracking the wake source to identify the origin of the
> > > wake.
> >
> > I wonder if we could do that form the i2c core instead of individual drivers?
> I am sorry, I don't see a way how this could be done.

Sorry, brain fart on my part. Applied, thank you.

> >
> > >
> > > Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
> > > ---
> > >  drivers/input/mouse/elan_i2c_core.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> > > index f9525d6f0bfe..2c0561e20b7f 100644
> > > --- a/drivers/input/mouse/elan_i2c_core.c
> > > +++ b/drivers/input/mouse/elan_i2c_core.c
> > > @@ -981,6 +981,8 @@ static irqreturn_t elan_isr(int irq, void *dev_id)
> > >         if (error)
> > >                 goto out;
> > >
> > > +       pm_wakeup_event(dev, 0);
> > > +
> > >         switch (report[ETP_REPORT_ID_OFFSET]) {
> > >         case ETP_REPORT_ID:
> > >                 elan_report_absolute(data, report);
> > > --
> > > 2.20.1
> > >
> >
> > Thanks.
> >
> > --
> > Dmitry
> 
> Thanks,
> Ravi
diff mbox series

Patch

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index f9525d6f0bfe..2c0561e20b7f 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -981,6 +981,8 @@  static irqreturn_t elan_isr(int irq, void *dev_id)
 	if (error)
 		goto out;
 
+	pm_wakeup_event(dev, 0);
+
 	switch (report[ETP_REPORT_ID_OFFSET]) {
 	case ETP_REPORT_ID:
 		elan_report_absolute(data, report);