diff options
-rw-r--r-- | sound/soc/codecs/arizona.c | 27 | ||||
-rw-r--r-- | sound/soc/codecs/arizona.h | 6 | ||||
-rw-r--r-- | sound/soc/codecs/wm5102.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 24 |
4 files changed, 67 insertions, 1 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 6c773804ffe0..26e1579c36cb 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -433,6 +433,33 @@ EXPORT_SYMBOL_GPL(arizona_mixer_values); | |||
433 | const DECLARE_TLV_DB_SCALE(arizona_mixer_tlv, -3200, 100, 0); | 433 | const DECLARE_TLV_DB_SCALE(arizona_mixer_tlv, -3200, 100, 0); |
434 | EXPORT_SYMBOL_GPL(arizona_mixer_tlv); | 434 | EXPORT_SYMBOL_GPL(arizona_mixer_tlv); |
435 | 435 | ||
436 | const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE] = { | ||
437 | "SYNCCLK rate", "8kHz", "16kHz", "ASYNCCLK rate", | ||
438 | }; | ||
439 | EXPORT_SYMBOL_GPL(arizona_rate_text); | ||
440 | |||
441 | const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE] = { | ||
442 | 0, 1, 2, 8, | ||
443 | }; | ||
444 | EXPORT_SYMBOL_GPL(arizona_rate_val); | ||
445 | |||
446 | |||
447 | const struct soc_enum arizona_isrc_fsl[] = { | ||
448 | SOC_VALUE_ENUM_SINGLE(ARIZONA_ISRC_1_CTRL_2, | ||
449 | ARIZONA_ISRC1_FSL_SHIFT, 0xf, | ||
450 | ARIZONA_RATE_ENUM_SIZE, | ||
451 | arizona_rate_text, arizona_rate_val), | ||
452 | SOC_VALUE_ENUM_SINGLE(ARIZONA_ISRC_2_CTRL_2, | ||
453 | ARIZONA_ISRC2_FSL_SHIFT, 0xf, | ||
454 | ARIZONA_RATE_ENUM_SIZE, | ||
455 | arizona_rate_text, arizona_rate_val), | ||
456 | SOC_VALUE_ENUM_SINGLE(ARIZONA_ISRC_3_CTRL_2, | ||
457 | ARIZONA_ISRC3_FSL_SHIFT, 0xf, | ||
458 | ARIZONA_RATE_ENUM_SIZE, | ||
459 | arizona_rate_text, arizona_rate_val), | ||
460 | }; | ||
461 | EXPORT_SYMBOL_GPL(arizona_isrc_fsl); | ||
462 | |||
436 | static const char *arizona_vol_ramp_text[] = { | 463 | static const char *arizona_vol_ramp_text[] = { |
437 | "0ms/6dB", "0.5ms/6dB", "1ms/6dB", "2ms/6dB", "4ms/6dB", "8ms/6dB", | 464 | "0ms/6dB", "0.5ms/6dB", "1ms/6dB", "2ms/6dB", "4ms/6dB", "8ms/6dB", |
438 | "15ms/6dB", "30ms/6dB", | 465 | "15ms/6dB", "30ms/6dB", |
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h index 9399940f700d..a754a1c0217f 100644 --- a/sound/soc/codecs/arizona.h +++ b/sound/soc/codecs/arizona.h | |||
@@ -180,6 +180,12 @@ extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS]; | |||
180 | ARIZONA_MIXER_ROUTES(name, name "L"), \ | 180 | ARIZONA_MIXER_ROUTES(name, name "L"), \ |
181 | ARIZONA_MIXER_ROUTES(name, name "R") | 181 | ARIZONA_MIXER_ROUTES(name, name "R") |
182 | 182 | ||
183 | #define ARIZONA_RATE_ENUM_SIZE 4 | ||
184 | extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE]; | ||
185 | extern const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE]; | ||
186 | |||
187 | extern const struct soc_enum arizona_isrc_fsl[]; | ||
188 | |||
183 | extern const struct soc_enum arizona_in_vi_ramp; | 189 | extern const struct soc_enum arizona_in_vi_ramp; |
184 | extern const struct soc_enum arizona_in_vd_ramp; | 190 | extern const struct soc_enum arizona_in_vd_ramp; |
185 | 191 | ||
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index 97757bc5fd0e..a0084b1febdb 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
@@ -731,6 +731,9 @@ SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode), | |||
731 | SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode), | 731 | SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode), |
732 | SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode), | 732 | SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode), |
733 | 733 | ||
734 | SOC_ENUM("ISRC1 FSL", arizona_isrc_fsl[0]), | ||
735 | SOC_ENUM("ISRC2 FSL", arizona_isrc_fsl[1]), | ||
736 | |||
734 | ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE), | 737 | ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE), |
735 | ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE), | 738 | ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE), |
736 | 739 | ||
@@ -1532,7 +1535,7 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec) | |||
1532 | if (ret != 0) | 1535 | if (ret != 0) |
1533 | return ret; | 1536 | return ret; |
1534 | 1537 | ||
1535 | ret = snd_soc_add_codec_controls(codec, wm_adsp_fw_controls, 1); | 1538 | ret = snd_soc_add_codec_controls(codec, wm_adsp_fw_controls, 2); |
1536 | if (ret != 0) | 1539 | if (ret != 0) |
1537 | return ret; | 1540 | return ret; |
1538 | 1541 | ||
@@ -1624,6 +1627,12 @@ static int wm5102_probe(struct platform_device *pdev) | |||
1624 | ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK, | 1627 | ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK, |
1625 | &wm5102->fll[1]); | 1628 | &wm5102->fll[1]); |
1626 | 1629 | ||
1630 | /* SR2 fixed at 8kHz, SR3 fixed at 16kHz */ | ||
1631 | regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2, | ||
1632 | ARIZONA_SAMPLE_RATE_2_MASK, 0x11); | ||
1633 | regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3, | ||
1634 | ARIZONA_SAMPLE_RATE_3_MASK, 0x12); | ||
1635 | |||
1627 | for (i = 0; i < ARRAY_SIZE(wm5102_dai); i++) | 1636 | for (i = 0; i < ARRAY_SIZE(wm5102_dai); i++) |
1628 | arizona_init_dai(&wm5102->core, i); | 1637 | arizona_init_dai(&wm5102->core, i); |
1629 | 1638 | ||
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index f3f7e75f8628..3a481fd1bf9a 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include <linux/mfd/arizona/registers.h> | 32 | #include <linux/mfd/arizona/registers.h> |
33 | 33 | ||
34 | #include "arizona.h" | ||
34 | #include "wm_adsp.h" | 35 | #include "wm_adsp.h" |
35 | 36 | ||
36 | #define adsp_crit(_dsp, fmt, ...) \ | 37 | #define adsp_crit(_dsp, fmt, ...) \ |
@@ -246,15 +247,38 @@ static const struct soc_enum wm_adsp_fw_enum[] = { | |||
246 | 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), |
247 | }; | 248 | }; |
248 | 249 | ||
250 | static const struct soc_enum wm_adsp_rate_enum[] = { | ||
251 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1, | ||
252 | ARIZONA_DSP1_RATE_SHIFT, 0xf, | ||
253 | ARIZONA_RATE_ENUM_SIZE, | ||
254 | arizona_rate_text, arizona_rate_val), | ||
255 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP2_CONTROL_1, | ||
256 | ARIZONA_DSP1_RATE_SHIFT, 0xf, | ||
257 | ARIZONA_RATE_ENUM_SIZE, | ||
258 | arizona_rate_text, arizona_rate_val), | ||
259 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP3_CONTROL_1, | ||
260 | ARIZONA_DSP1_RATE_SHIFT, 0xf, | ||
261 | ARIZONA_RATE_ENUM_SIZE, | ||
262 | arizona_rate_text, arizona_rate_val), | ||
263 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP3_CONTROL_1, | ||
264 | ARIZONA_DSP1_RATE_SHIFT, 0xf, | ||
265 | ARIZONA_RATE_ENUM_SIZE, | ||
266 | arizona_rate_text, arizona_rate_val), | ||
267 | }; | ||
268 | |||
249 | const struct snd_kcontrol_new wm_adsp_fw_controls[] = { | 269 | const struct snd_kcontrol_new wm_adsp_fw_controls[] = { |
250 | SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0], | 270 | SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0], |
251 | wm_adsp_fw_get, wm_adsp_fw_put), | 271 | wm_adsp_fw_get, wm_adsp_fw_put), |
272 | SOC_ENUM("DSP1 Rate", wm_adsp_rate_enum[0]), | ||
252 | SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1], | 273 | SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1], |
253 | wm_adsp_fw_get, wm_adsp_fw_put), | 274 | wm_adsp_fw_get, wm_adsp_fw_put), |
275 | SOC_ENUM("DSP2 Rate", wm_adsp_rate_enum[1]), | ||
254 | SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2], | 276 | SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2], |
255 | wm_adsp_fw_get, wm_adsp_fw_put), | 277 | wm_adsp_fw_get, wm_adsp_fw_put), |
278 | SOC_ENUM("DSP3 Rate", wm_adsp_rate_enum[2]), | ||
256 | SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3], | 279 | SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3], |
257 | wm_adsp_fw_get, wm_adsp_fw_put), | 280 | wm_adsp_fw_get, wm_adsp_fw_put), |
281 | SOC_ENUM("DSP4 Rate", wm_adsp_rate_enum[3]), | ||
258 | }; | 282 | }; |
259 | EXPORT_SYMBOL_GPL(wm_adsp_fw_controls); | 283 | EXPORT_SYMBOL_GPL(wm_adsp_fw_controls); |
260 | 284 | ||