提交 6666cabf 编写于 作者: L Linus Torvalds

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

Pull sound fixes from Takashi Iwai:
 "Containing only a few really small/trivial fixes.  The only urgent fix
  is a regression fix of HDMI codec probing, introduced in 3.6-rc1.  The
  rest are HD-audio specific fixes and a copule of minor bug fixes in
  PCM core and the old emu10k1."

* tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad
  ALSA: hda - Fix ugly debug prints with CONFIG_SND_VERBOSE_PRINTK=y
  ALSA: hda - remove redundant auto quirks for conexant 506x
  ALSA: hda - remove quirk for Dell Vostro 1015
  ALSA: hda - add dock support for Thinkpad X230
  ALSA: hda - Fix regression of HDMI codec probing
  ALSA: hda - add dock support for Thinkpad T430s
  ALSA: emu10k1: Avoid access to invalid pages when period=1
  ALSA: PCM: Fix possible memory leaks in the error path
...@@ -101,7 +101,7 @@ void *snd_malloc_sgbuf_pages(struct device *device, ...@@ -101,7 +101,7 @@ void *snd_malloc_sgbuf_pages(struct device *device,
if (snd_dma_alloc_pages_fallback(SNDRV_DMA_TYPE_DEV, device, if (snd_dma_alloc_pages_fallback(SNDRV_DMA_TYPE_DEV, device,
chunk, &tmpb) < 0) { chunk, &tmpb) < 0) {
if (!sgbuf->pages) if (!sgbuf->pages)
return NULL; goto _failed;
if (!res_size) if (!res_size)
goto _failed; goto _failed;
size = sgbuf->pages * PAGE_SIZE; size = sgbuf->pages * PAGE_SIZE;
......
...@@ -326,6 +326,9 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst ...@@ -326,6 +326,9 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
for (page = blk->first_page; page <= blk->last_page; page++, idx++) { for (page = blk->first_page; page <= blk->last_page; page++, idx++) {
unsigned long ofs = idx << PAGE_SHIFT; unsigned long ofs = idx << PAGE_SHIFT;
dma_addr_t addr; dma_addr_t addr;
if (ofs >= runtime->dma_bytes)
addr = emu->silent_page.addr;
else
addr = snd_pcm_sgbuf_get_addr(substream, ofs); addr = snd_pcm_sgbuf_get_addr(substream, ofs);
if (! is_valid_page(emu, addr)) { if (! is_valid_page(emu, addr)) {
printk(KERN_ERR "emu: failure page = %d\n", idx); printk(KERN_ERR "emu: failure page = %d\n", idx);
......
...@@ -332,13 +332,12 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, ...@@ -332,13 +332,12 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
if (cfg->dig_outs) if (cfg->dig_outs)
snd_printd(" dig-out=0x%x/0x%x\n", snd_printd(" dig-out=0x%x/0x%x\n",
cfg->dig_out_pins[0], cfg->dig_out_pins[1]); cfg->dig_out_pins[0], cfg->dig_out_pins[1]);
snd_printd(" inputs:"); snd_printd(" inputs:\n");
for (i = 0; i < cfg->num_inputs; i++) { for (i = 0; i < cfg->num_inputs; i++) {
snd_printd(" %s=0x%x", snd_printd(" %s=0x%x\n",
hda_get_autocfg_input_label(codec, cfg, i), hda_get_autocfg_input_label(codec, cfg, i),
cfg->inputs[i].pin); cfg->inputs[i].pin);
} }
snd_printd("\n");
if (cfg->dig_in_pin) if (cfg->dig_in_pin)
snd_printd(" dig-in=0x%x\n", cfg->dig_in_pin); snd_printd(" dig-in=0x%x\n", cfg->dig_in_pin);
......
...@@ -2967,12 +2967,10 @@ static const char * const cxt5066_models[CXT5066_MODELS] = { ...@@ -2967,12 +2967,10 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
}; };
static const struct snd_pci_quirk cxt5066_cfg_tbl[] = { static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT5066_AUTO),
SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD),
...@@ -2988,14 +2986,10 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = { ...@@ -2988,14 +2986,10 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS), SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T510", CXT5066_AUTO),
SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520 & W520", CXT5066_AUTO),
SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo U350", CXT5066_ASUS), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo U350", CXT5066_ASUS),
SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G565", CXT5066_AUTO),
SND_PCI_QUIRK(0x1b0a, 0x2092, "CyberpowerPC Gamer Xplorer N57001", CXT5066_AUTO),
{} {}
}; };
......
...@@ -877,8 +877,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, ...@@ -877,8 +877,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
struct hdmi_eld *eld; struct hdmi_eld *eld;
struct hdmi_spec_per_cvt *per_cvt = NULL; struct hdmi_spec_per_cvt *per_cvt = NULL;
hinfo->nid = 0; /* clear the leftover value */
/* Validate hinfo */ /* Validate hinfo */
pin_idx = hinfo_to_pin_index(spec, hinfo); pin_idx = hinfo_to_pin_index(spec, hinfo);
if (snd_BUG_ON(pin_idx < 0)) if (snd_BUG_ON(pin_idx < 0))
...@@ -1163,6 +1161,14 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, ...@@ -1163,6 +1161,14 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format); return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
} }
static int generic_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
snd_hda_codec_cleanup_stream(codec, hinfo->nid);
return 0;
}
static int hdmi_pcm_close(struct hda_pcm_stream *hinfo, static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
struct hda_codec *codec, struct hda_codec *codec,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
...@@ -1202,6 +1208,7 @@ static const struct hda_pcm_ops generic_ops = { ...@@ -1202,6 +1208,7 @@ static const struct hda_pcm_ops generic_ops = {
.open = hdmi_pcm_open, .open = hdmi_pcm_open,
.close = hdmi_pcm_close, .close = hdmi_pcm_close,
.prepare = generic_hdmi_playback_pcm_prepare, .prepare = generic_hdmi_playback_pcm_prepare,
.cleanup = generic_hdmi_playback_pcm_cleanup,
}; };
static int generic_hdmi_build_pcms(struct hda_codec *codec) static int generic_hdmi_build_pcms(struct hda_codec *codec)
...@@ -1220,7 +1227,6 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec) ...@@ -1220,7 +1227,6 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK]; pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK];
pstr->substreams = 1; pstr->substreams = 1;
pstr->ops = generic_ops; pstr->ops = generic_ops;
pstr->nid = 1; /* FIXME: just for avoiding a debug WARNING */
/* other pstr fields are set in open */ /* other pstr fields are set in open */
} }
......
...@@ -6099,6 +6099,8 @@ static const struct alc_fixup alc269_fixups[] = { ...@@ -6099,6 +6099,8 @@ static const struct alc_fixup alc269_fixups[] = {
[ALC269_FIXUP_PCM_44K] = { [ALC269_FIXUP_PCM_44K] = {
.type = ALC_FIXUP_FUNC, .type = ALC_FIXUP_FUNC,
.v.func = alc269_fixup_pcm_44k, .v.func = alc269_fixup_pcm_44k,
.chained = true,
.chain_id = ALC269_FIXUP_QUANTA_MUTE
}, },
[ALC269_FIXUP_STEREO_DMIC] = { [ALC269_FIXUP_STEREO_DMIC] = {
.type = ALC_FIXUP_FUNC, .type = ALC_FIXUP_FUNC,
...@@ -6207,9 +6209,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -6207,9 +6209,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE), SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),
SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
#if 0 #if 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册