History

Merge tag 'sound-4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai: "This ended up with a larger set of fixes than wished, unfortunately. As diffstat shows, the majority of changes are for various ASoC drivers (Realtek, Wolfson codec drivers, etc), in addition to a couple of HD-audio regression fixes. All these are reasonably small and nothing to scare much" * tag 'sound-4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (29 commits) ALSA: hda - Disable power_save_node for Thinkpads ALSA: hda/tegra - async probe for avoiding module loading deadlock ASoC: rt5645: Prevent the pop sound in case of playback and the jack is plugging ASoC: rt5645: Increase the delay time to remove the pop sound ASoC: rt5645: Use the type SOC_DAPM_SINGLE_AUTODISABLE to prevent the weird sound in runtime of power up ASoC: pxa: pxa2xx-ac97: fix dma requestor lines MAINTAINERS: Update website and git repo for Wolfson Microelectronics ASoC: fsl_ssi: Fix checking of dai format for AC97 mode ASoC: wm0010: fix error path ASoC: wm0010: fix memory leak ASoC: wm8960: correct the max register value of mic boost pga ASoC: wm8962: remove 64k sample rate support ASoC: davinci-mcasp: Fix devm_kasprintf format string ASoC: fix broken pxa SoC support ASoC: davinci-mcasp: Set .symmetric_rates = 1 in snd_soc_dai_driver ASoC: au1x: psc-i2s: Fix unused variable 'ret' warning ASoC: SPEAr: Make SND_SPEAR_SOC select SND_SOC_GENERIC_DMAENGINE_PCM ASoC: mediatek: Increase periods_min in capture ASoC: davinci-mcasp: Revise the FIFO threshold calculation ASoC: wm8960: correct gain value for input PGA and add microphone PGA ...

Linus Torvalds committed 11 years ago

Commit ddff42e2 parents 966966a 7f57d8021 files · +166 −92Browse files

Unified · Split

21 files
  1. MAINTAINERS +3 −6
  2. sound/arm/Kconfig +8 −7
  3. sound/pci/hda/hda_tegra.c +25 −5
  4. sound/pci/hda/patch_realtek.c +19 −12
  5. sound/soc/au1x/psc-i2s.c +0 −1
  6. sound/soc/codecs/rt5645.c +13 −9
  7. sound/soc/codecs/wm0010.c +9 −14
  8. sound/soc/codecs/wm8960.c +18 −8
  9. sound/soc/codecs/wm8962.c +2 −1
  10. sound/soc/davinci/davinci-mcasp.c +7 −7
  11. sound/soc/fsl/fsl-asoc-card.c +2 −1
  12. sound/soc/fsl/fsl_ssi.c +3 −2
  13. sound/soc/intel/haswell/sst-haswell-ipc.c +12 −8
  14. sound/soc/mediatek/mtk-afe-pcm.c +17 −0
  15. sound/soc/pxa/Kconfig +0 −2
  16. sound/soc/pxa/pxa2xx-ac97.c +2 −2
  17. sound/soc/soc-dapm.c +1 −1
  18. sound/soc/soc-utils.c +9 −0
  19. sound/soc/spear/Kconfig +1 −1
  20. sound/soc/sti/uniperif_player.c +10 −4
  21. sound/soc/sti/uniperif_reader.c +5 −1
