From patchwork Thu Apr 11 14:19: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: 10896149 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 5C14917E0 for ; Thu, 11 Apr 2019 14:37:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BA4528D20 for ; Thu, 11 Apr 2019 14:37:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CAFF28C01; Thu, 11 Apr 2019 14:37: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 68C2E28CF4 for ; Thu, 11 Apr 2019 14:37: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 4A303871; Thu, 11 Apr 2019 16:37:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4A303871 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554993473; bh=W/zQPt4FOKxKCQLWg/RYWPp8GvgDtLevCsRgNCfeJsQ=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BER291llrJtLVzh7fgpYRezqVo+nQ7wFkCUXQhDaFp09mn+IK7N02cFKF6FJjXp3k P9ye8n+DUohrv/NwSUly1Qhdk4zS6ZHoFkaEBCmkpx6v5EwE9yWxsYw5SgmI2skvcc 2qQRPKJT+fqGhypBcel/SUH20+nZsLIJTXG0PLSk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2053CF89616; Thu, 11 Apr 2019 16:36: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 E3097F8971A; Thu, 11 Apr 2019 16:36:08 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 2E5D7F89625 for ; Thu, 11 Apr 2019 16:36:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2E5D7F89625 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 07:36:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,337,1549958400"; d="scan'208";a="130506495" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by orsmga007.jf.intel.com with ESMTP; 11 Apr 2019 07:36:00 -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: Thu, 11 Apr 2019 22:19:49 +0800 Message-Id: <1554992400-28777-2-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554992400-28777-1-git-send-email-libin.yang@intel.com> References: <1554992400-28777-1-git-send-email-libin.yang@intel.com> Cc: libin.yang@intel.com Subject: [alsa-devel] [PATCH v3 01/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 | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 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..277493d --- /dev/null +++ b/sound/soc/intel/boards/hdac_hdmi_common.h @@ -0,0 +1,36 @@ +/* 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 | + DL_FLAG_AUTOREMOVE_CONSUMER); + + if (!(*link)) + dev_warn(consumer, + "failed creating device_link for HDMI codec\n"); + + return 0; +} + +#endif /* __SOUND_SOC_HDAC_HDMI_COMMON */