]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/aoa/codecs/snd-aoa-codec-tas.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6-omap-h63xx.git] / sound / aoa / codecs / snd-aoa-codec-tas.c
index 2ef55a17917c64999740b02780e035b2457429c2..ceca38486eae7d4a54797f981ff383e150e6a27b 100644 (file)
@@ -61,7 +61,6 @@
  */
 #include <stddef.h>
 #include <linux/i2c.h>
-#include <linux/i2c-dev.h>
 #include <asm/pmac_low_i2c.h>
 #include <asm/prom.h>
 #include <linux/delay.h>
@@ -514,9 +513,15 @@ static int tas_snd_capture_source_put(struct snd_kcontrol *kcontrol,
        mutex_lock(&tas->mtx);
        oldacr = tas->acr;
 
-       tas->acr &= ~TAS_ACR_INPUT_B;
+       /*
+        * Despite what the data sheet says in one place, the
+        * TAS_ACR_B_MONAUREAL bit forces mono output even when
+        * input A (line in) is selected.
+        */
+       tas->acr &= ~(TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL);
        if (ucontrol->value.enumerated.item[0])
-               tas->acr |= TAS_ACR_INPUT_B;
+               tas->acr |= TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL |
+                     TAS_ACR_B_MON_SEL_RIGHT;
        if (oldacr == tas->acr) {
                mutex_unlock(&tas->mtx);
                return 0;
@@ -686,8 +691,7 @@ static int tas_reset_init(struct tas *tas)
        if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp))
                goto outerr;
 
-       tas->acr |= TAS_ACR_ANALOG_PDOWN | TAS_ACR_B_MONAUREAL |
-               TAS_ACR_B_MON_SEL_RIGHT;
+       tas->acr |= TAS_ACR_ANALOG_PDOWN;
        if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
                goto outerr;
 
@@ -935,9 +939,9 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
 
        while ((dev = of_get_next_child(busnode, dev)) != NULL) {
                if (device_is_compatible(dev, "tas3004")) {
-                       u32 *addr;
+                       const u32 *addr;
                        printk(KERN_DEBUG PFX "found tas3004\n");
-                       addr = (u32 *) get_property(dev, "reg", NULL);
+                       addr = of_get_property(dev, "reg", NULL);
                        if (!addr)
                                continue;
                        return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
@@ -946,9 +950,10 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
                 * property that says 'tas3004', they just have a 'deq'
                 * node without any such property... */
                if (strcmp(dev->name, "deq") == 0) {
-                       u32 *_addr, addr;
+                       const u32 *_addr;
+                       u32 addr;
                        printk(KERN_DEBUG PFX "found 'deq' node\n");
-                       _addr = (u32 *) get_property(dev, "i2c-address", NULL);
+                       _addr = of_get_property(dev, "i2c-address", NULL);
                        if (!_addr)
                                continue;
                        addr = ((*_addr) >> 1) & 0x7f;