| @@ -455,7 +455,18 @@ static void zforce_complete(struct zforce_ts *ts, int cmd, int result) · 454 unmodified lines |
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | | −static irqreturn_t zforce_interrupt(int irq, void *dev_id) |
| 458 | +static irqreturn_t zforce_irq(int irq, void *dev_id) |
| 459 | +{ |
| 460 | + struct zforce_ts *ts = dev_id; |
| 461 | + struct i2c_client *client = ts->client; |
| 462 | + |
| 463 | + if (ts->suspended && device_may_wakeup(&client->dev)) |
| 464 | + pm_wakeup_event(&client->dev, 500); |
| 465 | + |
| 466 | + return IRQ_WAKE_THREAD; |
| 467 | +} |
| 468 | + |
| 469 | +static irqreturn_t zforce_irq_thread(int irq, void *dev_id) |
| 459 | 470 | { |
| 460 | 471 | struct zforce_ts *ts = dev_id; |
| 461 | 472 | struct i2c_client *client = ts->client; |
| @@ -465,12 +476,10 @@ static irqreturn_t zforce_interrupt(int irq, void *dev_id) · 3 unmodified lines |
| 465 | 476 | u8 *payload; |
| 466 | 477 | |
| 467 | 478 | /* |
| 468 | | − * When suspended, emit a wakeup signal if necessary and return. |
| 479 | + * When still suspended, return. |
| 469 | 480 | * Due to the level-interrupt we will get re-triggered later. |
| 470 | 481 | */ |
| 471 | 482 | if (ts->suspended) { |
| 472 | | − if (device_may_wakeup(&client->dev)) |
| 473 | | − pm_wakeup_event(&client->dev, 500); |
| 474 | 483 | msleep(20); |
| 475 | 484 | return IRQ_HANDLED; |
| 476 | 485 | } |
| @@ -763,8 +772,8 @@ static int zforce_probe(struct i2c_client *client, · 286 unmodified lines |
| 763 | 772 | * Therefore we can trigger the interrupt anytime it is low and do |
| 764 | 773 | * not need to limit it to the interrupt edge. |
| 765 | 774 | */ |
| 766 | | − ret = devm_request_threaded_irq(&client->dev, client->irq, NULL, |
| 767 | | − zforce_interrupt, |
| 775 | + ret = devm_request_threaded_irq(&client->dev, client->irq, |
| 776 | + zforce_irq, zforce_irq_thread, |
| 768 | 777 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, |
| 769 | 778 | input_dev->name, ts); |
| 770 | 779 | if (ret) { |