summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSumit Bhattacharya <sumitb@nvidia.com>2011-07-26 20:49:29 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-07-27 18:28:31 -0700
commit87b21827c2b65c53d21b78d5eecedcafa3f16543 (patch)
tree460f8310cf4d999a9304317007f9eaa42eb2bada /sound
parentfff749fc9345347887e48938b7b6dc47c90dfeee (diff)
arm: tegra: Restart PCM stream during hot-plug in
If HDMI driver is restarted in middle of audio playback due to display resolution change or any other reason HDA goes to bad state causing audio to be muted. Whenever HDA driver gets hotplug notification in middle of audio playback restart alsa pcm playback stream. Bug 854284 Change-Id: Ia5af1e503faa7e501287a714c371df073cc31f2e Reviewed-on: http://git-master/r/43233 Tested-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_nvhdmi.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c
index ac4bff538c44..6776573d8124 100644
--- a/sound/pci/hda/patch_nvhdmi.c
+++ b/sound/pci/hda/patch_nvhdmi.c
@@ -161,6 +161,35 @@ static void nvhdmi_free(struct hda_codec *codec)
kfree(spec);
}
+static void nvhdmi_unsol_event(struct hda_codec *codec, unsigned int res)
+{
+ struct hdmi_spec *spec = codec->spec;
+ int tag = res >> AC_UNSOL_RES_TAG_SHIFT;
+ int index = hda_node_index(spec->pin, tag);
+ int sink_state_old = spec->sink_eld[index].monitor_present &
+ spec->sink_eld[index].eld_valid;
+ int sink_state_new;
+ struct snd_pcm_substream *s;
+
+ hdmi_unsol_event(codec, res);
+ sink_state_new = spec->sink_eld[index].monitor_present &
+ spec->sink_eld[index].eld_valid;
+
+ if (sink_state_old == sink_state_new)
+ return;
+
+ if (!codec->pcm_info || !codec->pcm_info->pcm)
+ return;
+
+ s = codec->pcm_info->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+ if (s && s->runtime) {
+ if (snd_pcm_running(s)) {
+ snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN);
+ snd_pcm_start(s);
+ }
+ }
+}
+
static void nvhdmi_shutup(struct hda_codec *codec)
{
nv_tegra_enable_hda_clks(true);
@@ -463,7 +492,7 @@ static struct hda_codec_ops nvhdmi_patch_ops_8ch_89 = {
.build_pcms = nvhdmi_build_pcms_8ch_89,
.init = nvhdmi_init,
.free = nvhdmi_free,
- .unsol_event = hdmi_unsol_event,
+ .unsol_event = nvhdmi_unsol_event,
.reboot_notify = nvhdmi_shutup,
};