From patchwork Fri Jan 27 10:36:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 9541693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B12AA601D7 for ; Fri, 27 Jan 2017 12:02:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A241F26E51 for ; Fri, 27 Jan 2017 12:02:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94A60276D6; Fri, 27 Jan 2017 12:02:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2EB726E51 for ; Fri, 27 Jan 2017 12:02:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 03D11267A04; Fri, 27 Jan 2017 13:02:05 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5FAB4267A05; Fri, 27 Jan 2017 12:59:46 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1BA6B2679D0; Fri, 27 Jan 2017 11:36:37 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 1B7A72679CD for ; Fri, 27 Jan 2017 11:36:34 +0100 (CET) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 15DB7AC5B; Fri, 27 Jan 2017 10:36:34 +0000 (UTC) From: Takashi Iwai To: Pierre-Louis Bossart Date: Fri, 27 Jan 2017 11:36:31 +0100 Message-Id: <20170127103631.25302-4-tiwai@suse.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170127103631.25302-1-tiwai@suse.de> References: <20170127103631.25302-1-tiwai@suse.de> Cc: alsa-devel@alsa-project.org, intel-gfx@lists.freedesktop.org, jerome.anand@intel.com Subject: [alsa-devel] [PATCH RFC 3/3] ALSA: x86: Use config base depending on the pipe X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;