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,