diff options
Diffstat (limited to 'sound/soc/codecs/wm5110.c')
-rw-r--r-- | sound/soc/codecs/wm5110.c | 75 |
1 files changed, 59 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index 9211e4192f71..ae80c8c28536 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
@@ -84,11 +84,23 @@ SOC_DOUBLE_R_TLV("IN4 Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4L, | |||
84 | ARIZONA_ADC_DIGITAL_VOLUME_4R, ARIZONA_IN4L_DIG_VOL_SHIFT, | 84 | ARIZONA_ADC_DIGITAL_VOLUME_4R, ARIZONA_IN4L_DIG_VOL_SHIFT, |
85 | 0xbf, 0, digital_tlv), | 85 | 0xbf, 0, digital_tlv), |
86 | 86 | ||
87 | SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp), | ||
88 | SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp), | ||
89 | |||
87 | ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE), | 90 | ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE), |
88 | ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE), | 91 | ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE), |
89 | ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), | 92 | ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), |
90 | ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), | 93 | ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), |
91 | 94 | ||
95 | SND_SOC_BYTES_MASK("EQ1 Coefficeints", ARIZONA_EQ1_1, 21, | ||
96 | ARIZONA_EQ1_ENA_MASK), | ||
97 | SND_SOC_BYTES_MASK("EQ2 Coefficeints", ARIZONA_EQ2_1, 21, | ||
98 | ARIZONA_EQ2_ENA_MASK), | ||
99 | SND_SOC_BYTES_MASK("EQ3 Coefficeints", ARIZONA_EQ3_1, 21, | ||
100 | ARIZONA_EQ3_ENA_MASK), | ||
101 | SND_SOC_BYTES_MASK("EQ4 Coefficeints", ARIZONA_EQ4_1, 21, | ||
102 | ARIZONA_EQ4_ENA_MASK), | ||
103 | |||
92 | SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, | 104 | SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, |
93 | 24, 0, eq_tlv), | 105 | 24, 0, eq_tlv), |
94 | SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT, | 106 | SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT, |
@@ -148,6 +160,11 @@ ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE), | |||
148 | ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE), | 160 | ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE), |
149 | ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE), | 161 | ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE), |
150 | 162 | ||
163 | SND_SOC_BYTES("LHPF1 Coefficients", ARIZONA_HPLPF1_2, 1), | ||
164 | SND_SOC_BYTES("LHPF2 Coefficients", ARIZONA_HPLPF2_2, 1), | ||
165 | SND_SOC_BYTES("LHPF3 Coefficients", ARIZONA_HPLPF3_2, 1), | ||
166 | SND_SOC_BYTES("LHPF4 Coefficients", ARIZONA_HPLPF4_2, 1), | ||
167 | |||
151 | SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode), | 168 | SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode), |
152 | SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode), | 169 | SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode), |
153 | SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode), | 170 | SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode), |
@@ -243,6 +260,9 @@ SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT, | |||
243 | SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, | 260 | SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, |
244 | ARIZONA_SPK2R_MUTE_SHIFT, 1, 1), | 261 | ARIZONA_SPK2R_MUTE_SHIFT, 1, 1), |
245 | 262 | ||
263 | SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp), | ||
264 | SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp), | ||
265 | |||
246 | ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), | 266 | ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), |
247 | ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), | 267 | ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), |
248 | ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), | 268 | ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), |
@@ -308,10 +328,10 @@ ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE); | |||
308 | ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE); | 328 | ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE); |
309 | ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE); | 329 | ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE); |
310 | 330 | ||
311 | ARIZONA_MIXER_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE); | 331 | ARIZONA_MUX_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE); |
312 | ARIZONA_MIXER_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE); | 332 | ARIZONA_MUX_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE); |
313 | ARIZONA_MIXER_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE); | 333 | ARIZONA_MUX_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE); |
314 | ARIZONA_MIXER_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE); | 334 | ARIZONA_MUX_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE); |
315 | 335 | ||
316 | static const char *wm5110_aec_loopback_texts[] = { | 336 | static const char *wm5110_aec_loopback_texts[] = { |
317 | "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R", | 337 | "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R", |
@@ -352,6 +372,7 @@ SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0), | |||
352 | 372 | ||
353 | SND_SOC_DAPM_SIGGEN("TONE"), | 373 | SND_SOC_DAPM_SIGGEN("TONE"), |
354 | SND_SOC_DAPM_SIGGEN("NOISE"), | 374 | SND_SOC_DAPM_SIGGEN("NOISE"), |
375 | SND_SOC_DAPM_SIGGEN("HAPTICS"), | ||
355 | 376 | ||
356 | SND_SOC_DAPM_INPUT("IN1L"), | 377 | SND_SOC_DAPM_INPUT("IN1L"), |
357 | SND_SOC_DAPM_INPUT("IN1R"), | 378 | SND_SOC_DAPM_INPUT("IN1R"), |
@@ -585,10 +606,10 @@ ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"), | |||
585 | ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"), | 606 | ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"), |
586 | ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"), | 607 | ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"), |
587 | 608 | ||
588 | ARIZONA_MIXER_WIDGETS(ASRC1L, "ASRC1L"), | 609 | ARIZONA_MUX_WIDGETS(ASRC1L, "ASRC1L"), |
589 | ARIZONA_MIXER_WIDGETS(ASRC1R, "ASRC1R"), | 610 | ARIZONA_MUX_WIDGETS(ASRC1R, "ASRC1R"), |
590 | ARIZONA_MIXER_WIDGETS(ASRC2L, "ASRC2L"), | 611 | ARIZONA_MUX_WIDGETS(ASRC2L, "ASRC2L"), |
591 | ARIZONA_MIXER_WIDGETS(ASRC2R, "ASRC2R"), | 612 | ARIZONA_MUX_WIDGETS(ASRC2R, "ASRC2R"), |
592 | 613 | ||
593 | SND_SOC_DAPM_OUTPUT("HPOUT1L"), | 614 | SND_SOC_DAPM_OUTPUT("HPOUT1L"), |
594 | SND_SOC_DAPM_OUTPUT("HPOUT1R"), | 615 | SND_SOC_DAPM_OUTPUT("HPOUT1R"), |
@@ -610,6 +631,7 @@ SND_SOC_DAPM_OUTPUT("SPKDAT2R"), | |||
610 | { name, "Noise Generator", "Noise Generator" }, \ | 631 | { name, "Noise Generator", "Noise Generator" }, \ |
611 | { name, "Tone Generator 1", "Tone Generator 1" }, \ | 632 | { name, "Tone Generator 1", "Tone Generator 1" }, \ |
612 | { name, "Tone Generator 2", "Tone Generator 2" }, \ | 633 | { name, "Tone Generator 2", "Tone Generator 2" }, \ |
634 | { name, "Haptics", "HAPTICS" }, \ | ||
613 | { name, "AEC", "AEC Loopback" }, \ | 635 | { name, "AEC", "AEC Loopback" }, \ |
614 | { name, "IN1L", "IN1L PGA" }, \ | 636 | { name, "IN1L", "IN1L PGA" }, \ |
615 | { name, "IN1R", "IN1R PGA" }, \ | 637 | { name, "IN1R", "IN1R PGA" }, \ |
@@ -786,10 +808,10 @@ static const struct snd_soc_dapm_route wm5110_dapm_routes[] = { | |||
786 | ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"), | 808 | ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"), |
787 | ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"), | 809 | ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"), |
788 | 810 | ||
789 | ARIZONA_MIXER_ROUTES("ASRC1L", "ASRC1L"), | 811 | ARIZONA_MUX_ROUTES("ASRC1L"), |
790 | ARIZONA_MIXER_ROUTES("ASRC1R", "ASRC1R"), | 812 | ARIZONA_MUX_ROUTES("ASRC1R"), |
791 | ARIZONA_MIXER_ROUTES("ASRC2L", "ASRC2L"), | 813 | ARIZONA_MUX_ROUTES("ASRC2L"), |
792 | ARIZONA_MIXER_ROUTES("ASRC2R", "ASRC2R"), | 814 | ARIZONA_MUX_ROUTES("ASRC2R"), |
793 | 815 | ||
794 | { "HPOUT1L", NULL, "OUT1L" }, | 816 | { "HPOUT1L", NULL, "OUT1L" }, |
795 | { "HPOUT1R", NULL, "OUT1R" }, | 817 | { "HPOUT1R", NULL, "OUT1R" }, |
@@ -902,9 +924,29 @@ static struct snd_soc_dai_driver wm5110_dai[] = { | |||
902 | static int wm5110_codec_probe(struct snd_soc_codec *codec) | 924 | static int wm5110_codec_probe(struct snd_soc_codec *codec) |
903 | { | 925 | { |
904 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); | 926 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); |
927 | int ret; | ||
905 | 928 | ||
906 | codec->control_data = priv->core.arizona->regmap; | 929 | codec->control_data = priv->core.arizona->regmap; |
907 | return snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP); | 930 | priv->core.arizona->dapm = &codec->dapm; |
931 | |||
932 | ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP); | ||
933 | if (ret != 0) | ||
934 | return ret; | ||
935 | |||
936 | snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS"); | ||
937 | |||
938 | priv->core.arizona->dapm = &codec->dapm; | ||
939 | |||
940 | return 0; | ||
941 | } | ||
942 | |||
943 | static int wm5110_codec_remove(struct snd_soc_codec *codec) | ||
944 | { | ||
945 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); | ||
946 | |||
947 | priv->core.arizona->dapm = NULL; | ||
948 | |||
949 | return 0; | ||
908 | } | 950 | } |
909 | 951 | ||
910 | #define WM5110_DIG_VU 0x0200 | 952 | #define WM5110_DIG_VU 0x0200 |
@@ -935,6 +977,7 @@ static unsigned int wm5110_digital_vu[] = { | |||
935 | 977 | ||
936 | static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { | 978 | static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { |
937 | .probe = wm5110_codec_probe, | 979 | .probe = wm5110_codec_probe, |
980 | .remove = wm5110_codec_remove, | ||
938 | 981 | ||
939 | .idle_bias_off = true, | 982 | .idle_bias_off = true, |
940 | 983 | ||
@@ -949,7 +992,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { | |||
949 | .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes), | 992 | .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes), |
950 | }; | 993 | }; |
951 | 994 | ||
952 | static int __devinit wm5110_probe(struct platform_device *pdev) | 995 | static int wm5110_probe(struct platform_device *pdev) |
953 | { | 996 | { |
954 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); | 997 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); |
955 | struct wm5110_priv *wm5110; | 998 | struct wm5110_priv *wm5110; |
@@ -988,7 +1031,7 @@ static int __devinit wm5110_probe(struct platform_device *pdev) | |||
988 | wm5110_dai, ARRAY_SIZE(wm5110_dai)); | 1031 | wm5110_dai, ARRAY_SIZE(wm5110_dai)); |
989 | } | 1032 | } |
990 | 1033 | ||
991 | static int __devexit wm5110_remove(struct platform_device *pdev) | 1034 | static int wm5110_remove(struct platform_device *pdev) |
992 | { | 1035 | { |
993 | snd_soc_unregister_codec(&pdev->dev); | 1036 | snd_soc_unregister_codec(&pdev->dev); |
994 | pm_runtime_disable(&pdev->dev); | 1037 | pm_runtime_disable(&pdev->dev); |
@@ -1002,7 +1045,7 @@ static struct platform_driver wm5110_codec_driver = { | |||
1002 | .owner = THIS_MODULE, | 1045 | .owner = THIS_MODULE, |
1003 | }, | 1046 | }, |
1004 | .probe = wm5110_probe, | 1047 | .probe = wm5110_probe, |
1005 | .remove = __devexit_p(wm5110_remove), | 1048 | .remove = wm5110_remove, |
1006 | }; | 1049 | }; |
1007 | 1050 | ||
1008 | module_platform_driver(wm5110_codec_driver); | 1051 | module_platform_driver(wm5110_codec_driver); |