From patchwork Fri Mar 29 05:23:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10876411 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 AF67F1669 for ; Fri, 29 Mar 2019 05:40:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 943E228FC9 for ; Fri, 29 Mar 2019 05:40:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 873E528FCD; Fri, 29 Mar 2019 05:40:48 +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 2B09228FC9 for ; Fri, 29 Mar 2019 05:40:47 +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 34E59869; Fri, 29 Mar 2019 06:39:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 34E59869 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1553838045; bh=91l09otrTbN/4BEoqeFf9S3AqwGF/znNAhXu0QeA9PY=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=ZjQL9yld37uLPYXrljMRZdvgXf54e2dxhdgBkr7roeha1aSJ2JMYQ4GL5ZmJgea7V dmDyXLOiunsGPF96aPvb9IDiwAN9NcxfNba7Vqqv6huUlzFLu3pohYyzMIL1JC1DzJ H4w5eXgp23nmYeBko8RDdxs9qmwutUC6bNdyO/24= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 43C77F89664; Fri, 29 Mar 2019 06:39:29 +0100 (CET) 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 D7341F89671; Fri, 29 Mar 2019 06:39:27 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 C3718F8071D for ; Fri, 29 Mar 2019 06:39:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C3718F8071D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 22:39:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,283,1549958400"; d="scan'208";a="135808465" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by fmsmga008.fm.intel.com with ESMTP; 28 Mar 2019 22:39:16 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org Date: Fri, 29 Mar 2019 13:23:02 +0800 Message-Id: <1553836982-10653-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] ASoC: 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 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__ */