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: sound/usb/format: silence uninitialized variable warnings
MAINTAINERS: Add Ian Lartey as comaintaner for Wolfson devices
MAINTAINERS: Make Wolfson entry also cover CODEC drivers
ASoC: Only tweak WM8994 chip configuration on devices up to rev D
ASoC: Optimise DSP performance for WM8994
ALSA: hda - Fix dynamic ADC change working again
ALSA: hda - Restrict PCM parameters per ELD information over HDMI
sound: oss: sh_dac_audio.c removed duplicated #include

+147 -27
+4 -3
MAINTAINERS
··· 6402 6402 F: drivers/input/touchscreen/*wm97* 6403 6403 F: include/linux/wm97xx.h 6404 6404 6405 - WOLFSON MICROELECTRONICS PMIC DRIVERS 6405 + WOLFSON MICROELECTRONICS DRIVERS 6406 6406 M: Mark Brown <broonie@opensource.wolfsonmicro.com> 6407 + M: Ian Lartey <ian@opensource.wolfsonmicro.com> 6407 6408 T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus 6408 6409 W: http://opensource.wolfsonmicro.com/node/8 6409 6410 S: Supported ··· 6419 6418 F: include/linux/mfd/wm831x/ 6420 6419 F: include/linux/mfd/wm8350/ 6421 6420 F: include/linux/mfd/wm8400* 6422 - F: sound/soc/codecs/wm8350.* 6423 - F: sound/soc/codecs/wm8400.* 6421 + F: include/sound/wm????.h 6422 + F: sound/soc/codecs/wm* 6424 6423 6425 6424 X.25 NETWORK LAYER 6426 6425 M: Andrew Hendry <andrew.hendry@gmail.com>
-1
sound/oss/sh_dac_audio.c
··· 15 15 #include <linux/linkage.h> 16 16 #include <linux/slab.h> 17 17 #include <linux/fs.h> 18 - #include <linux/smp_lock.h> 19 18 #include <linux/sound.h> 20 19 #include <linux/smp_lock.h> 21 20 #include <linux/soundcard.h>
+18 -8
sound/pci/hda/hda_codec.c
··· 1261 1261 } 1262 1262 EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream); 1263 1263 1264 + static void really_cleanup_stream(struct hda_codec *codec, 1265 + struct hda_cvt_setup *q); 1266 + 1264 1267 /** 1265 - * snd_hda_codec_cleanup_stream - clean up the codec for closing 1268 + * __snd_hda_codec_cleanup_stream - clean up the codec for closing 1266 1269 * @codec: the CODEC to clean up 1267 1270 * @nid: the NID to clean up 1271 + * @do_now: really clean up the stream instead of clearing the active flag 1268 1272 */ 1269 - void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) 1273 + void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid, 1274 + int do_now) 1270 1275 { 1271 1276 struct hda_cvt_setup *p; 1272 1277 ··· 1279 1274 return; 1280 1275 1281 1276 snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid); 1282 - /* here we just clear the active flag; actual clean-ups will be done 1283 - * in purify_inactive_streams() 1284 - */ 1285 1277 p = get_hda_cvt_setup(codec, nid); 1286 - if (p) 1287 - p->active = 0; 1278 + if (p) { 1279 + /* here we just clear the active flag when do_now isn't set; 1280 + * actual clean-ups will be done later in 1281 + * purify_inactive_streams() called from snd_hda_codec_prpapre() 1282 + */ 1283 + if (do_now) 1284 + really_cleanup_stream(codec, p); 1285 + else 1286 + p->active = 0; 1287 + } 1288 1288 } 1289 - EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream); 1289 + EXPORT_SYMBOL_HDA(__snd_hda_codec_cleanup_stream); 1290 1290 1291 1291 static void really_cleanup_stream(struct hda_codec *codec, 1292 1292 struct hda_cvt_setup *q)
+4 -1
sound/pci/hda/hda_codec.h
··· 963 963 void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, 964 964 u32 stream_tag, 965 965 int channel_id, int format); 966 - void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid); 966 + void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid, 967 + int do_now); 968 + #define snd_hda_codec_cleanup_stream(codec, nid) \ 969 + __snd_hda_codec_cleanup_stream(codec, nid, 0) 967 970 unsigned int snd_hda_calc_stream_format(unsigned int rate, 968 971 unsigned int channels, 969 972 unsigned int format,
+49
sound/pci/hda/hda_eld.c
··· 596 596 } 597 597 EXPORT_SYMBOL_HDA(snd_hda_eld_proc_free); 598 598 599 + /* update PCM info based on ELD */ 600 + void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, 601 + struct hda_pcm_stream *codec_pars) 602 + { 603 + int i; 604 + 605 + pcm->rates = 0; 606 + pcm->formats = 0; 607 + pcm->maxbps = 0; 608 + pcm->channels_min = -1; 609 + pcm->channels_max = 0; 610 + for (i = 0; i < eld->sad_count; i++) { 611 + struct cea_sad *a = &eld->sad[i]; 612 + pcm->rates |= a->rates; 613 + if (a->channels < pcm->channels_min) 614 + pcm->channels_min = a->channels; 615 + if (a->channels > pcm->channels_max) 616 + pcm->channels_max = a->channels; 617 + if (a->format == AUDIO_CODING_TYPE_LPCM) { 618 + if (a->sample_bits & AC_SUPPCM_BITS_16) { 619 + pcm->formats |= SNDRV_PCM_FMTBIT_S16_LE; 620 + if (pcm->maxbps < 16) 621 + pcm->maxbps = 16; 622 + } 623 + if (a->sample_bits & AC_SUPPCM_BITS_20) { 624 + pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; 625 + if (pcm->maxbps < 20) 626 + pcm->maxbps = 20; 627 + } 628 + if (a->sample_bits & AC_SUPPCM_BITS_24) { 629 + pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; 630 + if (pcm->maxbps < 24) 631 + pcm->maxbps = 24; 632 + } 633 + } 634 + } 635 + 636 + if (!codec_pars) 637 + return; 638 + 639 + /* restrict the parameters by the values the codec provides */ 640 + pcm->rates &= codec_pars->rates; 641 + pcm->formats &= codec_pars->formats; 642 + pcm->channels_min = max(pcm->channels_min, codec_pars->channels_min); 643 + pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); 644 + pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); 645 + } 646 + EXPORT_SYMBOL_HDA(hdmi_eld_update_pcm_info); 647 + 599 648 #endif /* CONFIG_PROC_FS */
+2
sound/pci/hda/hda_local.h
··· 604 604 int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid); 605 605 int snd_hdmi_get_eld(struct hdmi_eld *, struct hda_codec *, hda_nid_t); 606 606 void snd_hdmi_show_eld(struct hdmi_eld *eld); 607 + void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, 608 + struct hda_pcm_stream *codec_pars); 607 609 608 610 #ifdef CONFIG_PROC_FS 609 611 int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld,
+1 -1
sound/pci/hda/patch_cirrus.c
··· 656 656 return 0; 657 657 if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) { 658 658 /* stream is running, let's swap the current ADC */ 659 - snd_hda_codec_cleanup_stream(codec, spec->cur_adc); 659 + __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); 660 660 spec->cur_adc = spec->adc_nid[idx]; 661 661 snd_hda_codec_setup_stream(codec, spec->cur_adc, 662 662 spec->cur_adc_stream_tag, 0,
+1 -1
sound/pci/hda/patch_conexant.c
··· 1733 1733 new_adc = spec->adc_nids[spec->cur_adc_idx]; 1734 1734 if (spec->cur_adc && spec->cur_adc != new_adc) { 1735 1735 /* stream is running, let's swap the current ADC */ 1736 - snd_hda_codec_cleanup_stream(codec, spec->cur_adc); 1736 + __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); 1737 1737 spec->cur_adc = new_adc; 1738 1738 snd_hda_codec_setup_stream(codec, new_adc, 1739 1739 spec->cur_adc_stream_tag, 0,
+42
sound/pci/hda/patch_hdmi.c
··· 46 46 * export one pcm per pipe 47 47 */ 48 48 struct hda_pcm pcm_rec[MAX_HDMI_CVTS]; 49 + struct hda_pcm_stream codec_pcm_pars[MAX_HDMI_CVTS]; 49 50 50 51 /* 51 52 * nvhdmi specific ··· 763 762 if (fmt != format) 764 763 snd_hda_codec_write(codec, nid, 0, 765 764 AC_VERB_SET_STREAM_FORMAT, format); 765 + return 0; 766 + } 767 + 768 + /* 769 + * HDA PCM callbacks 770 + */ 771 + static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, 772 + struct hda_codec *codec, 773 + struct snd_pcm_substream *substream) 774 + { 775 + struct hdmi_spec *spec = codec->spec; 776 + struct hdmi_eld *eld; 777 + struct hda_pcm_stream *codec_pars; 778 + unsigned int idx; 779 + 780 + for (idx = 0; idx < spec->num_cvts; idx++) 781 + if (hinfo->nid == spec->cvt[idx]) 782 + break; 783 + if (snd_BUG_ON(idx >= spec->num_cvts) || 784 + snd_BUG_ON(idx >= spec->num_pins)) 785 + return -EINVAL; 786 + 787 + /* save the PCM info the codec provides */ 788 + codec_pars = &spec->codec_pcm_pars[idx]; 789 + if (!codec_pars->rates) 790 + *codec_pars = *hinfo; 791 + 792 + eld = &spec->sink_eld[idx]; 793 + if (eld->sad_count > 0) { 794 + hdmi_eld_update_pcm_info(eld, hinfo, codec_pars); 795 + if (hinfo->channels_min > hinfo->channels_max || 796 + !hinfo->rates || !hinfo->formats) 797 + return -ENODEV; 798 + } else { 799 + /* fallback to the codec default */ 800 + hinfo->channels_min = codec_pars->channels_min; 801 + hinfo->channels_max = codec_pars->channels_max; 802 + hinfo->rates = codec_pars->rates; 803 + hinfo->formats = codec_pars->formats; 804 + hinfo->maxbps = codec_pars->maxbps; 805 + } 766 806 return 0; 767 807 } 768 808
+1
sound/pci/hda/patch_intelhdmi.c
··· 80 80 .substreams = 1, 81 81 .channels_min = 2, 82 82 .ops = { 83 + .open = hdmi_pcm_open, 83 84 .prepare = intel_hdmi_playback_pcm_prepare, 84 85 .cleanup = intel_hdmi_playback_pcm_cleanup, 85 86 },
+1 -3
sound/pci/hda/patch_nvhdmi.c
··· 347 347 static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = { 348 348 .substreams = 1, 349 349 .channels_min = 2, 350 - .rates = SUPPORTED_RATES, 351 - .maxbps = SUPPORTED_MAXBPS, 352 - .formats = SUPPORTED_FORMATS, 353 350 .ops = { 351 + .open = hdmi_pcm_open, 354 352 .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89, 355 353 .cleanup = nvhdmi_playback_pcm_cleanup, 356 354 },
+1 -1
sound/pci/hda/patch_realtek.c
··· 1037 1037 new_adc = spec->adc_nids[spec->cur_adc_idx]; 1038 1038 if (spec->cur_adc && spec->cur_adc != new_adc) { 1039 1039 /* stream is running, let's swap the current ADC */ 1040 - snd_hda_codec_cleanup_stream(codec, spec->cur_adc); 1040 + __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); 1041 1041 spec->cur_adc = new_adc; 1042 1042 snd_hda_codec_setup_stream(codec, new_adc, 1043 1043 spec->cur_adc_stream_tag, 0,
+15 -8
sound/soc/codecs/wm8994.c
··· 95 95 96 96 struct wm8994_micdet micdet[2]; 97 97 98 + int revision; 98 99 struct wm8994_pdata *pdata; 99 100 }; 100 101 ··· 3071 3070 static int wm8994_set_bias_level(struct snd_soc_codec *codec, 3072 3071 enum snd_soc_bias_level level) 3073 3072 { 3073 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 3074 + 3074 3075 switch (level) { 3075 3076 case SND_SOC_BIAS_ON: 3076 3077 break; ··· 3085 3082 3086 3083 case SND_SOC_BIAS_STANDBY: 3087 3084 if (codec->bias_level == SND_SOC_BIAS_OFF) { 3088 - /* Tweak DC servo configuration for improved 3089 - * performance. */ 3090 - snd_soc_write(codec, 0x102, 0x3); 3091 - snd_soc_write(codec, 0x56, 0x3); 3092 - snd_soc_write(codec, 0x102, 0); 3085 + /* Tweak DC servo and DSP configuration for 3086 + * improved performance. */ 3087 + if (wm8994->revision < 4) { 3088 + /* Tweak DC servo and DSP configuration for 3089 + * improved performance. */ 3090 + snd_soc_write(codec, 0x102, 0x3); 3091 + snd_soc_write(codec, 0x56, 0x3); 3092 + snd_soc_write(codec, 0x817, 0); 3093 + snd_soc_write(codec, 0x102, 0); 3094 + } 3093 3095 3094 3096 /* Discharge LINEOUT1 & 2 */ 3095 3097 snd_soc_update_bits(codec, WM8994_ANTIPOP_1, ··· 3927 3919 struct wm8994_priv *wm8994; 3928 3920 struct snd_soc_codec *codec; 3929 3921 int i; 3930 - u16 rev; 3931 3922 3932 3923 if (wm8994_codec) { 3933 3924 dev_err(&pdev->dev, "Another WM8994 is registered\n"); ··· 3980 3973 wm8994->reg_cache[i] = 0; 3981 3974 3982 3975 /* Set revision-specific configuration */ 3983 - rev = snd_soc_read(codec, WM8994_CHIP_REVISION); 3984 - switch (rev) { 3976 + wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); 3977 + switch (wm8994->revision) { 3985 3978 case 2: 3986 3979 case 3: 3987 3980 wm8994->hubs.dcs_codes = -5;
+8
sound/usb/format.c
··· 392 392 /* fp->channels is already set in this case */ 393 393 ret = parse_audio_format_rates_v2(chip, fp); 394 394 break; 395 + default: 396 + snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", 397 + chip->dev->devnum, fp->iface, fp->altsetting, protocol); 398 + return -EINVAL; 395 399 } 396 400 397 401 if (fp->channels < 1) { ··· 456 452 ret = parse_audio_format_rates_v2(chip, fp); 457 453 break; 458 454 } 455 + default: 456 + snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", 457 + chip->dev->devnum, fp->iface, fp->altsetting, protocol); 458 + return -EINVAL; 459 459 } 460 460 461 461 return ret;