diff options
| -rw-r--r-- | drivers/mfd/wm8350-core.c | 24 | ||||
| -rw-r--r-- | include/linux/mfd/wm8350/core.h | 1 |
2 files changed, 6 insertions, 19 deletions
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c index 9d662a576a41..ba27c9dc1ad3 100644 --- a/drivers/mfd/wm8350-core.c +++ b/drivers/mfd/wm8350-core.c | |||
| @@ -353,15 +353,15 @@ static void wm8350_irq_call_handler(struct wm8350 *wm8350, int irq) | |||
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | /* | 355 | /* |
| 356 | * wm8350_irq_worker actually handles the interrupts. Since all | 356 | * This is a threaded IRQ handler so can access I2C/SPI. Since all |
| 357 | * interrupts are clear on read the IRQ line will be reasserted and | 357 | * interrupts are clear on read the IRQ line will be reasserted and |
| 358 | * the physical IRQ will be handled again if another interrupt is | 358 | * the physical IRQ will be handled again if another interrupt is |
| 359 | * asserted while we run - in the normal course of events this is a | 359 | * asserted while we run - in the normal course of events this is a |
| 360 | * rare occurrence so we save I2C/SPI reads. | 360 | * rare occurrence so we save I2C/SPI reads. |
| 361 | */ | 361 | */ |
| 362 | static void wm8350_irq_worker(struct work_struct *work) | 362 | static irqreturn_t wm8350_irq(int irq, void *data) |
| 363 | { | 363 | { |
| 364 | struct wm8350 *wm8350 = container_of(work, struct wm8350, irq_work); | 364 | struct wm8350 *wm8350 = data; |
| 365 | u16 level_one, status1, status2, comp; | 365 | u16 level_one, status1, status2, comp; |
| 366 | 366 | ||
| 367 | /* TODO: Use block reads to improve performance? */ | 367 | /* TODO: Use block reads to improve performance? */ |
| @@ -552,16 +552,6 @@ static void wm8350_irq_worker(struct work_struct *work) | |||
| 552 | } | 552 | } |
| 553 | } | 553 | } |
| 554 | 554 | ||
| 555 | enable_irq(wm8350->chip_irq); | ||
| 556 | } | ||
| 557 | |||
| 558 | static irqreturn_t wm8350_irq(int irq, void *data) | ||
| 559 | { | ||
| 560 | struct wm8350 *wm8350 = data; | ||
| 561 | |||
| 562 | disable_irq_nosync(irq); | ||
| 563 | schedule_work(&wm8350->irq_work); | ||
| 564 | |||
| 565 | return IRQ_HANDLED; | 555 | return IRQ_HANDLED; |
| 566 | } | 556 | } |
| 567 | 557 | ||
| @@ -1428,9 +1418,8 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq, | |||
| 1428 | 1418 | ||
| 1429 | mutex_init(&wm8350->auxadc_mutex); | 1419 | mutex_init(&wm8350->auxadc_mutex); |
| 1430 | mutex_init(&wm8350->irq_mutex); | 1420 | mutex_init(&wm8350->irq_mutex); |
| 1431 | INIT_WORK(&wm8350->irq_work, wm8350_irq_worker); | ||
| 1432 | if (irq) { | 1421 | if (irq) { |
| 1433 | int flags = 0; | 1422 | int flags = IRQF_ONESHOT; |
| 1434 | 1423 | ||
| 1435 | if (pdata && pdata->irq_high) { | 1424 | if (pdata && pdata->irq_high) { |
| 1436 | flags |= IRQF_TRIGGER_HIGH; | 1425 | flags |= IRQF_TRIGGER_HIGH; |
| @@ -1444,8 +1433,8 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq, | |||
| 1444 | WM8350_IRQ_POL); | 1433 | WM8350_IRQ_POL); |
| 1445 | } | 1434 | } |
| 1446 | 1435 | ||
| 1447 | ret = request_irq(irq, wm8350_irq, flags, | 1436 | ret = request_threaded_irq(irq, NULL, wm8350_irq, flags, |
| 1448 | "wm8350", wm8350); | 1437 | "wm8350", wm8350); |
| 1449 | if (ret != 0) { | 1438 | if (ret != 0) { |
| 1450 | dev_err(wm8350->dev, "Failed to request IRQ: %d\n", | 1439 | dev_err(wm8350->dev, "Failed to request IRQ: %d\n", |
| 1451 | ret); | 1440 | ret); |
| @@ -1505,7 +1494,6 @@ void wm8350_device_exit(struct wm8350 *wm8350) | |||
| 1505 | platform_device_unregister(wm8350->codec.pdev); | 1494 | platform_device_unregister(wm8350->codec.pdev); |
| 1506 | 1495 | ||
| 1507 | free_irq(wm8350->chip_irq, wm8350); | 1496 | free_irq(wm8350->chip_irq, wm8350); |
| 1508 | flush_work(&wm8350->irq_work); | ||
| 1509 | kfree(wm8350->reg_cache); | 1497 | kfree(wm8350->reg_cache); |
| 1510 | } | 1498 | } |
| 1511 | EXPORT_SYMBOL_GPL(wm8350_device_exit); | 1499 | EXPORT_SYMBOL_GPL(wm8350_device_exit); |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 969b0b55615c..1d595de6a055 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
| @@ -626,7 +626,6 @@ struct wm8350 { | |||
| 626 | struct mutex auxadc_mutex; | 626 | struct mutex auxadc_mutex; |
| 627 | 627 | ||
| 628 | /* Interrupt handling */ | 628 | /* Interrupt handling */ |
| 629 | struct work_struct irq_work; | ||
| 630 | struct mutex irq_mutex; /* IRQ table mutex */ | 629 | struct mutex irq_mutex; /* IRQ table mutex */ |
| 631 | struct wm8350_irq irq[WM8350_NUM_IRQ]; | 630 | struct wm8350_irq irq[WM8350_NUM_IRQ]; |
| 632 | int chip_irq; | 631 | int chip_irq; |
