ASoC: Use more idiomatic driver name for WM8731
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 7 May 2010 17:39:25 +0000 (18:39 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 May 2010 10:04:34 +0000 (11:04 +0100)
Make dev_() prints much prettier.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/mfd/wm831x-irq.c
sound/soc/codecs/wm8731.c

index 301327697117da5c7ac1fcb8c759bbad7bdf2b37..4c1122ceb443b376040f4a232719437091f1915a 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <linux/mfd/wm831x/core.h>
 #include <linux/mfd/wm831x/pdata.h>
+#include <linux/mfd/wm831x/gpio.h>
 #include <linux/mfd/wm831x/irq.h>
 
 #include <linux/delay.h>
@@ -388,12 +389,41 @@ static void wm831x_irq_mask(unsigned int irq)
        wm831x->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask;
 }
 
+static int wm831x_irq_set_type(unsigned int irq, unsigned int type)
+{
+       struct wm831x *wm831x = get_irq_chip_data(irq);
+       int val;
+
+       irq = irq - wm831x->irq_base;
+
+       if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11)
+               return -EINVAL;
+
+       switch (type) {
+       case IRQ_TYPE_EDGE_BOTH:
+               val = WM831X_GPN_INT_MODE;
+               break;
+       case IRQ_TYPE_EDGE_RISING:
+               val = WM831X_GPN_POL;
+               break;
+       case IRQ_TYPE_EDGE_FALLING:
+               val = 0;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + irq,
+                              WM831X_GPN_INT_MODE | WM831X_GPN_POL, val);
+}
+
 static struct irq_chip wm831x_irq_chip = {
        .name = "wm831x",
        .bus_lock = wm831x_irq_lock,
        .bus_sync_unlock = wm831x_irq_sync_unlock,
        .mask = wm831x_irq_mask,
        .unmask = wm831x_irq_unmask,
+       .set_type = wm831x_irq_set_type,
 };
 
 /* The processing of the primary interrupt occurs in a thread so that
index 2650fac30ee46964ec817b1b9bbfba8247a3ad62..e17c714196f25fe59cdc4d2a1f36410fe1fa1356 100644 (file)
@@ -707,7 +707,7 @@ MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id);
 
 static struct i2c_driver wm8731_i2c_driver = {
        .driver = {
-               .name = "WM8731 I2C Codec",
+               .name = "wm8731",
                .owner = THIS_MODULE,
        },
        .probe =    wm8731_i2c_probe,