diff options
-rw-r--r-- | Documentation/devicetree/bindings/sound/rt5640.txt | 9 | ||||
-rw-r--r-- | include/sound/rt5640.h | 3 | ||||
-rw-r--r-- | sound/soc/codecs/rt298.c | 10 | ||||
-rw-r--r-- | sound/soc/codecs/rt5640.c | 22 | ||||
-rw-r--r-- | sound/soc/samsung/h1940_uda1380.c | 5 | ||||
-rw-r--r-- | sound/soc/samsung/rx1950_uda1380.c | 5 | ||||
-rw-r--r-- | sound/soc/sh/Kconfig | 2 |
7 files changed, 41 insertions, 15 deletions
diff --git a/Documentation/devicetree/bindings/sound/rt5640.txt b/Documentation/devicetree/bindings/sound/rt5640.txt index bac4d9ac1edc..9e62f6eb348f 100644 --- a/Documentation/devicetree/bindings/sound/rt5640.txt +++ b/Documentation/devicetree/bindings/sound/rt5640.txt | |||
@@ -14,7 +14,8 @@ Optional properties: | |||
14 | 14 | ||
15 | - realtek,in1-differential | 15 | - realtek,in1-differential |
16 | - realtek,in2-differential | 16 | - realtek,in2-differential |
17 | Boolean. Indicate MIC1/2 input are differential, rather than single-ended. | 17 | - realtek,in3-differential |
18 | Boolean. Indicate MIC1/2/3 input are differential, rather than single-ended. | ||
18 | 19 | ||
19 | - realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin. | 20 | - realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin. |
20 | 21 | ||
@@ -24,9 +25,11 @@ Pins on the device (for linking into audio routes) for RT5639/RT5640: | |||
24 | * DMIC2 | 25 | * DMIC2 |
25 | * MICBIAS1 | 26 | * MICBIAS1 |
26 | * IN1P | 27 | * IN1P |
27 | * IN1R | 28 | * IN1N |
28 | * IN2P | 29 | * IN2P |
29 | * IN2R | 30 | * IN2N |
31 | * IN3P | ||
32 | * IN3N | ||
30 | * HPOL | 33 | * HPOL |
31 | * HPOR | 34 | * HPOR |
32 | * LOUTL | 35 | * LOUTL |
diff --git a/include/sound/rt5640.h b/include/sound/rt5640.h index 59d26dd81e45..e3c84b92ff70 100644 --- a/include/sound/rt5640.h +++ b/include/sound/rt5640.h | |||
@@ -12,9 +12,10 @@ | |||
12 | #define __LINUX_SND_RT5640_H | 12 | #define __LINUX_SND_RT5640_H |
13 | 13 | ||
14 | struct rt5640_platform_data { | 14 | struct rt5640_platform_data { |
15 | /* IN1 & IN2 can optionally be differential */ | 15 | /* IN1 & IN2 & IN3 can optionally be differential */ |
16 | bool in1_diff; | 16 | bool in1_diff; |
17 | bool in2_diff; | 17 | bool in2_diff; |
18 | bool in3_diff; | ||
18 | 19 | ||
19 | bool dmic_en; | 20 | bool dmic_en; |
20 | bool dmic1_data_pin; /* 0 = IN1P; 1 = GPIO3 */ | 21 | bool dmic1_data_pin; /* 0 = IN1P; 1 = GPIO3 */ |
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index 603e9334b971..b3f795c60749 100644 --- a/sound/soc/codecs/rt298.c +++ b/sound/soc/codecs/rt298.c | |||
@@ -48,7 +48,7 @@ struct rt298_priv { | |||
48 | int is_hp_in; | 48 | int is_hp_in; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | static struct reg_default rt298_index_def[] = { | 51 | static const struct reg_default rt298_index_def[] = { |
52 | { 0x01, 0xa5a8 }, | 52 | { 0x01, 0xa5a8 }, |
53 | { 0x02, 0x8e95 }, | 53 | { 0x02, 0x8e95 }, |
54 | { 0x03, 0x0002 }, | 54 | { 0x03, 0x0002 }, |
@@ -128,7 +128,7 @@ static bool rt298_volatile_register(struct device *dev, unsigned int reg) | |||
128 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0): | 128 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0): |
129 | return true; | 129 | return true; |
130 | default: | 130 | default: |
131 | return true; | 131 | return false; |
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
@@ -1164,7 +1164,11 @@ static int rt298_i2c_probe(struct i2c_client *i2c, | |||
1164 | return -ENODEV; | 1164 | return -ENODEV; |
1165 | } | 1165 | } |
1166 | 1166 | ||
1167 | rt298->index_cache = rt298_index_def; | 1167 | rt298->index_cache = devm_kmemdup(&i2c->dev, rt298_index_def, |
1168 | sizeof(rt298_index_def), GFP_KERNEL); | ||
1169 | if (!rt298->index_cache) | ||
1170 | return -ENOMEM; | ||
1171 | |||
1168 | rt298->index_cache_size = INDEX_CACHE_SIZE; | 1172 | rt298->index_cache_size = INDEX_CACHE_SIZE; |
1169 | rt298->i2c = i2c; | 1173 | rt298->i2c = i2c; |
1170 | i2c_set_clientdata(i2c, rt298); | 1174 | i2c_set_clientdata(i2c, rt298); |
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index e1ceeb885f7d..f2beb1aa5763 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c | |||
@@ -405,11 +405,14 @@ static const struct snd_kcontrol_new rt5640_snd_controls[] = { | |||
405 | SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5640_DAC1_DIG_VOL, | 405 | SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5640_DAC1_DIG_VOL, |
406 | RT5640_L_VOL_SFT, RT5640_R_VOL_SFT, | 406 | RT5640_L_VOL_SFT, RT5640_R_VOL_SFT, |
407 | 175, 0, dac_vol_tlv), | 407 | 175, 0, dac_vol_tlv), |
408 | /* IN1/IN2 Control */ | 408 | /* IN1/IN2/IN3 Control */ |
409 | SOC_SINGLE_TLV("IN1 Boost", RT5640_IN1_IN2, | 409 | SOC_SINGLE_TLV("IN1 Boost", RT5640_IN1_IN2, |
410 | RT5640_BST_SFT1, 8, 0, bst_tlv), | 410 | RT5640_BST_SFT1, 8, 0, bst_tlv), |
411 | SOC_SINGLE_TLV("IN2 Boost", RT5640_IN3_IN4, | 411 | SOC_SINGLE_TLV("IN2 Boost", RT5640_IN3_IN4, |
412 | RT5640_BST_SFT2, 8, 0, bst_tlv), | 412 | RT5640_BST_SFT2, 8, 0, bst_tlv), |
413 | SOC_SINGLE_TLV("IN3 Boost", RT5640_IN1_IN2, | ||
414 | RT5640_BST_SFT2, 8, 0, bst_tlv), | ||
415 | |||
413 | /* INL/INR Volume Control */ | 416 | /* INL/INR Volume Control */ |
414 | SOC_DOUBLE_TLV("IN Capture Volume", RT5640_INL_INR_VOL, | 417 | SOC_DOUBLE_TLV("IN Capture Volume", RT5640_INL_INR_VOL, |
415 | RT5640_INL_VOL_SFT, RT5640_INR_VOL_SFT, | 418 | RT5640_INL_VOL_SFT, RT5640_INR_VOL_SFT, |
@@ -598,6 +601,8 @@ static const struct snd_kcontrol_new rt5640_rec_l_mix[] = { | |||
598 | RT5640_M_HP_L_RM_L_SFT, 1, 1), | 601 | RT5640_M_HP_L_RM_L_SFT, 1, 1), |
599 | SOC_DAPM_SINGLE("INL Switch", RT5640_REC_L2_MIXER, | 602 | SOC_DAPM_SINGLE("INL Switch", RT5640_REC_L2_MIXER, |
600 | RT5640_M_IN_L_RM_L_SFT, 1, 1), | 603 | RT5640_M_IN_L_RM_L_SFT, 1, 1), |
604 | SOC_DAPM_SINGLE("BST3 Switch", RT5640_REC_L2_MIXER, | ||
605 | RT5640_M_BST2_RM_L_SFT, 1, 1), | ||
601 | SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_L2_MIXER, | 606 | SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_L2_MIXER, |
602 | RT5640_M_BST4_RM_L_SFT, 1, 1), | 607 | RT5640_M_BST4_RM_L_SFT, 1, 1), |
603 | SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_L2_MIXER, | 608 | SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_L2_MIXER, |
@@ -611,6 +616,8 @@ static const struct snd_kcontrol_new rt5640_rec_r_mix[] = { | |||
611 | RT5640_M_HP_R_RM_R_SFT, 1, 1), | 616 | RT5640_M_HP_R_RM_R_SFT, 1, 1), |
612 | SOC_DAPM_SINGLE("INR Switch", RT5640_REC_R2_MIXER, | 617 | SOC_DAPM_SINGLE("INR Switch", RT5640_REC_R2_MIXER, |
613 | RT5640_M_IN_R_RM_R_SFT, 1, 1), | 618 | RT5640_M_IN_R_RM_R_SFT, 1, 1), |
619 | SOC_DAPM_SINGLE("BST3 Switch", RT5640_REC_R2_MIXER, | ||
620 | RT5640_M_BST2_RM_R_SFT, 1, 1), | ||
614 | SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_R2_MIXER, | 621 | SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_R2_MIXER, |
615 | RT5640_M_BST4_RM_R_SFT, 1, 1), | 622 | RT5640_M_BST4_RM_R_SFT, 1, 1), |
616 | SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_R2_MIXER, | 623 | SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_R2_MIXER, |
@@ -1065,6 +1072,8 @@ static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = { | |||
1065 | SND_SOC_DAPM_INPUT("IN1N"), | 1072 | SND_SOC_DAPM_INPUT("IN1N"), |
1066 | SND_SOC_DAPM_INPUT("IN2P"), | 1073 | SND_SOC_DAPM_INPUT("IN2P"), |
1067 | SND_SOC_DAPM_INPUT("IN2N"), | 1074 | SND_SOC_DAPM_INPUT("IN2N"), |
1075 | SND_SOC_DAPM_INPUT("IN3P"), | ||
1076 | SND_SOC_DAPM_INPUT("IN3N"), | ||
1068 | SND_SOC_DAPM_PGA("DMIC L1", SND_SOC_NOPM, 0, 0, NULL, 0), | 1077 | SND_SOC_DAPM_PGA("DMIC L1", SND_SOC_NOPM, 0, 0, NULL, 0), |
1069 | SND_SOC_DAPM_PGA("DMIC R1", SND_SOC_NOPM, 0, 0, NULL, 0), | 1078 | SND_SOC_DAPM_PGA("DMIC R1", SND_SOC_NOPM, 0, 0, NULL, 0), |
1070 | SND_SOC_DAPM_PGA("DMIC L2", SND_SOC_NOPM, 0, 0, NULL, 0), | 1079 | SND_SOC_DAPM_PGA("DMIC L2", SND_SOC_NOPM, 0, 0, NULL, 0), |
@@ -1081,6 +1090,8 @@ static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = { | |||
1081 | RT5640_PWR_BST1_BIT, 0, NULL, 0), | 1090 | RT5640_PWR_BST1_BIT, 0, NULL, 0), |
1082 | SND_SOC_DAPM_PGA("BST2", RT5640_PWR_ANLG2, | 1091 | SND_SOC_DAPM_PGA("BST2", RT5640_PWR_ANLG2, |
1083 | RT5640_PWR_BST4_BIT, 0, NULL, 0), | 1092 | RT5640_PWR_BST4_BIT, 0, NULL, 0), |
1093 | SND_SOC_DAPM_PGA("BST3", RT5640_PWR_ANLG2, | ||
1094 | RT5640_PWR_BST2_BIT, 0, NULL, 0), | ||
1084 | /* Input Volume */ | 1095 | /* Input Volume */ |
1085 | SND_SOC_DAPM_PGA("INL VOL", RT5640_PWR_VOL, | 1096 | SND_SOC_DAPM_PGA("INL VOL", RT5640_PWR_VOL, |
1086 | RT5640_PWR_IN_L_BIT, 0, NULL, 0), | 1097 | RT5640_PWR_IN_L_BIT, 0, NULL, 0), |
@@ -1310,6 +1321,7 @@ static const struct snd_soc_dapm_widget rt5639_specific_dapm_widgets[] = { | |||
1310 | static const struct snd_soc_dapm_route rt5640_dapm_routes[] = { | 1321 | static const struct snd_soc_dapm_route rt5640_dapm_routes[] = { |
1311 | {"IN1P", NULL, "LDO2"}, | 1322 | {"IN1P", NULL, "LDO2"}, |
1312 | {"IN2P", NULL, "LDO2"}, | 1323 | {"IN2P", NULL, "LDO2"}, |
1324 | {"IN3P", NULL, "LDO2"}, | ||
1313 | 1325 | ||
1314 | {"DMIC L1", NULL, "DMIC1"}, | 1326 | {"DMIC L1", NULL, "DMIC1"}, |
1315 | {"DMIC R1", NULL, "DMIC1"}, | 1327 | {"DMIC R1", NULL, "DMIC1"}, |
@@ -1320,18 +1332,22 @@ static const struct snd_soc_dapm_route rt5640_dapm_routes[] = { | |||
1320 | {"BST1", NULL, "IN1N"}, | 1332 | {"BST1", NULL, "IN1N"}, |
1321 | {"BST2", NULL, "IN2P"}, | 1333 | {"BST2", NULL, "IN2P"}, |
1322 | {"BST2", NULL, "IN2N"}, | 1334 | {"BST2", NULL, "IN2N"}, |
1335 | {"BST3", NULL, "IN3P"}, | ||
1336 | {"BST3", NULL, "IN3N"}, | ||
1323 | 1337 | ||
1324 | {"INL VOL", NULL, "IN2P"}, | 1338 | {"INL VOL", NULL, "IN2P"}, |
1325 | {"INR VOL", NULL, "IN2N"}, | 1339 | {"INR VOL", NULL, "IN2N"}, |
1326 | 1340 | ||
1327 | {"RECMIXL", "HPOL Switch", "HPOL"}, | 1341 | {"RECMIXL", "HPOL Switch", "HPOL"}, |
1328 | {"RECMIXL", "INL Switch", "INL VOL"}, | 1342 | {"RECMIXL", "INL Switch", "INL VOL"}, |
1343 | {"RECMIXL", "BST3 Switch", "BST3"}, | ||
1329 | {"RECMIXL", "BST2 Switch", "BST2"}, | 1344 | {"RECMIXL", "BST2 Switch", "BST2"}, |
1330 | {"RECMIXL", "BST1 Switch", "BST1"}, | 1345 | {"RECMIXL", "BST1 Switch", "BST1"}, |
1331 | {"RECMIXL", "OUT MIXL Switch", "OUT MIXL"}, | 1346 | {"RECMIXL", "OUT MIXL Switch", "OUT MIXL"}, |
1332 | 1347 | ||
1333 | {"RECMIXR", "HPOR Switch", "HPOR"}, | 1348 | {"RECMIXR", "HPOR Switch", "HPOR"}, |
1334 | {"RECMIXR", "INR Switch", "INR VOL"}, | 1349 | {"RECMIXR", "INR Switch", "INR VOL"}, |
1350 | {"RECMIXR", "BST3 Switch", "BST3"}, | ||
1335 | {"RECMIXR", "BST2 Switch", "BST2"}, | 1351 | {"RECMIXR", "BST2 Switch", "BST2"}, |
1336 | {"RECMIXR", "BST1 Switch", "BST1"}, | 1352 | {"RECMIXR", "BST1 Switch", "BST1"}, |
1337 | {"RECMIXR", "OUT MIXR Switch", "OUT MIXR"}, | 1353 | {"RECMIXR", "OUT MIXR Switch", "OUT MIXR"}, |
@@ -2260,6 +2276,10 @@ static int rt5640_i2c_probe(struct i2c_client *i2c, | |||
2260 | regmap_update_bits(rt5640->regmap, RT5640_IN3_IN4, | 2276 | regmap_update_bits(rt5640->regmap, RT5640_IN3_IN4, |
2261 | RT5640_IN_DF2, RT5640_IN_DF2); | 2277 | RT5640_IN_DF2, RT5640_IN_DF2); |
2262 | 2278 | ||
2279 | if (rt5640->pdata.in3_diff) | ||
2280 | regmap_update_bits(rt5640->regmap, RT5640_IN1_IN2, | ||
2281 | RT5640_IN_DF2, RT5640_IN_DF2); | ||
2282 | |||
2263 | rt5640->hp_mute = 1; | 2283 | rt5640->hp_mute = 1; |
2264 | 2284 | ||
2265 | return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5640, | 2285 | return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5640, |
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index c72e9fb26658..5f5825faeb2a 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c | |||
@@ -26,16 +26,15 @@ | |||
26 | #include <mach/gpio-samsung.h> | 26 | #include <mach/gpio-samsung.h> |
27 | #include "s3c24xx-i2s.h" | 27 | #include "s3c24xx-i2s.h" |
28 | 28 | ||
29 | static unsigned int rates[] = { | 29 | static const unsigned int rates[] = { |
30 | 11025, | 30 | 11025, |
31 | 22050, | 31 | 22050, |
32 | 44100, | 32 | 44100, |
33 | }; | 33 | }; |
34 | 34 | ||
35 | static struct snd_pcm_hw_constraint_list hw_rates = { | 35 | static const struct snd_pcm_hw_constraint_list hw_rates = { |
36 | .count = ARRAY_SIZE(rates), | 36 | .count = ARRAY_SIZE(rates), |
37 | .list = rates, | 37 | .list = rates, |
38 | .mask = 0, | ||
39 | }; | 38 | }; |
40 | 39 | ||
41 | static struct snd_soc_jack hp_jack; | 40 | static struct snd_soc_jack hp_jack; |
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 35e37c457f1f..fa096abe9e75 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c | |||
@@ -38,16 +38,15 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream, | |||
38 | static int rx1950_spk_power(struct snd_soc_dapm_widget *w, | 38 | static int rx1950_spk_power(struct snd_soc_dapm_widget *w, |
39 | struct snd_kcontrol *kcontrol, int event); | 39 | struct snd_kcontrol *kcontrol, int event); |
40 | 40 | ||
41 | static unsigned int rates[] = { | 41 | static const unsigned int rates[] = { |
42 | 16000, | 42 | 16000, |
43 | 44100, | 43 | 44100, |
44 | 48000, | 44 | 48000, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static struct snd_pcm_hw_constraint_list hw_rates = { | 47 | static const struct snd_pcm_hw_constraint_list hw_rates = { |
48 | .count = ARRAY_SIZE(rates), | 48 | .count = ARRAY_SIZE(rates), |
49 | .list = rates, | 49 | .list = rates, |
50 | .mask = 0, | ||
51 | }; | 50 | }; |
52 | 51 | ||
53 | static struct snd_soc_jack hp_jack; | 52 | static struct snd_soc_jack hp_jack; |
diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig index 6ca90aaf141f..206d1edab07c 100644 --- a/sound/soc/sh/Kconfig +++ b/sound/soc/sh/Kconfig | |||
@@ -41,7 +41,7 @@ config SND_SOC_RCAR | |||
41 | select SND_SIMPLE_CARD | 41 | select SND_SIMPLE_CARD |
42 | select REGMAP_MMIO | 42 | select REGMAP_MMIO |
43 | help | 43 | help |
44 | This option enables R-Car SUR/SCU/SSIU/SSI sound support | 44 | This option enables R-Car SRU/SCU/SSIU/SSI sound support |
45 | 45 | ||
46 | config SND_SOC_RSRC_CARD | 46 | config SND_SOC_RSRC_CARD |
47 | tristate "Renesas Sampling Rate Convert Sound Card" | 47 | tristate "Renesas Sampling Rate Convert Sound Card" |