Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull sound fixes from Takashi Iwai:

- A collection of small ASoC driver fixes (error path fixes, register
correction, regulator bypass mode fix, etc)

- A few regression fixes and quirks of HD-audio (wrong page attributes
for SG-buffer, Poulsbo/Oaktrail controller fix, digital mic fix for
Acer, etc)

- A fix for USB-audio UAC2 devices wrt FU length check

* tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Fix non-snoop page handling
ALSA: hda - Enable LPIB delay count for Poulsbo / Oaktrail
ALSA: hda - fix inverted internal mic on Acer AOA150/ZG5
ALSA: usb-audio: fix invalid length check for RME and other UAC 2 devices
ALSA: hda - Add a fixup for Packard-Bell desktop with ALC880
ASoC: wm_adsp: Release firmware on error
ASoC: wm_adsp: Use GFP_DMA for things that may be DMAed
ASoC: arizona: Use actual rather than desired BCLK when calculating LRCLK
ASoC: wm2200: correct mixer values and text
ASoC: MAINTAINERS: Update email address.
ASoC: wm5110: Correct AEC loopback mask
ASoC: wm5102: Correct AEC loopback mask
ASoC: dapm: Fix sense of regulator bypass mode
ASoC: fsl: fix multiple definition of init_module
ASoC: arizona: Disable free-running mode on FLL1

