aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-15 14:22:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-15 14:22:00 -0400
commit1b68c9596ce17a1e06918ed65fc3d19b92b04aab (patch)
treed7588c281a92fb30604ddc23f88f748be028921d /sound/pci/hda/patch_hdmi.c
parent5a4179460cb50d939a2ae713cf88fcbff75f2c1c (diff)
parentaaae5272118bcce90d11629f15bc01ea8e545e6d (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/pci/hda/patch_hdmi.c')
-rw-r--r--sound/pci/hda/patch_hdmi.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 522e0748ee99..2bc0f07cf33f 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 */
772static 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