diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-29 14:00:24 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-29 14:00:24 -0400 |
commit | b6ed61cfa24786e36164869b593d44d411a700ad (patch) | |
tree | 944322edebe04ddd891e2f2ccc0c9c87a684ed81 | |
parent | a96f5e9394d298689eb3b876e6619166f1a37cc4 (diff) |
ASoC: wm_adsp: Split ADSP1 and ADSP2 firmware controls
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>
-rw-r--r-- | sound/soc/codecs/wm2200.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm5102.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 26 | ||||
-rw-r--r-- | sound/soc/codecs/wm_adsp.h | 3 |
4 files changed, 23 insertions, 10 deletions
diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c index ddc98f02ecbd..57ba315d0c84 100644 --- a/sound/soc/codecs/wm2200.c +++ b/sound/soc/codecs/wm2200.c | |||
@@ -1565,7 +1565,7 @@ static int wm2200_probe(struct snd_soc_codec *codec) | |||
1565 | return ret; | 1565 | return ret; |
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | ret = snd_soc_add_codec_controls(codec, wm_adsp_fw_controls, 2); | 1568 | ret = snd_soc_add_codec_controls(codec, wm_adsp1_fw_controls, 2); |
1569 | if (ret != 0) | 1569 | if (ret != 0) |
1570 | return ret; | 1570 | return ret; |
1571 | 1571 | ||
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index d1b43ebec087..cb03cc448da6 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
@@ -1572,7 +1572,7 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec) | |||
1572 | if (ret != 0) | 1572 | if (ret != 0) |
1573 | return ret; | 1573 | return ret; |
1574 | 1574 | ||
1575 | ret = snd_soc_add_codec_controls(codec, wm_adsp_fw_controls, 2); | 1575 | ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 2); |
1576 | if (ret != 0) | 1576 | if (ret != 0) |
1577 | return ret; | 1577 | return ret; |
1578 | 1578 | ||
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 3a481fd1bf9a..bc03baef39fa 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
@@ -247,7 +247,18 @@ static const struct soc_enum wm_adsp_fw_enum[] = { | |||
247 | SOC_ENUM_SINGLE(0, 3, ARRAY_SIZE(wm_adsp_fw_text), wm_adsp_fw_text), | 247 | SOC_ENUM_SINGLE(0, 3, ARRAY_SIZE(wm_adsp_fw_text), wm_adsp_fw_text), |
248 | }; | 248 | }; |
249 | 249 | ||
250 | static const struct soc_enum wm_adsp_rate_enum[] = { | 250 | const struct snd_kcontrol_new wm_adsp1_fw_controls[] = { |
251 | SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0], | ||
252 | wm_adsp_fw_get, wm_adsp_fw_put), | ||
253 | SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1], | ||
254 | wm_adsp_fw_get, wm_adsp_fw_put), | ||
255 | SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2], | ||
256 | wm_adsp_fw_get, wm_adsp_fw_put), | ||
257 | }; | ||
258 | EXPORT_SYMBOL_GPL(wm_adsp1_fw_controls); | ||
259 | |||
260 | #if IS_ENABLED(CONFIG_SND_SOC_ARIZONA) | ||
261 | static const struct soc_enum wm_adsp2_rate_enum[] = { | ||
251 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1, | 262 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1, |
252 | ARIZONA_DSP1_RATE_SHIFT, 0xf, | 263 | ARIZONA_DSP1_RATE_SHIFT, 0xf, |
253 | ARIZONA_RATE_ENUM_SIZE, | 264 | ARIZONA_RATE_ENUM_SIZE, |
@@ -266,21 +277,22 @@ static const struct soc_enum wm_adsp_rate_enum[] = { | |||
266 | arizona_rate_text, arizona_rate_val), | 277 | arizona_rate_text, arizona_rate_val), |
267 | }; | 278 | }; |
268 | 279 | ||
269 | const struct snd_kcontrol_new wm_adsp_fw_controls[] = { | 280 | const struct snd_kcontrol_new wm_adsp2_fw_controls[] = { |
270 | SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0], | 281 | SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0], |
271 | wm_adsp_fw_get, wm_adsp_fw_put), | 282 | wm_adsp_fw_get, wm_adsp_fw_put), |
272 | SOC_ENUM("DSP1 Rate", wm_adsp_rate_enum[0]), | 283 | SOC_ENUM("DSP1 Rate", wm_adsp2_rate_enum[0]), |
273 | SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1], | 284 | SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1], |
274 | wm_adsp_fw_get, wm_adsp_fw_put), | 285 | wm_adsp_fw_get, wm_adsp_fw_put), |
275 | SOC_ENUM("DSP2 Rate", wm_adsp_rate_enum[1]), | 286 | SOC_ENUM("DSP2 Rate", wm_adsp2_rate_enum[1]), |
276 | SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2], | 287 | SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2], |
277 | wm_adsp_fw_get, wm_adsp_fw_put), | 288 | wm_adsp_fw_get, wm_adsp_fw_put), |
278 | SOC_ENUM("DSP3 Rate", wm_adsp_rate_enum[2]), | 289 | SOC_ENUM("DSP3 Rate", wm_adsp2_rate_enum[2]), |
279 | SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3], | 290 | SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3], |
280 | wm_adsp_fw_get, wm_adsp_fw_put), | 291 | wm_adsp_fw_get, wm_adsp_fw_put), |
281 | SOC_ENUM("DSP4 Rate", wm_adsp_rate_enum[3]), | 292 | SOC_ENUM("DSP4 Rate", wm_adsp2_rate_enum[3]), |
282 | }; | 293 | }; |
283 | EXPORT_SYMBOL_GPL(wm_adsp_fw_controls); | 294 | EXPORT_SYMBOL_GPL(wm_adsp2_fw_controls); |
295 | #endif | ||
284 | 296 | ||
285 | static struct wm_adsp_region const *wm_adsp_find_region(struct wm_adsp *dsp, | 297 | static struct wm_adsp_region const *wm_adsp_find_region(struct wm_adsp *dsp, |
286 | int type) | 298 | int type) |
diff --git a/sound/soc/codecs/wm_adsp.h b/sound/soc/codecs/wm_adsp.h index cb8871a3ec00..9f90c9fea842 100644 --- a/sound/soc/codecs/wm_adsp.h +++ b/sound/soc/codecs/wm_adsp.h | |||
@@ -65,7 +65,8 @@ struct wm_adsp { | |||
65 | .shift = num, .event = wm_adsp2_event, \ | 65 | .shift = num, .event = wm_adsp2_event, \ |
66 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD } | 66 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD } |
67 | 67 | ||
68 | extern const struct snd_kcontrol_new wm_adsp_fw_controls[]; | 68 | extern const struct snd_kcontrol_new wm_adsp1_fw_controls[]; |
69 | extern const struct snd_kcontrol_new wm_adsp2_fw_controls[]; | ||
69 | 70 | ||
70 | int wm_adsp1_init(struct wm_adsp *adsp); | 71 | int wm_adsp1_init(struct wm_adsp *adsp); |
71 | int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs); | 72 | int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs); |