Merge branch 'for-2.6.31' into for-2.6.32
[pandora-kernel.git] / sound / soc / soc-core.c
index dfc03c0..fb8d7a7 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/bitops.h>
 #include <linux/debugfs.h>
 #include <linux/platform_device.h>
+#include <sound/ac97_codec.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -1125,6 +1126,23 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
        return ret;
 }
 
+/**
+ * snd_soc_codec_volatile_register: Report if a register is volatile.
+ *
+ * @codec: CODEC to query.
+ * @reg: Register to query.
+ *
+ * Boolean function indiciating if a CODEC register is volatile.
+ */
+int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg)
+{
+       if (codec->volatile_register)
+               return codec->volatile_register(reg);
+       else
+               return 0;
+}
+EXPORT_SYMBOL_GPL(snd_soc_codec_volatile_register);
+
 /* codec register dump */
 static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)
 {
@@ -1138,6 +1156,9 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)
 
        count += sprintf(buf, "%s registers\n", codec->name);
        for (i = 0; i < codec->reg_cache_size; i += step) {
+               if (codec->readable_register && !codec->readable_register(i))
+                       continue;
+
                count += sprintf(buf + count, "%2x: ", i);
                if (count >= PAGE_SIZE - 1)
                        break;
@@ -1444,8 +1465,11 @@ int snd_soc_init_card(struct snd_soc_device *socdev)
                                continue;
                        }
                }
-               if (card->dai_link[i].codec_dai->ac97_control)
+               if (card->dai_link[i].codec_dai->ac97_control) {
                        ac97 = 1;
+                       snd_ac97_dev_add_pdata(codec->ac97,
+                               card->dai_link[i].cpu_dai->ac97_pdata);
+               }
        }
        snprintf(codec->card->shortname, sizeof(codec->card->shortname),
                 "%s",  card->name);