Skip to content

Commit 3206450

Browse files
broonieSamuel Ortiz
authored andcommitted
mfd: Support active high IRQs on WM835x
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
1 parent 9dfd338 commit 3206450

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎drivers/mfd/wm8350-core.c‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,21 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
14381438
mutex_init(&wm8350->irq_mutex);
14391439
INIT_WORK(&wm8350->irq_work, wm8350_irq_worker);
14401440
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,
14421456
"wm8350", wm8350);
14431457
if (ret != 0) {
14441458
dev_err(wm8350->dev, "Failed to request IRQ: %d\n",

‎include/linux/mfd/wm8350/core.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,11 @@ struct wm8350 {
640640
*
641641
* @init: Function called during driver initialisation. Should be
642642
* used by the platform to configure GPIO functions and similar.
643+
* @irq_high: Set if WM8350 IRQ is active high.
643644
*/
644645
struct wm8350_platform_data {
645646
int (*init)(struct wm8350 *wm8350);
647+
int irq_high;
646648
};
647649

648650

0 commit comments

Comments
 (0)