diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-15 14:22:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-15 14:22:00 -0400 |
commit | 1b68c9596ce17a1e06918ed65fc3d19b92b04aab (patch) | |
tree | d7588c281a92fb30604ddc23f88f748be028921d /sound | |
parent | 5a4179460cb50d939a2ae713cf88fcbff75f2c1c (diff) | |
parent | aaae5272118bcce90d11629f15bc01ea8e545e6d (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: 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
Diffstat (limited to 'sound')
-rw-r--r-- | sound/oss/sh_dac_audio.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 26 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 5 | ||||
-rw-r--r-- | sound/pci/hda/hda_eld.c | 49 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 42 | ||||
-rw-r--r-- | sound/pci/hda/patch_intelhdmi.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_nvhdmi.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.c | 23 | ||||
-rw-r--r-- | sound/usb/format.c | 8 |
13 files changed, 143 insertions, 24 deletions
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c index fdb58eb83d4..479e3025a8a 100644 --- a/sound/oss/sh_dac_audio.c +++ b/sound/oss/sh_dac_audio.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/smp_lock.h> | ||
19 | #include <linux/sound.h> | 18 | #include <linux/sound.h> |
20 | #include <linux/smp_lock.h> | 19 | #include <linux/smp_lock.h> |
21 | #include <linux/soundcard.h> | 20 | #include <linux/soundcard.h> |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 720a81d711e..dd8fb86c842 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1261,12 +1261,17 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, | |||
1261 | } | 1261 | } |
1262 | EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream); | 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 | * @codec: the CODEC to clean up | 1269 | * @codec: the CODEC to clean up |
1267 | * @nid: the NID to clean up | 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 | struct hda_cvt_setup *p; | 1276 | struct hda_cvt_setup *p; |
1272 | 1277 | ||
@@ -1274,14 +1279,19 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) | |||
1274 | return; | 1279 | return; |
1275 | 1280 | ||
1276 | snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid); | 1281 | snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid); |
1277 | /* here we just clear the active flag; actual clean-ups will be done | ||
1278 | * in purify_inactive_streams() | ||
1279 | */ | ||
1280 | p = get_hda_cvt_setup(codec, nid); | 1282 | p = get_hda_cvt_setup(codec, nid); |
1281 | if (p) | 1283 | if (p) { |
1282 | p->active = 0; | 1284 | /* here we just clear the active flag when do_now isn't set; |
1285 | * actual clean-ups will be done later in | ||
1286 | * purify_inactive_streams() called from snd_hda_codec_prpapre() | ||
1287 | */ | ||
1288 | if (do_now) | ||
1289 | really_cleanup_stream(codec, p); | ||
1290 | else | ||
1291 | p->active = 0; | ||
1292 | } | ||
1283 | } | 1293 | } |
1284 | EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream); | 1294 | EXPORT_SYMBOL_HDA(__snd_hda_codec_cleanup_stream); |
1285 | 1295 | ||
1286 | static void really_cleanup_stream(struct hda_codec *codec, | 1296 | static void really_cleanup_stream(struct hda_codec *codec, |
1287 | struct hda_cvt_setup *q) | 1297 | struct hda_cvt_setup *q) |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 3f7a479881e..4303353feda 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -963,7 +963,10 @@ void snd_hda_codec_cleanup(struct hda_codec *codec, | |||
963 | void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, | 963 | void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, |
964 | u32 stream_tag, | 964 | u32 stream_tag, |
965 | int channel_id, int format); | 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 | unsigned int snd_hda_calc_stream_format(unsigned int rate, | 970 | unsigned int snd_hda_calc_stream_format(unsigned int rate, |
968 | unsigned int channels, | 971 | unsigned int channels, |
969 | unsigned int format, | 972 | unsigned int format, |
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index d8da18a9e98..803b298f741 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -596,4 +596,53 @@ void snd_hda_eld_proc_free(struct hda_codec *codec, struct hdmi_eld *eld) | |||
596 | } | 596 | } |
597 | EXPORT_SYMBOL_HDA(snd_hda_eld_proc_free); | 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 | #endif /* CONFIG_PROC_FS */ | 648 | #endif /* CONFIG_PROC_FS */ |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 7a97f126f6f..28ab4aead48 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -604,6 +604,8 @@ struct hdmi_eld { | |||
604 | int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid); | 604 | int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid); |
605 | int snd_hdmi_get_eld(struct hdmi_eld *, struct hda_codec *, hda_nid_t); | 605 | int snd_hdmi_get_eld(struct hdmi_eld *, struct hda_codec *, hda_nid_t); |
606 | void snd_hdmi_show_eld(struct hdmi_eld *eld); | 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 | #ifdef CONFIG_PROC_FS | 610 | #ifdef CONFIG_PROC_FS |
609 | int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld, | 611 | int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld, |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 350ee8ac415..4ef5efaaaef 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -656,7 +656,7 @@ static int change_cur_input(struct hda_codec *codec, unsigned int idx, | |||
656 | return 0; | 656 | return 0; |
657 | if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) { | 657 | if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) { |
658 | /* stream is running, let's swap the current ADC */ | 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 | spec->cur_adc = spec->adc_nid[idx]; | 660 | spec->cur_adc = spec->adc_nid[idx]; |
661 | snd_hda_codec_setup_stream(codec, spec->cur_adc, | 661 | snd_hda_codec_setup_stream(codec, spec->cur_adc, |
662 | spec->cur_adc_stream_tag, 0, | 662 | spec->cur_adc_stream_tag, 0, |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index f7e234e5ee9..31b5d9eeba6 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -1733,7 +1733,7 @@ static void cxt5051_portc_automic(struct hda_codec *codec) | |||
1733 | new_adc = spec->adc_nids[spec->cur_adc_idx]; | 1733 | new_adc = spec->adc_nids[spec->cur_adc_idx]; |
1734 | if (spec->cur_adc && spec->cur_adc != new_adc) { | 1734 | if (spec->cur_adc && spec->cur_adc != new_adc) { |
1735 | /* stream is running, let's swap the current ADC */ | 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 | spec->cur_adc = new_adc; | 1737 | spec->cur_adc = new_adc; |
1738 | snd_hda_codec_setup_stream(codec, new_adc, | 1738 | snd_hda_codec_setup_stream(codec, new_adc, |
1739 | spec->cur_adc_stream_tag, 0, | 1739 | spec->cur_adc_stream_tag, 0, |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 522e0748ee9..2bc0f07cf33 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -46,6 +46,7 @@ struct hdmi_spec { | |||
46 | * export one pcm per pipe | 46 | * export one pcm per pipe |
47 | */ | 47 | */ |
48 | struct hda_pcm pcm_rec[MAX_HDMI_CVTS]; | 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 | * nvhdmi specific | 52 | * nvhdmi specific |
@@ -766,6 +767,47 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid, | |||
766 | } | 767 | } |
767 | 768 | ||
768 | /* | 769 | /* |
770 | * HDA PCM callbacks | ||
771 | */ | ||
772 | static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | ||
773 | struct hda_codec *codec, | ||
774 | struct snd_pcm_substream *substream) | ||
775 | { | ||
776 | struct hdmi_spec *spec = codec->spec; | ||
777 | struct hdmi_eld *eld; | ||
778 | struct hda_pcm_stream *codec_pars; | ||
779 | unsigned int idx; | ||
780 | |||
781 | for (idx = 0; idx < spec->num_cvts; idx++) | ||
782 | if (hinfo->nid == spec->cvt[idx]) | ||
783 | break; | ||
784 | if (snd_BUG_ON(idx >= spec->num_cvts) || | ||
785 | snd_BUG_ON(idx >= spec->num_pins)) | ||
786 | return -EINVAL; | ||
787 | |||
788 | /* save the PCM info the codec provides */ | ||
789 | codec_pars = &spec->codec_pcm_pars[idx]; | ||
790 | if (!codec_pars->rates) | ||
791 | *codec_pars = *hinfo; | ||
792 | |||
793 | eld = &spec->sink_eld[idx]; | ||
794 | if (eld->sad_count > 0) { | ||
795 | hdmi_eld_update_pcm_info(eld, hinfo, codec_pars); | ||
796 | if (hinfo->channels_min > hinfo->channels_max || | ||
797 | !hinfo->rates || !hinfo->formats) | ||
798 | return -ENODEV; | ||
799 | } else { | ||
800 | /* fallback to the codec default */ | ||
801 | hinfo->channels_min = codec_pars->channels_min; | ||
802 | hinfo->channels_max = codec_pars->channels_max; | ||
803 | hinfo->rates = codec_pars->rates; | ||
804 | hinfo->formats = codec_pars->formats; | ||
805 | hinfo->maxbps = codec_pars->maxbps; | ||
806 | } | ||
807 | return 0; | ||
808 | } | ||
809 | |||
810 | /* | ||
769 | * HDA/HDMI auto parsing | 811 | * HDA/HDMI auto parsing |
770 | */ | 812 | */ |
771 | 813 | ||
diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c index 5972d5e7d01..d382d3c81c0 100644 --- a/sound/pci/hda/patch_intelhdmi.c +++ b/sound/pci/hda/patch_intelhdmi.c | |||
@@ -80,6 +80,7 @@ static struct hda_pcm_stream intel_hdmi_pcm_playback = { | |||
80 | .substreams = 1, | 80 | .substreams = 1, |
81 | .channels_min = 2, | 81 | .channels_min = 2, |
82 | .ops = { | 82 | .ops = { |
83 | .open = hdmi_pcm_open, | ||
83 | .prepare = intel_hdmi_playback_pcm_prepare, | 84 | .prepare = intel_hdmi_playback_pcm_prepare, |
84 | .cleanup = intel_hdmi_playback_pcm_cleanup, | 85 | .cleanup = intel_hdmi_playback_pcm_cleanup, |
85 | }, | 86 | }, |
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 77e2b4028b9..f636870dc71 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -347,10 +347,8 @@ static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo, | |||
347 | static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = { | 347 | static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = { |
348 | .substreams = 1, | 348 | .substreams = 1, |
349 | .channels_min = 2, | 349 | .channels_min = 2, |
350 | .rates = SUPPORTED_RATES, | ||
351 | .maxbps = SUPPORTED_MAXBPS, | ||
352 | .formats = SUPPORTED_FORMATS, | ||
353 | .ops = { | 350 | .ops = { |
351 | .open = hdmi_pcm_open, | ||
354 | .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89, | 352 | .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89, |
355 | .cleanup = nvhdmi_playback_pcm_cleanup, | 353 | .cleanup = nvhdmi_playback_pcm_cleanup, |
356 | }, | 354 | }, |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 55d6e5b6bb7..2cd1ae809e4 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1037,7 +1037,7 @@ static void alc_dual_mic_adc_auto_switch(struct hda_codec *codec) | |||
1037 | new_adc = spec->adc_nids[spec->cur_adc_idx]; | 1037 | new_adc = spec->adc_nids[spec->cur_adc_idx]; |
1038 | if (spec->cur_adc && spec->cur_adc != new_adc) { | 1038 | if (spec->cur_adc && spec->cur_adc != new_adc) { |
1039 | /* stream is running, let's swap the current ADC */ | 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 | spec->cur_adc = new_adc; | 1041 | spec->cur_adc = new_adc; |
1042 | snd_hda_codec_setup_stream(codec, new_adc, | 1042 | snd_hda_codec_setup_stream(codec, new_adc, |
1043 | spec->cur_adc_stream_tag, 0, | 1043 | spec->cur_adc_stream_tag, 0, |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index a87046a96f2..522249d5c2b 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -95,6 +95,7 @@ struct wm8994_priv { | |||
95 | 95 | ||
96 | struct wm8994_micdet micdet[2]; | 96 | struct wm8994_micdet micdet[2]; |
97 | 97 | ||
98 | int revision; | ||
98 | struct wm8994_pdata *pdata; | 99 | struct wm8994_pdata *pdata; |
99 | }; | 100 | }; |
100 | 101 | ||
@@ -3070,6 +3071,8 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, | |||
3070 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, | 3071 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, |
3071 | enum snd_soc_bias_level level) | 3072 | enum snd_soc_bias_level level) |
3072 | { | 3073 | { |
3074 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
3075 | |||
3073 | switch (level) { | 3076 | switch (level) { |
3074 | case SND_SOC_BIAS_ON: | 3077 | case SND_SOC_BIAS_ON: |
3075 | break; | 3078 | break; |
@@ -3082,11 +3085,16 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, | |||
3082 | 3085 | ||
3083 | case SND_SOC_BIAS_STANDBY: | 3086 | case SND_SOC_BIAS_STANDBY: |
3084 | if (codec->bias_level == SND_SOC_BIAS_OFF) { | 3087 | if (codec->bias_level == SND_SOC_BIAS_OFF) { |
3085 | /* Tweak DC servo configuration for improved | 3088 | /* Tweak DC servo and DSP configuration for |
3086 | * performance. */ | 3089 | * improved performance. */ |
3087 | snd_soc_write(codec, 0x102, 0x3); | 3090 | if (wm8994->revision < 4) { |
3088 | snd_soc_write(codec, 0x56, 0x3); | 3091 | /* Tweak DC servo and DSP configuration for |
3089 | snd_soc_write(codec, 0x102, 0); | 3092 | * improved performance. */ |
3093 | snd_soc_write(codec, 0x102, 0x3); | ||
3094 | snd_soc_write(codec, 0x56, 0x3); | ||
3095 | snd_soc_write(codec, 0x817, 0); | ||
3096 | snd_soc_write(codec, 0x102, 0); | ||
3097 | } | ||
3090 | 3098 | ||
3091 | /* Discharge LINEOUT1 & 2 */ | 3099 | /* Discharge LINEOUT1 & 2 */ |
3092 | snd_soc_update_bits(codec, WM8994_ANTIPOP_1, | 3100 | snd_soc_update_bits(codec, WM8994_ANTIPOP_1, |
@@ -3919,7 +3927,6 @@ static int wm8994_codec_probe(struct platform_device *pdev) | |||
3919 | struct wm8994_priv *wm8994; | 3927 | struct wm8994_priv *wm8994; |
3920 | struct snd_soc_codec *codec; | 3928 | struct snd_soc_codec *codec; |
3921 | int i; | 3929 | int i; |
3922 | u16 rev; | ||
3923 | 3930 | ||
3924 | if (wm8994_codec) { | 3931 | if (wm8994_codec) { |
3925 | dev_err(&pdev->dev, "Another WM8994 is registered\n"); | 3932 | dev_err(&pdev->dev, "Another WM8994 is registered\n"); |
@@ -3973,8 +3980,8 @@ static int wm8994_codec_probe(struct platform_device *pdev) | |||
3973 | wm8994->reg_cache[i] = 0; | 3980 | wm8994->reg_cache[i] = 0; |
3974 | 3981 | ||
3975 | /* Set revision-specific configuration */ | 3982 | /* Set revision-specific configuration */ |
3976 | rev = snd_soc_read(codec, WM8994_CHIP_REVISION); | 3983 | wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); |
3977 | switch (rev) { | 3984 | switch (wm8994->revision) { |
3978 | case 2: | 3985 | case 2: |
3979 | case 3: | 3986 | case 3: |
3980 | wm8994->hubs.dcs_codes = -5; | 3987 | wm8994->hubs.dcs_codes = -5; |
diff --git a/sound/usb/format.c b/sound/usb/format.c index 4387f54d73d..3a1375459c0 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c | |||
@@ -392,6 +392,10 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, | |||
392 | /* fp->channels is already set in this case */ | 392 | /* fp->channels is already set in this case */ |
393 | ret = parse_audio_format_rates_v2(chip, fp); | 393 | ret = parse_audio_format_rates_v2(chip, fp); |
394 | break; | 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 | if (fp->channels < 1) { | 401 | if (fp->channels < 1) { |
@@ -452,6 +456,10 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
452 | ret = parse_audio_format_rates_v2(chip, fp); | 456 | ret = parse_audio_format_rates_v2(chip, fp); |
453 | break; | 457 | break; |
454 | } | 458 | } |
459 | default: | ||
460 | snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", | ||
461 | chip->dev->devnum, fp->iface, fp->altsetting, protocol); | ||
462 | return -EINVAL; | ||
455 | } | 463 | } |
456 | 464 | ||
457 | return ret; | 465 | return ret; |