Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Don't query connections for widgets have no connections
  ALSA: HDA: Fix single internal mic on ALC275 (Sony Vaio VPCSB1C5E)
  ALSA: hda - HDMI: Fix MCP7x audio infoframe checksums
  ALSA: usb-audio: define another USB ID for a buggy USB MIDI cable
  ALSA: HDA: Fix dock mic for Lenovo X220-tablet
  ASoC: format_register_str: Don't clip register values
  ASoC: PXA: Fix oops in __pxa2xx_pcm_prepare
  ASoC: zylonite: set .codec_dai_name in initializer
  • Loading branch information
torvalds committed Apr 10, 2011
2 parents 510ec7b + 84f3b6d commit 4263a2f
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 34 deletions.
3 changes: 3 additions & 0 deletions sound/arm/pxa2xx-pcm-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
if (!prtd || !prtd->params)
return 0;

if (prtd->dma_ch == -1)
return -EINVAL;

DCSR(prtd->dma_ch) &= ~DCSR_RUN;
DCSR(prtd->dma_ch) = 0;
DCMD(prtd->dma_ch) = 0;
Expand Down
1 change: 1 addition & 0 deletions sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -3035,6 +3035,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", 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, 0x38af, "Lenovo G560", CXT5066_ASUS),
SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
{}
Expand Down
70 changes: 44 additions & 26 deletions sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,39 @@ static int simple_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
stream_tag, format, substream);
}

static void nvhdmi_8ch_7x_set_info_frame_parameters(struct hda_codec *codec,
int channels)
{
unsigned int chanmask;
int chan = channels ? (channels - 1) : 1;

switch (channels) {
default:
case 0:
case 2:
chanmask = 0x00;
break;
case 4:
chanmask = 0x08;
break;
case 6:
chanmask = 0x0b;
break;
case 8:
chanmask = 0x13;
break;
}

/* Set the audio infoframe channel allocation and checksum fields. The
* channel count is computed implicitly by the hardware. */
snd_hda_codec_write(codec, 0x1, 0,
Nv_VERB_SET_Channel_Allocation, chanmask);

snd_hda_codec_write(codec, 0x1, 0,
Nv_VERB_SET_Info_Frame_Checksum,
(0x71 - chan - chanmask));
}

static int nvhdmi_8ch_7x_pcm_close(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
Expand All @@ -1298,6 +1331,10 @@ static int nvhdmi_8ch_7x_pcm_close(struct hda_pcm_stream *hinfo,
AC_VERB_SET_STREAM_FORMAT, 0);
}

/* The audio hardware sends a channel count of 0x7 (8ch) when all the
* streams are disabled. */
nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8);

return snd_hda_multi_out_dig_close(codec, &spec->multiout);
}

