Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <wfg@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel <alsa-devel@alsa-project.org>
Subject: [PATCH 1/4] hda: make standalone hdmi_fill_audio_infoframe()
Date: Tue, 18 Nov 2008 16:57:14 +0800	[thread overview]
Message-ID: <20081118085808.749153224@linux.intel.com> (raw)
In-Reply-To: 20081118085713.252457834@linux.intel.com

[-- Attachment #1: alsa-infoframe-cleanup.patch --]
[-- Type: text/plain, Size: 1418 bytes --]

code refactor: make a standalone function hdmi_fill_audio_infoframe().

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
---
 sound/pci/hda/patch_intelhdmi.c |   25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

--- sound-2.6.orig/sound/pci/hda/patch_intelhdmi.c
+++ sound-2.6/sound/pci/hda/patch_intelhdmi.c
@@ -246,24 +246,31 @@ static void hdmi_clear_dip_buffers(struc
 #endif
 }
 
+static void hdmi_fill_audio_infoframe(struct hda_codec *codec,
+					struct hdmi_audio_infoframe *ai)
+{
+	u8 *params = (u8 *)ai;
+	int i;
+
+	hdmi_debug_dip_size(codec);
+	hdmi_clear_dip_buffers(codec); /* be paranoid */
+
+	hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0);
+	for (i = 0; i < sizeof(ai); i++)
+		hdmi_write_dip_byte(codec, PIN_NID, params[i]);
+}
+
 static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
 					struct snd_pcm_substream *substream)
 {
-	struct hdmi_audio_infoframe audio_infoframe = {
+	struct hdmi_audio_infoframe ai = {
 		.type		= 0x84,
 		.ver		= 0x01,
 		.len		= 0x0a,
 		.CC02_CT47	= substream->runtime->channels - 1,
 	};
-	u8 *params = (u8 *)&audio_infoframe;
-	int i;
-
-	hdmi_debug_dip_size(codec);
-	hdmi_clear_dip_buffers(codec); /* be paranoid */
 
-	hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0);
-	for (i = 0; i < sizeof(audio_infoframe); i++)
-		hdmi_write_dip_byte(codec, PIN_NID, params[i]);
+	hdmi_fill_audio_infoframe(codec, &ai);
 }
 
 

-- 

  reply	other threads:[~2008-11-18  8:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18  8:57 [PATCH 0/4] [RFC] multi-channel HDMI audio support Wu Fengguang
2008-11-18  8:57 ` Wu Fengguang [this message]
2008-11-18  8:57 ` [PATCH 2/4] hda: make global snd_print_channel_allocation() Wu Fengguang
2008-11-18  8:57 ` [PATCH 3/4] hda: HDMI channel allocations for audio infoframe Wu Fengguang
2008-11-18 10:57   ` Takashi Iwai
2008-11-18 11:08     ` Wu Fengguang
2008-11-18 11:12       ` Takashi Iwai
2008-11-18 11:30         ` Wu Fengguang
2008-11-18  8:57 ` [PATCH 4/4] hda: HDMI channel mapping cleanups Wu Fengguang
2008-11-18 11:02 ` [PATCH 0/4] [RFC] multi-channel HDMI audio support Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2008-11-19  0:56 [PATCH 0/4] " Wu Fengguang
2008-11-19  0:56 ` [PATCH 1/4] hda: make standalone hdmi_fill_audio_infoframe() Wu Fengguang

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=20081118085808.749153224@linux.intel.com \
    --to=wfg@linux.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