ASoC: wm8994: Fix typo in VMID ramp setting
[pandora-kernel.git] / sound / soc / codecs / tlv320aic3x.c
index 0963c4c..87d5ef1 100644 (file)
@@ -76,7 +76,6 @@ struct aic3x_priv {
        struct aic3x_disable_nb disable_nb[AIC3X_NUM_SUPPLIES];
        enum snd_soc_control_type control_type;
        struct aic3x_setup_data *setup;
-       void *control_data;
        unsigned int sysclk;
        struct list_head list;
        int master;
@@ -138,7 +137,10 @@ static int aic3x_read(struct snd_soc_codec *codec, unsigned int reg,
        if (reg >= AIC3X_CACHEREGNUM)
                return -1;
 
-       *value = codec->hw_read(codec, reg);
+       codec->cache_bypass = 1;
+       *value = snd_soc_read(codec, reg);
+       codec->cache_bypass = 0;
+
        cache[reg] = *value;
 
        return 0;
@@ -198,6 +200,10 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
                        else
                                /* old connection must be powered down */
                                path->connect = invert ? 1 : 0;
+
+                       dapm_mark_dirty(path->source, "tlv320aic3x source");
+                       dapm_mark_dirty(path->sink, "tlv320aic3x sink");
+
                        break;
                }
 
@@ -1017,6 +1023,7 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
                break;
        case SND_SOC_DAIFMT_CBS_CFS:
                aic3x->master = 0;
+               iface_areg &= ~(BIT_CLK_MASTER | WORD_CLK_MASTER);
                break;
        default:
                return -EINVAL;
@@ -1383,7 +1390,6 @@ static int aic3x_probe(struct snd_soc_codec *codec)
        int ret, i;
 
        INIT_LIST_HEAD(&aic3x->list);
-       codec->control_data = aic3x->control_data;
        aic3x->codec = codec;
        codec->dapm.idle_bias_off = 1;
 
@@ -1495,9 +1501,9 @@ static struct snd_soc_codec_driver soc_codec_dev_aic3x = {
  */
 
 static const struct i2c_device_id aic3x_i2c_id[] = {
-       [AIC3X_MODEL_3X] = { "tlv320aic3x", 0 },
-       [AIC3X_MODEL_33] = { "tlv320aic33", 0 },
-       [AIC3X_MODEL_3007] = { "tlv320aic3007", 0 },
+       { "tlv320aic3x", AIC3X_MODEL_3X },
+       { "tlv320aic33", AIC3X_MODEL_33 },
+       { "tlv320aic3007", AIC3X_MODEL_3007 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, aic3x_i2c_id);
@@ -1512,7 +1518,6 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
        struct aic3x_pdata *pdata = i2c->dev.platform_data;
        struct aic3x_priv *aic3x;
        int ret;
-       const struct i2c_device_id *tbl;
 
        aic3x = kzalloc(sizeof(struct aic3x_priv), GFP_KERNEL);
        if (aic3x == NULL) {
@@ -1520,7 +1525,6 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
                return -ENOMEM;
        }
 
-       aic3x->control_data = i2c;
        aic3x->control_type = SND_SOC_I2C;
 
        i2c_set_clientdata(i2c, aic3x);
@@ -1531,11 +1535,7 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
                aic3x->gpio_reset = -1;
        }
 
-       for (tbl = aic3x_i2c_id; tbl->name[0]; tbl++) {
-               if (!strcmp(tbl->name, id->name))
-                       break;
-       }
-       aic3x->model = tbl - aic3x_i2c_id;
+       aic3x->model = id->driver_data;
 
        ret = snd_soc_register_codec(&i2c->dev,
                        &soc_codec_dev_aic3x, &aic3x_dai, 1);