[alsa-devel] [PATCH 0/4] ASoC: SOF: initial support for Intel ALH/SoundWire DAIs
This patchset adds the basic functionality to extract DAI information from the topology and send the information to firmware. At the moment there is no specific configuration in topology file, all the programming takes place based on the dai index and the related ALH stream ID.
The renaming from SoundWire to ALH (Audio Link Hub) is a better representation of the hardware, the ALH acts as a proxy between the DMA transfers and the Cadence IP.
Bard liao (1): ASoC: SOF: rename SOUNDWIRE to ALH
Pierre-Louis Bossart (3): ASoC: SOF: ipc: add ALH parameters ASoC: SOF: topology: initial support for Intel ALH DAI type ASoC: SOF: pcm: add ALH support
include/sound/sof/dai-intel.h | 9 ++++++++ include/sound/sof/dai.h | 3 ++- include/uapi/sound/sof/abi.h | 2 +- sound/soc/sof/pcm.c | 3 +++ sound/soc/sof/topology.c | 42 ++++++++++++++++++++++++++++++++++- 5 files changed, 56 insertions(+), 3 deletions(-)
From: Bard liao yung-chuan.liao@linux.intel.com
Rename SOUNDWIRE to ALH.
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.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h index 7a84f7fb460a..6b296df242bd 100644 --- a/include/sound/sof/dai.h +++ b/include/sound/sof/dai.h @@ -49,7 +49,7 @@ enum sof_ipc_dai_type { SOF_DAI_INTEL_SSP, /**< Intel SSP */ SOF_DAI_INTEL_DMIC, /**< Intel DMIC */ SOF_DAI_INTEL_HDA, /**< Intel HD/A */ - SOF_DAI_INTEL_SOUNDWIRE, /**< Intel SoundWire */ + SOF_DAI_INTEL_ALH, /**< Intel ALH */ SOF_DAI_IMX_SAI, /**< i.MX SAI */ SOF_DAI_IMX_ESAI, /**< i.MX ESAI */ };
On Thu, Aug 15, 2019 at 10:50:29AM -0500, Pierre-Louis Bossart wrote:
From: Bard liao yung-chuan.liao@linux.intel.com
Rename SOUNDWIRE to ALH.
What's this patch based on, it doesn't seem to be something upstream?
Description: [1/4] ASoC: SOF: rename SOUNDWIRE to ALH Applying: ASoC: SOF: rename SOUNDWIRE to ALH error: sha1 information is lacking or useless (include/sound/sof/dai.h). error: could not build fake ancestor Patch failed at 0001 ASoC: SOF: rename SOUNDWIRE to ALH
On 8/15/19 12:08 PM, Mark Brown wrote:
On Thu, Aug 15, 2019 at 10:50:29AM -0500, Pierre-Louis Bossart wrote:
From: Bard liao yung-chuan.liao@linux.intel.com
Rename SOUNDWIRE to ALH.
What's this patch based on, it doesn't seem to be something upstream?
Description: [1/4] ASoC: SOF: rename SOUNDWIRE to ALH Applying: ASoC: SOF: rename SOUNDWIRE to ALH error: sha1 information is lacking or useless (include/sound/sof/dai.h). error: could not build fake ancestor Patch failed at 0001 ASoC: SOF: rename SOUNDWIRE to ALH
ok so this is upstream but the patch will not apply if you didn't take Daniel's iMX patches, which change the same dai.h file in '[PATCH 3/3] ASoC: SOF: topology: Add dummy support for i.MX8 DAIs'
I'll resubmit this separately.
On 8/15/19 1:30 PM, Pierre-Louis Bossart wrote:
On 8/15/19 12:08 PM, Mark Brown wrote:
On Thu, Aug 15, 2019 at 10:50:29AM -0500, Pierre-Louis Bossart wrote:
From: Bard liao yung-chuan.liao@linux.intel.com
Rename SOUNDWIRE to ALH.
What's this patch based on, it doesn't seem to be something upstream?
Description: [1/4] ASoC: SOF: rename SOUNDWIRE to ALH Applying: ASoC: SOF: rename SOUNDWIRE to ALH error: sha1 information is lacking or useless (include/sound/sof/dai.h). error: could not build fake ancestor Patch failed at 0001 ASoC: SOF: rename SOUNDWIRE to ALH
ok so this is upstream but the patch will not apply if you didn't take Daniel's iMX patches, which change the same dai.h file in '[PATCH 3/3] ASoC: SOF: topology: Add dummy support for i.MX8 DAIs'
I'll resubmit this separately
Just resent a separate set of patches which combine i.MX8 and intel new DAI definitions. Putting them in different series was a mistake in hindsight since the same files are changed, sorry about that.
The only configuration parameter is the ALH stream ID. No range checking is done by the driver, the firmware should check that the stream is valid for a specific hardware.
Bump the ABI Minor number to keep the alignment with SOF firmware
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/sof/dai-intel.h | 9 +++++++++ include/sound/sof/dai.h | 1 + include/uapi/sound/sof/abi.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/sound/sof/dai-intel.h b/include/sound/sof/dai-intel.h index 1ab52fd63ceb..5f1ef5565be6 100644 --- a/include/sound/sof/dai-intel.h +++ b/include/sound/sof/dai-intel.h @@ -179,4 +179,13 @@ struct sof_ipc_dai_dmic_params { struct sof_ipc_dai_dmic_pdm_ctrl pdm[0]; } __packed;
+/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */ +struct sof_ipc_dai_alh_params { + struct sof_ipc_hdr hdr; + uint32_t stream_id; + + /* reserved for future use */ + uint32_t reserved[15]; +} __packed; + #endif diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h index 6b296df242bd..0f1235022146 100644 --- a/include/sound/sof/dai.h +++ b/include/sound/sof/dai.h @@ -72,6 +72,7 @@ struct sof_ipc_dai_config { struct sof_ipc_dai_ssp_params ssp; struct sof_ipc_dai_dmic_params dmic; struct sof_ipc_dai_hda_params hda; + struct sof_ipc_dai_alh_params alh; }; } __packed;
diff --git a/include/uapi/sound/sof/abi.h b/include/uapi/sound/sof/abi.h index dff70a42445a..a0fe0d4c4b66 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 9 +#define SOF_ABI_MINOR 10 #define SOF_ABI_PATCH 0
/* SOF ABI version number. Format within 32bit word is MMmmmppp */
The patch
ASoC: SOF: ipc: add ALH parameters
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 3a9477a06c6acb4234407b59999835a6f12f889d Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Date: Thu, 15 Aug 2019 10:50:30 -0500 Subject: [PATCH] ASoC: SOF: ipc: add ALH parameters
The only configuration parameter is the ALH stream ID. No range checking is done by the driver, the firmware should check that the stream is valid for a specific hardware.
Bump the ABI Minor number to keep the alignment with SOF firmware
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20190815155032.29181-3-pierre-louis.bossart@linux.... Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/sof/dai-intel.h | 9 +++++++++ include/sound/sof/dai.h | 1 + include/uapi/sound/sof/abi.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/sound/sof/dai-intel.h b/include/sound/sof/dai-intel.h index a81afd3fbd41..b03e2ec08694 100644 --- a/include/sound/sof/dai-intel.h +++ b/include/sound/sof/dai-intel.h @@ -179,4 +179,13 @@ struct sof_ipc_dai_dmic_params { struct sof_ipc_dai_dmic_pdm_ctrl pdm[0]; } __packed;
+/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */ +struct sof_ipc_dai_alh_params { + struct sof_ipc_hdr hdr; + uint32_t stream_id; + + /* reserved for future use */ + uint32_t reserved[15]; +} __packed; + #endif diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h index 3d174e20aa53..da9825ad41d4 100644 --- a/include/sound/sof/dai.h +++ b/include/sound/sof/dai.h @@ -70,6 +70,7 @@ struct sof_ipc_dai_config { struct sof_ipc_dai_ssp_params ssp; struct sof_ipc_dai_dmic_params dmic; struct sof_ipc_dai_hda_params hda; + struct sof_ipc_dai_alh_params alh; }; } __packed;
diff --git a/include/uapi/sound/sof/abi.h b/include/uapi/sound/sof/abi.h index dff70a42445a..a0fe0d4c4b66 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 9 +#define SOF_ABI_MINOR 10 #define SOF_ABI_PATCH 0
/* SOF ABI version number. Format within 32bit word is MMmmmppp */
The Audio Link Hub DAI does not require any static configuration from topology for now. We still need to pass the frame rate and format to firmware.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/sof/topology.c | 42 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index a215bf58b138..28a7a6e06a53 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -346,6 +346,7 @@ static const struct sof_dai_types sof_dais[] = { {"SSP", SOF_DAI_INTEL_SSP}, {"HDA", SOF_DAI_INTEL_HDA}, {"DMIC", SOF_DAI_INTEL_DMIC}, + {"ALH", SOF_DAI_INTEL_ALH}, {"SAI", SOF_DAI_IMX_SAI}, {"ESAI", SOF_DAI_IMX_ESAI}, }; @@ -2763,6 +2764,40 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index, return ret; }
+static int sof_link_alh_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) +{ + struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); + struct sof_ipc_reply reply; + u32 size = sizeof(*config); + int ret; + + /* init IPC */ + config->hdr.size = size; + + /* send message to DSP */ + ret = sof_ipc_tx_message(sdev->ipc, + config->hdr.cmd, config, size, &reply, + sizeof(reply)); + + if (ret < 0) { + dev_err(sdev->dev, "error: failed to set DAI config for ALH %d\n", + config->dai_index); + return ret; + } + + /* set config for all DAI's with name matching the link name */ + ret = sof_set_dai_config(sdev, size, link, config); + if (ret < 0) + dev_err(sdev->dev, "error: failed to save DAI config for ALH %d\n", + config->dai_index); + + return ret; +} + /* DAI link - used for any driver specific init */ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_soc_dai_link *link, @@ -2859,6 +2894,10 @@ 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_INTEL_ALH: + ret = sof_link_alh_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); @@ -2924,7 +2963,8 @@ static int sof_link_unload(struct snd_soc_component *scomp, switch (sof_dai->dai_config->type) { case SOF_DAI_INTEL_SSP: case SOF_DAI_INTEL_DMIC: - /* no resource needs to be released for SSP and DMIC */ + case SOF_DAI_INTEL_ALH: + /* no resource needs to be released for SSP, DMIC and ALH */ break; case SOF_DAI_INTEL_HDA: ret = sof_link_hda_unload(sdev, link);
Even if ALH has no specific configuration, we still need to handle the common parameters for all DAIs
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/sof/pcm.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 8612896673a5..e3f6a6dc0f36 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -675,6 +675,9 @@ static int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, case SOF_DAI_INTEL_HDA: /* do nothing for HDA dai_link */ break; + case SOF_DAI_INTEL_ALH: + /* do nothing for ALH dai_link */ + break; default: dev_err(sdev->dev, "error: invalid DAI type %d\n", dai->dai_config->type);
participants (2)
-
Mark Brown
-
Pierre-Louis Bossart