MAINTAINERS+3−6
@@ -11249,7 +11249,6 @@ VOLTAGE AND CURRENT REGULATOR FRAMEWORK · 11248 unmodified lines
1124911249 M: Liam Girdwood <lgirdwood@gmail.com>
1125011250 M: Mark Brown <broonie@kernel.org>
1125111251 L: linux-kernel@vger.kernel.org
11252−W: http://opensource.wolfsonmicro.com/node/15
1125311252 W: http://www.slimlogic.co.uk/?p=48
1125411253 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
1125511254 S: Supported
@@ -11378,17 +11377,15 @@ WM97XX TOUCHSCREEN DRIVERS · 122 unmodified lines
1137811377 M: Mark Brown <broonie@kernel.org>
1137911378 M: Liam Girdwood <lrg@slimlogic.co.uk>
1138011379 L: linux-input@vger.kernel.org
11381−T: git git://opensource.wolfsonmicro.com/linux-2.6-touch
11382−W: http://opensource.wolfsonmicro.com/node/7
11380+W: https://github.com/CirrusLogic/linux-drivers/wiki
1138311381 S: Supported
1138411382 F: drivers/input/touchscreen/*wm97*
1138511383 F: include/linux/wm97xx.h
1138611384
1138711385 WOLFSON MICROELECTRONICS DRIVERS
1138811386 L: patches@opensource.wolfsonmicro.com
11389−T: git git://opensource.wolfsonmicro.com/linux-2.6-asoc
11390−T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
11391−W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
11387+T: git https://github.com/CirrusLogic/linux-drivers.git
11388+W: https://github.com/CirrusLogic/linux-drivers/wiki
1139211389 S: Supported
1139311390 F: Documentation/hwmon/wm83??
1139411391 F: arch/arm/mach-s3c64xx/mach-crag6410*
sound/arm/Kconfig+8−7
@@ -9,6 +9,14 @@ menuconfig SND_ARM · 8 unmodified lines
99 Drivers that are implemented on ASoC can be found in
1010 "ALSA for SoC audio support" section.
1111
12+config SND_PXA2XX_LIB
13+ tristate
14+ select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
15+ select SND_DMAENGINE_PCM
16+
17+config SND_PXA2XX_LIB_AC97
18+ bool
19+
1220 if SND_ARM
1321
1422 config SND_ARMAACI
@@ -21,13 +29,6 @@ config SND_PXA2XX_PCM · 6 unmodified lines
2129 tristate
2230 select SND_PCM
2331
24−config SND_PXA2XX_LIB
25− tristate
26− select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
27−
28−config SND_PXA2XX_LIB_AC97
29− bool
30−
3132 config SND_PXA2XX_AC97
3233 tristate "AC97 driver for the Intel PXA2xx chip"
3334 depends on ARCH_PXA
sound/pci/hda/hda_tegra.c+25−5
@@ -73,6 +73,7 @@ struct hda_tegra { · 72 unmodified lines
7373 struct clk *hda2codec_2x_clk;
7474 struct clk *hda2hdmi_clk;
7575 void __iomem *regs;
76+ struct work_struct probe_work;
7677 };
7778
7879 #ifdef CONFIG_PM
@@ -294,7 +295,9 @@ static int hda_tegra_dev_disconnect(struct snd_device *device) · 215 unmodified lines
294295 static int hda_tegra_dev_free(struct snd_device *device)
295296 {
296297 struct azx *chip = device->device_data;
298+ struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
297299
300+ cancel_work_sync(&hda->probe_work);
298301 if (azx_bus(chip)->chip_init) {
299302 azx_stop_all_streams(chip);
300303 azx_stop_chip(chip);
@@ -426,6 +429,9 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) · 125 unmodified lines
426429 /*
427430 * constructor
428431 */
432+
433+static void hda_tegra_probe_work(struct work_struct *work);
434+
429435 static int hda_tegra_create(struct snd_card *card,
430436 unsigned int driver_caps,
431437 struct hda_tegra *hda)
@@ -452,6 +458,8 @@ static int hda_tegra_create(struct snd_card *card, · 20 unmodified lines
452458 chip->single_cmd = false;
453459 chip->snoop = true;
454460
461+ INIT_WORK(&hda->probe_work, hda_tegra_probe_work);
462+
455463 err = azx_bus_init(chip, NULL, &hda_tegra_io_ops);
456464 if (err < 0)
457465 return err;
@@ -499,6 +507,21 @@ static int hda_tegra_probe(struct platform_device *pdev) · 41 unmodified lines
499507 card->private_data = chip;
500508
501509 dev_set_drvdata(&pdev->dev, card);
510+ schedule_work(&hda->probe_work);
511+
512+ return 0;
513+
514+out_free:
515+ snd_card_free(card);
516+ return err;
517+}
518+
519+static void hda_tegra_probe_work(struct work_struct *work)
520+{
521+ struct hda_tegra *hda = container_of(work, struct hda_tegra, probe_work);
522+ struct azx *chip = &hda->chip;
523+ struct platform_device *pdev = to_platform_device(hda->dev);
524+ int err;
502525
503526 err = hda_tegra_first_init(chip, pdev);
504527 if (err < 0)
@@ -520,11 +543,8 @@ static int hda_tegra_probe(struct platform_device *pdev) · 15 unmodified lines
520543 chip->running = 1;
521544 snd_hda_set_power_save(&chip->bus, power_save * 1000);
522545
523− return 0;
524−
525−out_free:
526− snd_card_free(card);
527− return err;
546+ out_free:
547+ return; /* no error return from async probe */
528548 }
529549
530550 static int hda_tegra_remove(struct platform_device *pdev)
sound/pci/hda/patch_realtek.c+19−12
@@ -4188,6 +4188,24 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec, · 4187 unmodified lines
41884188 }
41894189 }
41904190
4191+/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
4192+static void alc_fixup_tpt440_dock(struct hda_codec *codec,
4193+ const struct hda_fixup *fix, int action)
4194+{
4195+ static const struct hda_pintbl pincfgs[] = {
4196+ { 0x16, 0x21211010 }, /* dock headphone */
4197+ { 0x19, 0x21a11010 }, /* dock mic */
4198+ { }
4199+ };
4200+ struct alc_spec *spec = codec->spec;
4201+
4202+ if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4203+ spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4204+ codec->power_save_node = 0; /* avoid click noises */
4205+ snd_hda_apply_pincfgs(codec, pincfgs);
4206+ }
4207+}
4208+
41914209 static void alc_shutup_dell_xps13(struct hda_codec *codec)
41924210 {
41934211 struct alc_spec *spec = codec->spec;
@@ -4562,7 +4580,6 @@ enum { · 368 unmodified lines
45624580 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
45634581 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
45644582 ALC292_FIXUP_TPT440_DOCK,
4565− ALC292_FIXUP_TPT440_DOCK2,
45664583 ALC283_FIXUP_BXBT2807_MIC,
45674584 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED,
45684585 ALC282_FIXUP_ASPIRE_V5_PINS,
@@ -5029,17 +5046,7 @@ static const struct hda_fixup alc269_fixups[] = { · 460 unmodified lines
50295046 },
50305047 [ALC292_FIXUP_TPT440_DOCK] = {
50315048 .type = HDA_FIXUP_FUNC,
5032− .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
5033− .chained = true,
5034− .chain_id = ALC292_FIXUP_TPT440_DOCK2
5035− },
5036− [ALC292_FIXUP_TPT440_DOCK2] = {
5037− .type = HDA_FIXUP_PINS,
5038− .v.pins = (const struct hda_pintbl[]) {
5039− { 0x16, 0x21211010 }, /* dock headphone */
5040− { 0x19, 0x21a11010 }, /* dock mic */
5041− { }
5042− },
5049+ .v.func = alc_fixup_tpt440_dock,
50435050 .chained = true,
50445051 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
50455052 },
sound/soc/au1x/psc-i2s.c+0−1
@@ -296,7 +296,6 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev) · 295 unmodified lines
296296 {
297297 struct resource *iores, *dmares;
298298 unsigned long sel;
299− int ret;
300299 struct au1xpsc_audio_data *wd;
301300
302301 wd = devm_kzalloc(&pdev->dev, sizeof(struct au1xpsc_audio_data),
sound/soc/codecs/rt5645.c+13−9
@@ -732,14 +732,14 @@ static const struct snd_kcontrol_new rt5645_mono_adc_r_mix[] = { · 731 unmodified lines
732732 static const struct snd_kcontrol_new rt5645_dac_l_mix[] = {
733733 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER,
734734 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,
736736 RT5645_M_DAC1_L_SFT, 1, 1),
737737 };
738738
739739 static const struct snd_kcontrol_new rt5645_dac_r_mix[] = {
740740 SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER,
741741 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,
743743 RT5645_M_DAC1_R_SFT, 1, 1),
744744 };
745745
@@ -1381,7 +1381,7 @@ static void hp_amp_power(struct snd_soc_codec *codec, int on) · 635 unmodified lines
13811381 regmap_write(rt5645->regmap, RT5645_PR_BASE +
13821382 RT5645_MAMP_INT_REG2, 0xfc00);
13831383 snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140);
1384− mdelay(5);
1384+ msleep(40);
13851385 rt5645->hp_on = true;
13861386 } else {
13871387 /* depop parameters */
@@ -2829,13 +2829,12 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert) · 1441 unmodified lines
28292829 snd_soc_dapm_sync(dapm);
28302830 rt5645->jack_type = SND_JACK_HEADPHONE;
28312831 }
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);
28362832 } else { /* jack out */
28372833 rt5645->jack_type = 0;
28382834
2835+ regmap_update_bits(rt5645->regmap, RT5645_HP_VOL,
2836+ RT5645_L_MUTE | RT5645_R_MUTE,
2837+ RT5645_L_MUTE | RT5645_R_MUTE);
28392838 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2,
28402839 RT5645_CBJ_MN_JD, RT5645_CBJ_MN_JD);
28412840 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1,
@@ -2880,8 +2879,6 @@ int rt5645_set_jack_detect(struct snd_soc_codec *codec, · 38 unmodified lines
28802879 rt5645->en_button_func = true;
28812880 regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1,
28822881 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);
28852882 regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1,
28862883 RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL);
28872884 }
@@ -3205,6 +3202,13 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = { · 317 unmodified lines
32053202 DMI_MATCH(DMI_PRODUCT_NAME, "Celes"),
32063203 },
32073204 },
3205+ {
3206+ .ident = "Google Ultima",
3207+ .callback = strago_quirk_cb,
3208+ .matches = {
3209+ DMI_MATCH(DMI_PRODUCT_NAME, "Ultima"),
3210+ },
3211+ },
32083212 { }
32093213 };
32103214
sound/soc/codecs/wm0010.c+9−14
@@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 576 unmodified lines
577577 struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec);
578578 unsigned long flags;
579579 int ret;
580− const struct firmware *fw;
581580 struct spi_message m;
582581 struct spi_transfer t;
583582 struct dfw_pllrec pll_rec;
@@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 39 unmodified lines
623622 wm0010->state = WM0010_OUT_OF_RESET;
624623 spin_unlock_irqrestore(&wm0010->irq_lock, flags);
625624
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−
634625 if (!wait_for_completion_timeout(&wm0010->boot_completion,
635626 msecs_to_jiffies(20)))
636627 dev_err(codec->dev, "Failed to get interrupt from DSP\n");
@@ -673,7 +664,7 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 36 unmodified lines
673664
674665 img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
675666 if (!img_swap)
676− goto abort;
667+ goto abort_out;
677668
678669 /* We need to re-order for 0010 */
679670 byte_swap_64((u64 *)&pll_rec, img_swap, len);
@@ -688,16 +679,16 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 8 unmodified lines
688679 spi_message_add_tail(&t, &m);
689680
690681 ret = spi_sync(spi, &m);
691− if (ret != 0) {
682+ if (ret) {
692683 dev_err(codec->dev, "First PLL write failed: %d\n", ret);
693− goto abort;
684+ goto abort_swap;
694685 }
695686
696687 /* Use a second send of the message to get the return status */
697688 ret = spi_sync(spi, &m);
698− if (ret != 0) {
689+ if (ret) {
699690 dev_err(codec->dev, "Second PLL write failed: %d\n", ret);
700− goto abort;
691+ goto abort_swap;
701692 }
702693
703694 p = (u32 *)out;
@@ -730,6 +721,10 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 26 unmodified lines
730721
731722 return 0;
732723
724+abort_swap:
725+ kfree(img_swap);
726+abort_out:
727+ kfree(out);
733728 abort:
734729 /* Put the chip back into reset */
735730 wm0010_halt(codec);
sound/soc/codecs/wm8960.c+18−8
@@ -211,28 +211,38 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol, · 210 unmodified lines
211211 return wm8960_set_deemph(codec);
212212 }
213213
214−static const DECLARE_TLV_DB_SCALE(adc_tlv, -9700, 50, 0);
215−static const DECLARE_TLV_DB_SCALE(dac_tlv, -12700, 50, 1);
214+static const DECLARE_TLV_DB_SCALE(adc_tlv, -9750, 50, 1);
215+static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1725, 75, 0);
216+static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
216217 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -2100, 300, 0);
217218 static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
218−static const DECLARE_TLV_DB_SCALE(boost_tlv, -1200, 300, 1);
219+static const DECLARE_TLV_DB_SCALE(lineinboost_tlv, -1500, 300, 1);
220+static 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+};
219225
220226 static const struct snd_kcontrol_new wm8960_snd_controls[] = {
221227 SOC_DOUBLE_R_TLV("Capture Volume", WM8960_LINVOL, WM8960_RINVOL,
222− 0, 63, 0, adc_tlv),
228+ 0, 63, 0, inpga_tlv),
223229 SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL,
224230 6, 1, 0),
225231 SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL,
226232 7, 1, 0),
227233
228234 SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume",
229− WM8960_INBMIX1, 4, 7, 0, boost_tlv),
235+ WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv),
230236 SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume",
231− WM8960_INBMIX1, 1, 7, 0, boost_tlv),
237+ WM8960_INBMIX1, 1, 7, 0, lineinboost_tlv),
232238 SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT3 Volume",
233− WM8960_INBMIX2, 4, 7, 0, boost_tlv),
239+ WM8960_INBMIX2, 4, 7, 0, lineinboost_tlv),
234240 SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT2 Volume",
235− WM8960_INBMIX2, 1, 7, 0, boost_tlv),
241+ WM8960_INBMIX2, 1, 7, 0, lineinboost_tlv),
242+SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT1 Volume",
243+ WM8960_RINPATH, 4, 3, 0, micboost_tlv),
244+SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT1 Volume",
245+ WM8960_LINPATH, 4, 3, 0, micboost_tlv),
236246
237247 SOC_DOUBLE_R_TLV("Playback Volume", WM8960_LDAC, WM8960_RDAC,
238248 0, 255, 0, dac_tlv),
sound/soc/codecs/wm8962.c+2−1
@@ -2944,7 +2944,8 @@ static int wm8962_mute(struct snd_soc_dai *dai, int mute) · 2943 unmodified lines
29442944 WM8962_DAC_MUTE, val);
29452945 }
29462946
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)
29482949
29492950 #define WM8962_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
29502951 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
sound/soc/davinci/davinci-mcasp.c+7−7
@@ -663,7 +663,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, · 662 unmodified lines
663663 u8 rx_ser = 0;
664664 u8 slots = mcasp->tdm_slots;
665665 u8 max_active_serializers = (channels + slots - 1) / slots;
666− int active_serializers, numevt, n;
666+ int active_serializers, numevt;
667667 u32 reg;
668668 /* Default configuration */
669669 if (mcasp->version < MCASP_VERSION_3)
@@ -745,9 +745,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, · 75 unmodified lines
745745 * The number of words for numevt need to be in steps of active
746746 * serializers.
747747 */
748− n = numevt % active_serializers;
749− if (n)
750− numevt += (active_serializers - n);
748+ numevt = (numevt / active_serializers) * active_serializers;
749+
751750 while (period_words % numevt && numevt > 0)
752751 numevt -= active_serializers;
753752 if (numevt <= 0)
@@ -1299,6 +1298,7 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = { · 545 unmodified lines
12991298 .ops = &davinci_mcasp_dai_ops,
13001299
13011300 .symmetric_samplebits = 1,
1301+ .symmetric_rates = 1,
13021302 },
13031303 {
13041304 .name = "davinci-mcasp.1",
@@ -1685,7 +1685,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) · 380 unmodified lines
16851685
16861686 irq = platform_get_irq_byname(pdev, "common");
16871687 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",
16891689 dev_name(&pdev->dev));
16901690 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
16911691 davinci_mcasp_common_irq_handler,
@@ -1702,7 +1702,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) · 10 unmodified lines
17021702
17031703 irq = platform_get_irq_byname(pdev, "rx");
17041704 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",
17061706 dev_name(&pdev->dev));
17071707 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
17081708 davinci_mcasp_rx_irq_handler,
@@ -1717,7 +1717,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) · 8 unmodified lines
17171717
17181718 irq = platform_get_irq_byname(pdev, "tx");
17191719 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",
17211721 dev_name(&pdev->dev));
17221722 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
17231723 davinci_mcasp_tx_irq_handler,
sound/soc/fsl/fsl-asoc-card.c+2−1
@@ -488,7 +488,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) · 487 unmodified lines
488488 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
489489 } else {
490490 dev_err(&pdev->dev, "unknown Device Tree compatible\n");
491− return -EINVAL;
491+ ret = -EINVAL;
492+ goto asrc_fail;
492493 }
493494
494495 /* Common settings for corresponding Freescale CPU DAI driver */
sound/soc/fsl/fsl_ssi.c+3−2
@@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids); · 248 unmodified lines
249249
250250 static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private)
251251 {
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;
253254 }
254255
255256 static 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, · 691 unmodified lines
947948 CCSR_SSI_SCR_TCH_EN);
948949 }
949950
950− if (fmt & SND_SOC_DAIFMT_AC97)
951+ if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97)
951952 fsl_ssi_setup_ac97(ssi_private);
952953
953954 return 0;
sound/soc/intel/haswell/sst-haswell-ipc.c+12−8
@@ -302,6 +302,10 @@ struct sst_hsw { · 301 unmodified lines
302302 struct sst_hsw_ipc_dx_reply dx;
303303 void *dx_context;
304304 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;
305309
306310 /* boot */
307311 wait_queue_head_t boot_wait;
@@ -1400,10 +1404,10 @@ int sst_hsw_device_set_config(struct sst_hsw *hsw, · 1092 unmodified lines
14001404
14011405 trace_ipc_request("set device config", dev);
14021406
1403− config.ssp_interface = dev;
1404− config.clock_frequency = mclk;
1405− config.mode = mode;
1406− config.clock_divider = clock_divider;
1407+ hsw->dx_dev = config.ssp_interface = dev;
1408+ hsw->dx_mclk = config.clock_frequency = mclk;
1409+ hsw->dx_mode = config.mode = mode;
1410+ hsw->dx_clock_divider = config.clock_divider = clock_divider;
14071411 if (mode == SST_HSW_DEVICE_TDM_CLOCK_MASTER)
14081412 config.channels = 4;
14091413 else
@@ -1704,10 +1708,10 @@ int sst_hsw_dsp_runtime_resume(struct sst_hsw *hsw) · 294 unmodified lines
17041708 return -EIO;
17051709 }
17061710
1707− /* Set ADSP SSP port settings */
1708− ret = sst_hsw_device_set_config(hsw, SST_HSW_DEVICE_SSP_0,
1709− SST_HSW_DEVICE_MCLK_FREQ_24_MHZ,
1710− SST_HSW_DEVICE_CLOCK_MASTER, 9);
1711+ /* Set ADSP SSP port settings - sadly the FW does not store SSP port
1712+ settings as part of the PM context. */
1713+ ret = sst_hsw_device_set_config(hsw, hsw->dx_dev, hsw->dx_mclk,
1714+ hsw->dx_mode, hsw->dx_clock_divider);
17111715 if (ret < 0)
17121716 dev_err(dev, "error: SSP re-initialization failed\n");
17131717
sound/soc/mediatek/mtk-afe-pcm.c+17−0
@@ -549,6 +549,23 @@ static int mtk_afe_dais_startup(struct snd_pcm_substream *substream, · 548 unmodified lines
549549 memif->substream = substream;
550550
551551 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+ }
552569 ret = snd_pcm_hw_constraint_integer(runtime,
553570 SNDRV_PCM_HW_PARAM_PERIODS);
554571 if (ret < 0)
sound/soc/pxa/Kconfig+0−2
@@ -1,7 +1,6 @@
11 config SND_PXA2XX_SOC
22 tristate "SoC Audio for the Intel PXA2xx chip"
33 depends on ARCH_PXA
4− select SND_ARM
54 select SND_PXA2XX_LIB
65 help
76 Say Y or M if you want to add support for codecs attached to
@@ -25,7 +24,6 @@ config SND_PXA2XX_AC97 · 17 unmodified lines
2524 config SND_PXA2XX_SOC_AC97
2625 tristate
2726 select AC97_BUS
28− select SND_ARM
2927 select SND_PXA2XX_LIB_AC97
3028 select SND_SOC_AC97_BUS
3129
sound/soc/pxa/pxa2xx-ac97.c+2−2
@@ -49,7 +49,7 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { · 48 unmodified lines
4949 .reset = pxa2xx_ac97_cold_reset,
5050 };
5151
52−static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 12;
52+static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 11;
5353 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
5454 .addr = __PREG(PCDR),
5555 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
@@ -57,7 +57,7 @@ static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = { · 1 unmodified line
5757 .filter_data = &pxa2xx_ac97_pcm_stereo_in_req,
5858 };
5959
60−static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 11;
60+static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 12;
6161 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
6262 .addr = __PREG(PCDR),
6363 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
sound/soc/soc-dapm.c+1−1
@@ -3501,7 +3501,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, · 3500 unmodified lines
35013501
35023502 default:
35033503 WARN(1, "Unknown event %d\n", event);
3504− return -EINVAL;
3504+ ret = -EINVAL;
35053505 }
35063506
35073507 out:
sound/soc/soc-utils.c+9−0
@@ -101,6 +101,15 @@ static struct snd_soc_codec_driver dummy_codec; · 100 unmodified lines
101101 SNDRV_PCM_FMTBIT_S32_LE | \
102102 SNDRV_PCM_FMTBIT_U32_LE | \
103103 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+ */
104113 static struct snd_soc_dai_driver dummy_dai = {
105114 .name = "snd-soc-dummy-dai",
106115 .playback = {
sound/soc/spear/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config SND_SPEAR_SOC
22 tristate
3− select SND_DMAENGINE_PCM
3+ select SND_SOC_GENERIC_DMAENGINE_PCM
44
55 config SND_SPEAR_SPDIF_OUT
66 tristate
sound/soc/sti/uniperif_player.c+10−4
@@ -989,8 +989,8 @@ static int uni_player_parse_dt(struct platform_device *pdev, · 988 unmodified lines
989989 if (!info)
990990 return -ENOMEM;
991991
992− of_property_read_u32(pnode, "version", &player->ver);
993− if (player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
992+ if (of_property_read_u32(pnode, "version", &player->ver) ||
993+ player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
994994 dev_err(dev, "Unknown uniperipheral version ");
995995 return -EINVAL;
996996 }
@@ -998,10 +998,16 @@ static int uni_player_parse_dt(struct platform_device *pdev, · 1 unmodified line
998998 if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
999999 info->underflow_enabled = 1;
10001000
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+ }
10021005
10031006 /* 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+ }
10051011
10061012 if (strcasecmp(mode, "hdmi") == 0)
10071013 info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_HDMI;
sound/soc/sti/uniperif_reader.c+5−1
@@ -316,7 +316,11 @@ static int uni_reader_parse_dt(struct platform_device *pdev, · 315 unmodified lines
316316 if (!info)
317317 return -ENOMEM;
318318
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+ }
320324
321325 /* Save the info structure */
322326 reader->info = info;