aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm5110.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm5110.c')
-rw-r--r--sound/soc/codecs/wm5110.c75
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
87SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp),
88SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp),
89
87ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE), 90ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE),
88ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE), 91ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
89ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), 92ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
90ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), 93ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
91 94
95SND_SOC_BYTES_MASK("EQ1 Coefficeints", ARIZONA_EQ1_1, 21,
96 ARIZONA_EQ1_ENA_MASK),
97SND_SOC_BYTES_MASK("EQ2 Coefficeints", ARIZONA_EQ2_1, 21,
98 ARIZONA_EQ2_ENA_MASK),
99SND_SOC_BYTES_MASK("EQ3 Coefficeints", ARIZONA_EQ3_1, 21,
100 ARIZONA_EQ3_ENA_MASK),
101SND_SOC_BYTES_MASK("EQ4 Coefficeints", ARIZONA_EQ4_1, 21,
102 ARIZONA_EQ4_ENA_MASK),
103
92SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, 104SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
93 24, 0, eq_tlv), 105 24, 0, eq_tlv),
94SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT, 106SOC_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),
148ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE), 160ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE),
149ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE), 161ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE),
150 162
163SND_SOC_BYTES("LHPF1 Coefficients", ARIZONA_HPLPF1_2, 1),
164SND_SOC_BYTES("LHPF2 Coefficients", ARIZONA_HPLPF2_2, 1),
165SND_SOC_BYTES("LHPF3 Coefficients", ARIZONA_HPLPF3_2, 1),
166SND_SOC_BYTES("LHPF4 Coefficients", ARIZONA_HPLPF4_2, 1),
167
151SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode), 168SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode),
152SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode), 169SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode),
153SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode), 170SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode),
@@ -243,6 +260,9 @@ SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT,
243SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, 260SOC_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
263SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp),
264SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp),
265
246ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), 266ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE),
247ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), 267ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE),
248ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), 268ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE),
@@ -308,10 +328,10 @@ ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE);
308ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE); 328ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE);
309ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE); 329ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE);
310 330
311ARIZONA_MIXER_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE); 331ARIZONA_MUX_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE);
312ARIZONA_MIXER_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE); 332ARIZONA_MUX_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE);
313ARIZONA_MIXER_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE); 333ARIZONA_MUX_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE);
314ARIZONA_MIXER_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE); 334ARIZONA_MUX_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE);
315 335
316static const char *wm5110_aec_loopback_texts[] = { 336static 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
353SND_SOC_DAPM_SIGGEN("TONE"), 373SND_SOC_DAPM_SIGGEN("TONE"),
354SND_SOC_DAPM_SIGGEN("NOISE"), 374SND_SOC_DAPM_SIGGEN("NOISE"),
375SND_SOC_DAPM_SIGGEN("HAPTICS"),
355 376
356SND_SOC_DAPM_INPUT("IN1L"), 377SND_SOC_DAPM_INPUT("IN1L"),
357SND_SOC_DAPM_INPUT("IN1R"), 378SND_SOC_DAPM_INPUT("IN1R"),
@@ -585,10 +606,10 @@ ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"),
585ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"), 606ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"),
586ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"), 607ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"),
587 608
588ARIZONA_MIXER_WIDGETS(ASRC1L, "ASRC1L"), 609ARIZONA_MUX_WIDGETS(ASRC1L, "ASRC1L"),
589ARIZONA_MIXER_WIDGETS(ASRC1R, "ASRC1R"), 610ARIZONA_MUX_WIDGETS(ASRC1R, "ASRC1R"),
590ARIZONA_MIXER_WIDGETS(ASRC2L, "ASRC2L"), 611ARIZONA_MUX_WIDGETS(ASRC2L, "ASRC2L"),
591ARIZONA_MIXER_WIDGETS(ASRC2R, "ASRC2R"), 612ARIZONA_MUX_WIDGETS(ASRC2R, "ASRC2R"),
592 613
593SND_SOC_DAPM_OUTPUT("HPOUT1L"), 614SND_SOC_DAPM_OUTPUT("HPOUT1L"),
594SND_SOC_DAPM_OUTPUT("HPOUT1R"), 615SND_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[] = {
902static int wm5110_codec_probe(struct snd_soc_codec *codec) 924static 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
943static 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
936static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { 978static 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
952static int __devinit wm5110_probe(struct platform_device *pdev) 995static 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
991static int __devexit wm5110_remove(struct platform_device *pdev) 1034static 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
1008module_platform_driver(wm5110_codec_driver); 1051module_platform_driver(wm5110_codec_driver);