All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org, intel-gfx@lists.freedesktop.org
Subject: [PATCH RFC 3/3] ALSA: x86: Use config base depending on the pipe
Date: Fri, 27 Jan 2017 11:36:31 +0100	[thread overview]
Message-ID: <20170127103631.25302-4-tiwai@suse.de> (raw)
In-Reply-To: <20170127103631.25302-1-tiwai@suse.de>

Now the pipe that is being used is passed over i915 notification, we
can re-setup the had_config_offset depending on it at the hotplug.
This allows, at least, the stream transfer on the second DP working on
Dell Wyse 3040 box here (although it's still not audible by other
reasons).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/x86/intel_hdmi_lpe_audio.c | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/sound/x86/intel_hdmi_lpe_audio.c b/sound/x86/intel_hdmi_lpe_audio.c
index 23e5b34dcf41..55bc2cfd21c4 100644
--- a/sound/x86/intel_hdmi_lpe_audio.c
+++ b/sound/x86/intel_hdmi_lpe_audio.c
@@ -463,6 +463,22 @@ static void notify_audio_lpe(void *audio_ptr)
 
 	} else if (eld != NULL) {
 
+		switch (eld->pipe_id) {
+		case 0:
+			ctx->had_config_offset = AUDIO_HDMI_CONFIG_A;
+			break;
+		case 1:
+			ctx->had_config_offset = AUDIO_HDMI_CONFIG_B;
+			break;
+		case 2:
+			ctx->had_config_offset = AUDIO_HDMI_CONFIG_C;
+			break;
+		default:
+			dev_dbg(&hlpe_pdev->dev, "Invalid pipe %d\n",
+				eld->pipe_id);
+			break;
+		}
+
 		hdmi_set_eld(eld->eld_data);
 
 		mid_hdmi_audio_signal_event(HAD_EVENT_HOT_PLUG);
@@ -560,21 +576,15 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
 	ctx->mmio_start = mmio_start;
 	ctx->tmds_clock_speed = DIS_SAMPLE_RATE_148_5;
 
-	if (pci_dev_present(cherryview_ids)) {
+	if (pci_dev_present(cherryview_ids))
 		dev_dbg(&hlpe_pdev->dev, "%s: Cherrytrail LPE - Detected\n",
 				__func__);
-		//ctx->had_config_offset = AUDIO_HDMI_CONFIG_C;
-		/* FIXME: hard-coding to CONFIG_A enables DP audio on CHT,
-		 *  how do I find out which config to use ?
-		 * the pipe is -1 (invalid) when the notify function is called,
-		 * so not sure how to go about this
-		 */
-		ctx->had_config_offset = AUDIO_HDMI_CONFIG_A;
-	} else {
+	else
 		dev_dbg(&hlpe_pdev->dev, "%s: Baytrail LPE - Assume\n",
 				__func__);
-		ctx->had_config_offset = AUDIO_HDMI_CONFIG_A;
-	}
+
+	/* assume pipe A as default */
+	ctx->had_config_offset = AUDIO_HDMI_CONFIG_A;
 
 	pdata = pdev->dev.platform_data;
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2017-01-27 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 10:36 [PATCH RFC 0/3] Pass pipe to LPE audio Takashi Iwai
2017-01-27 10:36 ` [PATCH RFC 1/3] drm/i915: Avoid MST pipe handling for " Takashi Iwai
2017-01-27 14:15   ` [alsa-devel] " Pierre-Louis Bossart
2017-01-27 14:17     ` Takashi Iwai
2017-01-27 10:36 ` [PATCH RFC 2/3] drm/i915: Pass pipe to LPE audio notification Takashi Iwai
2017-01-27 10:36 ` Takashi Iwai [this message]

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=20170127103631.25302-4-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=pierre-louis.bossart@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.