public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: <alsa-devel@alsa-project.org>, Wu Fengguang <fengguang.wu@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] hda - move eld->spk_alloc fixup to hdmi_update_eld()
Date: Wed, 16 Nov 2011 16:29:48 +0800	[thread overview]
Message-ID: <20111116083514.691170417@intel.com> (raw)
In-Reply-To: 20111116082945.414733231@intel.com

[-- Attachment #1: eld-move-spk --]
[-- Type: text/plain, Size: 1820 bytes --]

It looks more natural and saves two lines of code.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 sound/pci/hda/hda_eld.c    |    8 ++++++++
 sound/pci/hda/patch_hdmi.c |   10 ----------
 2 files changed, 8 insertions(+), 10 deletions(-)

--- linux.orig/sound/pci/hda/hda_eld.c	2011-11-16 09:53:01.000000000 +0800
+++ linux/sound/pci/hda/hda_eld.c	2011-11-16 10:05:06.000000000 +0800
@@ -297,6 +297,14 @@ static int hdmi_update_eld(struct hdmi_e
 					buf + ELD_FIXED_BYTES + mnl + 3 * i);
 	}
 
+	/*
+	 * HDMI sink's ELD info cannot always be retrieved for now, e.g.
+	 * in console or for audio devices. Assume the highest speakers
+	 * configuration, to _not_ prohibit multi-channel audio playback.
+	 */
+	if (!e->spk_alloc)
+		e->spk_alloc = 0xffff;
+
 	e->eld_valid = true;
 	return 0;
 
--- linux.orig/sound/pci/hda/patch_hdmi.c	2011-11-16 10:04:13.000000000 +0800
+++ linux/sound/pci/hda/patch_hdmi.c	2011-11-16 10:05:54.000000000 +0800
@@ -757,7 +757,6 @@ static void hdmi_intrinsic_event(struct 
 	int pd = !!(res & AC_UNSOL_RES_PD);
 	int eldv = !!(res & AC_UNSOL_RES_ELDV);
 	int pin_idx;
-	struct hdmi_eld *eld;
 
 	printk(KERN_INFO
 		"HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
@@ -766,17 +765,8 @@ static void hdmi_intrinsic_event(struct 
 	pin_idx = pin_nid_to_pin_index(spec, pin_nid);
 	if (pin_idx < 0)
 		return;
-	eld = &spec->pins[pin_idx].sink_eld;
 
 	hdmi_present_sense(&spec->pins[pin_idx], true);
-
-	/*
-	 * HDMI sink's ELD info cannot always be retrieved for now, e.g.
-	 * in console or for audio devices. Assume the highest speakers
-	 * configuration, to _not_ prohibit multi-channel audio playback.
-	 */
-	if (!eld->spk_alloc)
-		eld->spk_alloc = 0xffff;
 }
 
 static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)



  parent reply	other threads:[~2011-11-16  8:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16  8:29 [PATCH 0/3] ELD fixes for 3.2 Wu Fengguang
2011-11-16  8:29 ` [PATCH 1/3] hda - fix ELD memory leak Wu Fengguang
2011-11-16  8:29 ` [PATCH 2/3] hda - delayed ELD repoll Wu Fengguang
2011-11-21  6:48   ` Wu Fengguang
2011-11-22  7:30     ` Takashi Iwai
2011-11-22  8:00       ` Wu Fengguang
2011-11-16  8:29 ` Wu Fengguang [this message]
2011-11-16  9:54 ` [PATCH 0/3] ELD fixes for 3.2 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=20111116083514.691170417@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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