Merge remote-tracking branches 'asoc/topic/adau1977', 'asoc/topic/ak4642', 'asoc...
[sfrench/cifs-2.6.git] / sound / soc / codecs / arizona.c
index 9a730689a0ac4f2a1e7b5d507799a38b189c6d29..2f2e91ac690f683c6f87347b34d4b9cbe11c8038 100644 (file)
@@ -243,6 +243,31 @@ int arizona_init_spk(struct snd_soc_codec *codec)
 }
 EXPORT_SYMBOL_GPL(arizona_init_spk);
 
+static const struct snd_soc_dapm_route arizona_mono_routes[] = {
+       { "OUT1R", NULL, "OUT1L" },
+       { "OUT2R", NULL, "OUT2L" },
+       { "OUT3R", NULL, "OUT3L" },
+       { "OUT4R", NULL, "OUT4L" },
+       { "OUT5R", NULL, "OUT5L" },
+       { "OUT6R", NULL, "OUT6L" },
+};
+
+int arizona_init_mono(struct snd_soc_codec *codec)
+{
+       struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
+       struct arizona *arizona = priv->arizona;
+       int i;
+
+       for (i = 0; i < ARIZONA_MAX_OUTPUT; ++i) {
+               if (arizona->pdata.out_mono[i])
+                       snd_soc_dapm_add_routes(&codec->dapm,
+                                               &arizona_mono_routes[i], 1);
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(arizona_init_mono);
+
 int arizona_init_gpio(struct snd_soc_codec *codec)
 {
        struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);