Accels generating interrupts after every suspend/resume cycle

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accels generating interrupts after every suspend/resume cycle

Sebastian Krzyszkowiak
Hi,

We in SHR noticed that after first suspend and resume cycle everything
slows down.
powertop found a reason of that - after suspend/resume, lis302dl
generates about 40 wakeups per second. Using "cat /dev/input/event2"
and then ctrl+c, and after that the same with event3 fixes it, but
wakeups are back after next suspend/resume. Interrupts are not there
on fresh boot.

It happens on newest andy-tracking. Any ideas?

--
Sebastian Krzyszkowiak
dos

Reply | Threaded
Open this post in threaded view
|

Re: Accels generating interrupts after every suspend/resume cycle

Michael Trimarchi-3
Hi,

Sebastian Krzyszkowiak wrote:

> Hi,
>
> We in SHR noticed that after first suspend and resume cycle everything
> slows down.
> powertop found a reason of that - after suspend/resume, lis302dl
> generates about 40 wakeups per second. Using "cat /dev/input/event2"
> and then ctrl+c, and after that the same with event3 fixes it, but
> wakeups are back after next suspend/resume. Interrupts are not there
> on fresh boot.
>
> It happens on newest andy-tracking. Any ideas?
>
>  
Yes there is a patch :) in the mailing list and reviewed by Werner but
never pushed

Michael

Reply | Threaded
Open this post in threaded view
|

Can you test this? (WAS Re: Accels generating interrupts after every suspend/resume cycle)

Michael Trimarchi-3
In reply to this post by Sebastian Krzyszkowiak
Michael

This fix the resume path of the accelerometer. If the accelerometer
is not power up, restore to initial status. Move the REG_CTRL1 to the
last one position avoid writing on the register when the device is
in power down mode.

Signed-off-by: Michael Trimarchi <[hidden email]>

diff --git a/drivers/input/misc/lis302dl.c b/drivers/input/misc/lis302dl.c
index f31e548..d345bfb 100644
--- a/drivers/input/misc/lis302dl.c
+++ b/drivers/input/misc/lis302dl.c
@@ -818,7 +818,6 @@ static int __devexit lis302dl_remove(struct spi_device *spi)
 #ifdef CONFIG_PM
 
 static u8 regs_to_save[] = {
- LIS302DL_REG_CTRL1,
  LIS302DL_REG_CTRL2,
  LIS302DL_REG_CTRL3,
  LIS302DL_REG_FF_WU_CFG_1,
@@ -833,7 +832,7 @@ static u8 regs_to_save[] = {
  LIS302DL_REG_CLICK_TIME_LIMIT,
  LIS302DL_REG_CLICK_LATENCY,
  LIS302DL_REG_CLICK_WINDOW,
-
+ LIS302DL_REG_CTRL1,
 };
 
 static int lis302dl_suspend(struct spi_device *spi, pm_message_t state)
@@ -906,11 +905,6 @@ static int lis302dl_resume(struct spi_device *spi)
  if (__lis302dl_reset_device(lis))
  dev_err(&spi->dev, "device BOOT reload failed\n");
 
- lis->regs[LIS302DL_REG_CTRL1] |= LIS302DL_CTRL1_PD |
- LIS302DL_CTRL1_Xen |
- LIS302DL_CTRL1_Yen |
- LIS302DL_CTRL1_Zen;
-
  /* restore registers after resume */
  for (n = 0; n < ARRAY_SIZE(regs_to_save); n++)
  __reg_write(lis, regs_to_save[n], lis->regs[regs_to_save[n]]);