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:
ASoC: Only register AC97 bus if it's not done already
ALSA: hda - Add snd_hda_multi_out_dig_cleanup()
ALSA: hda - Add missing terminator in slave dig-out array
ALSA: hda - Change HP dv7 (103c:30f4) quirk from hp-m4 to hp-dv5 model
ALSA: hda - Register (new) devices at reconfig
ALSA: mtpav - Fix initial value for input hwport
ALSA: hda - add id for Intel IbexPeak integrated HDMI codec
ALSA: hda - compute checksum in HDMI audio infoframe
ALSA: hda - enable HDMI audio pin out at module loading time
ALSA: hda - allow multi-channel HDMI audio playback when ELD is not present
ASoC: Update SDP3430 machine driver for snd_soc_card
ALSA: hda - Add quirk for Asus z37e (1043:8284)
sound: Remove OSSlib stuff from linux/soundcard.h
ASoC: WM8990: Fix kcontrol's private value use in put callback
ASoC: TLV320AIC3X: Fix kcontrol's private value use in put callback

+110 -91
+21 -49
include/linux/soundcard.h
··· 1045 1045 */ 1046 1046 #define LOCL_STARTAUDIO 1 1047 1047 1048 - #if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) 1048 + #if !defined(__KERNEL__) || defined(USE_SEQ_MACROS) 1049 1049 /* 1050 1050 * Some convenience macros to simplify programming of the 1051 1051 * /dev/sequencer interface 1052 1052 * 1053 - * These macros define the API which should be used when possible. 1053 + * This is a legacy interface for applications written against 1054 + * the OSSlib-3.8 style interface. It is no longer possible 1055 + * to actually link against OSSlib with this header, but we 1056 + * still provide these macros for programs using them. 1057 + * 1058 + * If you want to use OSSlib, it is recommended that you get 1059 + * the GPL version of OSS-4.x and build against that version 1060 + * of the header. 1061 + * 1062 + * We redefine the extern keyword so that make headers_check 1063 + * does not complain about SEQ_USE_EXTBUF. 1054 1064 */ 1055 1065 #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF() 1056 1066 1057 1067 void seqbuf_dump(void); /* This function must be provided by programs */ 1058 1068 1059 - extern int OSS_init(int seqfd, int buflen); 1060 - extern void OSS_seqbuf_dump(int fd, unsigned char *buf, int buflen); 1061 - extern void OSS_seq_advbuf(int len, int fd, unsigned char *buf, int buflen); 1062 - extern void OSS_seq_needbuf(int len, int fd, unsigned char *buf, int buflen); 1063 - extern void OSS_patch_caching(int dev, int chn, int patch, 1064 - int fd, unsigned char *buf, int buflen); 1065 - extern void OSS_drum_caching(int dev, int chn, int patch, 1066 - int fd, unsigned char *buf, int buflen); 1067 - extern void OSS_write_patch(int fd, unsigned char *buf, int len); 1068 - extern int OSS_write_patch2(int fd, unsigned char *buf, int len); 1069 - 1070 1069 #define SEQ_PM_DEFINES int __foo_bar___ 1071 - #ifdef OSSLIB 1072 - # define SEQ_USE_EXTBUF() \ 1073 - extern unsigned char *_seqbuf; \ 1074 - extern int _seqbuflen;extern int _seqbufptr 1075 - # define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len 1076 - # define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen) 1077 - # define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen) 1078 - # define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen) 1079 1070 1080 - # define SEQ_LOAD_GMINSTR(dev, instr) \ 1081 - OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen) 1082 - # define SEQ_LOAD_GMDRUM(dev, drum) \ 1083 - OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen) 1084 - #else /* !OSSLIB */ 1071 + #define SEQ_LOAD_GMINSTR(dev, instr) 1072 + #define SEQ_LOAD_GMDRUM(dev, drum) 1085 1073 1086 - # define SEQ_LOAD_GMINSTR(dev, instr) 1087 - # define SEQ_LOAD_GMDRUM(dev, drum) 1088 - 1089 - # define SEQ_USE_EXTBUF() \ 1090 - extern unsigned char _seqbuf[]; \ 1091 - extern int _seqbuflen;extern int _seqbufptr 1074 + #define _SEQ_EXTERN extern 1075 + #define SEQ_USE_EXTBUF() \ 1076 + _SEQ_EXTERN unsigned char _seqbuf[]; \ 1077 + _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr 1092 1078 1093 1079 #ifndef USE_SIMPLE_MACROS 1094 1080 /* Sample seqbuf_dump() implementation: ··· 1117 1131 */ 1118 1132 #define _SEQ_NEEDBUF(len) /* empty */ 1119 1133 #endif 1120 - #endif /* !OSSLIB */ 1121 1134 1122 1135 #define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\ 1123 1136 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\ ··· 1200 1215 _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0) 1201 1216 1202 1217 #define SEQ_SET_PATCH SEQ_PGM_CHANGE 1203 - #ifdef OSSLIB 1204 - # define SEQ_PGM_CHANGE(dev, chn, patch) \ 1205 - {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen); \ 1206 - _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);} 1207 - #else 1208 - # define SEQ_PGM_CHANGE(dev, chn, patch) \ 1218 + #define SEQ_PGM_CHANGE(dev, chn, patch) \ 1209 1219 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0) 1210 - #endif 1211 1220 1212 1221 #define SEQ_CONTROL(dev, chn, controller, value) \ 1213 1222 _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value) ··· 1279 1300 /* 1280 1301 * Patch loading. 1281 1302 */ 1282 - #ifdef OSSLIB 1283 - # define SEQ_WRPATCH(patchx, len) \ 1284 - OSS_write_patch(seqfd, (char*)(patchx), len) 1285 - # define SEQ_WRPATCH2(patchx, len) \ 1286 - OSS_write_patch2(seqfd, (char*)(patchx), len) 1287 - #else 1288 - # define SEQ_WRPATCH(patchx, len) \ 1303 + #define SEQ_WRPATCH(patchx, len) \ 1289 1304 {if (_seqbufptr) SEQ_DUMPBUF();\ 1290 1305 if (write(seqfd, (char*)(patchx), len)==-1) \ 1291 1306 perror("Write patch: /dev/sequencer");} 1292 - # define SEQ_WRPATCH2(patchx, len) \ 1307 + #define SEQ_WRPATCH2(patchx, len) \ 1293 1308 (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len)) 1294 - #endif 1295 1309 1296 1310 #endif 1297 1311 #endif
+2 -1
sound/drivers/mtpav.c
··· 706 706 mtp_card->card = card; 707 707 mtp_card->irq = -1; 708 708 mtp_card->share_irq = 0; 709 - mtp_card->inmidiport = 0xffffffff; 710 709 mtp_card->inmidistate = 0; 711 710 mtp_card->outmidihwport = 0xffffffff; 712 711 init_timer(&mtp_card->timer); ··· 717 718 err = snd_mtpav_get_RAWMIDI(mtp_card); 718 719 if (err < 0) 719 720 goto __error; 721 + 722 + mtp_card->inmidiport = mtp_card->num_ports + MTPAV_PIDX_BROADCAST; 720 723 721 724 err = snd_mtpav_get_ISA(mtp_card); 722 725 if (err < 0)
+10
sound/pci/hda/hda_codec.c
··· 3088 3088 } 3089 3089 EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_prepare); 3090 3090 3091 + int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec, 3092 + struct hda_multi_out *mout) 3093 + { 3094 + mutex_lock(&codec->spdif_mutex); 3095 + cleanup_dig_out_stream(codec, mout->dig_out_nid); 3096 + mutex_unlock(&codec->spdif_mutex); 3097 + return 0; 3098 + } 3099 + EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_cleanup); 3100 + 3091 3101 /* 3092 3102 * release the digital out 3093 3103 */
+1 -1
sound/pci/hda/hda_hwdep.c
··· 175 175 err = snd_hda_codec_build_controls(codec); 176 176 if (err < 0) 177 177 return err; 178 - return 0; 178 + return snd_card_register(codec->bus->card); 179 179 } 180 180 181 181 /*
+2
sound/pci/hda/hda_local.h
··· 251 251 unsigned int stream_tag, 252 252 unsigned int format, 253 253 struct snd_pcm_substream *substream); 254 + int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec, 255 + struct hda_multi_out *mout); 254 256 int snd_hda_multi_out_analog_open(struct hda_codec *codec, 255 257 struct hda_multi_out *mout, 256 258 struct snd_pcm_substream *substream,
+12 -3
sound/pci/hda/patch_analog.c
··· 275 275 format, substream); 276 276 } 277 277 278 + static int ad198x_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, 279 + struct hda_codec *codec, 280 + struct snd_pcm_substream *substream) 281 + { 282 + struct ad198x_spec *spec = codec->spec; 283 + return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); 284 + } 285 + 278 286 /* 279 287 * Analog capture 280 288 */ ··· 341 333 .ops = { 342 334 .open = ad198x_dig_playback_pcm_open, 343 335 .close = ad198x_dig_playback_pcm_close, 344 - .prepare = ad198x_dig_playback_pcm_prepare 336 + .prepare = ad198x_dig_playback_pcm_prepare, 337 + .cleanup = ad198x_dig_playback_pcm_cleanup 345 338 }, 346 339 }; 347 340 ··· 1894 1885 #define AD1988_SPDIF_OUT_HDMI 0x0b 1895 1886 #define AD1988_SPDIF_IN 0x07 1896 1887 1897 - static hda_nid_t ad1989b_slave_dig_outs[2] = { 1898 - AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI 1888 + static hda_nid_t ad1989b_slave_dig_outs[] = { 1889 + AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI, 0 1899 1890 }; 1900 1891 1901 1892 static struct hda_input_mux ad1988_6stack_capture_source = {
+34 -27
sound/pci/hda/patch_intelhdmi.c
··· 49 49 {} /* terminator */ 50 50 }; 51 51 52 - static struct hda_verb pinout_disable_verb[] = { 53 - {PIN_NID, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00}, 54 - {} 55 - }; 56 - 57 52 static struct hda_verb unsolicited_response_verb[] = { 58 53 {PIN_NID, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | 59 54 INTEL_HDMI_EVENT_TAG}, ··· 243 248 244 249 static void hdmi_enable_output(struct hda_codec *codec) 245 250 { 246 - /* Enable Audio InfoFrame Transmission */ 247 - hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0); 248 - snd_hda_codec_write(codec, PIN_NID, 0, AC_VERB_SET_HDMI_DIP_XMIT, 249 - AC_DIPXMIT_BEST); 250 251 /* Unmute */ 251 252 if (get_wcaps(codec, PIN_NID) & AC_WCAP_OUT_AMP) 252 253 snd_hda_codec_write(codec, PIN_NID, 0, ··· 251 260 snd_hda_sequence_write(codec, pinout_enable_verb); 252 261 } 253 262 254 - static void hdmi_disable_output(struct hda_codec *codec) 263 + /* 264 + * Enable Audio InfoFrame Transmission 265 + */ 266 + static void hdmi_start_infoframe_trans(struct hda_codec *codec) 255 267 { 256 - snd_hda_sequence_write(codec, pinout_disable_verb); 257 - if (get_wcaps(codec, PIN_NID) & AC_WCAP_OUT_AMP) 258 - snd_hda_codec_write(codec, PIN_NID, 0, 259 - AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 268 + hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0); 269 + snd_hda_codec_write(codec, PIN_NID, 0, AC_VERB_SET_HDMI_DIP_XMIT, 270 + AC_DIPXMIT_BEST); 271 + } 260 272 261 - /* 262 - * FIXME: noises may arise when playing music after reloading the 263 - * kernel module, until the next X restart or monitor repower. 264 - */ 273 + /* 274 + * Disable Audio InfoFrame Transmission 275 + */ 276 + static void hdmi_stop_infoframe_trans(struct hda_codec *codec) 277 + { 278 + hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0); 279 + snd_hda_codec_write(codec, PIN_NID, 0, AC_VERB_SET_HDMI_DIP_XMIT, 280 + AC_DIPXMIT_DISABLE); 265 281 } 266 282 267 283 static int hdmi_get_channel_count(struct hda_codec *codec) ··· 366 368 struct hdmi_audio_infoframe *ai) 367 369 { 368 370 u8 *params = (u8 *)ai; 371 + u8 sum = 0; 369 372 int i; 370 373 371 374 hdmi_debug_dip_size(codec); 372 375 hdmi_clear_dip_buffers(codec); /* be paranoid */ 376 + 377 + for (i = 0; i < sizeof(ai); i++) 378 + sum += params[i]; 379 + ai->checksum = - sum; 373 380 374 381 hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0); 375 382 for (i = 0; i < sizeof(ai); i++) ··· 422 419 /* 423 420 * CA defaults to 0 for basic stereo audio 424 421 */ 425 - if (!eld->eld_ver) 426 - return 0; 427 - if (!eld->spk_alloc) 428 - return 0; 429 422 if (channels <= 2) 430 423 return 0; 424 + 425 + /* 426 + * HDMI sink's ELD info cannot always be retrieved for now, e.g. 427 + * in console or for audio devices. Assume the highest speakers 428 + * configuration, to _not_ prohibit multi-channel audio playback. 429 + */ 430 + if (!eld->spk_alloc) 431 + eld->spk_alloc = 0xffff; 431 432 432 433 /* 433 434 * expand ELD's speaker allocation mask ··· 492 485 hdmi_setup_channel_mapping(codec, &ai); 493 486 494 487 hdmi_fill_audio_infoframe(codec, &ai); 488 + hdmi_start_infoframe_trans(codec); 495 489 } 496 490 497 491 ··· 570 562 { 571 563 struct intel_hdmi_spec *spec = codec->spec; 572 564 573 - hdmi_disable_output(codec); 565 + hdmi_stop_infoframe_trans(codec); 574 566 575 567 return snd_hda_multi_out_dig_close(codec, &spec->multiout); 576 568 } ··· 589 581 hdmi_set_channel_count(codec, substream->runtime->channels); 590 582 591 583 hdmi_setup_audio_infoframe(codec, substream); 592 - 593 - hdmi_enable_output(codec); 594 584 595 585 return 0; 596 586 } ··· 634 628 635 629 static int intel_hdmi_init(struct hda_codec *codec) 636 630 { 637 - /* disable audio output as early as possible */ 638 - hdmi_disable_output(codec); 631 + hdmi_enable_output(codec); 639 632 640 633 snd_hda_sequence_write(codec, unsolicited_response_verb); 641 634 ··· 684 679 { .id = 0x80862801, .name = "G45 DEVBLC", .patch = patch_intel_hdmi }, 685 680 { .id = 0x80862802, .name = "G45 DEVCTG", .patch = patch_intel_hdmi }, 686 681 { .id = 0x80862803, .name = "G45 DEVELK", .patch = patch_intel_hdmi }, 682 + { .id = 0x80862804, .name = "G45 DEVIBX", .patch = patch_intel_hdmi }, 687 683 { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi }, 688 684 {} /* terminator */ 689 685 }; ··· 693 687 MODULE_ALIAS("snd-hda-codec-id:80862801"); 694 688 MODULE_ALIAS("snd-hda-codec-id:80862802"); 695 689 MODULE_ALIAS("snd-hda-codec-id:80862803"); 690 + MODULE_ALIAS("snd-hda-codec-id:80862804"); 696 691 MODULE_ALIAS("snd-hda-codec-id:10951392"); 697 692 698 693 MODULE_LICENSE("GPL");
+1
sound/pci/hda/patch_realtek.c
··· 8478 8478 SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP), 8479 8479 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V), 8480 8480 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG), 8481 + SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG), 8481 8482 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q), 8482 8483 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601), 8483 8484 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
+11 -2
sound/pci/hda/patch_sigmatel.c
··· 1799 1799 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f2, 1800 1800 "HP dv5", STAC_HP_M4), 1801 1801 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4, 1802 - "HP dv7", STAC_HP_M4), 1802 + "HP dv7", STAC_HP_DV5), 1803 1803 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f7, 1804 1804 "HP dv4", STAC_HP_DV5), 1805 1805 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc, ··· 2442 2442 stream_tag, format, substream); 2443 2443 } 2444 2444 2445 + static int stac92xx_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, 2446 + struct hda_codec *codec, 2447 + struct snd_pcm_substream *substream) 2448 + { 2449 + struct sigmatel_spec *spec = codec->spec; 2450 + return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); 2451 + } 2452 + 2445 2453 2446 2454 /* 2447 2455 * Analog capture callbacks ··· 2494 2486 .ops = { 2495 2487 .open = stac92xx_dig_playback_pcm_open, 2496 2488 .close = stac92xx_dig_playback_pcm_close, 2497 - .prepare = stac92xx_dig_playback_pcm_prepare 2489 + .prepare = stac92xx_dig_playback_pcm_prepare, 2490 + .cleanup = stac92xx_dig_playback_pcm_cleanup 2498 2491 }, 2499 2492 }; 2500 2493
+7 -4
sound/soc/codecs/tlv320aic3x.c
··· 165 165 struct snd_ctl_elem_value *ucontrol) 166 166 { 167 167 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); 168 - int reg = kcontrol->private_value & 0xff; 169 - int shift = (kcontrol->private_value >> 8) & 0x0f; 170 - int mask = (kcontrol->private_value >> 16) & 0xff; 171 - int invert = (kcontrol->private_value >> 24) & 0x01; 168 + struct soc_mixer_control *mc = 169 + (struct soc_mixer_control *)kcontrol->private_value; 170 + unsigned int reg = mc->reg; 171 + unsigned int shift = mc->shift; 172 + int max = mc->max; 173 + unsigned int mask = (1 << fls(max)) - 1; 174 + unsigned int invert = mc->invert; 172 175 unsigned short val, val_mask; 173 176 int ret; 174 177 struct snd_soc_dapm_path *path;
+3 -1
sound/soc/codecs/wm8990.c
··· 176 176 struct snd_ctl_elem_value *ucontrol) 177 177 { 178 178 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 179 - int reg = kcontrol->private_value & 0xff; 179 + struct soc_mixer_control *mc = 180 + (struct soc_mixer_control *)kcontrol->private_value; 181 + int reg = mc->reg; 180 182 int ret; 181 183 u16 val; 182 184
+2 -2
sound/soc/omap/sdp3430.c
··· 91 91 }; 92 92 93 93 /* Audio machine driver */ 94 - static struct snd_soc_machine snd_soc_machine_sdp3430 = { 94 + static struct snd_soc_card snd_soc_sdp3430 = { 95 95 .name = "SDP3430", 96 96 .platform = &omap_soc_platform, 97 97 .dai_link = &sdp3430_dai, ··· 100 100 101 101 /* Audio subsystem */ 102 102 static struct snd_soc_device sdp3430_snd_devdata = { 103 - .machine = &snd_soc_machine_sdp3430, 103 + .card = &snd_soc_sdp3430, 104 104 .codec_dev = &soc_codec_dev_twl4030, 105 105 }; 106 106
+4 -1
sound/soc/soc-core.c
··· 1385 1385 1386 1386 mutex_lock(&codec->mutex); 1387 1387 #ifdef CONFIG_SND_SOC_AC97_BUS 1388 - if (ac97) { 1388 + /* Only instantiate AC97 if not already done by the adaptor 1389 + * for the generic AC97 subsystem. 1390 + */ 1391 + if (ac97 && strcmp(codec->name, "AC97") != 0) { 1389 1392 ret = soc_ac97_dev_register(codec); 1390 1393 if (ret < 0) { 1391 1394 printk(KERN_ERR "asoc: AC97 device register failed\n");