ASoC: wm_adsp: Split ADSP1 and ADSP2 firmware controls
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 29 Mar 2013 18:00:24 +0000 (18:00 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 29 Mar 2013 18:00:24 +0000 (18:00 +0000)
Now that we have regular register mapped controls we should be splitting
the control sets for ADSP1 and ADSP2 as the register maps are not
identical. Do that.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm2200.c
sound/soc/codecs/wm5102.c
sound/soc/codecs/wm_adsp.c
sound/soc/codecs/wm_adsp.h

index ddc98f02ecbd0ea9cf4b61de47490a21bfd3fdb9..57ba315d0c84d41c4c5f8b390014cde50f84f85f 100644 (file)
@@ -1565,7 +1565,7 @@ static int wm2200_probe(struct snd_soc_codec *codec)
                return ret;
        }
 
-       ret = snd_soc_add_codec_controls(codec, wm_adsp_fw_controls, 2);
+       ret = snd_soc_add_codec_controls(codec, wm_adsp1_fw_controls, 2);
        if (ret != 0)
                return ret;
 
index d1b43ebec087b029d65eb5220d2b4faa90ad84c3..cb03cc448da64e92f32f1448014844eb9bf9d97a 100644 (file)
@@ -1572,7 +1572,7 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec)
        if (ret != 0)
                return ret;
 
-       ret = snd_soc_add_codec_controls(codec, wm_adsp_fw_controls, 2);
+       ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 2);
        if (ret != 0)
                return ret;
 
index 3a481fd1bf9a25465723482e78891e7176ec2301..bc03baef39fad925af3a5a4a3f2ad1c35cf7dcca 100644 (file)
@@ -247,7 +247,18 @@ static const struct soc_enum wm_adsp_fw_enum[] = {
        SOC_ENUM_SINGLE(0, 3, ARRAY_SIZE(wm_adsp_fw_text), wm_adsp_fw_text),
 };
 
-static const struct soc_enum wm_adsp_rate_enum[] = {
+const struct snd_kcontrol_new wm_adsp1_fw_controls[] = {
+       SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0],
+                    wm_adsp_fw_get, wm_adsp_fw_put),
+       SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1],
+                    wm_adsp_fw_get, wm_adsp_fw_put),
+       SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2],
+                    wm_adsp_fw_get, wm_adsp_fw_put),
+};
+EXPORT_SYMBOL_GPL(wm_adsp1_fw_controls);
+
+#if IS_ENABLED(CONFIG_SND_SOC_ARIZONA)
+static const struct soc_enum wm_adsp2_rate_enum[] = {
        SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1,
                              ARIZONA_DSP1_RATE_SHIFT, 0xf,
                              ARIZONA_RATE_ENUM_SIZE,
@@ -266,21 +277,22 @@ static const struct soc_enum wm_adsp_rate_enum[] = {
                              arizona_rate_text, arizona_rate_val),
 };
 
-const struct snd_kcontrol_new wm_adsp_fw_controls[] = {
+const struct snd_kcontrol_new wm_adsp2_fw_controls[] = {
        SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0],
                     wm_adsp_fw_get, wm_adsp_fw_put),
-       SOC_ENUM("DSP1 Rate", wm_adsp_rate_enum[0]),
+       SOC_ENUM("DSP1 Rate", wm_adsp2_rate_enum[0]),
        SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1],
                     wm_adsp_fw_get, wm_adsp_fw_put),
-       SOC_ENUM("DSP2 Rate", wm_adsp_rate_enum[1]),
+       SOC_ENUM("DSP2 Rate", wm_adsp2_rate_enum[1]),
        SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2],
                     wm_adsp_fw_get, wm_adsp_fw_put),
-       SOC_ENUM("DSP3 Rate", wm_adsp_rate_enum[2]),
+       SOC_ENUM("DSP3 Rate", wm_adsp2_rate_enum[2]),
        SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3],
                     wm_adsp_fw_get, wm_adsp_fw_put),
-       SOC_ENUM("DSP4 Rate", wm_adsp_rate_enum[3]),
+       SOC_ENUM("DSP4 Rate", wm_adsp2_rate_enum[3]),
 };
-EXPORT_SYMBOL_GPL(wm_adsp_fw_controls);
+EXPORT_SYMBOL_GPL(wm_adsp2_fw_controls);
+#endif
 
 static struct wm_adsp_region const *wm_adsp_find_region(struct wm_adsp *dsp,
                                                        int type)
index cb8871a3ec0015854c6d13bebb1055661b7cf4be..9f90c9fea84275842ddbb8d9e2f0737ecb1b2266 100644 (file)
@@ -65,7 +65,8 @@ struct wm_adsp {
        .shift = num, .event = wm_adsp2_event, \
        .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD }
 
-extern const struct snd_kcontrol_new wm_adsp_fw_controls[];
+extern const struct snd_kcontrol_new wm_adsp1_fw_controls[];
+extern const struct snd_kcontrol_new wm_adsp2_fw_controls[];
 
 int wm_adsp1_init(struct wm_adsp *adsp);
 int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs);