All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	broonie@kernel.org, Bard Liao <yung-chuan.liao@linux.intel.com>
Subject: [PATCH 22/24] ASoC: SOF: topology: Get HDA rate and channels from topology
Date: Wed, 15 Apr 2020 15:28:14 -0500	[thread overview]
Message-ID: <20200415202816.934-23-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20200415202816.934-1-pierre-louis.bossart@linux.intel.com>

From: Bard Liao <yung-chuan.liao@linux.intel.com>

FW interface for HDA DAI parameters was extended with information on
sampling rate and channel count in version 3.16. Align kernel header
with the FW change. This change is backwards compatible. Old firmware
will ignore the values.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 include/sound/sof/dai-intel.h   | 2 ++
 include/uapi/sound/sof/abi.h    | 2 +-
 include/uapi/sound/sof/tokens.h | 4 ++++
 sound/soc/sof/topology.c        | 9 +++++++++
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/sound/sof/dai-intel.h b/include/sound/sof/dai-intel.h
index 4db906c4a534..896db2243d87 100644
--- a/include/sound/sof/dai-intel.h
+++ b/include/sound/sof/dai-intel.h
@@ -88,6 +88,8 @@ struct sof_ipc_dai_ssp_params {
 struct sof_ipc_dai_hda_params {
 	struct sof_ipc_hdr hdr;
 	uint32_t link_dma_ch;
+	uint32_t rate;
+	uint32_t channels;
 } __packed;
 
 /* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */
diff --git a/include/uapi/sound/sof/abi.h b/include/uapi/sound/sof/abi.h
index 6c802a2386ef..d54be303090f 100644
--- a/include/uapi/sound/sof/abi.h
+++ b/include/uapi/sound/sof/abi.h
@@ -26,7 +26,7 @@
 
 /* SOF ABI version major, minor and patch numbers */
 #define SOF_ABI_MAJOR 3
-#define SOF_ABI_MINOR 15
+#define SOF_ABI_MINOR 16
 #define SOF_ABI_PATCH 0
 
 /* SOF ABI version number. Format within 32bit word is MMmmmppp */
diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h
index b7ad1cd4526a..5941e2eb1588 100644
--- a/include/uapi/sound/sof/tokens.h
+++ b/include/uapi/sound/sof/tokens.h
@@ -130,4 +130,8 @@
 #define SOF_TKN_INTEL_ALH_RATE			1400
 #define SOF_TKN_INTEL_ALH_CH			1401
 
+/* HDA */
+#define SOF_TKN_INTEL_HDA_RATE			1500
+#define SOF_TKN_INTEL_HDA_CH			1501
+
 #endif
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 51d19ffe35b3..a1287924a12d 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -753,6 +753,12 @@ static const struct sof_topology_token dmic_pdm_tokens[] = {
 
 /* HDA */
 static const struct sof_topology_token hda_tokens[] = {
+	{SOF_TKN_INTEL_HDA_RATE,
+		SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+		offsetof(struct sof_ipc_dai_hda_params, rate), 0},
+	{SOF_TKN_INTEL_HDA_CH,
+		SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+		offsetof(struct sof_ipc_dai_hda_params, channels), 0},
 };
 
 /* Leds */
@@ -3083,6 +3089,9 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index,
 		return ret;
 	}
 
+	dev_dbg(scomp->dev, "HDA config rate %d channels %d\n",
+		config->hda.rate, config->hda.channels);
+
 	dai = snd_soc_find_dai(link->cpus);
 	if (!dai) {
 		dev_err(scomp->dev, "error: failed to find dai %s in %s",
-- 
2.20.1


  parent reply	other threads:[~2020-04-15 20:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 20:27 [PATCH 00/24] ASoC: SOF: topology and firmware IPC updates for 5.8 Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 01/24] ASoC: SOF: topology: fix: handle DAI widget connections properly with multiple CPU DAI's Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 02/24] ASoC: SOF: Mark get_ext* function ext_hdr arguments as const Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 03/24] ASoC: SOF: Introduce offset in firmware data Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 04/24] ASoC: SOF: Introduce extended manifest Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 05/24] ASoC: SOF: ext_manifest: parse firmware version Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 06/24] ASoC: SOF: ext_manifest: parse windows Pierre-Louis Bossart
2020-04-15 20:27 ` [PATCH 07/24] ASoC: SOF: ext_manifest: parse compiler version Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 08/24] ASoC: SOF: topology: Add support for DC Blocker Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 09/24] ASoC: SOF: add probe support extend data Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 10/24] ASoC: SOF: add debug ABI version Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 11/24] ASoC: SOF: change type char to uint8_t in info.h Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 12/24] ASoC: SOF: change type char to uint8_t in trace.h Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 13/24] ASoC: SOF: change type char to uint8_t in topology.h Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 14/24] ASoC: SOF: make sof_ipc_cc_version to fixed length Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 15/24] ASoC: SOF: Add XRUN flags field to struct sof_ipc_buffer Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 16/24] ASoC: SOF: Intel: Fix typo in header file comment text Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 17/24] ASoC: SOF: Intel: Change DMIC load IPC to fixed length Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 18/24] ASoC: SOF: Intel: Rename deprecated DMIC IPC struct field Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 19/24] ASoC: SOF: align sof_ipc_dai_alh_params with FW Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 20/24] ASoC: SOF: topology: Get ALH rate amd channels from topology Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 21/24] ASoC: SOF: topology: fix: parse hda_tokens to &config->hda Pierre-Louis Bossart
2020-04-15 20:28 ` Pierre-Louis Bossart [this message]
2020-04-15 20:28 ` [PATCH 23/24] ASoC: SOF: topology: stop parsing when all tokens have been found Pierre-Louis Bossart
2020-04-15 20:28 ` [PATCH 24/24] ASoC: SOF: topology: handle multiple sets of tuple arrays Pierre-Louis Bossart
2020-04-15 23:36 ` [PATCH 00/24] ASoC: SOF: topology and firmware IPC updates for 5.8 Mark Brown

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=20200415202816.934-23-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.