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 ...
Unified · Split
| @@ -11249,7 +11249,6 @@ VOLTAGE AND CURRENT REGULATOR FRAMEWORK · 11248 unmodified lines | ||
| 11249 | 11249 | M: Liam Girdwood <lgirdwood@gmail.com> |
| 11250 | 11250 | M: Mark Brown <broonie@kernel.org> |
| 11251 | 11251 | L: linux-kernel@vger.kernel.org |
| 11252 | −W: http://opensource.wolfsonmicro.com/node/15 | |
| 11253 | 11252 | W: http://www.slimlogic.co.uk/?p=48 |
| 11254 | 11253 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git |
| 11255 | 11254 | S: Supported |
| @@ -11378,17 +11377,15 @@ WM97XX TOUCHSCREEN DRIVERS · 122 unmodified lines | ||
| 11378 | 11377 | M: Mark Brown <broonie@kernel.org> |
| 11379 | 11378 | M: Liam Girdwood <lrg@slimlogic.co.uk> |
| 11380 | 11379 | 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 | |
| 11383 | 11381 | S: Supported |
| 11384 | 11382 | F: drivers/input/touchscreen/*wm97* |
| 11385 | 11383 | F: include/linux/wm97xx.h |
| 11386 | 11384 | |
| 11387 | 11385 | WOLFSON MICROELECTRONICS DRIVERS |
| 11388 | 11386 | 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 | |
| 11392 | 11389 | S: Supported |
| 11393 | 11390 | F: Documentation/hwmon/wm83?? |
| 11394 | 11391 | F: arch/arm/mach-s3c64xx/mach-crag6410* |
| @@ -9,6 +9,14 @@ menuconfig SND_ARM · 8 unmodified lines | ||
| 9 | 9 | Drivers that are implemented on ASoC can be found in |
| 10 | 10 | "ALSA for SoC audio support" section. |
| 11 | 11 | |
| 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 | + | |
| 12 | 20 | if SND_ARM |
| 13 | 21 | |
| 14 | 22 | config SND_ARMAACI |
| @@ -21,13 +29,6 @@ config SND_PXA2XX_PCM · 6 unmodified lines | ||
| 21 | 29 | tristate |
| 22 | 30 | select SND_PCM |
| 23 | 31 | |
| 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 | − | |
| 31 | 32 | config SND_PXA2XX_AC97 |
| 32 | 33 | tristate "AC97 driver for the Intel PXA2xx chip" |
| 33 | 34 | depends on ARCH_PXA |
| @@ -73,6 +73,7 @@ struct hda_tegra { · 72 unmodified lines | ||
| 73 | 73 | struct clk *hda2codec_2x_clk; |
| 74 | 74 | struct clk *hda2hdmi_clk; |
| 75 | 75 | void __iomem *regs; |
| 76 | + struct work_struct probe_work; | |
| 76 | 77 | }; |
| 77 | 78 | |
| 78 | 79 | #ifdef CONFIG_PM |
| @@ -294,7 +295,9 @@ static int hda_tegra_dev_disconnect(struct snd_device *device) · 215 unmodified lines | ||
| 294 | 295 | static int hda_tegra_dev_free(struct snd_device *device) |
| 295 | 296 | { |
| 296 | 297 | struct azx *chip = device->device_data; |
| 298 | + struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip); | |
| 297 | 299 | |
| 300 | + cancel_work_sync(&hda->probe_work); | |
| 298 | 301 | if (azx_bus(chip)->chip_init) { |
| 299 | 302 | azx_stop_all_streams(chip); |
| 300 | 303 | azx_stop_chip(chip); |
| @@ -426,6 +429,9 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) · 125 unmodified lines | ||
| 426 | 429 | /* |
| 427 | 430 | * constructor |
| 428 | 431 | */ |
| 432 | + | |
| 433 | +static void hda_tegra_probe_work(struct work_struct *work); | |
| 434 | + | |
| 429 | 435 | static int hda_tegra_create(struct snd_card *card, |
| 430 | 436 | unsigned int driver_caps, |
| 431 | 437 | struct hda_tegra *hda) |
| @@ -452,6 +458,8 @@ static int hda_tegra_create(struct snd_card *card, · 20 unmodified lines | ||
| 452 | 458 | chip->single_cmd = false; |
| 453 | 459 | chip->snoop = true; |
| 454 | 460 | |
| 461 | + INIT_WORK(&hda->probe_work, hda_tegra_probe_work); | |
| 462 | + | |
| 455 | 463 | err = azx_bus_init(chip, NULL, &hda_tegra_io_ops); |
| 456 | 464 | if (err < 0) |
| 457 | 465 | return err; |
| @@ -499,6 +507,21 @@ static int hda_tegra_probe(struct platform_device *pdev) · 41 unmodified lines | ||
| 499 | 507 | card->private_data = chip; |
| 500 | 508 | |
| 501 | 509 | 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; | |
| 502 | 525 | |
| 503 | 526 | err = hda_tegra_first_init(chip, pdev); |
| 504 | 527 | if (err < 0) |
| @@ -520,11 +543,8 @@ static int hda_tegra_probe(struct platform_device *pdev) · 15 unmodified lines | ||
| 520 | 543 | chip->running = 1; |
| 521 | 544 | snd_hda_set_power_save(&chip->bus, power_save * 1000); |
| 522 | 545 | |
| 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 */ | |
| 528 | 548 | } |
| 529 | 549 | |
| 530 | 550 | static int hda_tegra_remove(struct platform_device *pdev) |
| @@ -4188,6 +4188,24 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec, · 4187 unmodified lines | ||
| 4188 | 4188 | } |
| 4189 | 4189 | } |
| 4190 | 4190 | |
| 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 | + | |
| 4191 | 4209 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
| 4192 | 4210 | { |
| 4193 | 4211 | struct alc_spec *spec = codec->spec; |
| @@ -4562,7 +4580,6 @@ enum { · 368 unmodified lines | ||
| 4562 | 4580 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
| 4563 | 4581 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 4564 | 4582 | ALC292_FIXUP_TPT440_DOCK, |
| 4565 | − ALC292_FIXUP_TPT440_DOCK2, | |
| 4566 | 4583 | ALC283_FIXUP_BXBT2807_MIC, |
| 4567 | 4584 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, |
| 4568 | 4585 | ALC282_FIXUP_ASPIRE_V5_PINS, |
| @@ -5029,17 +5046,7 @@ static const struct hda_fixup alc269_fixups[] = { · 460 unmodified lines | ||
| 5029 | 5046 | }, |
| 5030 | 5047 | [ALC292_FIXUP_TPT440_DOCK] = { |
| 5031 | 5048 | .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, | |
| 5043 | 5050 | .chained = true, |
| 5044 | 5051 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 5045 | 5052 | }, |
| @@ -296,7 +296,6 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev) · 295 unmodified lines | ||
| 296 | 296 | { |
| 297 | 297 | struct resource *iores, *dmares; |
| 298 | 298 | unsigned long sel; |
| 299 | − int ret; | |
| 300 | 299 | struct au1xpsc_audio_data *wd; |
| 301 | 300 | |
| 302 | 301 | wd = devm_kzalloc(&pdev->dev, sizeof(struct au1xpsc_audio_data), |
| @@ -732,14 +732,14 @@ static const struct snd_kcontrol_new rt5645_mono_adc_r_mix[] = { · 731 unmodified lines | ||
| 732 | 732 | static const struct snd_kcontrol_new rt5645_dac_l_mix[] = { |
| 733 | 733 | SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER, |
| 734 | 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 | 736 | RT5645_M_DAC1_L_SFT, 1, 1), |
| 737 | 737 | }; |
| 738 | 738 | |
| 739 | 739 | static const struct snd_kcontrol_new rt5645_dac_r_mix[] = { |
| 740 | 740 | SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER, |
| 741 | 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 | 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) · 635 unmodified lines | ||
| 1381 | 1381 | regmap_write(rt5645->regmap, RT5645_PR_BASE + |
| 1382 | 1382 | RT5645_MAMP_INT_REG2, 0xfc00); |
| 1383 | 1383 | snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140); |
| 1384 | − mdelay(5); | |
| 1384 | + msleep(40); | |
| 1385 | 1385 | rt5645->hp_on = true; |
| 1386 | 1386 | } else { |
| 1387 | 1387 | /* depop parameters */ |
| @@ -2829,13 +2829,12 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert) · 1441 unmodified lines | ||
| 2829 | 2829 | snd_soc_dapm_sync(dapm); |
| 2830 | 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 | 2832 | } else { /* jack out */ |
| 2837 | 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 | 2838 | regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2, |
| 2840 | 2839 | RT5645_CBJ_MN_JD, RT5645_CBJ_MN_JD); |
| 2841 | 2840 | 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 | ||
| 2880 | 2879 | rt5645->en_button_func = true; |
| 2881 | 2880 | regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1, |
| 2882 | 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 | 2882 | regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1, |
| 2886 | 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[] = { · 317 unmodified lines | ||
| 3205 | 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 | |
| @@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 576 unmodified lines | ||
| 577 | 577 | struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec); |
| 578 | 578 | unsigned long flags; |
| 579 | 579 | int ret; |
| 580 | − const struct firmware *fw; | |
| 581 | 580 | struct spi_message m; |
| 582 | 581 | struct spi_transfer t; |
| 583 | 582 | struct dfw_pllrec pll_rec; |
| @@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 39 unmodified lines | ||
| 623 | 622 | wm0010->state = WM0010_OUT_OF_RESET; |
| 624 | 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 | 625 | if (!wait_for_completion_timeout(&wm0010->boot_completion, |
| 635 | 626 | msecs_to_jiffies(20))) |
| 636 | 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) · 36 unmodified lines | ||
| 673 | 664 | |
| 674 | 665 | img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA); |
| 675 | 666 | if (!img_swap) |
| 676 | − goto abort; | |
| 667 | + goto abort_out; | |
| 677 | 668 | |
| 678 | 669 | /* We need to re-order for 0010 */ |
| 679 | 670 | 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 | ||
| 688 | 679 | spi_message_add_tail(&t, &m); |
| 689 | 680 | |
| 690 | 681 | ret = spi_sync(spi, &m); |
| 691 | − if (ret != 0) { | |
| 682 | + if (ret) { | |
| 692 | 683 | dev_err(codec->dev, "First PLL write failed: %d\n", ret); |
| 693 | − goto abort; | |
| 684 | + goto abort_swap; | |
| 694 | 685 | } |
| 695 | 686 | |
| 696 | 687 | /* Use a second send of the message to get the return status */ |
| 697 | 688 | ret = spi_sync(spi, &m); |
| 698 | − if (ret != 0) { | |
| 689 | + if (ret) { | |
| 699 | 690 | dev_err(codec->dev, "Second PLL write failed: %d\n", ret); |
| 700 | − goto abort; | |
| 691 | + goto abort_swap; | |
| 701 | 692 | } |
| 702 | 693 | |
| 703 | 694 | p = (u32 *)out; |
| @@ -730,6 +721,10 @@ static int wm0010_boot(struct snd_soc_codec *codec) · 26 unmodified lines | ||
| 730 | 721 | |
| 731 | 722 | return 0; |
| 732 | 723 | |
| 724 | +abort_swap: | |
| 725 | + kfree(img_swap); | |
| 726 | +abort_out: | |
| 727 | + kfree(out); | |
| 733 | 728 | abort: |
| 734 | 729 | /* Put the chip back into reset */ |
| 735 | 730 | wm0010_halt(codec); |
| @@ -211,28 +211,38 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol, · 210 unmodified lines | ||
| 211 | 211 | return wm8960_set_deemph(codec); |
| 212 | 212 | } |
| 213 | 213 | |
| 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); | |
| 216 | 217 | static const DECLARE_TLV_DB_SCALE(bypass_tlv, -2100, 300, 0); |
| 217 | 218 | 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 | +}; | |
| 219 | 225 | |
| 220 | 226 | static const struct snd_kcontrol_new wm8960_snd_controls[] = { |
| 221 | 227 | SOC_DOUBLE_R_TLV("Capture Volume", WM8960_LINVOL, WM8960_RINVOL, |
| 222 | − 0, 63, 0, adc_tlv), | |
| 228 | + 0, 63, 0, inpga_tlv), | |
| 223 | 229 | SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL, |
| 224 | 230 | 6, 1, 0), |
| 225 | 231 | SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL, |
| 226 | 232 | 7, 1, 0), |
| 227 | 233 | |
| 228 | 234 | 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), | |
| 230 | 236 | 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), | |
| 232 | 238 | 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), | |
| 234 | 240 | 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), | |
| 236 | 246 | |
| 237 | 247 | SOC_DOUBLE_R_TLV("Playback Volume", WM8960_LDAC, WM8960_RDAC, |
| 238 | 248 | 0, 255, 0, dac_tlv), |
| @@ -2944,7 +2944,8 @@ static int wm8962_mute(struct snd_soc_dai *dai, int mute) · 2943 unmodified lines | ||
| 2944 | 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 | 2950 | #define WM8962_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
| 2950 | 2951 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
| @@ -663,7 +663,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, · 662 unmodified lines | ||
| 663 | 663 | u8 rx_ser = 0; |
| 664 | 664 | u8 slots = mcasp->tdm_slots; |
| 665 | 665 | u8 max_active_serializers = (channels + slots - 1) / slots; |
| 666 | − int active_serializers, numevt, n; | |
| 666 | + int active_serializers, numevt; | |
| 667 | 667 | u32 reg; |
| 668 | 668 | /* Default configuration */ |
| 669 | 669 | 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 | ||
| 745 | 745 | * The number of words for numevt need to be in steps of active |
| 746 | 746 | * serializers. |
| 747 | 747 | */ |
| 748 | − n = numevt % active_serializers; | |
| 749 | − if (n) | |
| 750 | − numevt += (active_serializers - n); | |
| 748 | + numevt = (numevt / active_serializers) * active_serializers; | |
| 749 | + | |
| 751 | 750 | while (period_words % numevt && numevt > 0) |
| 752 | 751 | numevt -= active_serializers; |
| 753 | 752 | if (numevt <= 0) |
| @@ -1299,6 +1298,7 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = { · 545 unmodified lines | ||
| 1299 | 1298 | .ops = &davinci_mcasp_dai_ops, |
| 1300 | 1299 | |
| 1301 | 1300 | .symmetric_samplebits = 1, |
| 1301 | + .symmetric_rates = 1, | |
| 1302 | 1302 | }, |
| 1303 | 1303 | { |
| 1304 | 1304 | .name = "davinci-mcasp.1", |
| @@ -1685,7 +1685,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) · 380 unmodified lines | ||
| 1685 | 1685 | |
| 1686 | 1686 | irq = platform_get_irq_byname(pdev, "common"); |
| 1687 | 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 | 1689 | dev_name(&pdev->dev)); |
| 1690 | 1690 | ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, |
| 1691 | 1691 | davinci_mcasp_common_irq_handler, |
| @@ -1702,7 +1702,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) · 10 unmodified lines | ||
| 1702 | 1702 | |
| 1703 | 1703 | irq = platform_get_irq_byname(pdev, "rx"); |
| 1704 | 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 | 1706 | dev_name(&pdev->dev)); |
| 1707 | 1707 | ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, |
| 1708 | 1708 | davinci_mcasp_rx_irq_handler, |
| @@ -1717,7 +1717,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) · 8 unmodified lines | ||
| 1717 | 1717 | |
| 1718 | 1718 | irq = platform_get_irq_byname(pdev, "tx"); |
| 1719 | 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 | 1721 | dev_name(&pdev->dev)); |
| 1722 | 1722 | ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, |
| 1723 | 1723 | davinci_mcasp_tx_irq_handler, |
| @@ -488,7 +488,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) · 487 unmodified lines | ||
| 488 | 488 | priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; |
| 489 | 489 | } else { |
| 490 | 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 | 495 | /* Common settings for corresponding Freescale CPU DAI driver */ |
| @@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids); · 248 unmodified lines | ||
| 249 | 249 | |
| 250 | 250 | static 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 | |
| 255 | 256 | 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 | ||
| 947 | 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 | 952 | fsl_ssi_setup_ac97(ssi_private); |
| 952 | 953 | |
| 953 | 954 | return 0; |
| @@ -302,6 +302,10 @@ struct sst_hsw { · 301 unmodified lines | ||
| 302 | 302 | struct sst_hsw_ipc_dx_reply dx; |
| 303 | 303 | void *dx_context; |
| 304 | 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 | 310 | /* boot */ |
| 307 | 311 | wait_queue_head_t boot_wait; |
| @@ -1400,10 +1404,10 @@ int sst_hsw_device_set_config(struct sst_hsw *hsw, · 1092 unmodified lines | ||
| 1400 | 1404 | |
| 1401 | 1405 | trace_ipc_request("set device config", dev); |
| 1402 | 1406 | |
| 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; | |
| 1407 | 1411 | if (mode == SST_HSW_DEVICE_TDM_CLOCK_MASTER) |
| 1408 | 1412 | config.channels = 4; |
| 1409 | 1413 | else |
| @@ -1704,10 +1708,10 @@ int sst_hsw_dsp_runtime_resume(struct sst_hsw *hsw) · 294 unmodified lines | ||
| 1704 | 1708 | return -EIO; |
| 1705 | 1709 | } |
| 1706 | 1710 | |
| 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); | |
| 1711 | 1715 | if (ret < 0) |
| 1712 | 1716 | dev_err(dev, "error: SSP re-initialization failed\n"); |
| 1713 | 1717 | |
| @@ -549,6 +549,23 @@ static int mtk_afe_dais_startup(struct snd_pcm_substream *substream, · 548 unmodified lines | ||
| 549 | 549 | memif->substream = substream; |
| 550 | 550 | |
| 551 | 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 | 569 | ret = snd_pcm_hw_constraint_integer(runtime, |
| 553 | 570 | SNDRV_PCM_HW_PARAM_PERIODS); |
| 554 | 571 | if (ret < 0) |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | config SND_PXA2XX_SOC |
| 2 | 2 | tristate "SoC Audio for the Intel PXA2xx chip" |
| 3 | 3 | depends on ARCH_PXA |
| 4 | − select SND_ARM | |
| 5 | 4 | select SND_PXA2XX_LIB |
| 6 | 5 | help |
| 7 | 6 | 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 | ||
| 25 | 24 | config SND_PXA2XX_SOC_AC97 |
| 26 | 25 | tristate |
| 27 | 26 | select AC97_BUS |
| 28 | − select SND_ARM | |
| 29 | 27 | select SND_PXA2XX_LIB_AC97 |
| 30 | 28 | select SND_SOC_AC97_BUS |
| 31 | 29 | |
| @@ -49,7 +49,7 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { · 48 unmodified lines | ||
| 49 | 49 | .reset = pxa2xx_ac97_cold_reset, |
| 50 | 50 | }; |
| 51 | 51 | |
| 52 | −static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 12; | |
| 52 | +static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 11; | |
| 53 | 53 | static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = { |
| 54 | 54 | .addr = __PREG(PCDR), |
| 55 | 55 | .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 | ||
| 57 | 57 | .filter_data = &pxa2xx_ac97_pcm_stereo_in_req, |
| 58 | 58 | }; |
| 59 | 59 | |
| 60 | −static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 11; | |
| 60 | +static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 12; | |
| 61 | 61 | static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = { |
| 62 | 62 | .addr = __PREG(PCDR), |
| 63 | 63 | .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, |
| @@ -3501,7 +3501,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, · 3500 unmodified lines | ||
| 3501 | 3501 | |
| 3502 | 3502 | default: |
| 3503 | 3503 | WARN(1, "Unknown event %d\n", event); |
| 3504 | − return -EINVAL; | |
| 3504 | + ret = -EINVAL; | |
| 3505 | 3505 | } |
| 3506 | 3506 | |
| 3507 | 3507 | out: |
| @@ -101,6 +101,15 @@ static struct snd_soc_codec_driver dummy_codec; · 100 unmodified lines | ||
| 101 | 101 | SNDRV_PCM_FMTBIT_S32_LE | \ |
| 102 | 102 | SNDRV_PCM_FMTBIT_U32_LE | \ |
| 103 | 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 | + */ | |
| 104 | 113 | static struct snd_soc_dai_driver dummy_dai = { |
| 105 | 114 | .name = "snd-soc-dummy-dai", |
| 106 | 115 | .playback = { |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | config SND_SPEAR_SOC |
| 2 | 2 | tristate |
| 3 | − select SND_DMAENGINE_PCM | |
| 3 | + select SND_SOC_GENERIC_DMAENGINE_PCM | |
| 4 | 4 | |
| 5 | 5 | config SND_SPEAR_SPDIF_OUT |
| 6 | 6 | tristate |
| @@ -989,8 +989,8 @@ static int uni_player_parse_dt(struct platform_device *pdev, · 988 unmodified lines | ||
| 989 | 989 | if (!info) |
| 990 | 990 | return -ENOMEM; |
| 991 | 991 | |
| 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) { | |
| 994 | 994 | dev_err(dev, "Unknown uniperipheral version "); |
| 995 | 995 | return -EINVAL; |
| 996 | 996 | } |
| @@ -998,10 +998,16 @@ static int uni_player_parse_dt(struct platform_device *pdev, · 1 unmodified line | ||
| 998 | 998 | if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) |
| 999 | 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 | 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 | 1012 | if (strcasecmp(mode, "hdmi") == 0) |
| 1007 | 1013 | info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_HDMI; |
| @@ -316,7 +316,11 @@ static int uni_reader_parse_dt(struct platform_device *pdev, · 315 unmodified lines | ||
| 316 | 316 | if (!info) |
| 317 | 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 | 325 | /* Save the info structure */ |
| 322 | 326 | reader->info = info; |