Expand All @@ -1308,37 +1345,16 @@ static int nvhdmi_8ch_7x_pcm_prepare(struct hda_pcm_stream *hinfo,
struct snd_pcm_substream *substream)
{
int chs;
unsigned int dataDCC1, dataDCC2, chan, chanmask, channel_id;
unsigned int dataDCC1, dataDCC2, channel_id;
int i;

mutex_lock(&codec->spdif_mutex);

chs = substream->runtime->channels;
chan = chs ? (chs - 1) : 1;

switch (chs) {
default:
case 0:
case 2:
chanmask = 0x00;
break;
case 4:
chanmask = 0x08;
break;
case 6:
chanmask = 0x0b;
break;
case 8:
chanmask = 0x13;
break;
}
dataDCC1 = AC_DIG1_ENABLE | AC_DIG1_COPYRIGHT;
dataDCC2 = 0x2;

/* set the Audio InforFrame Channel Allocation */
snd_hda_codec_write(codec, 0x1, 0,
Nv_VERB_SET_Channel_Allocation, chanmask);

/* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
snd_hda_codec_write(codec,
Expand Down Expand Up @@ -1413,10 +1429,7 @@ static int nvhdmi_8ch_7x_pcm_prepare(struct hda_pcm_stream *hinfo,
}
}

/* set the Audio Info Frame Checksum */
snd_hda_codec_write(codec, 0x1, 0,
Nv_VERB_SET_Info_Frame_Checksum,
(0x71 - chan - chanmask));
nvhdmi_8ch_7x_set_info_frame_parameters(codec, chs);

mutex_unlock(&codec->spdif_mutex);
return 0;
Expand Down Expand Up @@ -1512,6 +1525,11 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
spec->multiout.max_channels = 8;
spec->pcm_playback = &nvhdmi_pcm_playback_8ch_7x;
codec->patch_ops = nvhdmi_patch_ops_8ch_7x;

/* Initialize the audio infoframe channel mask and checksum to something
* valid */
nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -14124,7 +14124,7 @@ static hda_nid_t alc269vb_capsrc_nids[1] = {
};

static hda_nid_t alc269_adc_candidates[] = {
0x08, 0x09, 0x07,
0x08, 0x09, 0x07, 0x11,
};

#define alc269_modes alc260_modes
Expand Down
3 changes: 3 additions & 0 deletions sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -3408,6 +3408,9 @@ static int get_connection_index(struct hda_codec *codec, hda_nid_t mux,
hda_nid_t conn[HDA_MAX_NUM_INPUTS];
int i, nums;

if (!(get_wcaps(codec, mux) & AC_WCAP_CONN_LIST))
return -1;

nums = snd_hda_get_connections(codec, mux, conn, ARRAY_SIZE(conn));
for (i = 0; i < nums; i++)
if (conn[i] == nid)
Expand Down
1 change: 1 addition & 0 deletions sound/soc/pxa/pxa2xx-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
if (prtd->dma_ch >= 0) {
pxa_free_dma(prtd->dma_ch);
prtd->dma_ch = -1;
prtd->params = NULL;
}

return 0;
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/pxa/zylonite.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static struct snd_soc_dai_link zylonite_dai[] = {
.codec_name = "wm9713-codec",
.platform_name = "pxa-pcm-audio",
.cpu_dai_name = "pxa2xx-ac97",
.codec_name = "wm9713-hifi",
.codec_dai_name = "wm9713-hifi",
.init = zylonite_wm9713_init,
},
{
Expand All @@ -176,15 +176,15 @@ static struct snd_soc_dai_link zylonite_dai[] = {
.codec_name = "wm9713-codec",
.platform_name = "pxa-pcm-audio",
.cpu_dai_name = "pxa2xx-ac97-aux",
.codec_name = "wm9713-aux",
.codec_dai_name = "wm9713-aux",
},
{
.name = "WM9713 Voice",
.stream_name = "WM9713 Voice",
.codec_name = "wm9713-codec",
.platform_name = "pxa-pcm-audio",
.cpu_dai_name = "pxa-ssp-dai.2",
.codec_name = "wm9713-voice",
.codec_dai_name = "wm9713-voice",
.ops = &zylonite_voice_ops,
},
};
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ static int min_bytes_needed(unsigned long val)
static int format_register_str(struct snd_soc_codec *codec,
unsigned int reg, char *buf, size_t len)
{
int wordsize = codec->driver->reg_word_size * 2;
int regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
int wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
int regsize = codec->driver->reg_word_size * 2;
int ret;
char tmpbuf[len + 1];
char regbuf[regsize + 1];
Expand Down Expand Up @@ -132,8 +132,8 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf,
size_t total = 0;
loff_t p = 0;

wordsize = codec->driver->reg_word_size * 2;
regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
regsize = codec->driver->reg_word_size * 2;

len = wordsize + regsize + 2 + 1;

Expand Down
1 change: 1 addition & 0 deletions sound/usb/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
case USB_ID(0x15ca, 0x0101): /* Textech USB Midi Cable */
case USB_ID(0x15ca, 0x1806): /* Textech USB Midi Cable */
case USB_ID(0x1a86, 0x752d): /* QinHeng CH345 "USB2.0-MIDI" */
case USB_ID(0xfc08, 0x0101): /* Unknown vendor Cable */
ep->max_transfer = 4;
break;
/*
Expand Down

0 comments on commit 4263a2f

Please sign in to comment.