From patchwork Thu Apr 11 09:34:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3795E17E0 for ; Thu, 11 Apr 2019 09:52:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17C7228A4C for ; Thu, 11 Apr 2019 09:52:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 086D428CB5; Thu, 11 Apr 2019 09:52:56 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3C39828A4C for ; Thu, 11 Apr 2019 09:52:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 52E40869; Thu, 11 Apr 2019 11:52:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 52E40869 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976373; bh=5bJNdz3nhI5MjBjuLeK0yshvn77eBav8e2ETt2UDIo8=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=o0l9VqpaIX176dllW/a9jp/Gk9l9JBCZ24Ftff4bqtGd5RixuMPzPJie4QBsRlmE0 2gCUuR+0EinJ2xqPqjL6CGlp04ODi5/dp/4lA+OGPvp2LIXKOqVQDzdeP61CpJddLp p47/L1z3hccwhoCXWxUZdEPbdY/NEDQ3Vkfc5mGo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46C74F8971B; Thu, 11 Apr 2019 11:51:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1263F8971C; Thu, 11 Apr 2019 11:51:08 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4A863F89625 for ; Thu, 11 Apr 2019 11:51:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4A863F89625 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833713" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:00 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:48 +0800 Message-Id: <1554975299-25343-2-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 01/12] ASoC: intel: skl_hda_dsp_generic: add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between cAVS generic machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/skl_hda_dsp_common.c | 22 ++++++++++++++++++++++ sound/soc/intel/boards/skl_hda_dsp_common.h | 1 + sound/soc/intel/boards/skl_hda_dsp_generic.c | 12 ++++++++++++ 3 files changed, 35 insertions(+) diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.c b/sound/soc/intel/boards/skl_hda_dsp_common.c index 3fdbf23..9144e38 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.c +++ b/sound/soc/intel/boards/skl_hda_dsp_common.c @@ -17,6 +17,25 @@ #define NAME_SIZE 32 +static int skl_hdmi_init(struct snd_soc_pcm_runtime *rtd) +{ + struct skl_hda_private *ctx = snd_soc_card_get_drvdata(rtd->card); + struct snd_soc_dai *dai = rtd->codec_dai; + + /* + * Setup a device_link between machine device and HDMI codec device. + * The machine device is the consumer and the HDMI codec device is + * the supplier. With this setting, we can make sure that the audio + * domain in display power will be always turned on before operating + * on the HDMI audio codec registers. + */ + if (!ctx->link) + ctx->link = device_link_add(rtd->card->dev, dai->dev, + DL_FLAG_RPM_ACTIVE); + + return 0; +} + int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device) { struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); @@ -48,6 +67,7 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { .cpu_dai_name = "iDisp1 Pin", .codec_name = "ehdaudio0D2", .codec_dai_name = "intel-hdmi-hifi1", + .init = skl_hdmi_init, .dpcm_playback = 1, .no_pcm = 1, }, @@ -57,6 +77,7 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { .cpu_dai_name = "iDisp2 Pin", .codec_name = "ehdaudio0D2", .codec_dai_name = "intel-hdmi-hifi2", + .init = skl_hdmi_init, .dpcm_playback = 1, .no_pcm = 1, }, @@ -66,6 +87,7 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { .cpu_dai_name = "iDisp3 Pin", .codec_name = "ehdaudio0D2", .codec_dai_name = "intel-hdmi-hifi3", + .init = skl_hdmi_init, .dpcm_playback = 1, .no_pcm = 1, }, diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h index 87c50af..df5cc6b 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.h +++ b/sound/soc/intel/boards/skl_hda_dsp_common.h @@ -29,6 +29,7 @@ struct skl_hda_private { int pcm_count; int dai_index; const char *platform_name; + struct device_link *link; }; extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS]; diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c index b9a21e6..ceca11e 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -166,8 +166,20 @@ static int skl_hda_audio_probe(struct platform_device *pdev) return devm_snd_soc_register_card(&pdev->dev, &hda_soc_card); } +static int skl_hda_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); + + if (ctx->link) + device_link_del(ctx->link); + + return 0; +} + static struct platform_driver skl_hda_audio = { .probe = skl_hda_audio_probe, + .remove = skl_hda_audio_remove, .driver = { .name = "skl_hda_dsp_generic", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F63B17E0 for ; Thu, 11 Apr 2019 09:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01BD028A4C for ; Thu, 11 Apr 2019 09:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E985F28CB5; Thu, 11 Apr 2019 09:53:41 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3881A28A4C for ; Thu, 11 Apr 2019 09:53:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6B5E4825; Thu, 11 Apr 2019 11:52:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6B5E4825 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976419; bh=LG24+Ul1GZidRmnM7NfdUlH8IlkAdf0paOkisR5mGhw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PTDGIZXY0v/Y/trcmmtUWK42sEJ1pXVaJv/jHZIcp6OdAyz1ShtKhD0JH04iOyRUB hDfc8he9CIo7UN3K5Us+XJIYv9oimwPvnzv4DKgLUQLjdaAxwRSJeLMX7WVbQbnGmL lvxPjyq7XnZ/msE0hXmpIW9mQWKlrN+GHQwN6s0o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 92B4AF89722; Thu, 11 Apr 2019 11:51:14 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 117C8F896F6; Thu, 11 Apr 2019 11:51:08 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E76CEF89616 for ; Thu, 11 Apr 2019 11:51:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E76CEF89616 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833725" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:01 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:49 +0800 Message-Id: <1554975299-25343-3-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 02/12] ASoC: intel: boards: define some general functions for hdac_hdmi X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang Create hdac_hdmi_common.h and define some general functions related to hdac_hdmi codec. Signed-off-by: Libin Yang --- sound/soc/intel/boards/hdac_hdmi_common.h | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sound/soc/intel/boards/hdac_hdmi_common.h diff --git a/sound/soc/intel/boards/hdac_hdmi_common.h b/sound/soc/intel/boards/hdac_hdmi_common.h new file mode 100644 index 0000000..565906cf --- /dev/null +++ b/sound/soc/intel/boards/hdac_hdmi_common.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright(c) 2019 Intel Corporation. + */ + +/* + * This file includes the general functions related to hdac_hdmi codec, + * which is used by the different boards + */ + +#ifndef __SOUND_SOC_HDAC_HDMI_COMMON +#define __SOUND_SOC_HDAC_HDMI_COMMON + +static int hdac_hdmi_add_device_link(struct device *consumer, + struct device *supplier, + struct device_link **link) +{ + /* + * Setup a device_link between machine device and HDMI codec device. + * The machine device is the consumer and the HDMI codec device is + * the supplier. With this setting, we can make sure that the audio + * domain in display power will be always turned on before operating + * on the HDMI audio codec registers. + */ + if (!(*link)) + *link = device_link_add(consumer, supplier, DL_FLAG_RPM_ACTIVE); + + if (!(*link)) + dev_warn(consumer, + "failed creating device_link for HDMI codec\n"); + + return 0; +} + +static int hdac_hdmi_del_device_link(struct device_link **link) +{ + /* + * delete the device_link between machine device and HDMI codec device. + */ + if (*link) + device_link_del(*link); + + return 0; +} + +#endif /* __SOUND_SOC_HDAC_HDMI_COMMON */ From patchwork Thu Apr 11 09:34:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABD931515 for ; Thu, 11 Apr 2019 09:55:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DC052886B for ; Thu, 11 Apr 2019 09:55:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DAA7288F8; Thu, 11 Apr 2019 09:55:02 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C33B2886B for ; Thu, 11 Apr 2019 09:55:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 69D8E87D; Thu, 11 Apr 2019 11:54:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 69D8E87D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976499; bh=KCQMN0cJR+mXW9fVGRomR4ZZiK0F/AhOSiRWV9NtAmQ=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fH8TetkUdLWJe/9a8HrYmKZeKvCyXXQcMJ660RGNsvOoZBrn6GeAPjVC40IpSopkr UBn063iyT5V7iDKaslNS+3PddFlPrk/OGyw4AFOwCjNUx9ic/r3EO92sGS6e20sNY1 IsvblQi4aAGGBd3HT6KWbbKLJDuzerN9Oh0nF78I= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 34F07F8971D; Thu, 11 Apr 2019 11:51:24 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 05D0FF89727; Thu, 11 Apr 2019 11:51:16 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5216CF8963E for ; Thu, 11 Apr 2019 11:51:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5216CF8963E X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833735" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:02 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:50 +0800 Message-Id: <1554975299-25343-4-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 03/12] ASoC: intel: bxt_da7219_max98357a: add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between bxt_da7219_max98357a machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/bxt_da7219_max98357a.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index 5cadb7f..9a0ec2c 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -29,6 +29,7 @@ #include "../../codecs/hdac_hdmi.h" #include "../../codecs/da7219.h" #include "../../codecs/da7219-aad.h" +#include "hdac_hdmi_common.h" #define BXT_DIALOG_CODEC_DAI "da7219-hifi" #define BXT_MAXIM_CODEC_DAI "HiFi" @@ -46,6 +47,7 @@ struct bxt_hdmi_pcm { struct bxt_card_private { struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { @@ -237,7 +239,8 @@ static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int broxton_da7219_fe_init(struct snd_soc_pcm_runtime *rtd) @@ -684,8 +687,17 @@ static const struct platform_device_id bxt_board_ids[] = { { } }; +static int broxton_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct bxt_card_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver broxton_audio = { .probe = broxton_audio_probe, + .remove = broxton_audio_remove, .driver = { .name = "bxt_da7219_max98357a", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31F391515 for ; Thu, 11 Apr 2019 09:54:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14BCA28A4C for ; Thu, 11 Apr 2019 09:54:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 090E528CB7; Thu, 11 Apr 2019 09:54:21 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 55C7928A4C for ; Thu, 11 Apr 2019 09:54:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 92CD5887; Thu, 11 Apr 2019 11:53:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 92CD5887 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976458; bh=mfEiW0N3tWiMTkqIFgyVb7JFEbHJ1DEI1u70EpKOfPg=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AayL0G3IKILZyCKP7ovpXXcgHt1uwhXBRGKm5W7dcXBmoYrdOMHEGy4VSmpWkFaml whzTtaQ2hhu6APdZiBTICq8AToESzbMGoxqvR6H3q5JqGKTxrn3pvgS+dwK4pZq7CN VraTNSa6CS9HzScEdTdtSNeAEKOw6h+zZZQ/cFcg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7AA74F89728; Thu, 11 Apr 2019 11:51:18 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 54BF6F89726; Thu, 11 Apr 2019 11:51:15 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B0A52F808F6 for ; Thu, 11 Apr 2019 11:51:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B0A52F808F6 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833743" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:04 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:51 +0800 Message-Id: <1554975299-25343-5-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 04/12] ASoC: intel: bxt_rt298: add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between bxt_rt298 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/bxt_rt298.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index e91057f..1d40dd3 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c @@ -26,6 +26,7 @@ #include #include "../../codecs/hdac_hdmi.h" #include "../../codecs/rt298.h" +#include "hdac_hdmi_common.h" /* Headset jack detection DAPM pins */ static struct snd_soc_jack broxton_headset; @@ -39,6 +40,7 @@ struct bxt_hdmi_pcm { struct bxt_rt286_private { struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { @@ -204,7 +206,8 @@ static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int broxton_ssp5_fixup(struct snd_soc_pcm_runtime *rtd, @@ -626,8 +629,17 @@ static const struct platform_device_id bxt_board_ids[] = { {} }; +static int broxton_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct bxt_rt286_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver broxton_audio = { .probe = broxton_audio_probe, + .remove = broxton_audio_remove, .driver = { .name = "bxt_alc298s_i2s", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 136EC1515 for ; Thu, 11 Apr 2019 09:55:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8DC028B02 for ; Thu, 11 Apr 2019 09:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCC2E28CB7; Thu, 11 Apr 2019 09:55:31 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 296E928B02 for ; Thu, 11 Apr 2019 09:55:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 660CA875; Thu, 11 Apr 2019 11:54:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 660CA875 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976529; bh=8Dzt5QoplG97IAAUhmDeYSruv4UbtbeRgi/e9rViogU=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dbatx2O7df9hx0TBtl+/Q/xkWWqTBPLg5Qx7eGzxefvTZBfaoeYTj6T0fgWIR8Xil DFTubXupz+kYgXxTn5loJT+WipLJWR7bWgAXFI8UzpzdQaRwprdkj15O18FdDF4i4X m/mA42EUsTCWu6uSDC1L2i1CIxqTGyVZL5ISVi4M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B92A1F89726; Thu, 11 Apr 2019 11:51:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id F2F15F8972B; Thu, 11 Apr 2019 11:51:18 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AD5C7F8971A for ; Thu, 11 Apr 2019 11:51:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AD5C7F8971A X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833750" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:05 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:52 +0800 Message-Id: <1554975299-25343-6-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 05/12] ASoC: intel: glk_rt5682_max98357a: add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between glk_rt5682_max98357a machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/glk_rt5682_max98357a.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/glk_rt5682_max98357a.c b/sound/soc/intel/boards/glk_rt5682_max98357a.c index d17126f..f35ea41 100644 --- a/sound/soc/intel/boards/glk_rt5682_max98357a.c +++ b/sound/soc/intel/boards/glk_rt5682_max98357a.c @@ -20,6 +20,7 @@ #include "../skylake/skl.h" #include "../../codecs/rt5682.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h" /* The platform clock outputs 19.2Mhz clock to codec as I2S MCLK */ #define GLK_PLAT_CLK_FREQ 19200000 @@ -42,6 +43,7 @@ struct glk_hdmi_pcm { struct glk_card_private { struct snd_soc_jack geminilake_headset; struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { @@ -218,7 +220,8 @@ static int geminilake_hdmi_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int geminilake_rt5682_fe_init(struct snd_soc_pcm_runtime *rtd) @@ -607,8 +610,17 @@ static const struct platform_device_id glk_board_ids[] = { { } }; +static int geminilake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct glk_card_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver geminilake_audio = { .probe = geminilake_audio_probe, + .remove = geminilake_audio_remove, .driver = { .name = "glk_rt5682_max98357a", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70D7917E0 for ; Thu, 11 Apr 2019 09:56:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5439A28B02 for ; Thu, 11 Apr 2019 09:56:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47A8D28CB7; Thu, 11 Apr 2019 09:56:18 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 968D428B02 for ; Thu, 11 Apr 2019 09:56:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C6298888; Thu, 11 Apr 2019 11:55:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C6298888 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976575; bh=5w+IDEdgySlxrUBCkHx5TzRZs+qJ+xIb4vbKjjM8x8A=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rM1FSN43tu6qvY5JBojL1S7+UjWn3DQaBTak3bmxxwKHP4T+gjZR/K40bKbXH1Up4 35TSWftc4x5XRbpnwkZ6bTEeuIMTf2IHpY52JpIXSYy/IQ5WTbK1METLbWxmZkzkjh QJawsxy6PuPY+YiEiTCE/SHFFgH4dIW9JF3lCBJ8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 21F0EF8972F; Thu, 11 Apr 2019 11:51:29 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7FDFEF8972C; Thu, 11 Apr 2019 11:51:19 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CBEFFF89625 for ; Thu, 11 Apr 2019 11:51:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CBEFFF89625 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833762" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:07 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:53 +0800 Message-Id: <1554975299-25343-7-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 06/12] ASoC: intel: kbl_da7219_max98357a: add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between kbl_da7219_max98357a machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/kbl_da7219_max98357a.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c index 38f6ab7..2f67a9f 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98357a.c +++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c @@ -21,6 +21,7 @@ #include "../../codecs/hdac_hdmi.h" #include "../skylake/skl.h" #include "../../codecs/da7219-aad.h" +#include "hdac_hdmi_common.h" #define KBL_DIALOG_CODEC_DAI "da7219-hifi" #define KBL_MAXIM_CODEC_DAI "HiFi" @@ -40,6 +41,7 @@ struct kbl_hdmi_pcm { struct kbl_codec_private { struct snd_soc_jack kabylake_headset; struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { @@ -216,7 +218,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) @@ -597,8 +600,17 @@ static const struct platform_device_id kbl_board_ids[] = { { } }; +static int kabylake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver kabylake_audio = { .probe = kabylake_audio_probe, + .remove = kabylake_audio_remove, .driver = { .name = "kbl_da7219_max98357a", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D26E1515 for ; Thu, 11 Apr 2019 09:57:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D9A628C99 for ; Thu, 11 Apr 2019 09:57:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B52528C6B; Thu, 11 Apr 2019 09:57:07 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7469F28C6B for ; Thu, 11 Apr 2019 09:57:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7045486F; Thu, 11 Apr 2019 11:56:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7045486F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976624; bh=gpMhZI6YpEa7Apg0cqFnb1CWc+vIIrQ71OoHUdYxydE=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GiFT8FlNZQIHoSnPNH+la1+YciUgnKNkaDC2sVmb+ZtpaCR0alRDOF29mww1cm4yA gxwHav3UmaXEeBb9lPvFxQ3JKPCcDvkgyeyPIzPa3qSjzyLZjEvUl3n3YTt/7VmJdy YsBwLVIYI5Pb/LgSPBfSt1WRSUO/dqE03myZT02Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9EEB2F89738; Thu, 11 Apr 2019 11:51:32 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE616F8972A; Thu, 11 Apr 2019 11:51:20 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 772D4F89636 for ; Thu, 11 Apr 2019 11:51:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 772D4F89636 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833771" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:08 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:54 +0800 Message-Id: <1554975299-25343-8-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 07/12] ASoC: intel: kbl_da7219_max98927: add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between kbl_da7219_max98927 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/kbl_da7219_max98927.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/kbl_da7219_max98927.c b/sound/soc/intel/boards/kbl_da7219_max98927.c index f72a7bf..5ae6ddb 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98927.c +++ b/sound/soc/intel/boards/kbl_da7219_max98927.c @@ -21,6 +21,7 @@ #include "../../codecs/hdac_hdmi.h" #include "../skylake/skl.h" #include "../../codecs/da7219-aad.h" +#include "hdac_hdmi_common.h" #define KBL_DIALOG_CODEC_DAI "da7219-hifi" #define MAX98927_CODEC_DAI "max98927-aif1" @@ -48,6 +49,7 @@ struct kbl_hdmi_pcm { struct kbl_codec_private { struct snd_soc_jack kabylake_headset; struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { @@ -339,7 +341,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) @@ -1113,8 +1116,17 @@ static const struct platform_device_id kbl_board_ids[] = { { } }; +static int kabylake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver kabylake_audio = { .probe = kabylake_audio_probe, + .remove = kabylake_audio_remove, .driver = { .name = "kbl_da7219_max98_927_373", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1989A1515 for ; Thu, 11 Apr 2019 09:57:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F045828B02 for ; Thu, 11 Apr 2019 09:57:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E495928C99; Thu, 11 Apr 2019 09:57:42 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E08328C6B for ; Thu, 11 Apr 2019 09:57:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 704C1867; Thu, 11 Apr 2019 11:56:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 704C1867 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976660; bh=37LBbFEPxvTqGS+ArbyDNtz8dK89BKoe4mPFSqE/a7U=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=O6eVz7c06fo56JWIRt5D9xxYhlvsYebsqGxp9ziZvUqg4e3aA/pk4wwjePliVaod7 qCyA08rcXljb0dZ1MZI6SSPs8cx/qEvPW89K6CZ7UnpllfB9WEnjjb3frEl/9j2nuc MKyGi9nplEpw1krEkTEob6r9SZWxoCKbRZ+V6YmA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DA799F8973D; Thu, 11 Apr 2019 11:51:34 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1882DF8971A; Thu, 11 Apr 2019 11:51:22 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C99DAF8971D for ; Thu, 11 Apr 2019 11:51:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C99DAF8971D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833778" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:10 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:55 +0800 Message-Id: <1554975299-25343-9-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 08/12] ASoC: intel: kbl_rt5660: add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between kbl_rt5660 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/kbl_rt5660.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/kbl_rt5660.c b/sound/soc/intel/boards/kbl_rt5660.c index 3255e00..3150aa9 100644 --- a/sound/soc/intel/boards/kbl_rt5660.c +++ b/sound/soc/intel/boards/kbl_rt5660.c @@ -23,6 +23,7 @@ #include "../../codecs/hdac_hdmi.h" #include "../../codecs/rt5660.h" +#include "hdac_hdmi_common.h" #define KBL_RT5660_CODEC_DAI "rt5660-aif1" #define DUAL_CHANNEL 2 @@ -41,6 +42,7 @@ struct kbl_hdmi_pcm { struct kbl_codec_private { struct gpio_desc *gpio_lo_mute; struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { @@ -222,7 +224,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) @@ -525,8 +528,17 @@ static const struct platform_device_id kbl_board_ids[] = { { } }; +static int kabylake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver kabylake_audio = { .probe = kabylake_audio_probe, + .remove = kabylake_audio_remove, .driver = { .name = "kbl_rt5660", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 563DD1515 for ; Thu, 11 Apr 2019 09:58:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 382E428C6B for ; Thu, 11 Apr 2019 09:58:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C79128C99; Thu, 11 Apr 2019 09:58:20 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7904D28C6B for ; Thu, 11 Apr 2019 09:58:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AC1FB883; Thu, 11 Apr 2019 11:57:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AC1FB883 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976697; bh=YBH1SoIGzDnsWhF/sVUWs0F4+0X7SFhHKXXjsGPwSQI=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=By6W6KCUSRfQsOEO+/5Es7+HbE2MLp1MU7RmZlu4+Ipou2kH1zEMcT1wuuRcSkpct d12adrYoh2qsRk9PxhSiLOz1jLh9GUg3Gk0kUjy77Ri950IYWjgydAm58XgDJ5hbLg 4nxOOWcm5QmeD1S06M+GXjWP5kUHu7/vH7TE6x3Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 750CAF89744; Thu, 11 Apr 2019 11:51:36 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A3683F8972B; Thu, 11 Apr 2019 11:51:24 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 32F38F8971F for ; Thu, 11 Apr 2019 11:51:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 32F38F8971F X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833781" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:11 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:56 +0800 Message-Id: <1554975299-25343-10-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 09/12] ASoC: intel: kbl_rt5663_max98927 add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between kbl_rt5663_max98927 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/kbl_rt5663_max98927.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/kbl_rt5663_max98927.c b/sound/soc/intel/boards/kbl_rt5663_max98927.c index d714752..6e23461 100644 --- a/sound/soc/intel/boards/kbl_rt5663_max98927.c +++ b/sound/soc/intel/boards/kbl_rt5663_max98927.c @@ -31,6 +31,7 @@ #include #include #include +#include "hdac_hdmi_common.h" #define KBL_REALTEK_CODEC_DAI "rt5663-aif" #define KBL_MAXIM_CODEC_DAI "max98927-aif1" @@ -53,6 +54,7 @@ struct kbl_rt5663_private { struct list_head hdmi_pcm_list; struct clk *mclk; struct clk *sclk; + struct device_link *link; }; enum { @@ -336,7 +338,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) @@ -1033,8 +1036,17 @@ static const struct platform_device_id kbl_board_ids[] = { { } }; +static int kabylake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct kbl_rt5663_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver kabylake_audio = { .probe = kabylake_audio_probe, + .remove = kabylake_audio_remove, .driver = { .name = "kbl_rt5663_m98927", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4148617E0 for ; Thu, 11 Apr 2019 09:58:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2420A28B02 for ; Thu, 11 Apr 2019 09:58:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16CC428C91; Thu, 11 Apr 2019 09:58:56 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 627F828B02 for ; Thu, 11 Apr 2019 09:58:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A108887C; Thu, 11 Apr 2019 11:58:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A108887C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976733; bh=M5qppWVC+otP3Rx9A5iMuG+pJFlU4U1JUitNdcqM1vg=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tizLOQ6l/CBWAmP7dOdCHm/Xy7d7uPm4RuhEwnnnBXRO4/RxxDQQVjhBkWquN70Xy KN79GlYlbYZ5lP912ZFb4WbQsaZEt6YSv0egiH8WFUdiUZ7qUXj/62rBjeQBjT8fsf xnjzRUuo4IJEjEgSD3sQTaQTPfRXSq1GuJe33M2U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C262CF89749; Thu, 11 Apr 2019 11:51:37 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2DB7FF8972C; Thu, 11 Apr 2019 11:51:26 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 802F3F808F6 for ; Thu, 11 Apr 2019 11:51:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 802F3F808F6 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833784" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:13 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:57 +0800 Message-Id: <1554975299-25343-11-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 10/12] ASoC: intel: kbl_rt5663_rt5514_max98927 add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between kbl_rt5663_rt5514_max98927 machine device(consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c index 879f142..e9ec696 100644 --- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c @@ -30,6 +30,7 @@ #include "../../codecs/rt5514.h" #include "../../codecs/rt5663.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h" #define KBL_REALTEK_CODEC_DAI "rt5663-aif" #define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1" @@ -58,6 +59,7 @@ struct kbl_codec_private { struct snd_soc_jack kabylake_headset; struct list_head hdmi_pcm_list; struct snd_soc_jack kabylake_hdmi[2]; + struct device_link *link; }; enum { @@ -224,7 +226,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) @@ -672,8 +675,17 @@ static const struct platform_device_id kbl_board_ids[] = { { } }; +static int kabylake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver kabylake_audio = { .probe = kabylake_audio_probe, + .remove = kabylake_audio_remove, .driver = { .name = "kbl_r5514_5663_max", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14EF21515 for ; Thu, 11 Apr 2019 09:59:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E789828A40 for ; Thu, 11 Apr 2019 09:59:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D75FC28A35; Thu, 11 Apr 2019 09:59:40 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7585928A35 for ; Thu, 11 Apr 2019 09:59:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AC6D086F; Thu, 11 Apr 2019 11:58:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AC6D086F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976777; bh=R38peRkBjiNbdzeNHvGmNCl6R5mIVOVVZ040BANrv/4=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rtEfnAwvZ5XZhCCg74bdw7nIExnkqDmwMfLF2v6LCLBKaSDIV07eWMCQxYcVEmwYz gstG/6Kh7KBRcQiQZ6jG9xBwItNrH28iUxPgQY67QTOZ+WY3LHv1A6Y50CX2ZPY6RZ iT21KuYI5ThljQYSnIQLc7F5WAJROYJhw84lpvd0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2CBA0F8974E; Thu, 11 Apr 2019 11:51:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id F1547F8972C; Thu, 11 Apr 2019 11:51:26 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D6E99F89725 for ; Thu, 11 Apr 2019 11:51:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D6E99F89725 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833788" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:14 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:58 +0800 Message-Id: <1554975299-25343-12-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 11/12] ASoC: intel: skl_nau88l25_max98357a add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between skl_nau88l25_max98357a machine device(consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/boards/skl_nau88l25_max98357a.c b/sound/soc/intel/boards/skl_nau88l25_max98357a.c index 0922106..38d599b 100644 --- a/sound/soc/intel/boards/skl_nau88l25_max98357a.c +++ b/sound/soc/intel/boards/skl_nau88l25_max98357a.c @@ -24,6 +24,7 @@ #include #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h" #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" #define SKL_MAXIM_CODEC_DAI "HiFi" @@ -42,6 +43,7 @@ struct skl_hdmi_pcm { struct skl_nau8825_private { struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { @@ -202,7 +204,8 @@ static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd) @@ -220,7 +223,8 @@ static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd) @@ -238,7 +242,8 @@ static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd) @@ -666,8 +671,17 @@ static const struct platform_device_id skl_board_ids[] = { { } }; +static int skylake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct skl_nau8825_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver skylake_audio = { .probe = skylake_audio_probe, + .remove = skylake_audio_remove, .driver = { .name = "skl_n88l25_m98357a", .pm = &snd_soc_pm_ops, From patchwork Thu Apr 11 09:34:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10895555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E258317E6 for ; Thu, 11 Apr 2019 10:00:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2D7828A35 for ; Thu, 11 Apr 2019 10:00:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B68AD28C91; Thu, 11 Apr 2019 10:00:18 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 04C0028A35 for ; Thu, 11 Apr 2019 10:00:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1B525875; Thu, 11 Apr 2019 11:59:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1B525875 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554976815; bh=fZwl7sJj2403oPMgbIiVohH+UaBhEc9c8KMjHg3D2+M=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KqVthfRdAGOXX5iyX+FmucQTN5DEgbWx5I8rRi5Wvo1K4ZQ+aqublnjy0DSjn5DhY 2ML2F/B2COcGY4MmViH72bggIr2/Q7z5JicnfCZKCIOFnZvqeZQXkxUAQ8ZVfvLcvK 9seTXu+NfQyLVeNrsbTodIXJGlqOHLtnVd6JKd/Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 60A4AF89753; Thu, 11 Apr 2019 11:51:40 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7FB46F89725; Thu, 11 Apr 2019 11:51:27 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 48236F89726 for ; Thu, 11 Apr 2019 11:51:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 48236F89726 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 02:51:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,336,1549958400"; d="scan'208";a="141833793" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2019 02:51:15 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 11 Apr 2019 17:34:59 +0800 Message-Id: <1554975299-25343-13-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554975299-25343-1-git-send-email-libin.yang@intel.com> References: <1554975299-25343-1-git-send-email-libin.yang@intel.com> Cc: tiwai@suse.de, libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 12/12] ASoC: intel: skl_nau88l25_ssm4567 add device_link to HDMI audio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between skl_nau88l25_ssm4567 machine device(consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang --- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c index 8433c52..949f1eb 100644 --- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c +++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c @@ -28,6 +28,7 @@ #include #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h" #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" #define SKL_SSM_CODEC_DAI "ssm4567-hifi" @@ -46,6 +47,7 @@ struct skl_hdmi_pcm { struct skl_nau88125_private { struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { SKL_DPCM_AUDIO_PB = 0, @@ -232,7 +234,8 @@ static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd) @@ -250,7 +253,8 @@ static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } @@ -269,7 +273,8 @@ static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd) list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); - return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); } static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd) @@ -719,8 +724,17 @@ static const struct platform_device_id skl_board_ids[] = { { } }; +static int skylake_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct skl_nau88125_private *ctx = snd_soc_card_get_drvdata(card); + + return hdac_hdmi_del_device_link(&ctx->link); +} + static struct platform_driver skylake_audio = { .probe = skylake_audio_probe, + .remove = skylake_audio_remove, .driver = { .name = "skl_n88l25_s4567", .pm = &snd_soc_pm_ops,