From patchwork Mon Apr 1 04:50: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: 10879131 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 ACC251390 for ; Mon, 1 Apr 2019 05:08:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9213D28754 for ; Mon, 1 Apr 2019 05:08:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8653828763; Mon, 1 Apr 2019 05:08:06 +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 CD0AC28754 for ; Mon, 1 Apr 2019 05:08:04 +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 A752C1644; Mon, 1 Apr 2019 07:07:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A752C1644 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554095282; bh=p8gqufw6nt7xtT3H/4gnYacVWIxmn1Vt29PXKGxVeJQ=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=RhqU+KC1KIZwToI+xWim15Y8LtHt6ph0k873V+Zg3DU0tSc/eIH1Eo0Lq8DloIhKG QObXoI2Sz59juX9960mZL/lgz/Y8o57BDmJTpBt2trOmud6Cj5c567W/8RRtfWgYpj F4D94iLekk8xwjFnRM+U70Cke1NMwVbcnHXDErgk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1516CF89612; Mon, 1 Apr 2019 07:07:12 +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 E8F93F89614; Mon, 1 Apr 2019 07:07:09 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 5B970F8075C for ; Mon, 1 Apr 2019 07:07:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5B970F8075C X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2019 22:07:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,295,1549958400"; d="scan'208";a="139056571" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by fmsmga007.fm.intel.com with ESMTP; 31 Mar 2019 22:07:01 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, pierre-louis.bossart@linux.intel.com Date: Mon, 1 Apr 2019 12:50:51 +0800 Message-Id: <1554094251-25910-1-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 Cc: libin.yang@intel.com Subject: [alsa-devel] [PATCH V2] ASoC: hdac_hdmi: add device PM dependency 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 HDMI audio codec register operation depends on the display audio power domain. The hdmi audio codec dapm event callback must be called after display audio power is turned on. Add hdac_hdmi_device_link_add() in HDMI audio codec driver. The customer audio driver, such as cAVS/SST and SOF audio driver, can call the function to set the audio power dependency. Signed-off-by: Libin Yang --- sound/soc/codecs/hdac_hdmi.c | 12 ++++++++++++ sound/soc/codecs/hdac_hdmi.h | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 5eeb0fe..c991407 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1792,6 +1792,18 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device, } EXPORT_SYMBOL_GPL(hdac_hdmi_jack_init); +struct device_link * +hdac_hdmi_device_link_add(struct device *consumer, + struct snd_soc_component *component, + u32 flags) +{ + struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component); + struct hdac_device *hdev = hdmi->hdev; + + return device_link_add(consumer, &hdev->dev, flags); +} +EXPORT_SYMBOL_GPL(hdac_hdmi_device_link_add); + static void hdac_hdmi_present_sense_all_pins(struct hdac_device *hdev, struct hdac_hdmi_priv *hdmi, bool detect_pin_caps) { diff --git a/sound/soc/codecs/hdac_hdmi.h b/sound/soc/codecs/hdac_hdmi.h index 4fa2fc9..9239c6b 100644 --- a/sound/soc/codecs/hdac_hdmi.h +++ b/sound/soc/codecs/hdac_hdmi.h @@ -7,4 +7,10 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int pcm, int hdac_hdmi_jack_port_init(struct snd_soc_component *component, struct snd_soc_dapm_context *dapm); + +struct device_link * +hdac_hdmi_device_link_add(struct device *consumer, + struct snd_soc_component *component, + u32 flags); + #endif /* __HDAC_HDMI_H__ */