+69 -48
+30 -19
sound/pci/hda/hda_intel.c
··· 656 656 #define get_azx_dev(substream) (substream->runtime->private_data) 657 657 658 658 #ifdef CONFIG_X86 659 - static void __mark_pages_wc(struct azx *chip, void *addr, size_t size, bool on) 659 + static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) 660 660 { 661 + int pages; 662 + 661 663 if (azx_snoop(chip)) 662 664 return; 663 - if (addr && size) { 664 - int pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; 665 + if (!dmab || !dmab->area || !dmab->bytes) 666 + return; 667 + 668 + #ifdef CONFIG_SND_DMA_SGBUF 669 + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_SG) { 670 + struct snd_sg_buf *sgbuf = dmab->private_data; 665 671 if (on) 666 - set_memory_wc((unsigned long)addr, pages); 672 + set_pages_array_wc(sgbuf->page_table, sgbuf->pages); 667 673 else 668 - set_memory_wb((unsigned long)addr, pages); 674 + set_pages_array_wb(sgbuf->page_table, sgbuf->pages); 675 + return; 669 676 } 677 + #endif 678 + 679 + pages = (dmab->bytes + PAGE_SIZE - 1) >> PAGE_SHIFT; 680 + if (on) 681 + set_memory_wc((unsigned long)dmab->area, pages); 682 + else 683 + set_memory_wb((unsigned long)dmab->area, pages); 670 684 } 671 685 672 686 static inline void mark_pages_wc(struct azx *chip, struct snd_dma_buffer *buf, 673 687 bool on) 674 688 { 675 - __mark_pages_wc(chip, buf->area, buf->bytes, on); 689 + __mark_pages_wc(chip, buf, on); 676 690 } 677 691 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, 678 - struct snd_pcm_runtime *runtime, bool on) 692 + struct snd_pcm_substream *substream, bool on) 679 693 { 680 694 if (azx_dev->wc_marked != on) { 681 - __mark_pages_wc(chip, runtime->dma_area, runtime->dma_bytes, on); 695 + __mark_pages_wc(chip, snd_pcm_get_dma_buf(substream), on); 682 696 azx_dev->wc_marked = on; 683 697 } 684 698 } ··· 703 689 { 704 690 } 705 691 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, 706 - struct snd_pcm_runtime *runtime, bool on) 692 + struct snd_pcm_substream *substream, bool on) 707 693 { 708 694 } 709 695 #endif ··· 1982 1968 { 1983 1969 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); 1984 1970 struct azx *chip = apcm->chip; 1985 - struct snd_pcm_runtime *runtime = substream->runtime; 1986 1971 struct azx_dev *azx_dev = get_azx_dev(substream); 1987 1972 int ret; 1988 1973 1989 - mark_runtime_wc(chip, azx_dev, runtime, false); 1974 + mark_runtime_wc(chip, azx_dev, substream, false); 1990 1975 azx_dev->bufsize = 0; 1991 1976 azx_dev->period_bytes = 0; 1992 1977 azx_dev->format_val = 0; ··· 1993 1980 params_buffer_bytes(hw_params)); 1994 1981 if (ret < 0) 1995 1982 return ret; 1996 - mark_runtime_wc(chip, azx_dev, runtime, true); 1983 + mark_runtime_wc(chip, azx_dev, substream, true); 1997 1984 return ret; 1998 1985 } 1999 1986 ··· 2002 1989 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); 2003 1990 struct azx_dev *azx_dev = get_azx_dev(substream); 2004 1991 struct azx *chip = apcm->chip; 2005 - struct snd_pcm_runtime *runtime = substream->runtime; 2006 1992 struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream]; 2007 1993 2008 1994 /* reset BDL address */ ··· 2014 2002 2015 2003 snd_hda_codec_cleanup(apcm->codec, hinfo, substream); 2016 2004 2017 - mark_runtime_wc(chip, azx_dev, runtime, false); 2005 + mark_runtime_wc(chip, azx_dev, substream, false); 2018 2006 return snd_pcm_lib_free_pages(substream); 2019 2007 } 2020 2008 ··· 3625 3613 /* 5 Series/3400 */ 3626 3614 { PCI_DEVICE(0x8086, 0x3b56), 3627 3615 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH }, 3628 - /* SCH */ 3616 + /* Poulsbo */ 3629 3617 { PCI_DEVICE(0x8086, 0x811b), 3630 - .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3631 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_LPIB }, /* Poulsbo */ 3618 + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, 3619 + /* Oaktrail */ 3632 3620 { PCI_DEVICE(0x8086, 0x080a), 3633 - .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3634 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_LPIB }, /* Oaktrail */ 3621 + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, 3635 3622 /* ICH */ 3636 3623 { PCI_DEVICE(0x8086, 0x2668), 3637 3624 .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_OLD_SSYNC |
+2
sound/pci/hda/patch_realtek.c
··· 4694 4694 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), 4695 4695 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), 4696 4696 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), 4697 + SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST), 4697 4698 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734), 4698 4699 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), 4699 4700 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), ··· 5709 5708 }; 5710 5709 5711 5710 static const struct snd_pci_quirk alc268_fixup_tbl[] = { 5711 + SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), 5712 5712 /* below is codec SSID since multiple Toshiba laptops have the 5713 5713 * same PCI SSID 1179:ff00 5714 5714 */
+4 -1
sound/soc/codecs/arizona.c
··· 685 685 } 686 686 sr_val = i; 687 687 688 - lrclk = snd_soc_params_to_bclk(params) / params_rate(params); 688 + lrclk = rates[bclk] / params_rate(params); 689 689 690 690 arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", 691 691 rates[bclk], rates[bclk] / lrclk); ··· 1081 1081 dev_err(arizona->dev, "Failed to get FLL%d clock OK IRQ: %d\n", 1082 1082 id, ret); 1083 1083 } 1084 + 1085 + regmap_update_bits(arizona->regmap, fll->base + 1, 1086 + ARIZONA_FLL1_FREERUN, 0); 1084 1087 1085 1088 return 0; 1086 1089 }
-3
sound/soc/codecs/wm2200.c
··· 1019 1019 "EQR", 1020 1020 "LHPF1", 1021 1021 "LHPF2", 1022 - "LHPF3", 1023 - "LHPF4", 1024 1022 "DSP1.1", 1025 1023 "DSP1.2", 1026 1024 "DSP1.3", ··· 1051 1053 0x25, 1052 1054 0x50, /* EQ */ 1053 1055 0x51, 1054 - 0x52, 1055 1056 0x60, /* LHPF1 */ 1056 1057 0x61, /* LHPF2 */ 1057 1058 0x68, /* DSP1 */
+1 -2
sound/soc/codecs/wm5102.c
··· 896 896 897 897 static const struct soc_enum wm5102_aec_loopback = 898 898 SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, 899 - ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 900 - ARIZONA_AEC_LOOPBACK_SRC_MASK, 899 + ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, 901 900 ARRAY_SIZE(wm5102_aec_loopback_texts), 902 901 wm5102_aec_loopback_texts, 903 902 wm5102_aec_loopback_values);
+1 -2
sound/soc/codecs/wm5110.c
··· 344 344 345 345 static const struct soc_enum wm5110_aec_loopback = 346 346 SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, 347 - ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 348 - ARIZONA_AEC_LOOPBACK_SRC_MASK, 347 + ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, 349 348 ARRAY_SIZE(wm5110_aec_loopback_texts), 350 349 wm5110_aec_loopback_texts, 351 350 wm5110_aec_loopback_values);
+3 -3
sound/soc/codecs/wm_adsp.c
··· 324 324 325 325 if (reg) { 326 326 buf = kmemdup(region->data, le32_to_cpu(region->len), 327 - GFP_KERNEL); 327 + GFP_KERNEL | GFP_DMA); 328 328 if (!buf) { 329 329 adsp_err(dsp, "Out of memory\n"); 330 330 return -ENOMEM; ··· 396 396 hdr = (void*)&firmware->data[0]; 397 397 if (memcmp(hdr->magic, "WMDR", 4) != 0) { 398 398 adsp_err(dsp, "%s: invalid magic\n", file); 399 - return -EINVAL; 399 + goto out_fw; 400 400 } 401 401 402 402 adsp_dbg(dsp, "%s: v%d.%d.%d\n", file, ··· 439 439 440 440 if (reg) { 441 441 buf = kmemdup(blk->data, le32_to_cpu(blk->len), 442 - GFP_KERNEL); 442 + GFP_KERNEL | GFP_DMA); 443 443 if (!buf) { 444 444 adsp_err(dsp, "Out of memory\n"); 445 445 return -ENOMEM;
+2 -7
sound/soc/fsl/Kconfig
··· 108 108 config SND_SOC_IMX_SSI 109 109 tristate 110 110 111 - config SND_SOC_IMX_PCM 112 - tristate 113 - 114 111 config SND_SOC_IMX_PCM_FIQ 115 - bool 112 + tristate 116 113 select FIQ 117 - select SND_SOC_IMX_PCM 118 114 119 115 config SND_SOC_IMX_PCM_DMA 120 - bool 116 + tristate 121 117 select SND_SOC_DMAENGINE_PCM 122 - select SND_SOC_IMX_PCM 123 118 124 119 config SND_SOC_IMX_AUDMUX 125 120 tristate
+4 -1
sound/soc/fsl/Makefile
··· 41 41 obj-$(CONFIG_SND_SOC_IMX_SSI) += snd-soc-imx-ssi.o 42 42 obj-$(CONFIG_SND_SOC_IMX_AUDMUX) += snd-soc-imx-audmux.o 43 43 44 - obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o 44 + obj-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += snd-soc-imx-pcm-fiq.o 45 + snd-soc-imx-pcm-fiq-y := imx-pcm-fiq.o imx-pcm.o 46 + obj-$(CONFIG_SND_SOC_IMX_PCM_DMA) += snd-soc-imx-pcm-dma.o 47 + snd-soc-imx-pcm-dma-y := imx-pcm-dma.o imx-pcm.o 45 48 46 49 # i.MX Machine Support 47 50 snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o
-3
sound/soc/fsl/imx-pcm.c
··· 31 31 runtime->dma_bytes); 32 32 return ret; 33 33 } 34 - EXPORT_SYMBOL_GPL(snd_imx_pcm_mmap); 35 34 36 35 static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) 37 36 { ··· 79 80 out: 80 81 return ret; 81 82 } 82 - EXPORT_SYMBOL_GPL(imx_pcm_new); 83 83 84 84 void imx_pcm_free(struct snd_pcm *pcm) 85 85 { ··· 100 102 buf->area = NULL; 101 103 } 102 104 } 103 - EXPORT_SYMBOL_GPL(imx_pcm_free); 104 105 105 106 MODULE_DESCRIPTION("Freescale i.MX PCM driver"); 106 107 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
+10 -2
sound/soc/soc-dapm.c
··· 1023 1023 1024 1024 if (SND_SOC_DAPM_EVENT_ON(event)) { 1025 1025 if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { 1026 - ret = regulator_allow_bypass(w->regulator, true); 1026 + ret = regulator_allow_bypass(w->regulator, false); 1027 1027 if (ret != 0) 1028 1028 dev_warn(w->dapm->dev, 1029 1029 "ASoC: Failed to bypass %s: %d\n", ··· 1033 1033 return regulator_enable(w->regulator); 1034 1034 } else { 1035 1035 if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { 1036 - ret = regulator_allow_bypass(w->regulator, false); 1036 + ret = regulator_allow_bypass(w->regulator, true); 1037 1037 if (ret != 0) 1038 1038 dev_warn(w->dapm->dev, 1039 1039 "ASoC: Failed to unbypass %s: %d\n", ··· 3038 3038 dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", 3039 3039 w->name, ret); 3040 3040 return NULL; 3041 + } 3042 + 3043 + if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { 3044 + ret = regulator_allow_bypass(w->regulator, true); 3045 + if (ret != 0) 3046 + dev_warn(w->dapm->dev, 3047 + "ASoC: Failed to unbypass %s: %d\n", 3048 + w->name, ret); 3041 3049 } 3042 3050 break; 3043 3051 case snd_soc_dapm_clock_supply:
+12 -5
sound/usb/mixer.c
··· 1331 1331 } 1332 1332 channels = (hdr->bLength - 7) / csize - 1; 1333 1333 bmaControls = hdr->bmaControls; 1334 + if (hdr->bLength < 7 + csize) { 1335 + snd_printk(KERN_ERR "usbaudio: unit %u: " 1336 + "invalid UAC_FEATURE_UNIT descriptor\n", 1337 + unitid); 1338 + return -EINVAL; 1339 + } 1334 1340 } else { 1335 1341 struct uac2_feature_unit_descriptor *ftr = _ftr; 1336 1342 csize = 4; 1337 1343 channels = (hdr->bLength - 6) / 4 - 1; 1338 1344 bmaControls = ftr->bmaControls; 1339 - } 1340 - 1341 - if (hdr->bLength < 7 || !csize || hdr->bLength < 7 + csize) { 1342 - snd_printk(KERN_ERR "usbaudio: unit %u: invalid UAC_FEATURE_UNIT descriptor\n", unitid); 1343 - return -EINVAL; 1345 + if (hdr->bLength < 6 + csize) { 1346 + snd_printk(KERN_ERR "usbaudio: unit %u: " 1347 + "invalid UAC_FEATURE_UNIT descriptor\n", 1348 + unitid); 1349 + return -EINVAL; 1350 + } 1344 1351 } 1345 1352 1346 1353 /* parse the source unit */