aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-09-24 14:48:01 -0400
committerTakashi Iwai <tiwai@suse.de>2015-09-24 14:48:01 -0400
commit1ce3cbe2ab4074ca5196e74a45665a2cd87bbdb1 (patch)
tree1a0bdcb031aa30ea05cbe4aa48d0ac6007b033a2
parent83510441bc08bee201c0ded9d81da6dfd008d69a (diff)
parented14ee0eea8b6808025356cecc87a8007885263f (diff)
Merge tag 'asoc-fix-v4.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.3 A disappointingly large set of fixes, though none of them very big and very widely spread over many different drivers. Nothing especially stands out, it's mostly all device specific and relatively minor.
-rw-r--r--MAINTAINERS9
-rw-r--r--sound/arm/Kconfig15
-rw-r--r--sound/soc/au1x/psc-i2s.c1
-rw-r--r--sound/soc/codecs/rt5645.c22
-rw-r--r--sound/soc/codecs/wm0010.c23
-rw-r--r--sound/soc/codecs/wm8960.c26
-rw-r--r--sound/soc/codecs/wm8962.c3
-rw-r--r--sound/soc/davinci/davinci-mcasp.c14
-rw-r--r--sound/soc/fsl/fsl-asoc-card.c3
-rw-r--r--sound/soc/fsl/fsl_ssi.c5
-rw-r--r--sound/soc/intel/haswell/sst-haswell-ipc.c20
-rw-r--r--sound/soc/mediatek/mtk-afe-pcm.c17
-rw-r--r--sound/soc/pxa/Kconfig2
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c4
-rw-r--r--sound/soc/soc-dapm.c2
-rw-r--r--sound/soc/soc-utils.c9
-rw-r--r--sound/soc/spear/Kconfig2
-rw-r--r--sound/soc/sti/uniperif_player.c14
-rw-r--r--sound/soc/sti/uniperif_reader.c6
19 files changed, 122 insertions, 75 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 274f85405584..0581f47e959b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11239,7 +11239,6 @@ VOLTAGE AND CURRENT REGULATOR FRAMEWORK
11239M: Liam Girdwood <lgirdwood@gmail.com> 11239M: Liam Girdwood <lgirdwood@gmail.com>
11240M: Mark Brown <broonie@kernel.org> 11240M: Mark Brown <broonie@kernel.org>
11241L: linux-kernel@vger.kernel.org 11241L: linux-kernel@vger.kernel.org
11242W: http://opensource.wolfsonmicro.com/node/15
11243W: http://www.slimlogic.co.uk/?p=48 11242W: http://www.slimlogic.co.uk/?p=48
11244T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 11243T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
11245S: Supported 11244S: Supported
@@ -11368,17 +11367,15 @@ WM97XX TOUCHSCREEN DRIVERS
11368M: Mark Brown <broonie@kernel.org> 11367M: Mark Brown <broonie@kernel.org>
11369M: Liam Girdwood <lrg@slimlogic.co.uk> 11368M: Liam Girdwood <lrg@slimlogic.co.uk>
11370L: linux-input@vger.kernel.org 11369L: linux-input@vger.kernel.org
11371T: git git://opensource.wolfsonmicro.com/linux-2.6-touch 11370W: https://github.com/CirrusLogic/linux-drivers/wiki
11372W: http://opensource.wolfsonmicro.com/node/7
11373S: Supported 11371S: Supported
11374F: drivers/input/touchscreen/*wm97* 11372F: drivers/input/touchscreen/*wm97*
11375F: include/linux/wm97xx.h 11373F: include/linux/wm97xx.h
11376 11374
11377WOLFSON MICROELECTRONICS DRIVERS 11375WOLFSON MICROELECTRONICS DRIVERS
11378L: patches@opensource.wolfsonmicro.com 11376L: patches@opensource.wolfsonmicro.com
11379T: git git://opensource.wolfsonmicro.com/linux-2.6-asoc 11377T: git https://github.com/CirrusLogic/linux-drivers.git
11380T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus 11378W: https://github.com/CirrusLogic/linux-drivers/wiki
11381W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
11382S: Supported 11379S: Supported
11383F: Documentation/hwmon/wm83?? 11380F: Documentation/hwmon/wm83??
11384F: arch/arm/mach-s3c64xx/mach-crag6410* 11381F: arch/arm/mach-s3c64xx/mach-crag6410*
diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig
index 885683a3b0bd..e0406211716b 100644
--- a/sound/arm/Kconfig
+++ b/sound/arm/Kconfig
@@ -9,6 +9,14 @@ menuconfig SND_ARM
9 Drivers that are implemented on ASoC can be found in 9 Drivers that are implemented on ASoC can be found in
10 "ALSA for SoC audio support" section. 10 "ALSA for SoC audio support" section.
11 11
12config SND_PXA2XX_LIB
13 tristate
14 select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
15 select SND_DMAENGINE_PCM
16
17config SND_PXA2XX_LIB_AC97
18 bool
19
12if SND_ARM 20if SND_ARM
13 21
14config SND_ARMAACI 22config SND_ARMAACI
@@ -21,13 +29,6 @@ config SND_PXA2XX_PCM
21 tristate 29 tristate
22 select SND_PCM 30 select SND_PCM
23 31
24config SND_PXA2XX_LIB
25 tristate
26 select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
27
28config SND_PXA2XX_LIB_AC97
29 bool
30
31config SND_PXA2XX_AC97 32config SND_PXA2XX_AC97
32 tristate "AC97 driver for the Intel PXA2xx chip" 33 tristate "AC97 driver for the Intel PXA2xx chip"
33 depends on ARCH_PXA 34 depends on ARCH_PXA
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c
index 38e853add96e..0bf9d62b91a0 100644
--- a/sound/soc/au1x/psc-i2s.c
+++ b/sound/soc/au1x/psc-i2s.c
@@ -296,7 +296,6 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
296{ 296{
297 struct resource *iores, *dmares; 297 struct resource *iores, *dmares;
298 unsigned long sel; 298 unsigned long sel;
299 int ret;
300 struct au1xpsc_audio_data *wd; 299 struct au1xpsc_audio_data *wd;
301 300
302 wd = devm_kzalloc(&pdev->dev, sizeof(struct au1xpsc_audio_data), 301 wd = devm_kzalloc(&pdev->dev, sizeof(struct au1xpsc_audio_data),
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 4972bf3efa91..268a28bd1df4 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -732,14 +732,14 @@ static const struct snd_kcontrol_new rt5645_mono_adc_r_mix[] = {
732static const struct snd_kcontrol_new rt5645_dac_l_mix[] = { 732static const struct snd_kcontrol_new rt5645_dac_l_mix[] = {
733 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER, 733 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER,
734 RT5645_M_ADCMIX_L_SFT, 1, 1), 734 RT5645_M_ADCMIX_L_SFT, 1, 1),
735 SOC_DAPM_SINGLE("DAC1 Switch", RT5645_AD_DA_MIXER, 735 SOC_DAPM_SINGLE_AUTODISABLE("DAC1 Switch", RT5645_AD_DA_MIXER,
736 RT5645_M_DAC1_L_SFT, 1, 1), 736 RT5645_M_DAC1_L_SFT, 1, 1),
737}; 737};
738 738
739static const struct snd_kcontrol_new rt5645_dac_r_mix[] = { 739static const struct snd_kcontrol_new rt5645_dac_r_mix[] = {
740 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER, 740 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER,
741 RT5645_M_ADCMIX_R_SFT, 1, 1), 741 RT5645_M_ADCMIX_R_SFT, 1, 1),
742 SOC_DAPM_SINGLE("DAC1 Switch", RT5645_AD_DA_MIXER, 742 SOC_DAPM_SINGLE_AUTODISABLE("DAC1 Switch", RT5645_AD_DA_MIXER,
743 RT5645_M_DAC1_R_SFT, 1, 1), 743 RT5645_M_DAC1_R_SFT, 1, 1),
744}; 744};
745 745
@@ -1381,7 +1381,7 @@ static void hp_amp_power(struct snd_soc_codec *codec, int on)
1381 regmap_write(rt5645->regmap, RT5645_PR_BASE + 1381 regmap_write(rt5645->regmap, RT5645_PR_BASE +
1382 RT5645_MAMP_INT_REG2, 0xfc00); 1382 RT5645_MAMP_INT_REG2, 0xfc00);
1383 snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140); 1383 snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140);
1384 mdelay(5); 1384 msleep(40);
1385 rt5645->hp_on = true; 1385 rt5645->hp_on = true;
1386 } else { 1386 } else {
1387 /* depop parameters */ 1387 /* depop parameters */
@@ -2829,13 +2829,12 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
2829 snd_soc_dapm_sync(dapm); 2829 snd_soc_dapm_sync(dapm);
2830 rt5645->jack_type = SND_JACK_HEADPHONE; 2830 rt5645->jack_type = SND_JACK_HEADPHONE;
2831 } 2831 }
2832
2833 snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
2834 snd_soc_write(codec, RT5645_DEPOP_M1, 0x001d);
2835 snd_soc_write(codec, RT5645_DEPOP_M1, 0x0001);
2836 } else { /* jack out */ 2832 } else { /* jack out */
2837 rt5645->jack_type = 0; 2833 rt5645->jack_type = 0;
2838 2834
2835 regmap_update_bits(rt5645->regmap, RT5645_HP_VOL,
2836 RT5645_L_MUTE | RT5645_R_MUTE,
2837 RT5645_L_MUTE | RT5645_R_MUTE);
2839 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2, 2838 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2,
2840 RT5645_CBJ_MN_JD, RT5645_CBJ_MN_JD); 2839 RT5645_CBJ_MN_JD, RT5645_CBJ_MN_JD);
2841 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1, 2840 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1,
@@ -2880,8 +2879,6 @@ int rt5645_set_jack_detect(struct snd_soc_codec *codec,
2880 rt5645->en_button_func = true; 2879 rt5645->en_button_func = true;
2881 regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1, 2880 regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1,
2882 RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ); 2881 RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ);
2883 regmap_update_bits(rt5645->regmap, RT5645_DEPOP_M1,
2884 RT5645_HP_CB_MASK, RT5645_HP_CB_PU);
2885 regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1, 2882 regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1,
2886 RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL); 2883 RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL);
2887 } 2884 }
@@ -3205,6 +3202,13 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = {
3205 DMI_MATCH(DMI_PRODUCT_NAME, "Celes"), 3202 DMI_MATCH(DMI_PRODUCT_NAME, "Celes"),
3206 }, 3203 },
3207 }, 3204 },
3205 {
3206 .ident = "Google Ultima",
3207 .callback = strago_quirk_cb,
3208 .matches = {
3209 DMI_MATCH(DMI_PRODUCT_NAME, "Ultima"),
3210 },
3211 },
3208 { } 3212 { }
3209}; 3213};
3210 3214
diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
index f2c6ad4b8fde..581ec1502228 100644
--- a/sound/soc/codecs/wm0010.c
+++ b/sound/soc/codecs/wm0010.c
@@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
577 struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec); 577 struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec);
578 unsigned long flags; 578 unsigned long flags;
579 int ret; 579 int ret;
580 const struct firmware *fw;
581 struct spi_message m; 580 struct spi_message m;
582 struct spi_transfer t; 581 struct spi_transfer t;
583 struct dfw_pllrec pll_rec; 582 struct dfw_pllrec pll_rec;
@@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
623 wm0010->state = WM0010_OUT_OF_RESET; 622 wm0010->state = WM0010_OUT_OF_RESET;
624 spin_unlock_irqrestore(&wm0010->irq_lock, flags); 623 spin_unlock_irqrestore(&wm0010->irq_lock, flags);
625 624
626 /* First the bootloader */
627 ret = request_firmware(&fw, "wm0010_stage2.bin", codec->dev);
628 if (ret != 0) {
629 dev_err(codec->dev, "Failed to request stage2 loader: %d\n",
630 ret);
631 goto abort;
632 }
633
634 if (!wait_for_completion_timeout(&wm0010->boot_completion, 625 if (!wait_for_completion_timeout(&wm0010->boot_completion,
635 msecs_to_jiffies(20))) 626 msecs_to_jiffies(20)))
636 dev_err(codec->dev, "Failed to get interrupt from DSP\n"); 627 dev_err(codec->dev, "Failed to get interrupt from DSP\n");
@@ -673,7 +664,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)
673 664
674 img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA); 665 img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
675 if (!img_swap) 666 if (!img_swap)
676 goto abort; 667 goto abort_out;
677 668
678 /* We need to re-order for 0010 */ 669 /* We need to re-order for 0010 */
679 byte_swap_64((u64 *)&pll_rec, img_swap, len); 670 byte_swap_64((u64 *)&pll_rec, img_swap, len);
@@ -688,16 +679,16 @@ static int wm0010_boot(struct snd_soc_codec *codec)
688 spi_message_add_tail(&t, &m); 679 spi_message_add_tail(&t, &m);
689 680
690 ret = spi_sync(spi, &m); 681 ret = spi_sync(spi, &m);
691 if (ret != 0) { 682 if (ret) {
692 dev_err(codec->dev, "First PLL write failed: %d\n", ret); 683 dev_err(codec->dev, "First PLL write failed: %d\n", ret);
693 goto abort; 684 goto abort_swap;
694 } 685 }
695 686
696 /* Use a second send of the message to get the return status */ 687 /* Use a second send of the message to get the return status */
697 ret = spi_sync(spi, &m); 688 ret = spi_sync(spi, &m);
698 if (ret != 0) { 689 if (ret) {
699 dev_err(codec->dev, "Second PLL write failed: %d\n", ret); 690 dev_err(codec->dev, "Second PLL write failed: %d\n", ret);
700 goto abort; 691 goto abort_swap;
701 } 692 }
702 693
703 p = (u32 *)out; 694 p = (u32 *)out;
@@ -730,6 +721,10 @@ static int wm0010_boot(struct snd_soc_codec *codec)
730 721
731 return 0; 722 return 0;
732 723
724abort_swap:
725 kfree(img_swap);
726abort_out:
727 kfree(out);
733abort: 728abort:
734 /* Put the chip back into reset */ 729 /* Put the chip back into reset */
735 wm0010_halt(codec); 730 wm0010_halt(codec);
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index e3b7d0c57411..dbd88408861a 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -211,28 +211,38 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
211 return wm8960_set_deemph(codec); 211 return wm8960_set_deemph(codec);
212} 212}
213 213
214static const DECLARE_TLV_DB_SCALE(adc_tlv, -9700, 50, 0); 214static const DECLARE_TLV_DB_SCALE(adc_tlv, -9750, 50, 1);
215static const DECLARE_TLV_DB_SCALE(dac_tlv, -12700, 50, 1); 215static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1725, 75, 0);
216static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
216static const DECLARE_TLV_DB_SCALE(bypass_tlv, -2100, 300, 0); 217static const DECLARE_TLV_DB_SCALE(bypass_tlv, -2100, 300, 0);
217static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1); 218static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
218static const DECLARE_TLV_DB_SCALE(boost_tlv, -1200, 300, 1); 219static const DECLARE_TLV_DB_SCALE(lineinboost_tlv, -1500, 300, 1);
220static const unsigned int micboost_tlv[] = {
221 TLV_DB_RANGE_HEAD(2),
222 0, 1, TLV_DB_SCALE_ITEM(0, 1300, 0),
223 2, 3, TLV_DB_SCALE_ITEM(2000, 900, 0),
224};
219 225
220static const struct snd_kcontrol_new wm8960_snd_controls[] = { 226static const struct snd_kcontrol_new wm8960_snd_controls[] = {
221SOC_DOUBLE_R_TLV("Capture Volume", WM8960_LINVOL, WM8960_RINVOL, 227SOC_DOUBLE_R_TLV("Capture Volume", WM8960_LINVOL, WM8960_RINVOL,
222 0, 63, 0, adc_tlv), 228 0, 63, 0, inpga_tlv),
223SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL, 229SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL,
224 6, 1, 0), 230 6, 1, 0),
225SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL, 231SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL,
226 7, 1, 0), 232 7, 1, 0),
227 233
228SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume", 234SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume",
229 WM8960_INBMIX1, 4, 7, 0, boost_tlv), 235 WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv),
230SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume", 236SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume",
231 WM8960_INBMIX1, 1, 7, 0, boost_tlv), 237 WM8960_INBMIX1, 1, 7, 0, lineinboost_tlv),
232SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT3 Volume", 238SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT3 Volume",
233 WM8960_INBMIX2, 4, 7, 0, boost_tlv), 239 WM8960_INBMIX2, 4, 7, 0, lineinboost_tlv),
234SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT2 Volume", 240SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT2 Volume",
235 WM8960_INBMIX2, 1, 7, 0, boost_tlv), 241 WM8960_INBMIX2, 1, 7, 0, lineinboost_tlv),
242SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT1 Volume",
243 WM8960_RINPATH, 4, 3, 0, micboost_tlv),
244SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT1 Volume",
245 WM8960_LINPATH, 4, 3, 0, micboost_tlv),
236 246
237SOC_DOUBLE_R_TLV("Playback Volume", WM8960_LDAC, WM8960_RDAC, 247SOC_DOUBLE_R_TLV("Playback Volume", WM8960_LDAC, WM8960_RDAC,
238 0, 255, 0, dac_tlv), 248 0, 255, 0, dac_tlv),
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index b4eb975da981..293e47a6ff59 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2944,7 +2944,8 @@ static int wm8962_mute(struct snd_soc_dai *dai, int mute)
2944 WM8962_DAC_MUTE, val); 2944 WM8962_DAC_MUTE, val);
2945} 2945}
2946 2946
2947#define WM8962_RATES SNDRV_PCM_RATE_8000_96000 2947#define WM8962_RATES (SNDRV_PCM_RATE_8000_48000 |\
2948 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
2948 2949
2949#define WM8962_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 2950#define WM8962_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
2950 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 2951 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index add6bb99661d..7d45d98a861f 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -663,7 +663,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
663 u8 rx_ser = 0; 663 u8 rx_ser = 0;
664 u8 slots = mcasp->tdm_slots; 664 u8 slots = mcasp->tdm_slots;
665 u8 max_active_serializers = (channels + slots - 1) / slots; 665 u8 max_active_serializers = (channels + slots - 1) / slots;
666 int active_serializers, numevt, n; 666 int active_serializers, numevt;
667 u32 reg; 667 u32 reg;
668 /* Default configuration */ 668 /* Default configuration */
669 if (mcasp->version < MCASP_VERSION_3) 669 if (mcasp->version < MCASP_VERSION_3)
@@ -745,9 +745,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
745 * The number of words for numevt need to be in steps of active 745 * The number of words for numevt need to be in steps of active
746 * serializers. 746 * serializers.
747 */ 747 */
748 n = numevt % active_serializers; 748 numevt = (numevt / active_serializers) * active_serializers;
749 if (n) 749
750 numevt += (active_serializers - n);
751 while (period_words % numevt && numevt > 0) 750 while (period_words % numevt && numevt > 0)
752 numevt -= active_serializers; 751 numevt -= active_serializers;
753 if (numevt <= 0) 752 if (numevt <= 0)
@@ -1299,6 +1298,7 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
1299 .ops = &davinci_mcasp_dai_ops, 1298 .ops = &davinci_mcasp_dai_ops,
1300 1299
1301 .symmetric_samplebits = 1, 1300 .symmetric_samplebits = 1,
1301 .symmetric_rates = 1,
1302 }, 1302 },
1303 { 1303 {
1304 .name = "davinci-mcasp.1", 1304 .name = "davinci-mcasp.1",
@@ -1685,7 +1685,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1685 1685
1686 irq = platform_get_irq_byname(pdev, "common"); 1686 irq = platform_get_irq_byname(pdev, "common");
1687 if (irq >= 0) { 1687 if (irq >= 0) {
1688 irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_common\n", 1688 irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_common",
1689 dev_name(&pdev->dev)); 1689 dev_name(&pdev->dev));
1690 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, 1690 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
1691 davinci_mcasp_common_irq_handler, 1691 davinci_mcasp_common_irq_handler,
@@ -1702,7 +1702,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1702 1702
1703 irq = platform_get_irq_byname(pdev, "rx"); 1703 irq = platform_get_irq_byname(pdev, "rx");
1704 if (irq >= 0) { 1704 if (irq >= 0) {
1705 irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_rx\n", 1705 irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_rx",
1706 dev_name(&pdev->dev)); 1706 dev_name(&pdev->dev));
1707 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, 1707 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
1708 davinci_mcasp_rx_irq_handler, 1708 davinci_mcasp_rx_irq_handler,
@@ -1717,7 +1717,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1717 1717
1718 irq = platform_get_irq_byname(pdev, "tx"); 1718 irq = platform_get_irq_byname(pdev, "tx");
1719 if (irq >= 0) { 1719 if (irq >= 0) {
1720 irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_tx\n", 1720 irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_tx",
1721 dev_name(&pdev->dev)); 1721 dev_name(&pdev->dev));
1722 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, 1722 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
1723 davinci_mcasp_tx_irq_handler, 1723 davinci_mcasp_tx_irq_handler,
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 5aeb6ed4827e..96f55ae75c71 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -488,7 +488,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
488 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; 488 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
489 } else { 489 } else {
490 dev_err(&pdev->dev, "unknown Device Tree compatible\n"); 490 dev_err(&pdev->dev, "unknown Device Tree compatible\n");
491 return -EINVAL; 491 ret = -EINVAL;
492 goto asrc_fail;
492 } 493 }
493 494
494 /* Common settings for corresponding Freescale CPU DAI driver */ 495 /* Common settings for corresponding Freescale CPU DAI driver */
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 8ec6fb208ea0..37c5cd4d0e59 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
249 249
250static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private) 250static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private)
251{ 251{
252 return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97); 252 return (ssi_private->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) ==
253 SND_SOC_DAIFMT_AC97;
253} 254}
254 255
255static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private) 256static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private)
@@ -947,7 +948,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
947 CCSR_SSI_SCR_TCH_EN); 948 CCSR_SSI_SCR_TCH_EN);
948 } 949 }
949 950
950 if (fmt & SND_SOC_DAIFMT_AC97) 951 if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97)
951 fsl_ssi_setup_ac97(ssi_private); 952 fsl_ssi_setup_ac97(ssi_private);
952 953
953 return 0; 954 return 0;
diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c
index f6efa9d4acad..b27f25f70730 100644
--- a/sound/soc/intel/haswell/sst-haswell-ipc.c
+++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
@@ -302,6 +302,10 @@ struct sst_hsw {
302 struct sst_hsw_ipc_dx_reply dx; 302 struct sst_hsw_ipc_dx_reply dx;
303 void *dx_context; 303 void *dx_context;
304 dma_addr_t dx_context_paddr; 304 dma_addr_t dx_context_paddr;
305 enum sst_hsw_device_id dx_dev;
306 enum sst_hsw_device_mclk dx_mclk;
307 enum sst_hsw_device_mode dx_mode;
308 u32 dx_clock_divider;
305 309
306 /* boot */ 310 /* boot */
307 wait_queue_head_t boot_wait; 311 wait_queue_head_t boot_wait;
@@ -1400,10 +1404,10 @@ int sst_hsw_device_set_config(struct sst_hsw *hsw,
1400 1404
1401 trace_ipc_request("set device config", dev); 1405 trace_ipc_request("set device config", dev);
1402 1406
1403 config.ssp_interface = dev; 1407 hsw->dx_dev = config.ssp_interface = dev;
1404 config.clock_frequency = mclk; 1408 hsw->dx_mclk = config.clock_frequency = mclk;
1405 config.mode = mode; 1409 hsw->dx_mode = config.mode = mode;
1406 config.clock_divider = clock_divider; 1410 hsw->dx_clock_divider = config.clock_divider = clock_divider;
1407 if (mode == SST_HSW_DEVICE_TDM_CLOCK_MASTER) 1411 if (mode == SST_HSW_DEVICE_TDM_CLOCK_MASTER)
1408 config.channels = 4; 1412 config.channels = 4;
1409 else 1413 else
@@ -1704,10 +1708,10 @@ int sst_hsw_dsp_runtime_resume(struct sst_hsw *hsw)
1704 return -EIO; 1708 return -EIO;
1705 } 1709 }
1706 1710
1707 /* Set ADSP SSP port settings */ 1711 /* Set ADSP SSP port settings - sadly the FW does not store SSP port
1708 ret = sst_hsw_device_set_config(hsw, SST_HSW_DEVICE_SSP_0, 1712 settings as part of the PM context. */
1709 SST_HSW_DEVICE_MCLK_FREQ_24_MHZ, 1713 ret = sst_hsw_device_set_config(hsw, hsw->dx_dev, hsw->dx_mclk,
1710 SST_HSW_DEVICE_CLOCK_MASTER, 9); 1714 hsw->dx_mode, hsw->dx_clock_divider);
1711 if (ret < 0) 1715 if (ret < 0)
1712 dev_err(dev, "error: SSP re-initialization failed\n"); 1716 dev_err(dev, "error: SSP re-initialization failed\n");
1713 1717
diff --git a/sound/soc/mediatek/mtk-afe-pcm.c b/sound/soc/mediatek/mtk-afe-pcm.c
index d190fe017559..f5baf3c38863 100644
--- a/sound/soc/mediatek/mtk-afe-pcm.c
+++ b/sound/soc/mediatek/mtk-afe-pcm.c
@@ -549,6 +549,23 @@ static int mtk_afe_dais_startup(struct snd_pcm_substream *substream,
549 memif->substream = substream; 549 memif->substream = substream;
550 550
551 snd_soc_set_runtime_hwparams(substream, &mtk_afe_hardware); 551 snd_soc_set_runtime_hwparams(substream, &mtk_afe_hardware);
552
553 /*
554 * Capture cannot use ping-pong buffer since hw_ptr at IRQ may be
555 * smaller than period_size due to AFE's internal buffer.
556 * This easily leads to overrun when avail_min is period_size.
557 * One more period can hold the possible unread buffer.
558 */
559 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
560 ret = snd_pcm_hw_constraint_minmax(runtime,
561 SNDRV_PCM_HW_PARAM_PERIODS,
562 3,
563 mtk_afe_hardware.periods_max);
564 if (ret < 0) {
565 dev_err(afe->dev, "hw_constraint_minmax failed\n");
566 return ret;
567 }
568 }
552 ret = snd_pcm_hw_constraint_integer(runtime, 569 ret = snd_pcm_hw_constraint_integer(runtime,
553 SNDRV_PCM_HW_PARAM_PERIODS); 570 SNDRV_PCM_HW_PARAM_PERIODS);
554 if (ret < 0) 571 if (ret < 0)
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 39cea80846c3..f2bf8661dd21 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -1,7 +1,6 @@
1config SND_PXA2XX_SOC 1config SND_PXA2XX_SOC
2 tristate "SoC Audio for the Intel PXA2xx chip" 2 tristate "SoC Audio for the Intel PXA2xx chip"
3 depends on ARCH_PXA 3 depends on ARCH_PXA
4 select SND_ARM
5 select SND_PXA2XX_LIB 4 select SND_PXA2XX_LIB
6 help 5 help
7 Say Y or M if you want to add support for codecs attached to 6 Say Y or M if you want to add support for codecs attached to
@@ -25,7 +24,6 @@ config SND_PXA2XX_AC97
25config SND_PXA2XX_SOC_AC97 24config SND_PXA2XX_SOC_AC97
26 tristate 25 tristate
27 select AC97_BUS 26 select AC97_BUS
28 select SND_ARM
29 select SND_PXA2XX_LIB_AC97 27 select SND_PXA2XX_LIB_AC97
30 select SND_SOC_AC97_BUS 28 select SND_SOC_AC97_BUS
31 29
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 1f6054650991..9e4b04e0fbd1 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -49,7 +49,7 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
49 .reset = pxa2xx_ac97_cold_reset, 49 .reset = pxa2xx_ac97_cold_reset,
50}; 50};
51 51
52static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 12; 52static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 11;
53static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = { 53static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
54 .addr = __PREG(PCDR), 54 .addr = __PREG(PCDR),
55 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, 55 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
@@ -57,7 +57,7 @@ static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
57 .filter_data = &pxa2xx_ac97_pcm_stereo_in_req, 57 .filter_data = &pxa2xx_ac97_pcm_stereo_in_req,
58}; 58};
59 59
60static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 11; 60static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 12;
61static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = { 61static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
62 .addr = __PREG(PCDR), 62 .addr = __PREG(PCDR),
63 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, 63 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index f4bf21a5539b..ff8bda471b25 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3501,7 +3501,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
3501 3501
3502 default: 3502 default:
3503 WARN(1, "Unknown event %d\n", event); 3503 WARN(1, "Unknown event %d\n", event);
3504 return -EINVAL; 3504 ret = -EINVAL;
3505 } 3505 }
3506 3506
3507out: 3507out:
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index 362c69ac1d6c..53dd085d3ee2 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -101,6 +101,15 @@ static struct snd_soc_codec_driver dummy_codec;
101 SNDRV_PCM_FMTBIT_S32_LE | \ 101 SNDRV_PCM_FMTBIT_S32_LE | \
102 SNDRV_PCM_FMTBIT_U32_LE | \ 102 SNDRV_PCM_FMTBIT_U32_LE | \
103 SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE) 103 SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
104/*
105 * The dummy CODEC is only meant to be used in situations where there is no
106 * actual hardware.
107 *
108 * If there is actual hardware even if it does not have a control bus
109 * the hardware will still have constraints like supported samplerates, etc.
110 * which should be modelled. And the data flow graph also should be modelled
111 * using DAPM.
112 */
104static struct snd_soc_dai_driver dummy_dai = { 113static struct snd_soc_dai_driver dummy_dai = {
105 .name = "snd-soc-dummy-dai", 114 .name = "snd-soc-dummy-dai",
106 .playback = { 115 .playback = {
diff --git a/sound/soc/spear/Kconfig b/sound/soc/spear/Kconfig
index 0a53053495f3..4fb91412ebec 100644
--- a/sound/soc/spear/Kconfig
+++ b/sound/soc/spear/Kconfig
@@ -1,6 +1,6 @@
1config SND_SPEAR_SOC 1config SND_SPEAR_SOC
2 tristate 2 tristate
3 select SND_DMAENGINE_PCM 3 select SND_SOC_GENERIC_DMAENGINE_PCM
4 4
5config SND_SPEAR_SPDIF_OUT 5config SND_SPEAR_SPDIF_OUT
6 tristate 6 tristate
diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c
index f6eefe1b8f8f..843f037a317d 100644
--- a/sound/soc/sti/uniperif_player.c
+++ b/sound/soc/sti/uniperif_player.c
@@ -989,8 +989,8 @@ static int uni_player_parse_dt(struct platform_device *pdev,
989 if (!info) 989 if (!info)
990 return -ENOMEM; 990 return -ENOMEM;
991 991
992 of_property_read_u32(pnode, "version", &player->ver); 992 if (of_property_read_u32(pnode, "version", &player->ver) ||
993 if (player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) { 993 player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
994 dev_err(dev, "Unknown uniperipheral version "); 994 dev_err(dev, "Unknown uniperipheral version ");
995 return -EINVAL; 995 return -EINVAL;
996 } 996 }
@@ -998,10 +998,16 @@ static int uni_player_parse_dt(struct platform_device *pdev,
998 if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) 998 if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
999 info->underflow_enabled = 1; 999 info->underflow_enabled = 1;
1000 1000
1001 of_property_read_u32(pnode, "uniperiph-id", &info->id); 1001 if (of_property_read_u32(pnode, "uniperiph-id", &info->id)) {
1002 dev_err(dev, "uniperipheral id not defined");
1003 return -EINVAL;
1004 }
1002 1005
1003 /* Read the device mode property */ 1006 /* Read the device mode property */
1004 of_property_read_string(pnode, "mode", &mode); 1007 if (of_property_read_string(pnode, "mode", &mode)) {
1008 dev_err(dev, "uniperipheral mode not defined");
1009 return -EINVAL;
1010 }
1005 1011
1006 if (strcasecmp(mode, "hdmi") == 0) 1012 if (strcasecmp(mode, "hdmi") == 0)
1007 info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_HDMI; 1013 info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_HDMI;
diff --git a/sound/soc/sti/uniperif_reader.c b/sound/soc/sti/uniperif_reader.c
index c502626f339b..f791239a3087 100644
--- a/sound/soc/sti/uniperif_reader.c
+++ b/sound/soc/sti/uniperif_reader.c
@@ -316,7 +316,11 @@ static int uni_reader_parse_dt(struct platform_device *pdev,
316 if (!info) 316 if (!info)
317 return -ENOMEM; 317 return -ENOMEM;
318 318
319 of_property_read_u32(node, "version", &reader->ver); 319 if (of_property_read_u32(node, "version", &reader->ver) ||
320 reader->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
321 dev_err(&pdev->dev, "Unknown uniperipheral version ");
322 return -EINVAL;
323 }
320 324
321 /* Save the info structure */ 325 /* Save the info structure */
322 reader->info = info; 326 reader->info = info;