Skip to content

Commit

Permalink
Input: cyapa - fix resuming the device
Browse files Browse the repository at this point in the history
Chage b1cfa7b tried to get away form using
irq in cyapa structure and use client->irq instead, but missed a couple of
spots making the touchpad inoperative after resume.

Reported-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dudley Du <dudley.dulixin@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dudley Du authored and Dmitry Torokhov committed Dec 3, 2014
1 parent f2d347f commit f68a95c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/input/mouse/cyapa.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ struct cyapa {
struct i2c_client *client;
struct input_dev *input;
char phys[32]; /* device physical location */
int irq;
bool irq_wake; /* irq wake is enabled */
bool smbus;

Expand Down Expand Up @@ -938,7 +937,7 @@ static int __maybe_unused cyapa_suspend(struct device *dev)
power_mode, error);

if (device_may_wakeup(dev))
cyapa->irq_wake = (enable_irq_wake(cyapa->irq) == 0);
cyapa->irq_wake = (enable_irq_wake(client->irq) == 0);

mutex_unlock(&input->mutex);

Expand All @@ -956,15 +955,15 @@ static int __maybe_unused cyapa_resume(struct device *dev)
mutex_lock(&input->mutex);

if (device_may_wakeup(dev) && cyapa->irq_wake)
disable_irq_wake(cyapa->irq);
disable_irq_wake(client->irq);

power_mode = input->users ? PWR_MODE_FULL_ACTIVE : PWR_MODE_OFF;
error = cyapa_set_power_mode(cyapa, PWR_MODE_FULL_ACTIVE);
if (error)
dev_warn(dev, "resume: set power mode to %d failed: %d\n",
power_mode, error);

enable_irq(cyapa->irq);
enable_irq(client->irq);

mutex_unlock(&input->mutex);

Expand Down

0 comments on commit f68a95c

Please sign in to comment.