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 4/4] hda: HDMI channel mapping cleanups
Date: Wed, 19 Nov 2008 08:56:18 +0800	[thread overview]
Message-ID: <20081119013904.977235568@linux.intel.com> (raw)
In-Reply-To: 20081119005614.431653658@linux.intel.com

[-- Attachment #1: alsa-speakers2.patch --]
[-- Type: text/plain, Size: 2022 bytes --]

Refactor the channel mapping code for consistent naming
and make it more informed about channel allocations.

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

--- sound-2.6.orig/sound/pci/hda/patch_intelhdmi.c
+++ sound-2.6/sound/pci/hda/patch_intelhdmi.c
@@ -290,7 +290,7 @@ static void hdmi_set_channel_count(struc
 				chs, hdmi_get_channel_count(codec));
 }
 
-static void hdmi_debug_slot_mapping(struct hda_codec *codec)
+static void hdmi_debug_channel_mapping(struct hda_codec *codec)
 {
 #ifdef CONFIG_SND_DEBUG_VERBOSE
 	int i;
@@ -305,13 +305,6 @@ static void hdmi_debug_slot_mapping(stru
 #endif
 }
 
-static void hdmi_setup_channel_mapping(struct hda_codec *codec)
-{
-	snd_hda_sequence_write(codec, def_chan_map);
-	hdmi_debug_slot_mapping(codec);
-}
-
-
 static void hdmi_parse_eld(struct hda_codec *codec)
 {
 	struct intel_hdmi_spec *spec = codec->spec;
@@ -461,6 +454,22 @@ static int hdmi_setup_channel_allocation
 	return -1;
 }
 
+static void hdmi_setup_channel_mapping(struct hda_codec *codec,
+					struct hdmi_audio_infoframe *ai)
+{
+	if (!ai->CA)
+		return;
+
+	/*
+	 * TODO: adjust channel mapping if necessary
+	 * ALSA sequence is front/surr/clfe/side?
+	 */
+
+	snd_hda_sequence_write(codec, def_chan_map);
+	hdmi_debug_channel_mapping(codec);
+}
+
+
 static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
 					struct snd_pcm_substream *substream)
 {
@@ -472,6 +481,7 @@ static void hdmi_setup_audio_infoframe(s
 	};
 
 	hdmi_setup_channel_allocation(codec, &ai);
+	hdmi_setup_channel_mapping(codec, &ai);
 
 	hdmi_fill_audio_infoframe(codec, &ai);
 }
@@ -569,9 +579,6 @@ static int intel_hdmi_playback_pcm_prepa
 
 	hdmi_set_channel_count(codec, substream->runtime->channels);
 
-	/* wfg: channel mapping not supported by DEVCTG */
-	hdmi_setup_channel_mapping(codec);
-
 	hdmi_setup_audio_infoframe(codec, substream);
 
 	hdmi_enable_output(codec);

-- 

  parent reply	other threads:[~2008-11-19  1:41 UTC|newest]

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