aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-05-07 13:39:25 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-05-10 06:04:34 -0400
commit896060c76bdfd8a45eb33b3dd1a8307fe37f6c04 (patch)
tree531f445feee2c226c477a288eda98c6d0141c586 /drivers/mfd
parent06ae99888e599ea2e82386d618405c473c379185 (diff)
ASoC: Use more idiomatic driver name for WM8731
Make dev_() prints much prettier. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/wm831x-irq.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c
index 301327697117..4c1122ceb443 100644
--- a/drivers/mfd/wm831x-irq.c
+++ b/drivers/mfd/wm831x-irq.c
@@ -21,6 +21,7 @@
21 21
22#include <linux/mfd/wm831x/core.h> 22#include <linux/mfd/wm831x/core.h>
23#include <linux/mfd/wm831x/pdata.h> 23#include <linux/mfd/wm831x/pdata.h>
24#include <linux/mfd/wm831x/gpio.h>
24#include <linux/mfd/wm831x/irq.h> 25#include <linux/mfd/wm831x/irq.h>
25 26
26#include <linux/delay.h> 27#include <linux/delay.h>
@@ -388,12 +389,41 @@ static void wm831x_irq_mask(unsigned int irq)
388 wm831x->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask; 389 wm831x->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask;
389} 390}
390 391
392static int wm831x_irq_set_type(unsigned int irq, unsigned int type)
393{
394 struct wm831x *wm831x = get_irq_chip_data(irq);
395 int val;
396
397 irq = irq - wm831x->irq_base;
398
399 if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11)
400 return -EINVAL;
401
402 switch (type) {
403 case IRQ_TYPE_EDGE_BOTH:
404 val = WM831X_GPN_INT_MODE;
405 break;
406 case IRQ_TYPE_EDGE_RISING:
407 val = WM831X_GPN_POL;
408 break;
409 case IRQ_TYPE_EDGE_FALLING:
410 val = 0;
411 break;
412 default:
413 return -EINVAL;
414 }
415
416 return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + irq,
417 WM831X_GPN_INT_MODE | WM831X_GPN_POL, val);
418}
419
391static struct irq_chip wm831x_irq_chip = { 420static struct irq_chip wm831x_irq_chip = {
392 .name = "wm831x", 421 .name = "wm831x",
393 .bus_lock = wm831x_irq_lock, 422 .bus_lock = wm831x_irq_lock,
394 .bus_sync_unlock = wm831x_irq_sync_unlock, 423 .bus_sync_unlock = wm831x_irq_sync_unlock,
395 .mask = wm831x_irq_mask, 424 .mask = wm831x_irq_mask,
396 .unmask = wm831x_irq_unmask, 425 .unmask = wm831x_irq_unmask,
426 .set_type = wm831x_irq_set_type,
397}; 427};
398 428
399/* The processing of the primary interrupt occurs in a thread so that 429/* The processing of the primary interrupt occurs in a thread so that