Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5743199ybh; Wed, 7 Aug 2019 10:38:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbx/9XIxCBM5tUPUhNb7Mri4e/NTyTUSyNUO9DaMcdv4G0/xorTXxn16ItYgf2OTSIhwPo X-Received: by 2002:aa7:8e10:: with SMTP id c16mr10267953pfr.124.1565199512939; Wed, 07 Aug 2019 10:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565199512; cv=none; d=google.com; s=arc-20160816; b=TR98cdteksE8vgtlRW+BGQfS09hLshYAk5J2si8/TvAt2Z65EIs/2LLnqr+hyLeVVq rdM7GRRV4Z4iFu+wUzp4z+RJ+5DUpMX0Em1U9GMihjpMYCSNusDkaxWZZ2/x7L7qpGaX GcfF8AeCnJ3jviBJnucohRt9o6WJmYilb6NAQPuGuFlU1ZfyVfkUEj52l9t+c8DOCmqF DlGsYuqfUCVKi0xbZKQh+es0Vr9TVAK15oWCtceDX/wg/ulOwa2lH287z3Tnm1vluqew 4Lr5hyZ4AW8RV5YNoccBMgunnk2F97KJSWjKJtEmiRP3WtvFx+mnseIpOoPnlx7LZBdv j8eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=vYmAuL2AvFJXZuvDfaCslJfK8wUCs+bL/NKWnJ/9NqQ=; b=hWMH2nLnieSGpsEYPkld8GFVcF//5Ufd7FhcUscghjFrFx6zWWIkqLVln/X1y73txn XN5S0aFstrmFd43oX1XrhgtalA1cJ1uRD5ZmH40n22e0q8C9XBdo1Cop1Qx0y2KSfPAs vKWtYWSkYSLNT1zLpiJ9XgsMJrAN80/fSus8C2kVwegak5ekZiPuGgHwKOQOvcfRc8oX sS8yE9LVm7Gt4DNPtjzwvF+1/YJN78Zm1ecUctRZ+5Lo7t+1X4oh8NBUPEJrZGwYUKIK dHX2k1Lg5ueS9G/Fi52aSFQxuMGCr/htY8gnAqLzRd2Hhz7avh78WmXV24SZcrAfHgoj szlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id co4si27322239plb.363.2019.08.07.10.38.17; Wed, 07 Aug 2019 10:38:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388822AbfHGQnU (ORCPT + 99 others); Wed, 7 Aug 2019 12:43:20 -0400 Received: from inva021.nxp.com ([92.121.34.21]:34040 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729944AbfHGQnS (ORCPT ); Wed, 7 Aug 2019 12:43:18 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E733C2007C4; Wed, 7 Aug 2019 18:43:15 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D9A172002E8; Wed, 7 Aug 2019 18:43:15 +0200 (CEST) Received: from fsr-ub1864-103.ea.freescale.net (fsr-ub1864-103.ea.freescale.net [10.171.82.17]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 1200F205E5; Wed, 7 Aug 2019 18:43:15 +0200 (CEST) From: Daniel Baluta To: daniel.baluta@nxp.com, shawnguo@kernel.org Cc: aisheng.dong@nxp.com, anson.huang@nxp.com, devicetree@vger.kernel.org, festevam@gmail.com, kernel@pengutronix.de, leonard.crestez@nxp.com, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, m.felsch@pengutronix.de, mark.rutland@arm.com, paul.olaru@nxp.com, peng.fan@nxp.com, robh+dt@kernel.org, shengjiu.wang@nxp.com, sound-open-firmware@alsa-project.org, pierre-louis.bossart@linux.intel.com, l.stach@pengutronix.de Subject: [PATCH v3 3/5] ASoC: SOF: topology: Add dummy support for i.MX8 DAIs Date: Wed, 7 Aug 2019 19:42:56 +0300 Message-Id: <20190807164258.8306-4-daniel.baluta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190807164258.8306-1-daniel.baluta@nxp.com> References: <20190807164258.8306-1-daniel.baluta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add dummy support for SAI/ESAI digital audio interface IPs found on i.MX8 boards. Signed-off-by: Daniel Baluta --- include/sound/sof/dai.h | 2 ++ include/uapi/sound/sof/tokens.h | 8 ++++++++ sound/soc/sof/topology.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h index 3d174e20aa53..ec3b5c080537 100644 --- a/include/sound/sof/dai.h +++ b/include/sound/sof/dai.h @@ -50,6 +50,8 @@ enum sof_ipc_dai_type { SOF_DAI_INTEL_DMIC, /**< Intel DMIC */ SOF_DAI_INTEL_HDA, /**< Intel HD/A */ SOF_DAI_INTEL_SOUNDWIRE, /**< Intel SoundWire */ + SOF_DAI_IMX_SAI, /**< i.MX SAI */ + SOF_DAI_IMX_ESAI, /**< i.MX ESAI */ }; /* general purpose DAI configuration */ diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h index 6435240cef13..8f996857fb24 100644 --- a/include/uapi/sound/sof/tokens.h +++ b/include/uapi/sound/sof/tokens.h @@ -106,4 +106,12 @@ /* for backward compatibility */ #define SOF_TKN_EFFECT_TYPE SOF_TKN_PROCESS_TYPE +/* SAI */ +#define SOF_TKN_IMX_SAI_FIRST_TOKEN 1000 +/* TODO: Add SAI tokens */ + +/* ESAI */ +#define SOF_TKN_IMX_ESAI_FIRST_TOKEN 1100 +/* TODO: Add ESAI tokens */ + #endif diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 30b5638622dd..e3761657ecc0 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -346,6 +346,8 @@ static const struct sof_dai_types sof_dais[] = { {"SSP", SOF_DAI_INTEL_SSP}, {"HDA", SOF_DAI_INTEL_HDA}, {"DMIC", SOF_DAI_INTEL_DMIC}, + {"SAI", SOF_DAI_IMX_SAI}, + {"ESAI", SOF_DAI_IMX_ESAI}, }; static enum sof_ipc_dai_type find_dai(const char *name) @@ -2516,6 +2518,26 @@ static int sof_link_ssp_load(struct snd_soc_component *scomp, int index, return ret; } +static int sof_link_sai_load(struct snd_soc_component *scomp, int index, + struct snd_soc_dai_link *link, + struct snd_soc_tplg_link_config *cfg, + struct snd_soc_tplg_hw_config *hw_config, + struct sof_ipc_dai_config *config) +{ + /*TODO: Add implementation */ + return 0; +} + +static int sof_link_esai_load(struct snd_soc_component *scomp, int index, + struct snd_soc_dai_link *link, + struct snd_soc_tplg_link_config *cfg, + struct snd_soc_tplg_hw_config *hw_config, + struct sof_ipc_dai_config *config) +{ + /*TODO: Add implementation */ + return 0; +} + static int sof_link_dmic_load(struct snd_soc_component *scomp, int index, struct snd_soc_dai_link *link, struct snd_soc_tplg_link_config *cfg, @@ -2840,6 +2862,14 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, ret = sof_link_hda_load(scomp, index, link, cfg, hw_config, &config); break; + case SOF_DAI_IMX_SAI: + ret = sof_link_sai_load(scomp, index, link, cfg, hw_config, + &config); + break; + case SOF_DAI_IMX_ESAI: + ret = sof_link_esai_load(scomp, index, link, cfg, hw_config, + &config); + break; default: dev_err(sdev->dev, "error: invalid DAI type %d\n", config.type); ret = -EINVAL; -- 2.17.1