diff options
-rw-r--r-- | drivers/mfd/wm8350-core.c | 16 | ||||
-rw-r--r-- | include/linux/mfd/wm8350/core.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c index f22b18b70796..a285cc0cc704 100644 --- a/drivers/mfd/wm8350-core.c +++ b/drivers/mfd/wm8350-core.c | |||
@@ -1438,7 +1438,21 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq, | |||
1438 | mutex_init(&wm8350->irq_mutex); | 1438 | mutex_init(&wm8350->irq_mutex); |
1439 | INIT_WORK(&wm8350->irq_work, wm8350_irq_worker); | 1439 | INIT_WORK(&wm8350->irq_work, wm8350_irq_worker); |
1440 | if (irq) { | 1440 | if (irq) { |
1441 | ret = request_irq(irq, wm8350_irq, 0, | 1441 | int flags = 0; |
1442 | |||
1443 | if (pdata && pdata->irq_high) { | ||
1444 | flags |= IRQF_TRIGGER_HIGH; | ||
1445 | |||
1446 | wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1, | ||
1447 | WM8350_IRQ_POL); | ||
1448 | } else { | ||
1449 | flags |= IRQF_TRIGGER_LOW; | ||
1450 | |||
1451 | wm8350_clear_bits(wm8350, WM8350_SYSTEM_CONTROL_1, | ||
1452 | WM8350_IRQ_POL); | ||
1453 | } | ||
1454 | |||
1455 | ret = request_irq(irq, wm8350_irq, flags, | ||
1442 | "wm8350", wm8350); | 1456 | "wm8350", wm8350); |
1443 | if (ret != 0) { | 1457 | if (ret != 0) { |
1444 | dev_err(wm8350->dev, "Failed to request IRQ: %d\n", | 1458 | dev_err(wm8350->dev, "Failed to request IRQ: %d\n", |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 980669d50dca..42cca672f340 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -640,9 +640,11 @@ struct wm8350 { | |||
640 | * | 640 | * |
641 | * @init: Function called during driver initialisation. Should be | 641 | * @init: Function called during driver initialisation. Should be |
642 | * used by the platform to configure GPIO functions and similar. | 642 | * used by the platform to configure GPIO functions and similar. |
643 | * @irq_high: Set if WM8350 IRQ is active high. | ||
643 | */ | 644 | */ |
644 | struct wm8350_platform_data { | 645 | struct wm8350_platform_data { |
645 | int (*init)(struct wm8350 *wm8350); | 646 | int (*init)(struct wm8350 *wm8350); |
647 | int irq_high; | ||
646 | }; | 648 | }; |
647 | 649 | ||
648 | 650 | ||