diff options
Diffstat (limited to 'sound/soc')
28 files changed, 145 insertions, 105 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index bd41ee4da078..2c71f16bd661 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -1278,6 +1278,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, | |||
1278 | else | 1278 | else |
1279 | rates = &arizona_48k_bclk_rates[0]; | 1279 | rates = &arizona_48k_bclk_rates[0]; |
1280 | 1280 | ||
1281 | wl = snd_pcm_format_width(params_format(params)); | ||
1282 | |||
1281 | if (tdm_slots) { | 1283 | if (tdm_slots) { |
1282 | arizona_aif_dbg(dai, "Configuring for %d %d bit TDM slots\n", | 1284 | arizona_aif_dbg(dai, "Configuring for %d %d bit TDM slots\n", |
1283 | tdm_slots, tdm_width); | 1285 | tdm_slots, tdm_width); |
@@ -1285,6 +1287,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, | |||
1285 | channels = tdm_slots; | 1287 | channels = tdm_slots; |
1286 | } else { | 1288 | } else { |
1287 | bclk_target = snd_soc_params_to_bclk(params); | 1289 | bclk_target = snd_soc_params_to_bclk(params); |
1290 | tdm_width = wl; | ||
1288 | } | 1291 | } |
1289 | 1292 | ||
1290 | if (chan_limit && chan_limit < channels) { | 1293 | if (chan_limit && chan_limit < channels) { |
@@ -1319,8 +1322,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, | |||
1319 | arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", | 1322 | arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", |
1320 | rates[bclk], rates[bclk] / lrclk); | 1323 | rates[bclk], rates[bclk] / lrclk); |
1321 | 1324 | ||
1322 | wl = snd_pcm_format_width(params_format(params)); | 1325 | frame = wl << ARIZONA_AIF1TX_WL_SHIFT | tdm_width; |
1323 | frame = wl << ARIZONA_AIF1TX_WL_SHIFT | wl; | ||
1324 | 1326 | ||
1325 | reconfig = arizona_aif_cfg_changed(codec, base, bclk, lrclk, frame); | 1327 | reconfig = arizona_aif_cfg_changed(codec, base, bclk, lrclk, frame); |
1326 | 1328 | ||
diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index a20b30ca52c0..69a85164357c 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c | |||
@@ -282,10 +282,10 @@ static const struct cs4265_clk_para clk_map_table[] = { | |||
282 | 282 | ||
283 | /*64k*/ | 283 | /*64k*/ |
284 | {8192000, 64000, 1, 0}, | 284 | {8192000, 64000, 1, 0}, |
285 | {1228800, 64000, 1, 1}, | 285 | {12288000, 64000, 1, 1}, |
286 | {1693440, 64000, 1, 2}, | 286 | {16934400, 64000, 1, 2}, |
287 | {2457600, 64000, 1, 3}, | 287 | {24576000, 64000, 1, 3}, |
288 | {3276800, 64000, 1, 4}, | 288 | {32768000, 64000, 1, 4}, |
289 | 289 | ||
290 | /* 88.2k */ | 290 | /* 88.2k */ |
291 | {11289600, 88200, 1, 0}, | 291 | {11289600, 88200, 1, 0}, |
@@ -435,10 +435,10 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, | |||
435 | index = cs4265_get_clk_index(cs4265->sysclk, params_rate(params)); | 435 | index = cs4265_get_clk_index(cs4265->sysclk, params_rate(params)); |
436 | if (index >= 0) { | 436 | if (index >= 0) { |
437 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 437 | snd_soc_update_bits(codec, CS4265_ADC_CTL, |
438 | CS4265_ADC_FM, clk_map_table[index].fm_mode); | 438 | CS4265_ADC_FM, clk_map_table[index].fm_mode << 6); |
439 | snd_soc_update_bits(codec, CS4265_MCLK_FREQ, | 439 | snd_soc_update_bits(codec, CS4265_MCLK_FREQ, |
440 | CS4265_MCLK_FREQ_MASK, | 440 | CS4265_MCLK_FREQ_MASK, |
441 | clk_map_table[index].mclkdiv); | 441 | clk_map_table[index].mclkdiv << 4); |
442 | 442 | ||
443 | } else { | 443 | } else { |
444 | dev_err(codec->dev, "can't get correct mclk\n"); | 444 | dev_err(codec->dev, "can't get correct mclk\n"); |
@@ -458,12 +458,12 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, | |||
458 | if (params_width(params) == 16) { | 458 | if (params_width(params) == 16) { |
459 | snd_soc_update_bits(codec, CS4265_DAC_CTL, | 459 | snd_soc_update_bits(codec, CS4265_DAC_CTL, |
460 | CS4265_DAC_CTL_DIF, (1 << 5)); | 460 | CS4265_DAC_CTL_DIF, (1 << 5)); |
461 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 461 | snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, |
462 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); | 462 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); |
463 | } else { | 463 | } else { |
464 | snd_soc_update_bits(codec, CS4265_DAC_CTL, | 464 | snd_soc_update_bits(codec, CS4265_DAC_CTL, |
465 | CS4265_DAC_CTL_DIF, (3 << 5)); | 465 | CS4265_DAC_CTL_DIF, (3 << 5)); |
466 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 466 | snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, |
467 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); | 467 | CS4265_SPDIF_CTL2_DIF, (1 << 7)); |
468 | } | 468 | } |
469 | break; | 469 | break; |
@@ -472,7 +472,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, | |||
472 | CS4265_DAC_CTL_DIF, 0); | 472 | CS4265_DAC_CTL_DIF, 0); |
473 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 473 | snd_soc_update_bits(codec, CS4265_ADC_CTL, |
474 | CS4265_ADC_DIF, 0); | 474 | CS4265_ADC_DIF, 0); |
475 | snd_soc_update_bits(codec, CS4265_ADC_CTL, | 475 | snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, |
476 | CS4265_SPDIF_CTL2_DIF, (1 << 6)); | 476 | CS4265_SPDIF_CTL2_DIF, (1 << 6)); |
477 | 477 | ||
478 | break; | 478 | break; |
diff --git a/sound/soc/codecs/da732x.h b/sound/soc/codecs/da732x.h index 1dceafeec415..f586cbd30b77 100644 --- a/sound/soc/codecs/da732x.h +++ b/sound/soc/codecs/da732x.h | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef __DA732X_H_ | 13 | #ifndef __DA732X_H_ |
14 | #define __DA732X_H | 14 | #define __DA732X_H_ |
15 | 15 | ||
16 | #include <sound/soc.h> | 16 | #include <sound/soc.h> |
17 | 17 | ||
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c index 163ec3855fd4..0c8aefab404c 100644 --- a/sound/soc/codecs/pcm512x.c +++ b/sound/soc/codecs/pcm512x.c | |||
@@ -259,13 +259,13 @@ static const struct soc_enum pcm512x_veds = | |||
259 | pcm512x_ramp_step_text); | 259 | pcm512x_ramp_step_text); |
260 | 260 | ||
261 | static const struct snd_kcontrol_new pcm512x_controls[] = { | 261 | static const struct snd_kcontrol_new pcm512x_controls[] = { |
262 | SOC_DOUBLE_R_TLV("Playback Digital Volume", PCM512x_DIGITAL_VOLUME_2, | 262 | SOC_DOUBLE_R_TLV("Digital Playback Volume", PCM512x_DIGITAL_VOLUME_2, |
263 | PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv), | 263 | PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv), |
264 | SOC_DOUBLE_TLV("Playback Volume", PCM512x_ANALOG_GAIN_CTRL, | 264 | SOC_DOUBLE_TLV("Playback Volume", PCM512x_ANALOG_GAIN_CTRL, |
265 | PCM512x_LAGN_SHIFT, PCM512x_RAGN_SHIFT, 1, 1, analog_tlv), | 265 | PCM512x_LAGN_SHIFT, PCM512x_RAGN_SHIFT, 1, 1, analog_tlv), |
266 | SOC_DOUBLE_TLV("Playback Boost Volume", PCM512x_ANALOG_GAIN_BOOST, | 266 | SOC_DOUBLE_TLV("Playback Boost Volume", PCM512x_ANALOG_GAIN_BOOST, |
267 | PCM512x_AGBL_SHIFT, PCM512x_AGBR_SHIFT, 1, 0, boost_tlv), | 267 | PCM512x_AGBL_SHIFT, PCM512x_AGBR_SHIFT, 1, 0, boost_tlv), |
268 | SOC_DOUBLE("Playback Digital Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT, | 268 | SOC_DOUBLE("Digital Playback Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT, |
269 | PCM512x_RQMR_SHIFT, 1, 1), | 269 | PCM512x_RQMR_SHIFT, 1, 1), |
270 | 270 | ||
271 | SOC_SINGLE("Deemphasis Switch", PCM512x_DSP, PCM512x_DEMP_SHIFT, 1, 1), | 271 | SOC_SINGLE("Deemphasis Switch", PCM512x_DSP, PCM512x_DEMP_SHIFT, 1, 1), |
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 6bc6efdec550..f1ec6e6bd08a 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c | |||
@@ -2059,6 +2059,7 @@ static struct snd_soc_codec_driver soc_codec_dev_rt5640 = { | |||
2059 | static const struct regmap_config rt5640_regmap = { | 2059 | static const struct regmap_config rt5640_regmap = { |
2060 | .reg_bits = 8, | 2060 | .reg_bits = 8, |
2061 | .val_bits = 16, | 2061 | .val_bits = 16, |
2062 | .use_single_rw = true, | ||
2062 | 2063 | ||
2063 | .max_register = RT5640_VENDOR_ID2 + 1 + (ARRAY_SIZE(rt5640_ranges) * | 2064 | .max_register = RT5640_VENDOR_ID2 + 1 + (ARRAY_SIZE(rt5640_ranges) * |
2064 | RT5640_PR_SPACING), | 2065 | RT5640_PR_SPACING), |
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 67f14556462f..5337c448b5e3 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c | |||
@@ -2135,10 +2135,10 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = { | |||
2135 | { "BST2", NULL, "IN2P" }, | 2135 | { "BST2", NULL, "IN2P" }, |
2136 | { "BST2", NULL, "IN2N" }, | 2136 | { "BST2", NULL, "IN2N" }, |
2137 | 2137 | ||
2138 | { "IN1P", NULL, "micbias1" }, | 2138 | { "IN1P", NULL, "MICBIAS1" }, |
2139 | { "IN1N", NULL, "micbias1" }, | 2139 | { "IN1N", NULL, "MICBIAS1" }, |
2140 | { "IN2P", NULL, "micbias1" }, | 2140 | { "IN2P", NULL, "MICBIAS1" }, |
2141 | { "IN2N", NULL, "micbias1" }, | 2141 | { "IN2N", NULL, "MICBIAS1" }, |
2142 | 2142 | ||
2143 | { "ADC 1", NULL, "BST1" }, | 2143 | { "ADC 1", NULL, "BST1" }, |
2144 | { "ADC 1", NULL, "ADC 1 power" }, | 2144 | { "ADC 1", NULL, "ADC 1 power" }, |
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index 9aa1323fb2ab..89c748dd3d6e 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver | 4 | * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver |
5 | * | 5 | * |
6 | * Copyright (C) 2012 ST Microelectronics | 6 | * Copyright (C) 2012 ST Microelectronics |
7 | * Rajeev Kumar <rajeev-dlh.kumar@st.com> | 7 | * Rajeev Kumar <rajeevkumar.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
@@ -426,5 +426,5 @@ static struct i2c_driver sta529_i2c_driver = { | |||
426 | module_i2c_driver(sta529_i2c_driver); | 426 | module_i2c_driver(sta529_i2c_driver); |
427 | 427 | ||
428 | MODULE_DESCRIPTION("ASoC STA529 codec driver"); | 428 | MODULE_DESCRIPTION("ASoC STA529 codec driver"); |
429 | MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | 429 | MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); |
430 | MODULE_LICENSE("GPL"); | 430 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 0f64c7890eed..aea9e1ff9126 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c | |||
@@ -189,46 +189,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = { | |||
189 | /* mclk rate pll: p j d dosr ndac mdac aors nadc madc */ | 189 | /* mclk rate pll: p j d dosr ndac mdac aors nadc madc */ |
190 | /* 8k rate */ | 190 | /* 8k rate */ |
191 | {12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2}, | 191 | {12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2}, |
192 | {12000000, 8000, 1, 8, 1920, 128, 32, 3, 128, 32, 3}, | ||
192 | {24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2}, | 193 | {24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2}, |
193 | {25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2}, | 194 | {25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2}, |
194 | /* 11.025k rate */ | 195 | /* 11.025k rate */ |
195 | {12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2}, | 196 | {12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2}, |
197 | {12000000, 11025, 1, 8, 4672, 128, 24, 3, 128, 24, 3}, | ||
196 | {24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2}, | 198 | {24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2}, |
197 | {25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2}, | 199 | {25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2}, |
198 | /* 16k rate */ | 200 | /* 16k rate */ |
199 | {12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2}, | 201 | {12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2}, |
202 | {12000000, 16000, 1, 8, 1920, 128, 16, 3, 128, 16, 3}, | ||
200 | {24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2}, | 203 | {24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2}, |
201 | {25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2}, | 204 | {25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2}, |
202 | /* 22.05k rate */ | 205 | /* 22.05k rate */ |
203 | {12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2}, | 206 | {12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2}, |
207 | {12000000, 22050, 1, 8, 4672, 128, 12, 3, 128, 12, 3}, | ||
204 | {24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2}, | 208 | {24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2}, |
205 | {25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2}, | 209 | {25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2}, |
206 | /* 32k rate */ | 210 | /* 32k rate */ |
207 | {12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2}, | 211 | {12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2}, |
212 | {12000000, 32000, 1, 8, 1920, 128, 8, 3, 128, 8, 3}, | ||
208 | {24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2}, | 213 | {24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2}, |
209 | {25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2}, | 214 | {25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2}, |
210 | /* 44.1k rate */ | 215 | /* 44.1k rate */ |
211 | {12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2}, | 216 | {12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2}, |
217 | {12000000, 44100, 1, 8, 4672, 128, 6, 3, 128, 6, 3}, | ||
212 | {24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2}, | 218 | {24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2}, |
213 | {25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2}, | 219 | {25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2}, |
214 | /* 48k rate */ | 220 | /* 48k rate */ |
215 | {12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2}, | 221 | {12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2}, |
222 | {12000000, 48000, 1, 7, 6800, 96, 5, 4, 96, 5, 4}, | ||
216 | {24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2}, | 223 | {24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2}, |
217 | {25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2}, | 224 | {25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2}, |
218 | /* 88.2k rate */ | 225 | /* 88.2k rate */ |
219 | {12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2}, | 226 | {12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2}, |
227 | {12000000, 88200, 1, 8, 4672, 64, 6, 3, 64, 6, 3}, | ||
220 | {24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2}, | 228 | {24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2}, |
221 | {25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2}, | 229 | {25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2}, |
222 | /* 96k rate */ | 230 | /* 96k rate */ |
223 | {12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2}, | 231 | {12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2}, |
232 | {12000000, 96000, 1, 7, 6800, 48, 5, 4, 48, 5, 4}, | ||
224 | {24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2}, | 233 | {24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2}, |
225 | {25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2}, | 234 | {25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2}, |
226 | /* 176.4k rate */ | 235 | /* 176.4k rate */ |
227 | {12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2}, | 236 | {12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2}, |
237 | {12000000, 176400, 1, 8, 4672, 32, 6, 3, 32, 6, 3}, | ||
228 | {24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2}, | 238 | {24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2}, |
229 | {25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2}, | 239 | {25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2}, |
230 | /* 192k rate */ | 240 | /* 192k rate */ |
231 | {12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2}, | 241 | {12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2}, |
242 | {12000000, 192000, 1, 7, 6800, 24, 5, 4, 24, 5, 4}, | ||
232 | {24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2}, | 243 | {24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2}, |
233 | {25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2}, | 244 | {25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2}, |
234 | }; | 245 | }; |
@@ -680,7 +691,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, | |||
680 | struct snd_pcm_hw_params *params) | 691 | struct snd_pcm_hw_params *params) |
681 | { | 692 | { |
682 | struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); | 693 | struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); |
694 | int bclk_score = snd_soc_params_to_frame_size(params); | ||
683 | int bclk_n = 0; | 695 | int bclk_n = 0; |
696 | int match = -1; | ||
684 | int i; | 697 | int i; |
685 | 698 | ||
686 | /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */ | 699 | /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */ |
@@ -691,15 +704,37 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, | |||
691 | 704 | ||
692 | for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) { | 705 | for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) { |
693 | if (aic31xx_divs[i].rate == params_rate(params) && | 706 | if (aic31xx_divs[i].rate == params_rate(params) && |
694 | aic31xx_divs[i].mclk == aic31xx->sysclk) | 707 | aic31xx_divs[i].mclk == aic31xx->sysclk) { |
695 | break; | 708 | int s = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) % |
709 | snd_soc_params_to_frame_size(params); | ||
710 | int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) / | ||
711 | snd_soc_params_to_frame_size(params); | ||
712 | if (s < bclk_score && bn > 0) { | ||
713 | match = i; | ||
714 | bclk_n = bn; | ||
715 | bclk_score = s; | ||
716 | } | ||
717 | } | ||
696 | } | 718 | } |
697 | 719 | ||
698 | if (i == ARRAY_SIZE(aic31xx_divs)) { | 720 | if (match == -1) { |
699 | dev_err(codec->dev, "%s: Sampling rate %u not supported\n", | 721 | dev_err(codec->dev, |
722 | "%s: Sample rate (%u) and format not supported\n", | ||
700 | __func__, params_rate(params)); | 723 | __func__, params_rate(params)); |
724 | /* See bellow for details how fix this. */ | ||
701 | return -EINVAL; | 725 | return -EINVAL; |
702 | } | 726 | } |
727 | if (bclk_score != 0) { | ||
728 | dev_warn(codec->dev, "Can not produce exact bitclock"); | ||
729 | /* This is fine if using dsp format, but if using i2s | ||
730 | there may be trouble. To fix the issue edit the | ||
731 | aic31xx_divs table for your mclk and sample | ||
732 | rate. Details can be found from: | ||
733 | http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf | ||
734 | Section: 5.6 CLOCK Generation and PLL | ||
735 | */ | ||
736 | } | ||
737 | i = match; | ||
703 | 738 | ||
704 | /* PLL configuration */ | 739 | /* PLL configuration */ |
705 | snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK, | 740 | snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK, |
@@ -729,14 +764,6 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, | |||
729 | snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr); | 764 | snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr); |
730 | 765 | ||
731 | /* Bit clock divider configuration. */ | 766 | /* Bit clock divider configuration. */ |
732 | bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) | ||
733 | / snd_soc_params_to_frame_size(params); | ||
734 | if (bclk_n == 0) { | ||
735 | dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n", | ||
736 | __func__); | ||
737 | return -EINVAL; | ||
738 | } | ||
739 | |||
740 | snd_soc_update_bits(codec, AIC31XX_BCLKN, | 767 | snd_soc_update_bits(codec, AIC31XX_BCLKN, |
741 | AIC31XX_PLL_MASK, bclk_n); | 768 | AIC31XX_PLL_MASK, bclk_n); |
742 | 769 | ||
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index c28508da34cf..68347b55f6e1 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -403,7 +403,8 @@ out: | |||
403 | return ret; | 403 | return ret; |
404 | } | 404 | } |
405 | 405 | ||
406 | static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div) | 406 | static int __davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, |
407 | int div, bool explicit) | ||
407 | { | 408 | { |
408 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); | 409 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); |
409 | 410 | ||
@@ -420,7 +421,8 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div | |||
420 | ACLKXDIV(div - 1), ACLKXDIV_MASK); | 421 | ACLKXDIV(div - 1), ACLKXDIV_MASK); |
421 | mcasp_mod_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, | 422 | mcasp_mod_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, |
422 | ACLKRDIV(div - 1), ACLKRDIV_MASK); | 423 | ACLKRDIV(div - 1), ACLKRDIV_MASK); |
423 | mcasp->bclk_div = div; | 424 | if (explicit) |
425 | mcasp->bclk_div = div; | ||
424 | break; | 426 | break; |
425 | 427 | ||
426 | case 2: /* BCLK/LRCLK ratio */ | 428 | case 2: /* BCLK/LRCLK ratio */ |
@@ -434,6 +436,12 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div | |||
434 | return 0; | 436 | return 0; |
435 | } | 437 | } |
436 | 438 | ||
439 | static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, | ||
440 | int div) | ||
441 | { | ||
442 | return __davinci_mcasp_set_clkdiv(dai, div_id, div, 1); | ||
443 | } | ||
444 | |||
437 | static int davinci_mcasp_set_sysclk(struct snd_soc_dai *dai, int clk_id, | 445 | static int davinci_mcasp_set_sysclk(struct snd_soc_dai *dai, int clk_id, |
438 | unsigned int freq, int dir) | 446 | unsigned int freq, int dir) |
439 | { | 447 | { |
@@ -459,8 +467,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp, | |||
459 | { | 467 | { |
460 | u32 fmt; | 468 | u32 fmt; |
461 | u32 tx_rotate = (word_length / 4) & 0x7; | 469 | u32 tx_rotate = (word_length / 4) & 0x7; |
462 | u32 rx_rotate = (32 - word_length) / 4; | ||
463 | u32 mask = (1ULL << word_length) - 1; | 470 | u32 mask = (1ULL << word_length) - 1; |
471 | /* | ||
472 | * For captured data we should not rotate, inversion and masking is | ||
473 | * enoguh to get the data to the right position: | ||
474 | * Format data from bus after reverse (XRBUF) | ||
475 | * S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB| | ||
476 | * S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| | ||
477 | * S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| | ||
478 | * S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB| | ||
479 | */ | ||
480 | u32 rx_rotate = 0; | ||
464 | 481 | ||
465 | /* | 482 | /* |
466 | * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() | 483 | * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() |
@@ -738,7 +755,7 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, | |||
738 | "Inaccurate BCLK: %u Hz / %u != %u Hz\n", | 755 | "Inaccurate BCLK: %u Hz / %u != %u Hz\n", |
739 | mcasp->sysclk_freq, div, bclk_freq); | 756 | mcasp->sysclk_freq, div, bclk_freq); |
740 | } | 757 | } |
741 | davinci_mcasp_set_clkdiv(cpu_dai, 1, div); | 758 | __davinci_mcasp_set_clkdiv(cpu_dai, 1, div, 0); |
742 | } | 759 | } |
743 | 760 | ||
744 | ret = mcasp_common_hw_param(mcasp, substream->stream, | 761 | ret = mcasp_common_hw_param(mcasp, substream->stream, |
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index 25c31f1655f6..e961388e6e9c 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * sound/soc/dwc/designware_i2s.c | 4 | * sound/soc/dwc/designware_i2s.c |
5 | * | 5 | * |
6 | * Copyright (C) 2010 ST Microelectronics | 6 | * Copyright (C) 2010 ST Microelectronics |
7 | * Rajeev Kumar <rajeev-dlh.kumar@st.com> | 7 | * Rajeev Kumar <rajeevkumar.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
@@ -455,7 +455,7 @@ static struct platform_driver dw_i2s_driver = { | |||
455 | 455 | ||
456 | module_platform_driver(dw_i2s_driver); | 456 | module_platform_driver(dw_i2s_driver); |
457 | 457 | ||
458 | MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | 458 | MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); |
459 | MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface"); | 459 | MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface"); |
460 | MODULE_LICENSE("GPL"); | 460 | MODULE_LICENSE("GPL"); |
461 | MODULE_ALIAS("platform:designware_i2s"); | 461 | MODULE_ALIAS("platform:designware_i2s"); |
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index f54a8fc99291..f3012b645b51 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig | |||
@@ -49,7 +49,6 @@ config SND_SOC_FSL_ESAI | |||
49 | tristate "Enhanced Serial Audio Interface (ESAI) module support" | 49 | tristate "Enhanced Serial Audio Interface (ESAI) module support" |
50 | select REGMAP_MMIO | 50 | select REGMAP_MMIO |
51 | select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n | 51 | select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n |
52 | select SND_SOC_FSL_UTILS | ||
53 | help | 52 | help |
54 | Say Y if you want to add Enhanced Synchronous Audio Interface | 53 | Say Y if you want to add Enhanced Synchronous Audio Interface |
55 | (ESAI) support for the Freescale CPUs. | 54 | (ESAI) support for the Freescale CPUs. |
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index 72d154e7dd03..a3b29ed84963 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | #include "fsl_esai.h" | 19 | #include "fsl_esai.h" |
20 | #include "imx-pcm.h" | 20 | #include "imx-pcm.h" |
21 | #include "fsl_utils.h" | ||
22 | 21 | ||
23 | #define FSL_ESAI_RATES SNDRV_PCM_RATE_8000_192000 | 22 | #define FSL_ESAI_RATES SNDRV_PCM_RATE_8000_192000 |
24 | #define FSL_ESAI_FORMATS (SNDRV_PCM_FMTBIT_S8 | \ | 23 | #define FSL_ESAI_FORMATS (SNDRV_PCM_FMTBIT_S8 | \ |
@@ -607,7 +606,6 @@ static struct snd_soc_dai_ops fsl_esai_dai_ops = { | |||
607 | .hw_params = fsl_esai_hw_params, | 606 | .hw_params = fsl_esai_hw_params, |
608 | .set_sysclk = fsl_esai_set_dai_sysclk, | 607 | .set_sysclk = fsl_esai_set_dai_sysclk, |
609 | .set_fmt = fsl_esai_set_dai_fmt, | 608 | .set_fmt = fsl_esai_set_dai_fmt, |
610 | .xlate_tdm_slot_mask = fsl_asoc_xlate_tdm_slot_mask, | ||
611 | .set_tdm_slot = fsl_esai_set_dai_tdm_slot, | 609 | .set_tdm_slot = fsl_esai_set_dai_tdm_slot, |
612 | }; | 610 | }; |
613 | 611 | ||
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 159e517fa09a..cef7776b712c 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -481,12 +481,19 @@ static int asoc_simple_card_probe(struct platform_device *pdev) | |||
481 | snd_soc_card_set_drvdata(&priv->snd_card, priv); | 481 | snd_soc_card_set_drvdata(&priv->snd_card, priv); |
482 | 482 | ||
483 | ret = devm_snd_soc_register_card(&pdev->dev, &priv->snd_card); | 483 | ret = devm_snd_soc_register_card(&pdev->dev, &priv->snd_card); |
484 | if (ret >= 0) | ||
485 | return ret; | ||
484 | 486 | ||
485 | err: | 487 | err: |
486 | asoc_simple_card_unref(pdev); | 488 | asoc_simple_card_unref(pdev); |
487 | return ret; | 489 | return ret; |
488 | } | 490 | } |
489 | 491 | ||
492 | static int asoc_simple_card_remove(struct platform_device *pdev) | ||
493 | { | ||
494 | return asoc_simple_card_unref(pdev); | ||
495 | } | ||
496 | |||
490 | static const struct of_device_id asoc_simple_of_match[] = { | 497 | static const struct of_device_id asoc_simple_of_match[] = { |
491 | { .compatible = "simple-audio-card", }, | 498 | { .compatible = "simple-audio-card", }, |
492 | {}, | 499 | {}, |
@@ -500,6 +507,7 @@ static struct platform_driver asoc_simple_card = { | |||
500 | .of_match_table = asoc_simple_of_match, | 507 | .of_match_table = asoc_simple_of_match, |
501 | }, | 508 | }, |
502 | .probe = asoc_simple_card_probe, | 509 | .probe = asoc_simple_card_probe, |
510 | .remove = asoc_simple_card_remove, | ||
503 | }; | 511 | }; |
504 | 512 | ||
505 | module_platform_driver(asoc_simple_card); | 513 | module_platform_driver(asoc_simple_card); |
diff --git a/sound/soc/intel/sst-acpi.c b/sound/soc/intel/sst-acpi.c index 42edc6f4fc4a..03d0a166b635 100644 --- a/sound/soc/intel/sst-acpi.c +++ b/sound/soc/intel/sst-acpi.c | |||
@@ -246,8 +246,8 @@ static struct sst_acpi_desc sst_acpi_broadwell_desc = { | |||
246 | }; | 246 | }; |
247 | 247 | ||
248 | static struct sst_acpi_mach baytrail_machines[] = { | 248 | static struct sst_acpi_mach baytrail_machines[] = { |
249 | { "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-i2s_master" }, | 249 | { "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master" }, |
250 | { "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-i2s_master" }, | 250 | { "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master" }, |
251 | {} | 251 | {} |
252 | }; | 252 | }; |
253 | 253 | ||
diff --git a/sound/soc/intel/sst-baytrail-ipc.c b/sound/soc/intel/sst-baytrail-ipc.c index 67673a2c0f41..b4ad98c43e5c 100644 --- a/sound/soc/intel/sst-baytrail-ipc.c +++ b/sound/soc/intel/sst-baytrail-ipc.c | |||
@@ -817,7 +817,7 @@ static struct sst_dsp_device byt_dev = { | |||
817 | .ops = &sst_byt_ops, | 817 | .ops = &sst_byt_ops, |
818 | }; | 818 | }; |
819 | 819 | ||
820 | int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata) | 820 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata) |
821 | { | 821 | { |
822 | struct sst_byt *byt = pdata->dsp; | 822 | struct sst_byt *byt = pdata->dsp; |
823 | 823 | ||
@@ -826,14 +826,6 @@ int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata) | |||
826 | sst_byt_drop_all(byt); | 826 | sst_byt_drop_all(byt); |
827 | dev_dbg(byt->dev, "dsp in reset\n"); | 827 | dev_dbg(byt->dev, "dsp in reset\n"); |
828 | 828 | ||
829 | return 0; | ||
830 | } | ||
831 | EXPORT_SYMBOL_GPL(sst_byt_dsp_suspend_noirq); | ||
832 | |||
833 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata) | ||
834 | { | ||
835 | struct sst_byt *byt = pdata->dsp; | ||
836 | |||
837 | dev_dbg(byt->dev, "free all blocks and unload fw\n"); | 829 | dev_dbg(byt->dev, "free all blocks and unload fw\n"); |
838 | sst_fw_unload(byt->fw); | 830 | sst_fw_unload(byt->fw); |
839 | 831 | ||
diff --git a/sound/soc/intel/sst-baytrail-ipc.h b/sound/soc/intel/sst-baytrail-ipc.h index 06a4d202689b..8faff6dcf25d 100644 --- a/sound/soc/intel/sst-baytrail-ipc.h +++ b/sound/soc/intel/sst-baytrail-ipc.h | |||
@@ -66,7 +66,6 @@ int sst_byt_get_dsp_position(struct sst_byt *byt, | |||
66 | int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata); | 66 | int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata); |
67 | void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata); | 67 | void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata); |
68 | struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt); | 68 | struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt); |
69 | int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata); | ||
70 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata); | 69 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata); |
71 | int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata); | 70 | int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata); |
72 | int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata); | 71 | int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata); |
diff --git a/sound/soc/intel/sst-baytrail-pcm.c b/sound/soc/intel/sst-baytrail-pcm.c index 599401c0c655..eab1c7d85187 100644 --- a/sound/soc/intel/sst-baytrail-pcm.c +++ b/sound/soc/intel/sst-baytrail-pcm.c | |||
@@ -59,6 +59,9 @@ struct sst_byt_priv_data { | |||
59 | 59 | ||
60 | /* DAI data */ | 60 | /* DAI data */ |
61 | struct sst_byt_pcm_data pcm[BYT_PCM_COUNT]; | 61 | struct sst_byt_pcm_data pcm[BYT_PCM_COUNT]; |
62 | |||
63 | /* flag indicating is stream context restore needed after suspend */ | ||
64 | bool restore_stream; | ||
62 | }; | 65 | }; |
63 | 66 | ||
64 | /* this may get called several times by oss emulation */ | 67 | /* this may get called several times by oss emulation */ |
@@ -184,7 +187,10 @@ static int sst_byt_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
184 | sst_byt_stream_start(byt, pcm_data->stream, 0); | 187 | sst_byt_stream_start(byt, pcm_data->stream, 0); |
185 | break; | 188 | break; |
186 | case SNDRV_PCM_TRIGGER_RESUME: | 189 | case SNDRV_PCM_TRIGGER_RESUME: |
187 | schedule_work(&pcm_data->work); | 190 | if (pdata->restore_stream == true) |
191 | schedule_work(&pcm_data->work); | ||
192 | else | ||
193 | sst_byt_stream_resume(byt, pcm_data->stream); | ||
188 | break; | 194 | break; |
189 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 195 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
190 | sst_byt_stream_resume(byt, pcm_data->stream); | 196 | sst_byt_stream_resume(byt, pcm_data->stream); |
@@ -193,6 +199,7 @@ static int sst_byt_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
193 | sst_byt_stream_stop(byt, pcm_data->stream); | 199 | sst_byt_stream_stop(byt, pcm_data->stream); |
194 | break; | 200 | break; |
195 | case SNDRV_PCM_TRIGGER_SUSPEND: | 201 | case SNDRV_PCM_TRIGGER_SUSPEND: |
202 | pdata->restore_stream = false; | ||
196 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 203 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
197 | sst_byt_stream_pause(byt, pcm_data->stream); | 204 | sst_byt_stream_pause(byt, pcm_data->stream); |
198 | break; | 205 | break; |
@@ -404,26 +411,10 @@ static const struct snd_soc_component_driver byt_dai_component = { | |||
404 | }; | 411 | }; |
405 | 412 | ||
406 | #ifdef CONFIG_PM | 413 | #ifdef CONFIG_PM |
407 | static int sst_byt_pcm_dev_suspend_noirq(struct device *dev) | ||
408 | { | ||
409 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); | ||
410 | int ret; | ||
411 | |||
412 | dev_dbg(dev, "suspending noirq\n"); | ||
413 | |||
414 | /* at this point all streams will be stopped and context saved */ | ||
415 | ret = sst_byt_dsp_suspend_noirq(dev, sst_pdata); | ||
416 | if (ret < 0) { | ||
417 | dev_err(dev, "failed to suspend %d\n", ret); | ||
418 | return ret; | ||
419 | } | ||
420 | |||
421 | return ret; | ||
422 | } | ||
423 | |||
424 | static int sst_byt_pcm_dev_suspend_late(struct device *dev) | 414 | static int sst_byt_pcm_dev_suspend_late(struct device *dev) |
425 | { | 415 | { |
426 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); | 416 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); |
417 | struct sst_byt_priv_data *priv_data = dev_get_drvdata(dev); | ||
427 | int ret; | 418 | int ret; |
428 | 419 | ||
429 | dev_dbg(dev, "suspending late\n"); | 420 | dev_dbg(dev, "suspending late\n"); |
@@ -434,34 +425,30 @@ static int sst_byt_pcm_dev_suspend_late(struct device *dev) | |||
434 | return ret; | 425 | return ret; |
435 | } | 426 | } |
436 | 427 | ||
428 | priv_data->restore_stream = true; | ||
429 | |||
437 | return ret; | 430 | return ret; |
438 | } | 431 | } |
439 | 432 | ||
440 | static int sst_byt_pcm_dev_resume_early(struct device *dev) | 433 | static int sst_byt_pcm_dev_resume_early(struct device *dev) |
441 | { | 434 | { |
442 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); | 435 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); |
436 | int ret; | ||
443 | 437 | ||
444 | dev_dbg(dev, "resume early\n"); | 438 | dev_dbg(dev, "resume early\n"); |
445 | 439 | ||
446 | /* load fw and boot DSP */ | 440 | /* load fw and boot DSP */ |
447 | return sst_byt_dsp_boot(dev, sst_pdata); | 441 | ret = sst_byt_dsp_boot(dev, sst_pdata); |
448 | } | 442 | if (ret) |
449 | 443 | return ret; | |
450 | static int sst_byt_pcm_dev_resume(struct device *dev) | ||
451 | { | ||
452 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); | ||
453 | |||
454 | dev_dbg(dev, "resume\n"); | ||
455 | 444 | ||
456 | /* wait for FW to finish booting */ | 445 | /* wait for FW to finish booting */ |
457 | return sst_byt_dsp_wait_for_ready(dev, sst_pdata); | 446 | return sst_byt_dsp_wait_for_ready(dev, sst_pdata); |
458 | } | 447 | } |
459 | 448 | ||
460 | static const struct dev_pm_ops sst_byt_pm_ops = { | 449 | static const struct dev_pm_ops sst_byt_pm_ops = { |
461 | .suspend_noirq = sst_byt_pcm_dev_suspend_noirq, | ||
462 | .suspend_late = sst_byt_pcm_dev_suspend_late, | 450 | .suspend_late = sst_byt_pcm_dev_suspend_late, |
463 | .resume_early = sst_byt_pcm_dev_resume_early, | 451 | .resume_early = sst_byt_pcm_dev_resume_early, |
464 | .resume = sst_byt_pcm_dev_resume, | ||
465 | }; | 452 | }; |
466 | 453 | ||
467 | #define SST_BYT_PM_OPS (&sst_byt_pm_ops) | 454 | #define SST_BYT_PM_OPS (&sst_byt_pm_ops) |
diff --git a/sound/soc/omap/omap-twl4030.c b/sound/soc/omap/omap-twl4030.c index f8a6adc2d81c..4336d1831485 100644 --- a/sound/soc/omap/omap-twl4030.c +++ b/sound/soc/omap/omap-twl4030.c | |||
@@ -260,7 +260,7 @@ static struct snd_soc_dai_link omap_twl4030_dai_links[] = { | |||
260 | .stream_name = "TWL4030 Voice", | 260 | .stream_name = "TWL4030 Voice", |
261 | .cpu_dai_name = "omap-mcbsp.3", | 261 | .cpu_dai_name = "omap-mcbsp.3", |
262 | .codec_dai_name = "twl4030-voice", | 262 | .codec_dai_name = "twl4030-voice", |
263 | .platform_name = "omap-mcbsp.2", | 263 | .platform_name = "omap-mcbsp.3", |
264 | .codec_name = "twl4030-codec", | 264 | .codec_name = "twl4030-codec", |
265 | .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | | 265 | .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | |
266 | SND_SOC_DAIFMT_CBM_CFM, | 266 | SND_SOC_DAIFMT_CBM_CFM, |
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 0109f6c2334e..a8e097433074 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c | |||
@@ -765,9 +765,7 @@ static int pxa_ssp_remove(struct snd_soc_dai *dai) | |||
765 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ | 765 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ |
766 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) | 766 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) |
767 | 767 | ||
768 | #define PXA_SSP_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ | 768 | #define PXA_SSP_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) |
769 | SNDRV_PCM_FMTBIT_S24_LE | \ | ||
770 | SNDRV_PCM_FMTBIT_S32_LE) | ||
771 | 769 | ||
772 | static const struct snd_soc_dai_ops pxa_ssp_dai_ops = { | 770 | static const struct snd_soc_dai_ops pxa_ssp_dai_ops = { |
773 | .startup = pxa_ssp_startup, | 771 | .startup = pxa_ssp_startup, |
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 8d8e4b59049f..fb9e05c9f471 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c | |||
@@ -165,13 +165,14 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, | |||
165 | struct rk_i2s_dev *i2s = to_info(cpu_dai); | 165 | struct rk_i2s_dev *i2s = to_info(cpu_dai); |
166 | unsigned int mask = 0, val = 0; | 166 | unsigned int mask = 0, val = 0; |
167 | 167 | ||
168 | mask = I2S_CKR_MSS_SLAVE; | 168 | mask = I2S_CKR_MSS_MASK; |
169 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 169 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
170 | case SND_SOC_DAIFMT_CBS_CFS: | 170 | case SND_SOC_DAIFMT_CBS_CFS: |
171 | val = I2S_CKR_MSS_SLAVE; | 171 | /* Set source clock in Master mode */ |
172 | val = I2S_CKR_MSS_MASTER; | ||
172 | break; | 173 | break; |
173 | case SND_SOC_DAIFMT_CBM_CFM: | 174 | case SND_SOC_DAIFMT_CBM_CFM: |
174 | val = I2S_CKR_MSS_MASTER; | 175 | val = I2S_CKR_MSS_SLAVE; |
175 | break; | 176 | break; |
176 | default: | 177 | default: |
177 | return -EINVAL; | 178 | return -EINVAL; |
@@ -361,6 +362,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) | |||
361 | case I2S_XFER: | 362 | case I2S_XFER: |
362 | case I2S_CLR: | 363 | case I2S_CLR: |
363 | case I2S_RXDR: | 364 | case I2S_RXDR: |
365 | case I2S_FIFOLR: | ||
366 | case I2S_INTSR: | ||
364 | return true; | 367 | return true; |
365 | default: | 368 | default: |
366 | return false; | 369 | return false; |
@@ -370,8 +373,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg) | |||
370 | static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) | 373 | static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) |
371 | { | 374 | { |
372 | switch (reg) { | 375 | switch (reg) { |
373 | case I2S_FIFOLR: | ||
374 | case I2S_INTSR: | 376 | case I2S_INTSR: |
377 | case I2S_CLR: | ||
375 | return true; | 378 | return true; |
376 | default: | 379 | default: |
377 | return false; | 380 | return false; |
@@ -381,8 +384,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg) | |||
381 | static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg) | 384 | static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg) |
382 | { | 385 | { |
383 | switch (reg) { | 386 | switch (reg) { |
384 | case I2S_FIFOLR: | ||
385 | return true; | ||
386 | default: | 387 | default: |
387 | return false; | 388 | return false; |
388 | } | 389 | } |
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 03eec22f0f46..9d513473b300 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -462,7 +462,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, | |||
462 | if (dir == SND_SOC_CLOCK_IN) | 462 | if (dir == SND_SOC_CLOCK_IN) |
463 | rfs = 0; | 463 | rfs = 0; |
464 | 464 | ||
465 | if ((rfs && other->rfs && (other->rfs != rfs)) || | 465 | if ((rfs && other && other->rfs && (other->rfs != rfs)) || |
466 | (any_active(i2s) && | 466 | (any_active(i2s) && |
467 | (((dir == SND_SOC_CLOCK_IN) | 467 | (((dir == SND_SOC_CLOCK_IN) |
468 | && !(mod & MOD_CDCLKCON)) || | 468 | && !(mod & MOD_CDCLKCON)) || |
@@ -762,7 +762,8 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, | |||
762 | } else { | 762 | } else { |
763 | u32 mod = readl(i2s->addr + I2SMOD); | 763 | u32 mod = readl(i2s->addr + I2SMOD); |
764 | i2s->cdclk_out = !(mod & MOD_CDCLKCON); | 764 | i2s->cdclk_out = !(mod & MOD_CDCLKCON); |
765 | other->cdclk_out = i2s->cdclk_out; | 765 | if (other) |
766 | other->cdclk_out = i2s->cdclk_out; | ||
766 | } | 767 | } |
767 | /* Reset any constraint on RFS and BFS */ | 768 | /* Reset any constraint on RFS and BFS */ |
768 | i2s->rfs = 0; | 769 | i2s->rfs = 0; |
diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 3fdf3be7b99a..f95e7ab135e8 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c | |||
@@ -247,7 +247,7 @@ rsnd_gen2_dma_addr(struct rsnd_priv *priv, | |||
247 | }; | 247 | }; |
248 | 248 | ||
249 | /* it shouldn't happen */ | 249 | /* it shouldn't happen */ |
250 | if (use_dvc & !use_src) | 250 | if (use_dvc && !use_src) |
251 | dev_err(dev, "DVC is selected without SRC\n"); | 251 | dev_err(dev, "DVC is selected without SRC\n"); |
252 | 252 | ||
253 | /* use SSIU or SSI ? */ | 253 | /* use SSIU or SSI ? */ |
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index 27c06acce205..3092b58fede6 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c | |||
@@ -101,7 +101,11 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) | |||
101 | 101 | ||
102 | fe->dpcm[stream].runtime = fe_substream->runtime; | 102 | fe->dpcm[stream].runtime = fe_substream->runtime; |
103 | 103 | ||
104 | if (dpcm_path_get(fe, stream, &list) <= 0) { | 104 | ret = dpcm_path_get(fe, stream, &list); |
105 | if (ret < 0) { | ||
106 | mutex_unlock(&fe->card->mutex); | ||
107 | goto fe_err; | ||
108 | } else if (ret == 0) { | ||
105 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", | 109 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", |
106 | fe->dai_link->name, stream ? "capture" : "playback"); | 110 | fe->dai_link->name, stream ? "capture" : "playback"); |
107 | } | 111 | } |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d4bfd4a9076f..889f4e3d35dc 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1325,7 +1325,7 @@ static int soc_post_component_init(struct snd_soc_pcm_runtime *rtd, | |||
1325 | device_initialize(rtd->dev); | 1325 | device_initialize(rtd->dev); |
1326 | rtd->dev->parent = rtd->card->dev; | 1326 | rtd->dev->parent = rtd->card->dev; |
1327 | rtd->dev->release = rtd_release; | 1327 | rtd->dev->release = rtd_release; |
1328 | rtd->dev->init_name = name; | 1328 | dev_set_name(rtd->dev, "%s", name); |
1329 | dev_set_drvdata(rtd->dev, rtd); | 1329 | dev_set_drvdata(rtd->dev, rtd); |
1330 | mutex_init(&rtd->pcm_mutex); | 1330 | mutex_init(&rtd->pcm_mutex); |
1331 | INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_PLAYBACK].be_clients); | 1331 | INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_PLAYBACK].be_clients); |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 8348352dc2c6..177bd8639ef9 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2860,12 +2860,14 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, | |||
2860 | struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); | 2860 | struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); |
2861 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; | 2861 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
2862 | unsigned int reg_val, val; | 2862 | unsigned int reg_val, val; |
2863 | int ret = 0; | ||
2864 | 2863 | ||
2865 | if (e->reg != SND_SOC_NOPM) | 2864 | if (e->reg != SND_SOC_NOPM) { |
2866 | ret = soc_dapm_read(dapm, e->reg, ®_val); | 2865 | int ret = soc_dapm_read(dapm, e->reg, ®_val); |
2867 | else | 2866 | if (ret) |
2867 | return ret; | ||
2868 | } else { | ||
2868 | reg_val = dapm_kcontrol_get_value(kcontrol); | 2869 | reg_val = dapm_kcontrol_get_value(kcontrol); |
2870 | } | ||
2869 | 2871 | ||
2870 | val = (reg_val >> e->shift_l) & e->mask; | 2872 | val = (reg_val >> e->shift_l) & e->mask; |
2871 | ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(e, val); | 2873 | ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(e, val); |
@@ -2875,7 +2877,7 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, | |||
2875 | ucontrol->value.enumerated.item[1] = val; | 2877 | ucontrol->value.enumerated.item[1] = val; |
2876 | } | 2878 | } |
2877 | 2879 | ||
2878 | return ret; | 2880 | return 0; |
2879 | } | 2881 | } |
2880 | EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_double); | 2882 | EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_double); |
2881 | 2883 | ||
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 731fdb5b5f9b..642c86240752 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -2352,7 +2352,11 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream) | |||
2352 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); | 2352 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); |
2353 | fe->dpcm[stream].runtime = fe_substream->runtime; | 2353 | fe->dpcm[stream].runtime = fe_substream->runtime; |
2354 | 2354 | ||
2355 | if (dpcm_path_get(fe, stream, &list) <= 0) { | 2355 | ret = dpcm_path_get(fe, stream, &list); |
2356 | if (ret < 0) { | ||
2357 | mutex_unlock(&fe->card->mutex); | ||
2358 | return ret; | ||
2359 | } else if (ret == 0) { | ||
2356 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", | 2360 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", |
2357 | fe->dai_link->name, stream ? "capture" : "playback"); | 2361 | fe->dai_link->name, stream ? "capture" : "playback"); |
2358 | } | 2362 | } |
diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c index 0e5a8f35d0ad..a7dc3c56f44d 100644 --- a/sound/soc/spear/spear_pcm.c +++ b/sound/soc/spear/spear_pcm.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * sound/soc/spear/spear_pcm.c | 4 | * sound/soc/spear/spear_pcm.c |
5 | * | 5 | * |
6 | * Copyright (C) 2012 ST Microelectronics | 6 | * Copyright (C) 2012 ST Microelectronics |
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | 7 | * Rajeev Kumar<rajeevkumar.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
@@ -50,6 +50,6 @@ int devm_spear_pcm_platform_register(struct device *dev, | |||
50 | } | 50 | } |
51 | EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register); | 51 | EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register); |
52 | 52 | ||
53 | MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>"); | 53 | MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>"); |
54 | MODULE_DESCRIPTION("SPEAr PCM DMA module"); | 54 | MODULE_DESCRIPTION("SPEAr PCM DMA module"); |
55 | MODULE_LICENSE("GPL"); | 55 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/tegra/tegra_asoc_utils.h b/sound/soc/tegra/tegra_asoc_utils.h index 9577121ce971..ca8037634100 100644 --- a/sound/soc/tegra/tegra_asoc_utils.h +++ b/sound/soc/tegra/tegra_asoc_utils.h | |||
@@ -21,7 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef __TEGRA_ASOC_UTILS_H__ | 23 | #ifndef __TEGRA_ASOC_UTILS_H__ |
24 | #define __TEGRA_ASOC_UTILS_H_ | 24 | #define __TEGRA_ASOC_UTILS_H__ |
25 | 25 | ||
26 | struct clk; | 26 | struct clk; |
27 | struct device; | 27 | struct device; |