From f5397783fb3039dd2ef225a56e0bf2341127062f Mon Sep 17 00:00:00 2001 From: Sumit Bhattacharya Date: Fri, 21 Oct 2011 16:50:30 +0530 Subject: ALSA: hda: Set samplerate to Tegra HDMI driver Set playback stream samplerate to Tegra HDMI driver. Bug 872652 Change-Id: Ie288ebf448e2000a53024e47941dfdc7aa9ce276 Signed-off-by: Sumit Bhattacharya Reviewed-on: http://git-master/r/64343 Reviewed-by: Scott Peterson Tested-by: Gerrit_Virtual_Submit Rebase-Id: R5f1e35081f70bcca2d6332abddda6883f883cbc8 --- sound/pci/hda/patch_hdmi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 22f238f9d851..e968cc9cbf31 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -34,6 +34,11 @@ #include #include #include + +#ifdef CONFIG_SND_HDA_PLATFORM_NVIDIA_TEGRA +#include +#endif + #include "hda_codec.h" #include "hda_local.h" @@ -1089,6 +1094,21 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, int pin_idx = hinfo_to_pin_index(spec, hinfo); hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid; +#if defined(CONFIG_SND_HDA_PLATFORM_NVIDIA_TEGRA) && defined(CONFIG_TEGRA_DC) + if (codec->preset->id == 0x10de0020) { + int err = 0; + /* Set hdmi:audio freq and source selection*/ + err = tegra_hdmi_setup_audio_freq_source( + substream->runtime->rate, HDA); + if ( err < 0 ) { + snd_printk(KERN_ERR + "Unable to set hdmi audio freq to %d \n", + substream->runtime->rate); + return err; + } + } +#endif + hdmi_set_channel_count(codec, cvt_nid, substream->runtime->channels); hdmi_setup_audio_infoframe(codec, pin_idx, substream); -- cgit v1.2.3