diff options
author | Felipe Balbi <balbi@ti.com> | 2011-06-21 07:20:57 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-06-21 08:08:30 -0400 |
commit | 61cf3813d32411b23d5df8a650bbd2aa89b4618c (patch) | |
tree | 0865f3b31a66e31b059b0aeb054d0b0bcafc0de3 /drivers/input/keyboard | |
parent | fef95faeae9fa5f605fbad8693e2d6e2171f5ad4 (diff) |
Input: lm8323 - convert to threaded IRQ
There's no need for that workqueue anymore. Get rid of it and move to
threaded IRQs instead.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Tested-by: Leigh Brown <leigh@solinno.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/lm8323.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 71f744a8e686..3b21f426ebb1 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c | |||
@@ -146,7 +146,6 @@ struct lm8323_chip { | |||
146 | /* device lock */ | 146 | /* device lock */ |
147 | struct mutex lock; | 147 | struct mutex lock; |
148 | struct i2c_client *client; | 148 | struct i2c_client *client; |
149 | struct work_struct work; | ||
150 | struct input_dev *idev; | 149 | struct input_dev *idev; |
151 | bool kp_enabled; | 150 | bool kp_enabled; |
152 | bool pm_suspend; | 151 | bool pm_suspend; |
@@ -162,7 +161,6 @@ struct lm8323_chip { | |||
162 | 161 | ||
163 | #define client_to_lm8323(c) container_of(c, struct lm8323_chip, client) | 162 | #define client_to_lm8323(c) container_of(c, struct lm8323_chip, client) |
164 | #define dev_to_lm8323(d) container_of(d, struct lm8323_chip, client->dev) | 163 | #define dev_to_lm8323(d) container_of(d, struct lm8323_chip, client->dev) |
165 | #define work_to_lm8323(w) container_of(w, struct lm8323_chip, work) | ||
166 | #define cdev_to_pwm(c) container_of(c, struct lm8323_pwm, cdev) | 164 | #define cdev_to_pwm(c) container_of(c, struct lm8323_pwm, cdev) |
167 | #define work_to_pwm(w) container_of(w, struct lm8323_pwm, work) | 165 | #define work_to_pwm(w) container_of(w, struct lm8323_pwm, work) |
168 | 166 | ||
@@ -375,9 +373,9 @@ static void pwm_done(struct lm8323_pwm *pwm) | |||
375 | * Bottom half: handle the interrupt by posting key events, or dealing with | 373 | * Bottom half: handle the interrupt by posting key events, or dealing with |
376 | * errors appropriately. | 374 | * errors appropriately. |
377 | */ | 375 | */ |
378 | static void lm8323_work(struct work_struct *work) | 376 | static irqreturn_t lm8323_irq(int irq, void *_lm) |
379 | { | 377 | { |
380 | struct lm8323_chip *lm = work_to_lm8323(work); | 378 | struct lm8323_chip *lm = _lm; |
381 | u8 ints; | 379 | u8 ints; |
382 | int i; | 380 | int i; |
383 | 381 | ||
@@ -409,16 +407,6 @@ static void lm8323_work(struct work_struct *work) | |||
409 | } | 407 | } |
410 | 408 | ||
411 | mutex_unlock(&lm->lock); | 409 | mutex_unlock(&lm->lock); |
412 | } | ||
413 | |||
414 | /* | ||
415 | * We cannot use I2C in interrupt context, so we just schedule work. | ||
416 | */ | ||
417 | static irqreturn_t lm8323_irq(int irq, void *data) | ||
418 | { | ||
419 | struct lm8323_chip *lm = data; | ||
420 | |||
421 | schedule_work(&lm->work); | ||
422 | 410 | ||
423 | return IRQ_HANDLED; | 411 | return IRQ_HANDLED; |
424 | } | 412 | } |
@@ -675,7 +663,6 @@ static int __devinit lm8323_probe(struct i2c_client *client, | |||
675 | lm->client = client; | 663 | lm->client = client; |
676 | lm->idev = idev; | 664 | lm->idev = idev; |
677 | mutex_init(&lm->lock); | 665 | mutex_init(&lm->lock); |
678 | INIT_WORK(&lm->work, lm8323_work); | ||
679 | 666 | ||
680 | lm->size_x = pdata->size_x; | 667 | lm->size_x = pdata->size_x; |
681 | lm->size_y = pdata->size_y; | 668 | lm->size_y = pdata->size_y; |
@@ -746,9 +733,8 @@ static int __devinit lm8323_probe(struct i2c_client *client, | |||
746 | goto fail3; | 733 | goto fail3; |
747 | } | 734 | } |
748 | 735 | ||
749 | err = request_irq(client->irq, lm8323_irq, | 736 | err = request_threaded_irq(client->irq, NULL, lm8323_irq, |
750 | IRQF_TRIGGER_FALLING | IRQF_DISABLED, | 737 | IRQF_TRIGGER_FALLING, "lm8323", lm); |
751 | "lm8323", lm); | ||
752 | if (err) { | 738 | if (err) { |
753 | dev_err(&client->dev, "could not get IRQ %d\n", client->irq); | 739 | dev_err(&client->dev, "could not get IRQ %d\n", client->irq); |
754 | goto fail4; | 740 | goto fail4; |
@@ -783,7 +769,6 @@ static int __devexit lm8323_remove(struct i2c_client *client) | |||
783 | 769 | ||
784 | disable_irq_wake(client->irq); | 770 | disable_irq_wake(client->irq); |
785 | free_irq(client->irq, lm); | 771 | free_irq(client->irq, lm); |
786 | cancel_work_sync(&lm->work); | ||
787 | 772 | ||
788 | input_unregister_device(lm->idev); | 773 | input_unregister_device(lm->idev); |
789 | 774 | ||