diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-01 11:33:19 -0400 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-07-08 18:16:10 -0400 |
| commit | b0ab907d325f99054eb2700a8f8c50776ebfeaf9 (patch) | |
| tree | 96d69fa3dbc33f9ff5d5d2af76df2d868e12db02 | |
| parent | 6d11d1356cb3b1c009a90b273350f6a88c0b90e0 (diff) | |
mfd: Support for user defined wm8994 irq flags
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>
| -rw-r--r-- | drivers/mfd/wm8994-irq.c | 10 | ||||
| -rw-r--r-- | include/linux/mfd/wm8994/pdata.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c index f1837f669755..0aac4aff17a5 100644 --- a/drivers/mfd/wm8994-irq.c +++ b/drivers/mfd/wm8994-irq.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/regmap.h> | 21 | #include <linux/regmap.h> |
| 22 | 22 | ||
| 23 | #include <linux/mfd/wm8994/core.h> | 23 | #include <linux/mfd/wm8994/core.h> |
| 24 | #include <linux/mfd/wm8994/pdata.h> | ||
| 24 | #include <linux/mfd/wm8994/registers.h> | 25 | #include <linux/mfd/wm8994/registers.h> |
| 25 | 26 | ||
| 26 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
| @@ -139,6 +140,8 @@ static struct regmap_irq_chip wm8994_irq_chip = { | |||
| 139 | int wm8994_irq_init(struct wm8994 *wm8994) | 140 | int wm8994_irq_init(struct wm8994 *wm8994) |
| 140 | { | 141 | { |
| 141 | int ret; | 142 | int ret; |
| 143 | unsigned long irqflags; | ||
| 144 | struct wm8994_pdata *pdata = wm8994->dev->platform_data; | ||
| 142 | 145 | ||
| 143 | if (!wm8994->irq) { | 146 | if (!wm8994->irq) { |
| 144 | dev_warn(wm8994->dev, | 147 | dev_warn(wm8994->dev, |
| @@ -147,8 +150,13 @@ int wm8994_irq_init(struct wm8994 *wm8994) | |||
| 147 | return 0; | 150 | return 0; |
| 148 | } | 151 | } |
| 149 | 152 | ||
| 153 | /* select user or default irq flags */ | ||
| 154 | irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT; | ||
| 155 | if (pdata->irq_flags) | ||
| 156 | irqflags = pdata->irq_flags; | ||
| 157 | |||
| 150 | ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq, | 158 | ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq, |
| 151 | IRQF_TRIGGER_HIGH | IRQF_ONESHOT, | 159 | irqflags, |
| 152 | wm8994->irq_base, &wm8994_irq_chip, | 160 | wm8994->irq_base, &wm8994_irq_chip, |
| 153 | &wm8994->irq_data); | 161 | &wm8994->irq_data); |
| 154 | if (ret != 0) { | 162 | if (ret != 0) { |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 893267bb6229..f0361c031927 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
| @@ -141,6 +141,7 @@ struct wm8994_pdata { | |||
| 141 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; | 141 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; |
| 142 | 142 | ||
| 143 | int irq_base; /** Base IRQ number for WM8994, required for IRQs */ | 143 | int irq_base; /** Base IRQ number for WM8994, required for IRQs */ |
| 144 | unsigned long irq_flags; /** user irq flags */ | ||
| 144 | 145 | ||
| 145 | int num_drc_cfgs; | 146 | int num_drc_cfgs; |
| 146 | struct wm8994_drc_cfg *drc_cfgs; | 147 | struct wm8994_drc_cfg *drc_cfgs; |
