ASoC: SOF: Intel and IMX updates for 5.8
Kai Vehmanen
reviewercover ASoC: SOF: Intel and IMX updates for 5.8
Hi,
here's a series of minor fixes and improvements to SOF. Add support for smart amplifier component type. Cover more systems by relaxing match rules for the generic Soundwire machine driver. Fix issues with driver unload and address a few compiler warnings.
Daniel Baluta (2):
ASoC: SOF: Do nothing when DSP PM callbacks are not set
ASoC: SOF: define INFO_ flags in dsp_ops
Keyon Jie (1):
ASoC: SOF: topology: add support to smart amplifier
Marcin Rajwa (2):
ASoC: SOF: add a power_down_notify method
ASoC: SOF: inform DSP that driver is going to be removed
Pierre-Louis Bossart (2):
ASoC: SOF: imx: make dsp_ops static
ASoC: SOF: imx: make imx8m_dsp_ops static
randerwang (1):
ASoC: SOF: Intel: sdw: relax sdw machine select constraints
include/sound/sof/topology.h | 2 ++ sound/soc/sof/core.c | 6 ++++++ sound/soc/sof/imx/imx8.c | 2 +- sound/soc/sof/imx/imx8m.c | 8 +++++++- sound/soc/sof/intel/hda.c | 10 +++++++++- sound/soc/sof/pm.c | 19 +++++++++++++++++-- sound/soc/sof/sof-priv.h | 1 + sound/soc/sof/topology.c | 1 + 8 files changed, 44 insertions(+), 5 deletions(-)
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 1/8 ASoC: SOF: Do nothing when DSP PM callbacks are not set
From: Daniel Baluta <[email protected]>
This provides a better separation between runtime and PM sleep callbacks.
Only do nothing if given runtime flag is set and calback is not set.
With the current implementation, if PM sleep callback is set but runtime callback is not set then at runtime resume we reload the firmware even if we do not support runtime resume callback.
--- sound/soc/sof/pm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/sof/pm.c +8 -2
@@ -90,7 +90,10 @@ static int sof_resume(struct device *dev, bool runtime_resume)int ret;/* do nothing if dsp resume callbacks are not set */ -if (!sof_ops (sdev)->resume || !sof_ops (sdev)->runtime_resume) +if (!runtime_resume && !sof_ops (sdev)->resume) +return 0 ; + +if (runtime_resume && !sof_ops (sdev)->runtime_resume)return 0 ;/* DSP was never successfully started, nothing to resume */
@@ -175,7 +178,10 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)int ret;/* do nothing if dsp suspend callback is not set */ -if (!sof_ops (sdev)->suspend) +if (!runtime_suspend && !sof_ops (sdev)->suspend) +return 0 ; + +if (runtime_suspend && !sof_ops (sdev)->runtime_suspend)return 0 ;if (sdev->fw_state !=SOF_FW_BOOT_COMPLETE )
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 2/8 ASoC: SOF: add a power_down_notify method
In reply to Kai VehmanenFrom: Marcin Rajwa <[email protected]>
This patch adds a snd_sof_dsp_power_down_notify() method which aims to prepare the DSP for the upcoming power down.
This new function make use of SOF_IPC_PM_CTX_SAVE message.
--- sound/soc/sof/pm.c | 9 +++++++++ sound/soc/sof/sof-priv.h | 1 + 2 files changed, 10 insertions(+)
sound/soc/sof/pm.c +9 -0
@@ -256,6 +256,15 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)return ret; } +int snd_sof_dsp_power_down_notify (struct snd_sof_dev *sdev) +{ +/* Notify DSP of upcoming power down */ +if (sof_ops (sdev)->remove) +return sof_send_pm_ctx_ipc (sdev,SOF_IPC_PM_CTX_SAVE ); + +return 0 ; +} +int snd_sof_runtime_suspend (struct device *dev) {return sof_suspend (dev, true);
sound/soc/sof/sof-priv.h +1 -0
@@ -453,6 +453,7 @@ int snd_sof_runtime_resume(struct device *dev);int snd_sof_runtime_idle (struct device *dev);int snd_sof_resume (struct device *dev);int snd_sof_suspend (struct device *dev); +int snd_sof_dsp_power_down_notify (struct snd_sof_dev *sdev);int snd_sof_prepare (struct device *dev);void snd_sof_complete (struct device *dev);
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 3/8 ASoC: SOF: inform DSP that driver is going to be removed
In reply to Kai VehmanenFrom: Marcin Rajwa <[email protected]>
This patch invokes the DSP power down notifier to inform DSP that driver is going to be removed.
The module removal entails DSP power down, disabling of IRQs and more. Therefore it is highly recommended to inform the DSP about this upcoming event.
Due to hardware limitations on some Intel platforms it is necessary to power gate all LPSRAM banks that were enabled prior to controller reset. Otherwise, an attempt to write LPSRAM control registers may have no effect.
--- sound/soc/sof/core.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/soc/sof/core.c +6 -0
@@ -343,6 +343,12 @@ int snd_sof_device_remove(struct device *dev) {struct snd_sof_dev *sdev =dev_get_drvdata (dev);struct snd_sof_pdata *pdata = sdev->pdata; +int ret; + + ret =snd_sof_dsp_power_down_notify (sdev); +if (ret <0 ) +dev_warn (dev,"error: %d failed to prepare DSP for device removal" , + ret);if (IS_ENABLED (CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE ))cancel_work_sync (&sdev->probe_work);
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 4/8 ASoC: SOF: topology: add support to smart amplifier
In reply to Kai VehmanenFrom: Keyon Jie <[email protected]>
Add smart amplifier component support, which is designed as another new type of process component and used for speaker protection algorithm integration.
--- include/sound/sof/topology.h | 2 ++ sound/soc/sof/topology.c | 1 + 2 files changed, 3 insertions(+)
include/sound/sof/topology.h +2 -0
@@ -38,6 +38,7 @@ enum sof_comp_type {SOF_COMP_DEMUX ,SOF_COMP_ASRC ,/**< Asynchronous sample rate converter */ SOF_COMP_DCBLOCK , +SOF_COMP_SMART_AMP ,/**< smart amplifier component */ /* keep FILEREAD/FILEWRITE as the last ones */ SOF_COMP_FILEREAD =10000 ,/**< host test based file IO */ SOF_COMP_FILEWRITE = 10001, /**< host test based file IO */
@@ -220,6 +221,7 @@ enum sof_ipc_process_type {SOF_PROCESS_MUX ,SOF_PROCESS_DEMUX ,SOF_PROCESS_DCBLOCK , + SOF_PROCESS_SMART_AMP, /**< Smart Amplifier */ };/* generic "effect", "codec" or proprietary processing component */
sound/soc/sof/topology.c +1 -0
@@ -431,6 +431,7 @@ static const struct sof_process_types sof_process[] = { {"MUX", SOF_PROCESS_MUX, SOF_COMP_MUX}, {"DEMUX", SOF_PROCESS_DEMUX, SOF_COMP_DEMUX}, {"DCBLOCK", SOF_PROCESS_DCBLOCK, SOF_COMP_DCBLOCK}, + {"SMART_AMP", SOF_PROCESS_SMART_AMP, SOF_COMP_SMART_AMP}, };static enum sof_ipc_process_type find_process (const char *name)
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 5/8 ASoC: SOF: Intel: sdw: relax sdw machine select constraints
In reply to Kai VehmanenFrom: randerwang <[email protected]>
On some platforms such as Up Extreme all links are enabled but only one link can be used by external codec. Instead of exact match of two masks, first check whether link_mask of mach is subset of link_mask supported by hw and then go on searching link_adr.
--- sound/soc/sof/intel/hda.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
sound/soc/sof/intel/hda.c +9 -1
@@ -1107,7 +1107,15 @@ static int hda_sdw_machine_select(struct snd_sof_dev *sdev)if (link_mask && !pdata->machine) {for (mach = pdata->desc->alt_machines; mach && mach->link_mask; mach++) { -if (mach->link_mask != link_mask) +/* +* On some platforms such as Up Extreme all links +* are enabled but only one link can be used by +* external codec. Instead of exact match of two masks, +* first check whether link_mask of mach is subset of +* link_mask supported by hw and then go on searching +* link_adr +*/ +if (~link_mask & mach->link_mask)continue ;/* No need to match adr if there is no links defined */
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 6/8 ASoC: SOF: define INFO_ flags in dsp_ops
In reply to Kai VehmanenFrom: Daniel Baluta <[email protected]>
In the past, the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP were defined in the SOF PCM core, but that was changed since commit 27e322fabd508b ("ASoC: SOF: define INFO_ flags in dsp_ops")
Now these flags must be set in DSP ops.
--- sound/soc/sof/imx/imx8m.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/soc/sof/imx/imx8m.c +6 -0
@@ -273,6 +273,12 @@ struct snd_sof_dsp_ops sof_imx8m_ops = {/* DAI drivers */ .drv = imx8m_dai, .num_drv = 1, /* we have only 1 SAI interface on i.MX8M */ + + .hw_info =SNDRV_PCM_INFO_MMAP | +SNDRV_PCM_INFO_MMAP_VALID | +SNDRV_PCM_INFO_INTERLEAVED | +SNDRV_PCM_INFO_PAUSE | + SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, };EXPORT_SYMBOL (sof_imx8m_ops);
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 7/8 ASoC: SOF: imx: make dsp_ops static
In reply to Kai VehmanenFrom: Pierre-Louis Bossart <[email protected]>
This was in the SOF tree but lost in upstream contributions
--- sound/soc/sof/imx/imx8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/imx/imx8.c +1 -1
@@ -119,7 +119,7 @@ static void imx8_dsp_handle_request(struct imx_dsp_ipc *ipc)snd_sof_ipc_msgs_rx (priv->sdev); } -struct imx_dsp_ops dsp_ops = { +static struct imx_dsp_ops dsp_ops = { .handle_reply = imx8_dsp_handle_reply, .handle_request = imx8_dsp_handle_request, };
Signature · 1 line
2.26.0
Kai Vehmanen
reviewerPATCH 8/8 ASoC: SOF: imx: make imx8m_dsp_ops static
In reply to Kai VehmanenFrom: Pierre-Louis Bossart <[email protected]>
This was in the SOF tree but lost in upstream contributions.
--- sound/soc/sof/imx/imx8m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/imx/imx8m.c +1 -1
@@ -92,7 +92,7 @@ static void imx8m_dsp_handle_request(struct imx_dsp_ipc *ipc)snd_sof_ipc_msgs_rx (priv->sdev); } -struct imx_dsp_ops imx8m_dsp_ops = { +static struct imx_dsp_ops imx8m_dsp_ops = { .handle_reply = imx8m_dsp_handle_reply, .handle_request = imx8m_dsp_handle_request, };
Signature · 1 line
2.26.0
Mark Brown
maintainerQuoted 10 lines · Kai Vehmanen
here's a series of minor fixes and improvements to SOF. Add support for smart amplifier component type. Cover more systems by relaxing match rules for the generic Soundwire machine driver. Fix issues with driver unload and address a few compiler warnings.
Daniel Baluta (2):
ASoC: SOF: Do nothing when DSP PM callbacks are not set
ASoC: SOF: defineINFO_flags indsp_ops[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.8
Thanks!
[1/8] ASoC: SOF: Do nothing when DSP PM callbacks are not set
commit: c26fde3b15ed41f5f452f1da727795f787833287
[2/8] ASoC: SOF: add a power_down_notify method
commit: 3541aef1b83fa3a13e9c4ecc0919156ff2ec9c22
[3/8] ASoC: SOF: inform DSP that driver is going to be removed
commit: 9f369f7e4660d05b5318aa413db199a70dfb2c4f
[4/8] ASoC: SOF: topology: add support to smart amplifier
commit: 82e8c00fa18a3ef0ad3087dcad1d82637a738e30
[5/8] ASoC: SOF: Intel: sdw: relax sdw machine select constraints
commit: 7d1952bceb8a1a2372a1cb86ab109c6ec8772c5c
[6/8] ASoC: SOF: define INFO_ flags in dsp_ops
commit: 5c2c3cb1ca7875a2685c8cc65f08a1238e00cedb
[7/8] ASoC: SOF: imx: make dsp_ops static
commit: 35e7c09d1edd6c60bfa98070b657986500819fd6
[8/8] ASoC: SOF: imx: make imx8m_dsp_ops static
commit: 99cb681e7b8eec917ddb34b76e303aa20b2d1c1aAll 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