mfd: Support for user defined wm8994 irq flags
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 1 Jun 2012 15:33:19 +0000 (16:33 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 8 Jul 2012 22:16:10 +0000 (00:16 +0200)
Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/wm8994-irq.c
include/linux/mfd/wm8994/pdata.h

index f1837f669755d4671615cb7a109e4d69ea827d21..0aac4aff17a5f6cf4d66144883608157a720d7ed 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/regmap.h>
 
 #include <linux/mfd/wm8994/core.h>
+#include <linux/mfd/wm8994/pdata.h>
 #include <linux/mfd/wm8994/registers.h>
 
 #include <linux/delay.h>
@@ -139,6 +140,8 @@ static struct regmap_irq_chip wm8994_irq_chip = {
 int wm8994_irq_init(struct wm8994 *wm8994)
 {
        int ret;
+       unsigned long irqflags;
+       struct wm8994_pdata *pdata = wm8994->dev->platform_data;
 
        if (!wm8994->irq) {
                dev_warn(wm8994->dev,
@@ -147,8 +150,13 @@ int wm8994_irq_init(struct wm8994 *wm8994)
                return 0;
        }
 
+       /* select user or default irq flags */
+       irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
+       if (pdata->irq_flags)
+               irqflags = pdata->irq_flags;
+
        ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq,
-                                 IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
+                                 irqflags,
                                  wm8994->irq_base, &wm8994_irq_chip,
                                  &wm8994->irq_data);
        if (ret != 0) {
index 893267bb622932d9299f6f81f87c5d87ef0d0fe0..f0361c031927417ee9af47ef0a2be55e718e344d 100644 (file)
@@ -141,6 +141,7 @@ struct wm8994_pdata {
        struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO];
 
        int irq_base;  /** Base IRQ number for WM8994, required for IRQs */
+       unsigned long irq_flags; /** user irq flags */
 
         int num_drc_cfgs;
         struct wm8994_drc_cfg *drc_cfgs;