ASoC: SOF: initial support for Intel ALH/SoundWire DAIs
Subsystems (3)
cover 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(-)
Signature · 1 line
2.20.1
PATCH 1/4 ASoC: SOF: rename SOUNDWIRE to ALH
From: Bard liao <[email protected]>
Rename SOUNDWIRE to ALH.
--- include/sound/sof/dai.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/sound/sof/dai.h +1 -1
@@ -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 */ };
Signature · 1 line
2.20.1
Mark Brown
maintainerRe: [PATCH 1/4] ASoC: SOF: rename SOUNDWIRE to ALH
Quoted 3 lines · Pierre-Louis Bossart
From: Bard liao <[email protected]>
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
Re: [PATCH 1/4] ASoC: SOF: rename SOUNDWIRE to ALH
Quoted 5 lines · Mark Brown
Quoted 3 lines · Pierre-Louis Bossart
From: Bard liao <[email protected]>
Rename SOUNDWIRE to ALH.
Quoted 7 lines
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.
Re: [PATCH 1/4] ASoC: SOF: rename SOUNDWIRE to ALH
Quoted 16 lines · Pierre-Louis Bossart
Quoted 5 lines · Mark Brown
Quoted 3 lines · Pierre-Louis Bossart
From: Bard liao <[email protected]>
Rename SOUNDWIRE to ALH.
Quoted 7 lines
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
Quoted 3 lines
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.hfile 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.
PATCH 2/4 ASoC: SOF: ipc: add ALH parameters
In reply to Pierre-Louis BossartThe 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
--- 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(-)
include/sound/sof/dai-intel.h +9 -0
@@ -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
include/sound/sof/dai.h +1 -0
@@ -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;
include/uapi/sound/sof/abi.h +1 -1
@@ -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 */
Signature · 1 line
2.20.1
Mark Brown
maintainerApplied "ASoC: SOF: ipc: add ALH parameters" to the asoc tree
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
Quoted 1 line
From
3a9477a06c6acb4234407b59999835a6f12f889dMon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <[email protected]>
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
--- 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(-)
include/sound/sof/dai-intel.h +9 -0
@@ -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
include/sound/sof/dai.h +1 -0
@@ -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;
include/uapi/sound/sof/abi.h +1 -1
@@ -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 */
Signature · 1 line
2.20.1
PATCH 3/4 ASoC: SOF: topology: initial support for Intel ALH DAI type
In reply to Pierre-Louis BossartThe 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.
--- sound/soc/sof/topology.c | 42 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-)
sound/soc/sof/topology.c +41 -1
@@ -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);
Signature · 1 line
2.20.1
PATCH 4/4 ASoC: SOF: pcm: add ALH support
In reply to Pierre-Louis BossartEven if ALH has no specific configuration, we still need to handle the common parameters for all DAIs
--- sound/soc/sof/pcm.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/sof/pcm.c +3 -0
@@ -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);
Signature · 1 line
2.20.1