aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-04-10 12:56:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-10 12:56:10 -0400
commit4263a2f1dad8c8e7ce2352a0cbc882c2b0c044a9 (patch)
treee5892af7a7fd7784c5a3dba682b3cc2728ecadcf /sound
parent510ec7bc3bf6bc6d87662d16a6136135d747e535 (diff)
parent84f3b6dab973c1a9e941fdd1a55caa44da6d9882 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/pxa2xx-pcm-lib.c3
-rw-r--r--sound/pci/hda/patch_conexant.c1
-rw-r--r--sound/pci/hda/patch_hdmi.c70
-rw-r--r--sound/pci/hda/patch_realtek.c2
-rw-r--r--sound/pci/hda/patch_sigmatel.c3
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c1
-rw-r--r--sound/soc/pxa/zylonite.c6
-rw-r--r--sound/soc/soc-core.c8
-rw-r--r--sound/usb/midi.c1
9 files changed, 61 insertions, 34 deletions
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
index 8808b82311b1..76e0d5695075 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/arm/pxa2xx-pcm-lib.c
@@ -140,6 +140,9 @@ int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
140 if (!prtd || !prtd->params) 140 if (!prtd || !prtd->params)
141 return 0; 141 return 0;
142 142
143 if (prtd->dma_ch == -1)
144 return -EINVAL;
145
143 DCSR(prtd->dma_ch) &= ~DCSR_RUN; 146 DCSR(prtd->dma_ch) &= ~DCSR_RUN;
144 DCSR(prtd->dma_ch) = 0; 147 DCSR(prtd->dma_ch) = 0;
145 DCMD(prtd->dma_ch) = 0; 148 DCMD(prtd->dma_ch) = 0;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 69e33869a53e..ad97d937d3a8 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3035,6 +3035,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3035 SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS), 3035 SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
3036 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), 3036 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
3037 SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD), 3037 SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD),
3038 SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT5066_THINKPAD),
3038 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), 3039 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
3039 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ 3040 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
3040 {} 3041 {}
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 251773e45f61..715615a88a8d 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1280,6 +1280,39 @@ static int simple_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
1280 stream_tag, format, substream); 1280 stream_tag, format, substream);
1281} 1281}
1282 1282
1283static void nvhdmi_8ch_7x_set_info_frame_parameters(struct hda_codec *codec,
1284 int channels)
1285{
1286 unsigned int chanmask;
1287 int chan = channels ? (channels - 1) : 1;
1288
1289 switch (channels) {
1290 default:
1291 case 0:
1292 case 2:
1293 chanmask = 0x00;
1294 break;
1295 case 4:
1296 chanmask = 0x08;
1297 break;
1298 case 6:
1299 chanmask = 0x0b;
1300 break;
1301 case 8:
1302 chanmask = 0x13;
1303 break;
1304 }
1305
1306 /* Set the audio infoframe channel allocation and checksum fields. The
1307 * channel count is computed implicitly by the hardware. */
1308 snd_hda_codec_write(codec, 0x1, 0,
1309 Nv_VERB_SET_Channel_Allocation, chanmask);
1310
1311 snd_hda_codec_write(codec, 0x1, 0,
1312 Nv_VERB_SET_Info_Frame_Checksum,
1313 (0x71 - chan - chanmask));
1314}
1315
1283static int nvhdmi_8ch_7x_pcm_close(struct hda_pcm_stream *hinfo, 1316static int nvhdmi_8ch_7x_pcm_close(struct hda_pcm_stream *hinfo,
1284 struct hda_codec *codec, 1317 struct hda_codec *codec,
1285 struct snd_pcm_substream *substream) 1318 struct snd_pcm_substream *substream)
@@ -1298,6 +1331,10 @@ static int nvhdmi_8ch_7x_pcm_close(struct hda_pcm_stream *hinfo,
1298 AC_VERB_SET_STREAM_FORMAT, 0); 1331 AC_VERB_SET_STREAM_FORMAT, 0);
1299 } 1332 }
1300 1333
1334 /* The audio hardware sends a channel count of 0x7 (8ch) when all the
1335 * streams are disabled. */
1336 nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8);
1337
1301 return snd_hda_multi_out_dig_close(codec, &spec->multiout); 1338 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
1302} 1339}
1303 1340
@@ -1308,37 +1345,16 @@ static int nvhdmi_8ch_7x_pcm_prepare(struct hda_pcm_stream *hinfo,
1308 struct snd_pcm_substream *substream) 1345 struct snd_pcm_substream *substream)
1309{ 1346{
1310 int chs; 1347 int chs;
1311 unsigned int dataDCC1, dataDCC2, chan, chanmask, channel_id; 1348 unsigned int dataDCC1, dataDCC2, channel_id;
1312 int i; 1349 int i;
1313 1350
1314 mutex_lock(&codec->spdif_mutex); 1351 mutex_lock(&codec->spdif_mutex);
1315 1352
1316 chs = substream->runtime->channels; 1353 chs = substream->runtime->channels;
1317 chan = chs ? (chs - 1) : 1;
1318 1354
1319 switch (chs) {
1320 default:
1321 case 0:
1322 case 2:
1323 chanmask = 0x00;
1324 break;
1325 case 4:
1326 chanmask = 0x08;
1327 break;
1328 case 6:
1329 chanmask = 0x0b;
1330 break;
1331 case 8:
1332 chanmask = 0x13;
1333 break;
1334 }
1335 dataDCC1 = AC_DIG1_ENABLE | AC_DIG1_COPYRIGHT; 1355 dataDCC1 = AC_DIG1_ENABLE | AC_DIG1_COPYRIGHT;
1336 dataDCC2 = 0x2; 1356 dataDCC2 = 0x2;
1337 1357
1338 /* set the Audio InforFrame Channel Allocation */
1339 snd_hda_codec_write(codec, 0x1, 0,
1340 Nv_VERB_SET_Channel_Allocation, chanmask);
1341
1342 /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ 1358 /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
1343 if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) 1359 if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
1344 snd_hda_codec_write(codec, 1360 snd_hda_codec_write(codec,
@@ -1413,10 +1429,7 @@ static int nvhdmi_8ch_7x_pcm_prepare(struct hda_pcm_stream *hinfo,
1413 } 1429 }
1414 } 1430 }
1415 1431
1416 /* set the Audio Info Frame Checksum */ 1432 nvhdmi_8ch_7x_set_info_frame_parameters(codec, chs);
1417 snd_hda_codec_write(codec, 0x1, 0,
1418 Nv_VERB_SET_Info_Frame_Checksum,
1419 (0x71 - chan - chanmask));
1420 1433
1421 mutex_unlock(&codec->spdif_mutex); 1434 mutex_unlock(&codec->spdif_mutex);
1422 return 0; 1435 return 0;
@@ -1512,6 +1525,11 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
1512 spec->multiout.max_channels = 8; 1525 spec->multiout.max_channels = 8;
1513 spec->pcm_playback = &nvhdmi_pcm_playback_8ch_7x; 1526 spec->pcm_playback = &nvhdmi_pcm_playback_8ch_7x;
1514 codec->patch_ops = nvhdmi_patch_ops_8ch_7x; 1527 codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
1528
1529 /* Initialize the audio infoframe channel mask and checksum to something
1530 * valid */
1531 nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8);
1532
1515 return 0; 1533 return 0;
1516} 1534}
1517 1535
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7e28a64884f6..52928d9a72da 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -14124,7 +14124,7 @@ static hda_nid_t alc269vb_capsrc_nids[1] = {
14124}; 14124};
14125 14125
14126static hda_nid_t alc269_adc_candidates[] = { 14126static hda_nid_t alc269_adc_candidates[] = {
14127 0x08, 0x09, 0x07, 14127 0x08, 0x09, 0x07, 0x11,
14128}; 14128};
14129 14129
14130#define alc269_modes alc260_modes 14130#define alc269_modes alc260_modes
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 1395991c39f2..94d19c03a7f4 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3408,6 +3408,9 @@ static int get_connection_index(struct hda_codec *codec, hda_nid_t mux,
3408 hda_nid_t conn[HDA_MAX_NUM_INPUTS]; 3408 hda_nid_t conn[HDA_MAX_NUM_INPUTS];
3409 int i, nums; 3409 int i, nums;
3410 3410
3411 if (!(get_wcaps(codec, mux) & AC_WCAP_CONN_LIST))
3412 return -1;
3413
3411 nums = snd_hda_get_connections(codec, mux, conn, ARRAY_SIZE(conn)); 3414 nums = snd_hda_get_connections(codec, mux, conn, ARRAY_SIZE(conn));
3412 for (i = 0; i < nums; i++) 3415 for (i = 0; i < nums; i++)
3413 if (conn[i] == nid) 3416 if (conn[i] == nid)
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index 02fb66416ddc..2ce0b2d891d5 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -65,6 +65,7 @@ static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
65 if (prtd->dma_ch >= 0) { 65 if (prtd->dma_ch >= 0) {
66 pxa_free_dma(prtd->dma_ch); 66 pxa_free_dma(prtd->dma_ch);
67 prtd->dma_ch = -1; 67 prtd->dma_ch = -1;
68 prtd->params = NULL;
68 } 69 }
69 70
70 return 0; 71 return 0;
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c
index ac577263b3e3..b6445757fc54 100644
--- a/sound/soc/pxa/zylonite.c
+++ b/sound/soc/pxa/zylonite.c
@@ -167,7 +167,7 @@ static struct snd_soc_dai_link zylonite_dai[] = {
167 .codec_name = "wm9713-codec", 167 .codec_name = "wm9713-codec",
168 .platform_name = "pxa-pcm-audio", 168 .platform_name = "pxa-pcm-audio",
169 .cpu_dai_name = "pxa2xx-ac97", 169 .cpu_dai_name = "pxa2xx-ac97",
170 .codec_name = "wm9713-hifi", 170 .codec_dai_name = "wm9713-hifi",
171 .init = zylonite_wm9713_init, 171 .init = zylonite_wm9713_init,
172}, 172},
173{ 173{
@@ -176,7 +176,7 @@ static struct snd_soc_dai_link zylonite_dai[] = {
176 .codec_name = "wm9713-codec", 176 .codec_name = "wm9713-codec",
177 .platform_name = "pxa-pcm-audio", 177 .platform_name = "pxa-pcm-audio",
178 .cpu_dai_name = "pxa2xx-ac97-aux", 178 .cpu_dai_name = "pxa2xx-ac97-aux",
179 .codec_name = "wm9713-aux", 179 .codec_dai_name = "wm9713-aux",
180}, 180},
181{ 181{
182 .name = "WM9713 Voice", 182 .name = "WM9713 Voice",
@@ -184,7 +184,7 @@ static struct snd_soc_dai_link zylonite_dai[] = {
184 .codec_name = "wm9713-codec", 184 .codec_name = "wm9713-codec",
185 .platform_name = "pxa-pcm-audio", 185 .platform_name = "pxa-pcm-audio",
186 .cpu_dai_name = "pxa-ssp-dai.2", 186 .cpu_dai_name = "pxa-ssp-dai.2",
187 .codec_name = "wm9713-voice", 187 .codec_dai_name = "wm9713-voice",
188 .ops = &zylonite_voice_ops, 188 .ops = &zylonite_voice_ops,
189}, 189},
190}; 190};
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4dda58926bc5..b76b74db0968 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -92,8 +92,8 @@ static int min_bytes_needed(unsigned long val)
92static int format_register_str(struct snd_soc_codec *codec, 92static int format_register_str(struct snd_soc_codec *codec,
93 unsigned int reg, char *buf, size_t len) 93 unsigned int reg, char *buf, size_t len)
94{ 94{
95 int wordsize = codec->driver->reg_word_size * 2; 95 int wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
96 int regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; 96 int regsize = codec->driver->reg_word_size * 2;
97 int ret; 97 int ret;
98 char tmpbuf[len + 1]; 98 char tmpbuf[len + 1];
99 char regbuf[regsize + 1]; 99 char regbuf[regsize + 1];
@@ -132,8 +132,8 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf,
132 size_t total = 0; 132 size_t total = 0;
133 loff_t p = 0; 133 loff_t p = 0;
134 134
135 wordsize = codec->driver->reg_word_size * 2; 135 wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
136 regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; 136 regsize = codec->driver->reg_word_size * 2;
137 137
138 len = wordsize + regsize + 2 + 1; 138 len = wordsize + regsize + 2 + 1;
139 139
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index b4b39c0b6c9e..f9289102886a 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1301,6 +1301,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
1301 case USB_ID(0x15ca, 0x0101): /* Textech USB Midi Cable */ 1301 case USB_ID(0x15ca, 0x0101): /* Textech USB Midi Cable */
1302 case USB_ID(0x15ca, 0x1806): /* Textech USB Midi Cable */ 1302 case USB_ID(0x15ca, 0x1806): /* Textech USB Midi Cable */
1303 case USB_ID(0x1a86, 0x752d): /* QinHeng CH345 "USB2.0-MIDI" */ 1303 case USB_ID(0x1a86, 0x752d): /* QinHeng CH345 "USB2.0-MIDI" */
1304 case USB_ID(0xfc08, 0x0101): /* Unknown vendor Cable */
1304 ep->max_transfer = 4; 1305 ep->max_transfer = 4;
1305 break; 1306 break;
1306 /* 1307 /*