alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Wang Xingchao <xingchao.wang@linux.intel.com>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org,
	Wang Xingchao <xingchao.wang@linux.intel.com>,
	xingchao.wang@intel.com
Subject: [PATCH 2/2] ALSA: hda - get realtime ELD info when codec suspended
Date: Mon, 24 Jun 2013 07:45:24 -0400	[thread overview]
Message-ID: <1372074324-13563-2-git-send-email-xingchao.wang@linux.intel.com> (raw)
In-Reply-To: <1372074324-13563-1-git-send-email-xingchao.wang@linux.intel.com>

when controller/codec in runtime suspended mode, monitor hotplug
would not trigger unsolicited event. This patch tries to power up
codec and hdmi driver would probe ELD info again.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
---
 sound/pci/hda/hda_eld.c   | 6 ++++++
 sound/pci/hda/hda_local.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index d0d7ac1..914712a 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -482,6 +482,7 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
 				struct snd_info_buffer *buffer)
 {
 	struct hdmi_eld *eld = entry->private_data;
+	struct hda_codec *codec = eld->codec;
 	struct parsed_hdmi_eld *e = &eld->info;
 	char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
 	int i;
@@ -500,11 +501,14 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
 		[4 ... 7] = "reserved"
 	};
 
+	snd_hda_power_up(codec);
+
 	mutex_lock(&eld->lock);
 	snd_iprintf(buffer, "monitor_present\t\t%d\n", eld->monitor_present);
 	snd_iprintf(buffer, "eld_valid\t\t%d\n", eld->eld_valid);
 	if (!eld->eld_valid) {
 		mutex_unlock(&eld->lock);
+		snd_hda_power_down(codec);
 		return;
 	}
 	snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name);
@@ -529,6 +533,7 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
 	for (i = 0; i < e->sad_count; i++)
 		hdmi_print_sad_info(i, e->sad + i, buffer);
 	mutex_unlock(&eld->lock);
+	snd_hda_power_down(codec);
 }
 
 static void hdmi_write_eld_info(struct snd_info_entry *entry,
@@ -614,6 +619,7 @@ int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld,
 	entry->c.text.write = hdmi_write_eld_info;
 	entry->mode |= S_IWUSR;
 	eld->proc_entry = entry;
+	eld->codec = codec;
 
 	return 0;
 }
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index e0bf753..1aaf8b6 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -747,6 +747,7 @@ struct hdmi_eld {
 #ifdef CONFIG_PROC_FS
 	struct snd_info_entry *proc_entry;
 #endif
+	struct hda_codec *codec;
 };
 
 int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid);
-- 
1.8.1.2

  parent reply	other threads:[~2013-06-24 10:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 11:45 [PATCH 1/2] ALSA: hdmi - poll eld at resume time Wang Xingchao
2013-06-24 10:43 ` Wang, Xingchao
2013-06-24 11:32 ` Takashi Iwai
2013-06-24 12:19   ` Wang, Xingchao
2013-06-24 12:49     ` Takashi Iwai
2013-06-25  4:54       ` Wang, Xingchao
2013-06-25  6:06         ` Takashi Iwai
2013-06-25  6:34           ` Wang, Xingchao
2013-06-25  7:06             ` Takashi Iwai
2013-06-25  7:09               ` Takashi Iwai
2013-06-25  8:30                 ` Wang, Xingchao
2013-06-26  4:28                   ` Wang, Xingchao
2013-06-25  6:15       ` Wang, Xingchao
2013-06-24 11:45 ` Wang Xingchao [this message]
2013-06-24 11:36   ` [PATCH 2/2] ALSA: hda - get realtime ELD info when codec suspended Takashi Iwai
2013-06-24 11:56     ` Wang, Xingchao
2013-06-24 12:00       ` Takashi Iwai
2013-06-24 12:47         ` David Henningsson
2013-06-24 13:00           ` Takashi Iwai
2013-06-25  7:45             ` David Henningsson
2013-06-25  7:55               ` Takashi Iwai
2013-06-25  9:02                 ` David Henningsson
2013-06-25  9:33                   ` Wang, Xingchao
2013-06-25  9:43                     ` David Henningsson
2013-07-12  6:13                       ` Wang Xingchao
2013-07-15  4:28                         ` David Henningsson
2013-07-15  8:54                           ` Wang, Xingchao
2013-07-17 10:15                             ` Wang, Xingchao
2013-07-18  5:47                               ` Wang, Xingchao
2013-07-18  6:43                                 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372074324-13563-2-git-send-email-xingchao.wang@linux.intel.com \
    --to=xingchao.wang@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    --cc=xingchao.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).