linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Baluta <daniel.baluta@nxp.com>
To: m.felsch@pengutronix.de, shawnguo@kernel.org
Cc: mark.rutland@arm.com, aisheng.dong@nxp.com, peng.fan@nxp.com,
	anson.huang@nxp.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-imx@nxp.com,
	shengjiu.wang@nxp.com, paul.olaru@nxp.com, robh+dt@kernel.org,
	kernel@pengutronix.de, leonard.crestez@nxp.com,
	festevam@gmail.com, linux-arm-kernel@lists.infradead.org,
	sound-open-firmware@alsa-project.org,
	Daniel Baluta <daniel.baluta@nxp.com>
Subject: [PATCH v2 2/5] ASoC: SOF: topology: Add dummy support for i.MX8 DAIs
Date: Tue, 23 Jul 2019 11:41:01 +0300	[thread overview]
Message-ID: <20190723084104.12639-3-daniel.baluta@nxp.com> (raw)
In-Reply-To: <20190723084104.12639-1-daniel.baluta@nxp.com>

Add dummy support for SAI/ESAI digital audio interface
IPs found on i.MX8 boards.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
This is also on review with SOF community here:

https://github.com/thesofproject/linux/pull/1048
 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 dc1b27daaac6..347ce10bfd2d 100644
--- a/include/uapi/sound/sof/tokens.h
+++ b/include/uapi/sound/sof/tokens.h
@@ -105,4 +105,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 432ae343f960..b5399f520366 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -339,6 +339,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)
@@ -2457,6 +2459,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,
@@ -2781,6 +2803,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


  parent reply	other threads:[~2019-07-23  8:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  8:40 [PATCH v2 0/5] Add DSP node for i.MX8QXP board to be used by DSP SOF driver Daniel Baluta
2019-07-23  8:41 ` [PATCH v2 1/5] ASoC: SOF: imx: Add i.MX8 HW support Daniel Baluta
2019-07-23 15:01   ` [Sound-open-firmware] " Pierre-Louis Bossart
2019-07-24  6:54     ` Daniel Baluta
2019-07-24  8:32       ` Lucas Stach
2019-07-24  8:58         ` Daniel Baluta
2019-07-23  8:41 ` Daniel Baluta [this message]
2019-07-23  8:41 ` [PATCH v2 3/5] ASoC: SOF: Add DT DSP device support Daniel Baluta
2019-07-23 15:11   ` [Sound-open-firmware] " Pierre-Louis Bossart
2019-07-24  7:04     ` Daniel Baluta
2019-08-07 14:39       ` Daniel Baluta
2019-08-07 15:22         ` Pierre-Louis Bossart
2019-08-07 15:28           ` Daniel Baluta
2019-08-08  6:27             ` Daniel Baluta
2019-08-07 15:29     ` Daniel Baluta
2019-08-07 16:01       ` Pierre-Louis Bossart
2019-07-23  8:41 ` [PATCH v2 4/5] arm64: dts: imx8qxp: Add DSP DT node Daniel Baluta
2019-07-23  8:41 ` [PATCH v2 5/5] dt-bindings: dsp: fsl: Add DSP core binding support Daniel Baluta
2019-07-23 22:32   ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190723084104.12639-3-daniel.baluta@nxp.com \
    --to=daniel.baluta@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mark.rutland@arm.com \
    --cc=paul.olaru@nxp.com \
    --cc=peng.fan@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@nxp.com \
    --cc=sound-open-firmware@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).