diff options
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/arizona.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/arizona.h | 18 | ||||
-rw-r--r-- | sound/soc/codecs/cs4271.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/cs42l52.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/lm49453.c | 106 | ||||
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/sta529.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/wm2000.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/wm2200.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/wm5100.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/wm5102.c | 51 | ||||
-rw-r--r-- | sound/soc/codecs/wm5110.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 25 |
13 files changed, 140 insertions, 121 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index adf397b9d0e6..ef62c435848e 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -446,15 +446,9 @@ static int arizona_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | |||
446 | case SND_SOC_DAIFMT_DSP_A: | 446 | case SND_SOC_DAIFMT_DSP_A: |
447 | mode = 0; | 447 | mode = 0; |
448 | break; | 448 | break; |
449 | case SND_SOC_DAIFMT_DSP_B: | ||
450 | mode = 1; | ||
451 | break; | ||
452 | case SND_SOC_DAIFMT_I2S: | 449 | case SND_SOC_DAIFMT_I2S: |
453 | mode = 2; | 450 | mode = 2; |
454 | break; | 451 | break; |
455 | case SND_SOC_DAIFMT_LEFT_J: | ||
456 | mode = 3; | ||
457 | break; | ||
458 | default: | 452 | default: |
459 | arizona_aif_err(dai, "Unsupported DAI format %d\n", | 453 | arizona_aif_err(dai, "Unsupported DAI format %d\n", |
460 | fmt & SND_SOC_DAIFMT_FORMAT_MASK); | 454 | fmt & SND_SOC_DAIFMT_FORMAT_MASK); |
@@ -691,7 +685,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, | |||
691 | } | 685 | } |
692 | sr_val = i; | 686 | sr_val = i; |
693 | 687 | ||
694 | lrclk = snd_soc_params_to_bclk(params) / params_rate(params); | 688 | lrclk = rates[bclk] / params_rate(params); |
695 | 689 | ||
696 | arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", | 690 | arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", |
697 | rates[bclk], rates[bclk] / lrclk); | 691 | rates[bclk], rates[bclk] / lrclk); |
@@ -714,7 +708,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, | |||
714 | snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1, | 708 | snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1, |
715 | ARIZONA_ASYNC_SAMPLE_RATE_MASK, sr_val); | 709 | ARIZONA_ASYNC_SAMPLE_RATE_MASK, sr_val); |
716 | snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL, | 710 | snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL, |
717 | ARIZONA_AIF1_RATE_MASK, 8); | 711 | ARIZONA_AIF1_RATE_MASK, |
712 | 8 << ARIZONA_AIF1_RATE_SHIFT); | ||
718 | break; | 713 | break; |
719 | default: | 714 | default: |
720 | arizona_aif_err(dai, "Invalid clock %d\n", dai_priv->clk); | 715 | arizona_aif_err(dai, "Invalid clock %d\n", dai_priv->clk); |
@@ -1087,6 +1082,9 @@ int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq, | |||
1087 | id, ret); | 1082 | id, ret); |
1088 | } | 1083 | } |
1089 | 1084 | ||
1085 | regmap_update_bits(arizona->regmap, fll->base + 1, | ||
1086 | ARIZONA_FLL1_FREERUN, 0); | ||
1087 | |||
1090 | return 0; | 1088 | return 0; |
1091 | } | 1089 | } |
1092 | EXPORT_SYMBOL_GPL(arizona_init_fll); | 1090 | EXPORT_SYMBOL_GPL(arizona_init_fll); |
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h index 41dae1ed3b71..4deebeb07177 100644 --- a/sound/soc/codecs/arizona.h +++ b/sound/soc/codecs/arizona.h | |||
@@ -34,15 +34,15 @@ | |||
34 | 34 | ||
35 | #define ARIZONA_FLL_SRC_MCLK1 0 | 35 | #define ARIZONA_FLL_SRC_MCLK1 0 |
36 | #define ARIZONA_FLL_SRC_MCLK2 1 | 36 | #define ARIZONA_FLL_SRC_MCLK2 1 |
37 | #define ARIZONA_FLL_SRC_SLIMCLK 2 | 37 | #define ARIZONA_FLL_SRC_SLIMCLK 3 |
38 | #define ARIZONA_FLL_SRC_FLL1 3 | 38 | #define ARIZONA_FLL_SRC_FLL1 4 |
39 | #define ARIZONA_FLL_SRC_FLL2 4 | 39 | #define ARIZONA_FLL_SRC_FLL2 5 |
40 | #define ARIZONA_FLL_SRC_AIF1BCLK 5 | 40 | #define ARIZONA_FLL_SRC_AIF1BCLK 8 |
41 | #define ARIZONA_FLL_SRC_AIF2BCLK 6 | 41 | #define ARIZONA_FLL_SRC_AIF2BCLK 9 |
42 | #define ARIZONA_FLL_SRC_AIF3BCLK 7 | 42 | #define ARIZONA_FLL_SRC_AIF3BCLK 10 |
43 | #define ARIZONA_FLL_SRC_AIF1LRCLK 8 | 43 | #define ARIZONA_FLL_SRC_AIF1LRCLK 12 |
44 | #define ARIZONA_FLL_SRC_AIF2LRCLK 9 | 44 | #define ARIZONA_FLL_SRC_AIF2LRCLK 13 |
45 | #define ARIZONA_FLL_SRC_AIF3LRCLK 10 | 45 | #define ARIZONA_FLL_SRC_AIF3LRCLK 14 |
46 | 46 | ||
47 | #define ARIZONA_MIXER_VOL_MASK 0x00FE | 47 | #define ARIZONA_MIXER_VOL_MASK 0x00FE |
48 | #define ARIZONA_MIXER_VOL_SHIFT 1 | 48 | #define ARIZONA_MIXER_VOL_SHIFT 1 |
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index 4f1127935fdf..ac8742a1f25a 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c | |||
@@ -474,16 +474,16 @@ static int cs4271_probe(struct snd_soc_codec *codec) | |||
474 | struct cs4271_platform_data *cs4271plat = codec->dev->platform_data; | 474 | struct cs4271_platform_data *cs4271plat = codec->dev->platform_data; |
475 | int ret; | 475 | int ret; |
476 | int gpio_nreset = -EINVAL; | 476 | int gpio_nreset = -EINVAL; |
477 | int amutec_eq_bmutec = 0; | 477 | bool amutec_eq_bmutec = false; |
478 | 478 | ||
479 | #ifdef CONFIG_OF | 479 | #ifdef CONFIG_OF |
480 | if (of_match_device(cs4271_dt_ids, codec->dev)) { | 480 | if (of_match_device(cs4271_dt_ids, codec->dev)) { |
481 | gpio_nreset = of_get_named_gpio(codec->dev->of_node, | 481 | gpio_nreset = of_get_named_gpio(codec->dev->of_node, |
482 | "reset-gpio", 0); | 482 | "reset-gpio", 0); |
483 | 483 | ||
484 | if (!of_get_property(codec->dev->of_node, | 484 | if (of_get_property(codec->dev->of_node, |
485 | "cirrus,amutec-eq-bmutec", NULL)) | 485 | "cirrus,amutec-eq-bmutec", NULL)) |
486 | amutec_eq_bmutec = 1; | 486 | amutec_eq_bmutec = true; |
487 | } | 487 | } |
488 | #endif | 488 | #endif |
489 | 489 | ||
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 99bb1c69499e..9811a5478c87 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c | |||
@@ -737,7 +737,7 @@ static const struct cs42l52_clk_para clk_map_table[] = { | |||
737 | 737 | ||
738 | static int cs42l52_get_clk(int mclk, int rate) | 738 | static int cs42l52_get_clk(int mclk, int rate) |
739 | { | 739 | { |
740 | int i, ret = 0; | 740 | int i, ret = -EINVAL; |
741 | u_int mclk1, mclk2 = 0; | 741 | u_int mclk1, mclk2 = 0; |
742 | 742 | ||
743 | for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) { | 743 | for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) { |
@@ -749,8 +749,6 @@ static int cs42l52_get_clk(int mclk, int rate) | |||
749 | } | 749 | } |
750 | } | 750 | } |
751 | } | 751 | } |
752 | if (ret > ARRAY_SIZE(clk_map_table)) | ||
753 | return -EINVAL; | ||
754 | return ret; | 752 | return ret; |
755 | } | 753 | } |
756 | 754 | ||
diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c index d75257d40a49..e19490cfb3a8 100644 --- a/sound/soc/codecs/lm49453.c +++ b/sound/soc/codecs/lm49453.c | |||
@@ -111,9 +111,9 @@ static struct reg_default lm49453_reg_defs[] = { | |||
111 | { 101, 0x00 }, | 111 | { 101, 0x00 }, |
112 | { 102, 0x00 }, | 112 | { 102, 0x00 }, |
113 | { 103, 0x01 }, | 113 | { 103, 0x01 }, |
114 | { 105, 0x01 }, | 114 | { 104, 0x01 }, |
115 | { 106, 0x00 }, | 115 | { 105, 0x00 }, |
116 | { 107, 0x01 }, | 116 | { 106, 0x01 }, |
117 | { 107, 0x00 }, | 117 | { 107, 0x00 }, |
118 | { 108, 0x00 }, | 118 | { 108, 0x00 }, |
119 | { 109, 0x00 }, | 119 | { 109, 0x00 }, |
@@ -163,56 +163,25 @@ static struct reg_default lm49453_reg_defs[] = { | |||
163 | { 184, 0x00 }, | 163 | { 184, 0x00 }, |
164 | { 185, 0x00 }, | 164 | { 185, 0x00 }, |
165 | { 186, 0x00 }, | 165 | { 186, 0x00 }, |
166 | { 189, 0x00 }, | 166 | { 187, 0x00 }, |
167 | { 188, 0x00 }, | 167 | { 188, 0x00 }, |
168 | { 194, 0x00 }, | 168 | { 189, 0x00 }, |
169 | { 195, 0x00 }, | 169 | { 208, 0x06 }, |
170 | { 196, 0x00 }, | ||
171 | { 197, 0x00 }, | ||
172 | { 200, 0x00 }, | ||
173 | { 201, 0x00 }, | ||
174 | { 202, 0x00 }, | ||
175 | { 203, 0x00 }, | ||
176 | { 204, 0x00 }, | ||
177 | { 205, 0x00 }, | ||
178 | { 208, 0x00 }, | ||
179 | { 209, 0x00 }, | 170 | { 209, 0x00 }, |
180 | { 210, 0x00 }, | 171 | { 210, 0x08 }, |
181 | { 211, 0x00 }, | 172 | { 211, 0x54 }, |
182 | { 213, 0x00 }, | 173 | { 212, 0x14 }, |
183 | { 214, 0x00 }, | 174 | { 213, 0x0d }, |
184 | { 215, 0x00 }, | 175 | { 214, 0x0d }, |
185 | { 216, 0x00 }, | 176 | { 215, 0x14 }, |
186 | { 217, 0x00 }, | 177 | { 216, 0x60 }, |
187 | { 218, 0x00 }, | ||
188 | { 219, 0x00 }, | ||
189 | { 221, 0x00 }, | 178 | { 221, 0x00 }, |
190 | { 222, 0x00 }, | 179 | { 222, 0x00 }, |
180 | { 223, 0x00 }, | ||
191 | { 224, 0x00 }, | 181 | { 224, 0x00 }, |
192 | { 225, 0x00 }, | ||
193 | { 226, 0x00 }, | ||
194 | { 227, 0x00 }, | ||
195 | { 228, 0x00 }, | ||
196 | { 229, 0x00 }, | ||
197 | { 230, 0x13 }, | ||
198 | { 231, 0x00 }, | ||
199 | { 232, 0x80 }, | ||
200 | { 233, 0x0C }, | ||
201 | { 234, 0xDD }, | ||
202 | { 235, 0x00 }, | ||
203 | { 236, 0x04 }, | ||
204 | { 237, 0x00 }, | ||
205 | { 238, 0x00 }, | ||
206 | { 239, 0x00 }, | ||
207 | { 240, 0x00 }, | ||
208 | { 241, 0x00 }, | ||
209 | { 242, 0x00 }, | ||
210 | { 243, 0x00 }, | ||
211 | { 244, 0x00 }, | ||
212 | { 245, 0x00 }, | ||
213 | { 248, 0x00 }, | 182 | { 248, 0x00 }, |
214 | { 249, 0x00 }, | 183 | { 249, 0x00 }, |
215 | { 254, 0x00 }, | 184 | { 250, 0x00 }, |
216 | { 255, 0x00 }, | 185 | { 255, 0x00 }, |
217 | }; | 186 | }; |
218 | 187 | ||
@@ -525,36 +494,41 @@ SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0), | |||
525 | }; | 494 | }; |
526 | 495 | ||
527 | /* TLV Declarations */ | 496 | /* TLV Declarations */ |
528 | static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1); | 497 | static const DECLARE_TLV_DB_SCALE(adc_dac_tlv, -7650, 150, 1); |
529 | static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0); | 498 | static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 200, 1); |
499 | static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0); | ||
500 | static const DECLARE_TLV_DB_SCALE(stn_tlv, -7200, 150, 0); | ||
530 | 501 | ||
531 | static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = { | 502 | static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = { |
532 | /* Sidetone supports mono only */ | 503 | /* Sidetone supports mono only */ |
533 | SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG, | 504 | SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG, |
534 | 0, 0x3F, 0, digital_tlv), | 505 | 0, 0x3F, 0, stn_tlv), |
535 | SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG, | 506 | SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG, |
536 | 0, 0x3F, 0, digital_tlv), | 507 | 0, 0x3F, 0, stn_tlv), |
537 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG, | 508 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG, |
538 | 0, 0x3F, 0, digital_tlv), | 509 | 0, 0x3F, 0, stn_tlv), |
539 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG, | 510 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG, |
540 | 0, 0x3F, 0, digital_tlv), | 511 | 0, 0x3F, 0, stn_tlv), |
541 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG, | 512 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG, |
542 | 0, 0x3F, 0, digital_tlv), | 513 | 0, 0x3F, 0, stn_tlv), |
543 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, | 514 | SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, |
544 | 0, 0x3F, 0, digital_tlv), | 515 | 0, 0x3F, 0, stn_tlv), |
545 | }; | 516 | }; |
546 | 517 | ||
547 | static const struct snd_kcontrol_new lm49453_snd_controls[] = { | 518 | static const struct snd_kcontrol_new lm49453_snd_controls[] = { |
548 | /* mic1 and mic2 supports mono only */ | 519 | /* mic1 and mic2 supports mono only */ |
549 | SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6, | 520 | SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_MICL_REG, 0, 15, 0, mic_tlv), |
550 | 0, digital_tlv), | 521 | SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_MICR_REG, 0, 15, 0, mic_tlv), |
551 | SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6, | 522 | |
552 | 0, digital_tlv), | 523 | SOC_SINGLE_TLV("ADCL Volume", LM49453_P0_ADC_LEVELL_REG, 0, 63, |
524 | 0, adc_dac_tlv), | ||
525 | SOC_SINGLE_TLV("ADCR Volume", LM49453_P0_ADC_LEVELR_REG, 0, 63, | ||
526 | 0, adc_dac_tlv), | ||
553 | 527 | ||
554 | SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG, | 528 | SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG, |
555 | LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv), | 529 | LM49453_P0_DMIC1_LEVELR_REG, 0, 63, 0, adc_dac_tlv), |
556 | SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG, | 530 | SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG, |
557 | LM49453_P0_DMIC2_LEVELR_REG, 0, 6, 0, digital_tlv), | 531 | LM49453_P0_DMIC2_LEVELR_REG, 0, 63, 0, adc_dac_tlv), |
558 | 532 | ||
559 | SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum), | 533 | SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum), |
560 | SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum), | 534 | SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum), |
@@ -569,16 +543,16 @@ static const struct snd_kcontrol_new lm49453_snd_controls[] = { | |||
569 | 2, 1, 0), | 543 | 2, 1, 0), |
570 | 544 | ||
571 | SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG, | 545 | SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG, |
572 | LM49453_P0_DAC_HP_LEVELR_REG, 0, 6, 0, digital_tlv), | 546 | LM49453_P0_DAC_HP_LEVELR_REG, 0, 63, 0, adc_dac_tlv), |
573 | SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG, | 547 | SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG, |
574 | LM49453_P0_DAC_LO_LEVELR_REG, 0, 6, 0, digital_tlv), | 548 | LM49453_P0_DAC_LO_LEVELR_REG, 0, 63, 0, adc_dac_tlv), |
575 | SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG, | 549 | SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG, |
576 | LM49453_P0_DAC_LS_LEVELR_REG, 0, 6, 0, digital_tlv), | 550 | LM49453_P0_DAC_LS_LEVELR_REG, 0, 63, 0, adc_dac_tlv), |
577 | SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG, | 551 | SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG, |
578 | LM49453_P0_DAC_HA_LEVELR_REG, 0, 6, 0, digital_tlv), | 552 | LM49453_P0_DAC_HA_LEVELR_REG, 0, 63, 0, adc_dac_tlv), |
579 | 553 | ||
580 | SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG, | 554 | SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG, |
581 | 0, 6, 0, digital_tlv), | 555 | 0, 63, 0, adc_dac_tlv), |
582 | 556 | ||
583 | SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, | 557 | SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, |
584 | 0, 3, 0, port_tlv), | 558 | 0, 3, 0, port_tlv), |
@@ -1218,7 +1192,7 @@ static int lm49453_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
1218 | } | 1192 | } |
1219 | 1193 | ||
1220 | snd_soc_update_bits(codec, LM49453_P0_AUDIO_PORT1_BASIC_REG, | 1194 | snd_soc_update_bits(codec, LM49453_P0_AUDIO_PORT1_BASIC_REG, |
1221 | LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(1)|BIT(5), | 1195 | LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(0)|BIT(5), |
1222 | (aif_val | mode | clk_phase)); | 1196 | (aif_val | mode | clk_phase)); |
1223 | 1197 | ||
1224 | snd_soc_write(codec, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift); | 1198 | snd_soc_write(codec, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift); |
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index cb1675cd8e1c..92bbfec9b107 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -401,7 +401,7 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = { | |||
401 | 5, 1, 0), | 401 | 5, 1, 0), |
402 | 402 | ||
403 | SOC_SINGLE_TLV("Mic Volume", SGTL5000_CHIP_MIC_CTRL, | 403 | SOC_SINGLE_TLV("Mic Volume", SGTL5000_CHIP_MIC_CTRL, |
404 | 0, 4, 0, mic_gain_tlv), | 404 | 0, 3, 0, mic_gain_tlv), |
405 | }; | 405 | }; |
406 | 406 | ||
407 | /* mute the codec used by alsa core */ | 407 | /* mute the codec used by alsa core */ |
@@ -1344,7 +1344,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec) | |||
1344 | SGTL5000_HP_ZCD_EN | | 1344 | SGTL5000_HP_ZCD_EN | |
1345 | SGTL5000_ADC_ZCD_EN); | 1345 | SGTL5000_ADC_ZCD_EN); |
1346 | 1346 | ||
1347 | snd_soc_write(codec, SGTL5000_CHIP_MIC_CTRL, 0); | 1347 | snd_soc_write(codec, SGTL5000_CHIP_MIC_CTRL, 2); |
1348 | 1348 | ||
1349 | /* | 1349 | /* |
1350 | * disable DAP | 1350 | * disable DAP |
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index ab355c4f0b2d..40c07be9b581 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c | |||
@@ -74,9 +74,10 @@ | |||
74 | SNDRV_PCM_FMTBIT_S32_LE) | 74 | SNDRV_PCM_FMTBIT_S32_LE) |
75 | #define S2PC_VALUE 0x98 | 75 | #define S2PC_VALUE 0x98 |
76 | #define CLOCK_OUT 0x60 | 76 | #define CLOCK_OUT 0x60 |
77 | #define LEFT_J_DATA_FORMAT 0x10 | 77 | #define DATA_FORMAT_MSK 0x0E |
78 | #define I2S_DATA_FORMAT 0x12 | 78 | #define LEFT_J_DATA_FORMAT 0x00 |
79 | #define RIGHT_J_DATA_FORMAT 0x14 | 79 | #define I2S_DATA_FORMAT 0x02 |
80 | #define RIGHT_J_DATA_FORMAT 0x04 | ||
80 | #define CODEC_MUTE_VAL 0x80 | 81 | #define CODEC_MUTE_VAL 0x80 |
81 | 82 | ||
82 | #define POWER_CNTLMSAK 0x40 | 83 | #define POWER_CNTLMSAK 0x40 |
@@ -289,7 +290,7 @@ static int sta529_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt) | |||
289 | return -EINVAL; | 290 | return -EINVAL; |
290 | } | 291 | } |
291 | 292 | ||
292 | snd_soc_update_bits(codec, STA529_S2PCFG0, 0x0D, mode); | 293 | snd_soc_update_bits(codec, STA529_S2PCFG0, DATA_FORMAT_MSK, mode); |
293 | 294 | ||
294 | return 0; | 295 | return 0; |
295 | } | 296 | } |
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index 1cbe88f01d63..12bcae63a7f0 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -209,9 +209,9 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue) | |||
209 | 209 | ||
210 | ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY); | 210 | ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY); |
211 | if (wm2000->speech_clarity) | 211 | if (wm2000->speech_clarity) |
212 | ret &= ~WM2000_SPEECH_CLARITY; | ||
213 | else | ||
214 | ret |= WM2000_SPEECH_CLARITY; | 212 | ret |= WM2000_SPEECH_CLARITY; |
213 | else | ||
214 | ret &= ~WM2000_SPEECH_CLARITY; | ||
215 | wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret); | 215 | wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret); |
216 | 216 | ||
217 | wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33); | 217 | wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33); |
diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c index afcf31df77e0..d8c65f574658 100644 --- a/sound/soc/codecs/wm2200.c +++ b/sound/soc/codecs/wm2200.c | |||
@@ -1019,8 +1019,6 @@ static const char *wm2200_mixer_texts[] = { | |||
1019 | "EQR", | 1019 | "EQR", |
1020 | "LHPF1", | 1020 | "LHPF1", |
1021 | "LHPF2", | 1021 | "LHPF2", |
1022 | "LHPF3", | ||
1023 | "LHPF4", | ||
1024 | "DSP1.1", | 1022 | "DSP1.1", |
1025 | "DSP1.2", | 1023 | "DSP1.2", |
1026 | "DSP1.3", | 1024 | "DSP1.3", |
@@ -1053,7 +1051,6 @@ static int wm2200_mixer_values[] = { | |||
1053 | 0x25, | 1051 | 0x25, |
1054 | 0x50, /* EQ */ | 1052 | 0x50, /* EQ */ |
1055 | 0x51, | 1053 | 0x51, |
1056 | 0x52, | ||
1057 | 0x60, /* LHPF1 */ | 1054 | 0x60, /* LHPF1 */ |
1058 | 0x61, /* LHPF2 */ | 1055 | 0x61, /* LHPF2 */ |
1059 | 0x68, /* DSP1 */ | 1056 | 0x68, /* DSP1 */ |
@@ -1566,15 +1563,9 @@ static int wm2200_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | |||
1566 | case SND_SOC_DAIFMT_DSP_A: | 1563 | case SND_SOC_DAIFMT_DSP_A: |
1567 | fmt_val = 0; | 1564 | fmt_val = 0; |
1568 | break; | 1565 | break; |
1569 | case SND_SOC_DAIFMT_DSP_B: | ||
1570 | fmt_val = 1; | ||
1571 | break; | ||
1572 | case SND_SOC_DAIFMT_I2S: | 1566 | case SND_SOC_DAIFMT_I2S: |
1573 | fmt_val = 2; | 1567 | fmt_val = 2; |
1574 | break; | 1568 | break; |
1575 | case SND_SOC_DAIFMT_LEFT_J: | ||
1576 | fmt_val = 3; | ||
1577 | break; | ||
1578 | default: | 1569 | default: |
1579 | dev_err(codec->dev, "Unsupported DAI format %d\n", | 1570 | dev_err(codec->dev, "Unsupported DAI format %d\n", |
1580 | fmt & SND_SOC_DAIFMT_FORMAT_MASK); | 1571 | fmt & SND_SOC_DAIFMT_FORMAT_MASK); |
@@ -1626,7 +1617,7 @@ static int wm2200_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | |||
1626 | WM2200_AIF1TX_LRCLK_MSTR | WM2200_AIF1TX_LRCLK_INV, | 1617 | WM2200_AIF1TX_LRCLK_MSTR | WM2200_AIF1TX_LRCLK_INV, |
1627 | lrclk); | 1618 | lrclk); |
1628 | snd_soc_update_bits(codec, WM2200_AUDIO_IF_1_5, | 1619 | snd_soc_update_bits(codec, WM2200_AUDIO_IF_1_5, |
1629 | WM2200_AIF1_FMT_MASK << 1, fmt_val << 1); | 1620 | WM2200_AIF1_FMT_MASK, fmt_val); |
1630 | 1621 | ||
1631 | return 0; | 1622 | return 0; |
1632 | } | 1623 | } |
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 5a5f36936235..54397a508073 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c | |||
@@ -1279,15 +1279,9 @@ static int wm5100_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | |||
1279 | case SND_SOC_DAIFMT_DSP_A: | 1279 | case SND_SOC_DAIFMT_DSP_A: |
1280 | mask = 0; | 1280 | mask = 0; |
1281 | break; | 1281 | break; |
1282 | case SND_SOC_DAIFMT_DSP_B: | ||
1283 | mask = 1; | ||
1284 | break; | ||
1285 | case SND_SOC_DAIFMT_I2S: | 1282 | case SND_SOC_DAIFMT_I2S: |
1286 | mask = 2; | 1283 | mask = 2; |
1287 | break; | 1284 | break; |
1288 | case SND_SOC_DAIFMT_LEFT_J: | ||
1289 | mask = 3; | ||
1290 | break; | ||
1291 | default: | 1285 | default: |
1292 | dev_err(codec->dev, "Unsupported DAI format %d\n", | 1286 | dev_err(codec->dev, "Unsupported DAI format %d\n", |
1293 | fmt & SND_SOC_DAIFMT_FORMAT_MASK); | 1287 | fmt & SND_SOC_DAIFMT_FORMAT_MASK); |
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index 688ade080589..1440b3f9b7bb 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
@@ -36,6 +36,9 @@ | |||
36 | struct wm5102_priv { | 36 | struct wm5102_priv { |
37 | struct arizona_priv core; | 37 | struct arizona_priv core; |
38 | struct arizona_fll fll[2]; | 38 | struct arizona_fll fll[2]; |
39 | |||
40 | unsigned int spk_ena:2; | ||
41 | unsigned int spk_ena_pending:1; | ||
39 | }; | 42 | }; |
40 | 43 | ||
41 | static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); | 44 | static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); |
@@ -787,6 +790,47 @@ ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE), | |||
787 | ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE), | 790 | ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE), |
788 | }; | 791 | }; |
789 | 792 | ||
793 | static int wm5102_spk_ev(struct snd_soc_dapm_widget *w, | ||
794 | struct snd_kcontrol *kcontrol, | ||
795 | int event) | ||
796 | { | ||
797 | struct snd_soc_codec *codec = w->codec; | ||
798 | struct arizona *arizona = dev_get_drvdata(codec->dev->parent); | ||
799 | struct wm5102_priv *wm5102 = snd_soc_codec_get_drvdata(codec); | ||
800 | |||
801 | if (arizona->rev < 1) | ||
802 | return 0; | ||
803 | |||
804 | switch (event) { | ||
805 | case SND_SOC_DAPM_PRE_PMU: | ||
806 | if (!wm5102->spk_ena) { | ||
807 | snd_soc_write(codec, 0x4f5, 0x25a); | ||
808 | wm5102->spk_ena_pending = true; | ||
809 | } | ||
810 | break; | ||
811 | case SND_SOC_DAPM_POST_PMU: | ||
812 | if (wm5102->spk_ena_pending) { | ||
813 | msleep(75); | ||
814 | snd_soc_write(codec, 0x4f5, 0xda); | ||
815 | wm5102->spk_ena_pending = false; | ||
816 | wm5102->spk_ena++; | ||
817 | } | ||
818 | break; | ||
819 | case SND_SOC_DAPM_PRE_PMD: | ||
820 | wm5102->spk_ena--; | ||
821 | if (!wm5102->spk_ena) | ||
822 | snd_soc_write(codec, 0x4f5, 0x25a); | ||
823 | break; | ||
824 | case SND_SOC_DAPM_POST_PMD: | ||
825 | if (!wm5102->spk_ena) | ||
826 | snd_soc_write(codec, 0x4f5, 0x0da); | ||
827 | break; | ||
828 | } | ||
829 | |||
830 | return 0; | ||
831 | } | ||
832 | |||
833 | |||
790 | ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE); | 834 | ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE); |
791 | ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE); | 835 | ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE); |
792 | ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE); | 836 | ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE); |
@@ -852,8 +896,7 @@ static const unsigned int wm5102_aec_loopback_values[] = { | |||
852 | 896 | ||
853 | static const struct soc_enum wm5102_aec_loopback = | 897 | static const struct soc_enum wm5102_aec_loopback = |
854 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, | 898 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, |
855 | ARIZONA_AEC_LOOPBACK_SRC_SHIFT, | 899 | ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, |
856 | ARIZONA_AEC_LOOPBACK_SRC_MASK, | ||
857 | ARRAY_SIZE(wm5102_aec_loopback_texts), | 900 | ARRAY_SIZE(wm5102_aec_loopback_texts), |
858 | wm5102_aec_loopback_texts, | 901 | wm5102_aec_loopback_texts, |
859 | wm5102_aec_loopback_values); | 902 | wm5102_aec_loopback_values); |
@@ -1034,10 +1077,10 @@ SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1, | |||
1034 | ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, | 1077 | ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
1035 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), | 1078 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
1036 | SND_SOC_DAPM_PGA_E("OUT4L", ARIZONA_OUTPUT_ENABLES_1, | 1079 | SND_SOC_DAPM_PGA_E("OUT4L", ARIZONA_OUTPUT_ENABLES_1, |
1037 | ARIZONA_OUT4L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, | 1080 | ARIZONA_OUT4L_ENA_SHIFT, 0, NULL, 0, wm5102_spk_ev, |
1038 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), | 1081 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
1039 | SND_SOC_DAPM_PGA_E("OUT4R", ARIZONA_OUTPUT_ENABLES_1, | 1082 | SND_SOC_DAPM_PGA_E("OUT4R", ARIZONA_OUTPUT_ENABLES_1, |
1040 | ARIZONA_OUT4R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, | 1083 | ARIZONA_OUT4R_ENA_SHIFT, 0, NULL, 0, wm5102_spk_ev, |
1041 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), | 1084 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
1042 | SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1, | 1085 | SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1, |
1043 | ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, | 1086 | ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index ae80c8c28536..7a090968c4f7 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -344,8 +344,7 @@ static const unsigned int wm5110_aec_loopback_values[] = { | |||
344 | 344 | ||
345 | static const struct soc_enum wm5110_aec_loopback = | 345 | static const struct soc_enum wm5110_aec_loopback = |
346 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, | 346 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, |
347 | ARIZONA_AEC_LOOPBACK_SRC_SHIFT, | 347 | ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, |
348 | ARIZONA_AEC_LOOPBACK_SRC_MASK, | ||
349 | ARRAY_SIZE(wm5110_aec_loopback_texts), | 348 | ARRAY_SIZE(wm5110_aec_loopback_texts), |
350 | wm5110_aec_loopback_texts, | 349 | wm5110_aec_loopback_texts, |
351 | wm5110_aec_loopback_values); | 350 | wm5110_aec_loopback_values); |
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index ffc89fab96fb..b6b654837585 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
@@ -169,6 +169,7 @@ static int wm_adsp_load(struct wm_adsp *dsp) | |||
169 | const struct wm_adsp_region *mem; | 169 | const struct wm_adsp_region *mem; |
170 | const char *region_name; | 170 | const char *region_name; |
171 | char *file, *text; | 171 | char *file, *text; |
172 | void *buf; | ||
172 | unsigned int reg; | 173 | unsigned int reg; |
173 | int regions = 0; | 174 | int regions = 0; |
174 | int ret, offset, type, sizes; | 175 | int ret, offset, type, sizes; |
@@ -322,8 +323,18 @@ static int wm_adsp_load(struct wm_adsp *dsp) | |||
322 | } | 323 | } |
323 | 324 | ||
324 | if (reg) { | 325 | if (reg) { |
325 | ret = regmap_raw_write(regmap, reg, region->data, | 326 | buf = kmemdup(region->data, le32_to_cpu(region->len), |
327 | GFP_KERNEL | GFP_DMA); | ||
328 | if (!buf) { | ||
329 | adsp_err(dsp, "Out of memory\n"); | ||
330 | return -ENOMEM; | ||
331 | } | ||
332 | |||
333 | ret = regmap_raw_write(regmap, reg, buf, | ||
326 | le32_to_cpu(region->len)); | 334 | le32_to_cpu(region->len)); |
335 | |||
336 | kfree(buf); | ||
337 | |||
327 | if (ret != 0) { | 338 | if (ret != 0) { |
328 | adsp_err(dsp, | 339 | adsp_err(dsp, |
329 | "%s.%d: Failed to write %d bytes at %d in %s: %d\n", | 340 | "%s.%d: Failed to write %d bytes at %d in %s: %d\n", |
@@ -359,6 +370,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
359 | const char *region_name; | 370 | const char *region_name; |
360 | int ret, pos, blocks, type, offset, reg; | 371 | int ret, pos, blocks, type, offset, reg; |
361 | char *file; | 372 | char *file; |
373 | void *buf; | ||
362 | 374 | ||
363 | file = kzalloc(PAGE_SIZE, GFP_KERNEL); | 375 | file = kzalloc(PAGE_SIZE, GFP_KERNEL); |
364 | if (file == NULL) | 376 | if (file == NULL) |
@@ -384,7 +396,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
384 | hdr = (void*)&firmware->data[0]; | 396 | hdr = (void*)&firmware->data[0]; |
385 | if (memcmp(hdr->magic, "WMDR", 4) != 0) { | 397 | if (memcmp(hdr->magic, "WMDR", 4) != 0) { |
386 | adsp_err(dsp, "%s: invalid magic\n", file); | 398 | adsp_err(dsp, "%s: invalid magic\n", file); |
387 | return -EINVAL; | 399 | goto out_fw; |
388 | } | 400 | } |
389 | 401 | ||
390 | adsp_dbg(dsp, "%s: v%d.%d.%d\n", file, | 402 | adsp_dbg(dsp, "%s: v%d.%d.%d\n", file, |
@@ -426,6 +438,13 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
426 | } | 438 | } |
427 | 439 | ||
428 | if (reg) { | 440 | if (reg) { |
441 | buf = kmemdup(blk->data, le32_to_cpu(blk->len), | ||
442 | GFP_KERNEL | GFP_DMA); | ||
443 | if (!buf) { | ||
444 | adsp_err(dsp, "Out of memory\n"); | ||
445 | return -ENOMEM; | ||
446 | } | ||
447 | |||
429 | ret = regmap_raw_write(regmap, reg, blk->data, | 448 | ret = regmap_raw_write(regmap, reg, blk->data, |
430 | le32_to_cpu(blk->len)); | 449 | le32_to_cpu(blk->len)); |
431 | if (ret != 0) { | 450 | if (ret != 0) { |
@@ -433,6 +452,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
433 | "%s.%d: Failed to write to %x in %s\n", | 452 | "%s.%d: Failed to write to %x in %s\n", |
434 | file, blocks, reg, region_name); | 453 | file, blocks, reg, region_name); |
435 | } | 454 | } |
455 | |||
456 | kfree(buf); | ||
436 | } | 457 | } |
437 | 458 | ||
438 | pos += le32_to_cpu(blk->len) + sizeof(*blk); | 459 | pos += le32_to_cpu(blk->len) + sizeof(*blk); |