From patchwork Tue Jul 26 12:36:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 9248545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9F29607D8 for ; Tue, 26 Jul 2016 17:37:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A87842094D for ; Tue, 26 Jul 2016 17:37:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97CB326B41; Tue, 26 Jul 2016 17:37:30 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1E912094D for ; Tue, 26 Jul 2016 17:37:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id ABC66266856; Tue, 26 Jul 2016 19:37:28 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EC61226699C; Tue, 26 Jul 2016 15:48:17 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 11C2A26699B; Tue, 26 Jul 2016 15:48:16 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id 3BDF926699C for ; Tue, 26 Jul 2016 14:29:49 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 26 Jul 2016 05:29:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,424,1464678000"; d="scan'208"; a="1024132627" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by orsmga002.jf.intel.com with ESMTP; 26 Jul 2016 05:29:40 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Tue, 26 Jul 2016 18:06:43 +0530 Message-Id: <1469536610-27606-6-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469536610-27606-1-git-send-email-vinod.koul@intel.com> References: <1469536610-27606-1-git-send-email-vinod.koul@intel.com> Cc: Kranthi G , patches.audio@intel.com, Ramesh Babu , liam.r.girdwood@linux.intel.com, Vinod Koul , broonie@kernel.org, Senthilnathan Veppur Subject: [alsa-devel] [PATCH 05/12] ASoC: Intel: Skylake: add support for tplg manifest load X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kranthi G Topology manifest gives information about the libraries to be loaded. Implement the topology manifest load callback to get this. Signed-off-by: Kranthi G Signed-off-by: Senthilnathan Veppur Signed-off-by: Ramesh Babu Signed-off-by: Vinod Koul --- sound/soc/intel/skylake/skl-sst-ipc.h | 3 +++ sound/soc/intel/skylake/skl-topology.c | 22 ++++++++++++++++++++++ sound/soc/intel/skylake/skl-tplg-interface.h | 12 ++++++++++++ 3 files changed, 37 insertions(+) diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h index 0a0d09cde99d..31e5bc356aa2 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.h +++ b/sound/soc/intel/skylake/skl-sst-ipc.h @@ -80,6 +80,9 @@ struct skl_sst { /* multi-core */ struct skl_dsp_cores cores; + + /* tplg manifest */ + struct skl_dfw_manifest manifest; }; struct skl_ipc_init_instance_msg { diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 904103056d62..a1d9f84d9674 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -1789,11 +1789,33 @@ static int skl_tplg_control_load(struct snd_soc_component *cmpnt, return 0; } +static int skl_manifest_load(struct snd_soc_component *cmpnt, + struct snd_soc_tplg_manifest *manifest) +{ + struct skl_dfw_manifest *minfo; + struct hdac_ext_bus *ebus = snd_soc_component_get_drvdata(cmpnt); + struct hdac_bus *bus = ebus_to_hbus(ebus); + struct skl *skl = ebus_to_skl(ebus); + int ret = 0; + + minfo = &skl->skl_sst->manifest; + memcpy(minfo, manifest->priv.data, sizeof(struct skl_dfw_manifest)); + + if (minfo->lib_count > HDA_MAX_LIB) { + dev_err(bus->dev, "Exceeding max Library count. Got:%d\n", + minfo->lib_count); + ret = -EINVAL; + } + + return ret; +} + static struct snd_soc_tplg_ops skl_tplg_ops = { .widget_load = skl_tplg_widget_load, .control_load = skl_tplg_control_load, .bytes_ext_ops = skl_tlv_ops, .bytes_ext_ops_count = ARRAY_SIZE(skl_tlv_ops), + .manifest = skl_manifest_load, }; /* diff --git a/sound/soc/intel/skylake/skl-tplg-interface.h b/sound/soc/intel/skylake/skl-tplg-interface.h index a32e5e9cc530..1b531c165a91 100644 --- a/sound/soc/intel/skylake/skl-tplg-interface.h +++ b/sound/soc/intel/skylake/skl-tplg-interface.h @@ -228,4 +228,16 @@ struct skl_dfw_algo_data { char params[0]; } __packed; +#define LIB_NAME_LENGTH 128 +#define HDA_MAX_LIB 16 + +struct lib_info { + char name[LIB_NAME_LENGTH]; +} __packed; + +struct skl_dfw_manifest { + u32 lib_count; + struct lib_info lib[HDA_MAX_LIB]; +} __packed; + #endif