[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.25 / 0051-ALSA-hda-Turn-on-PIN_OUT-from-hdmi-playback-prepare.patch
1 From d9c222f79d4fa6da0c113afe452968a2f0d226f4 Mon Sep 17 00:00:00 2001
2 From: Dylan Reid <dgreid@chromium.org>
3 Date: Thu, 19 Jul 2012 17:52:58 -0700
4 Subject: [PATCH 51/73] ALSA: hda - Turn on PIN_OUT from hdmi playback
5 prepare.
7 commit 9e76e6d031482194a5b24d8e9ab88063fbd6b4b5 upstream.
9 Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is
10 enabled in open, but is disabled in hdmi_init_pin which is called during
11 system resume. This causes a system suspend/resume during playback to
12 mute HDMI/DP. Enabling the pin in prepare instead of open allows calling
13 snd_pcm_prepare after a system resume to restore audio.
15 Signed-off-by: Dylan Reid <dgreid@chromium.org>
16 Signed-off-by: Takashi Iwai <tiwai@suse.de>
17 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18 ---
19 sound/pci/hda/patch_hdmi.c | 12 ++++++------
20 1 files changed, 6 insertions(+), 6 deletions(-)
22 diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
23 index c505fd5..c119f33 100644
24 --- a/sound/pci/hda/patch_hdmi.c
25 +++ b/sound/pci/hda/patch_hdmi.c
26 @@ -868,7 +868,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
27 struct hdmi_spec_per_pin *per_pin;
28 struct hdmi_eld *eld;
29 struct hdmi_spec_per_cvt *per_cvt = NULL;
30 - int pinctl;
32 /* Validate hinfo */
33 pin_idx = hinfo_to_pin_index(spec, hinfo);
34 @@ -904,11 +903,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
35 snd_hda_codec_write(codec, per_pin->pin_nid, 0,
36 AC_VERB_SET_CONNECT_SEL,
37 mux_idx);
38 - pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0,
39 - AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
40 - snd_hda_codec_write(codec, per_pin->pin_nid, 0,
41 - AC_VERB_SET_PIN_WIDGET_CONTROL,
42 - pinctl | PIN_OUT);
43 snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid);
45 /* Initially set the converter's capabilities */
46 @@ -1147,11 +1141,17 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
47 struct hdmi_spec *spec = codec->spec;
48 int pin_idx = hinfo_to_pin_index(spec, hinfo);
49 hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
50 + int pinctl;
52 hdmi_set_channel_count(codec, cvt_nid, substream->runtime->channels);
54 hdmi_setup_audio_infoframe(codec, pin_idx, substream);
56 + pinctl = snd_hda_codec_read(codec, pin_nid, 0,
57 + AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
58 + snd_hda_codec_write(codec, pin_nid, 0,
59 + AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT);
60 +
61 return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
62 }
64 --
65 1.7.7.6