platform/kernel/linux-rpi.git
17 months agoASoC: SOF: ipc4-pcm: Do not run the trigger pipelines if no spipe is stored
Peter Ujfalusi [Fri, 27 Jan 2023 12:00:31 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-pcm: Do not run the trigger pipelines if no spipe is stored

If the pipeline setup fails at the first widget/pipeline then we will have
no spipe stored under the pipeline_list->pipelines, the
pipeline_list->count is 0.

If this is the case we would have a NULL pointer dereference if the
execution is allowed to proceed.

Check for this condition along with the pipeline_list->pipelines check

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-19-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Protect swidget->use_count with mutex for kcontrol access race
Peter Ujfalusi [Fri, 27 Jan 2023 12:00:30 +0000 (14:00 +0200)]
ASoC: SOF: Protect swidget->use_count with mutex for kcontrol access race

The use_count of the swidget is protect by ALSA core PCM locking with the
exception when an associated kcontrol is changed.

It has been observed that a rightly timed kcontrol access during stream
stop can result of an attempt to send a control update to a widget which
has been freed up between the check of the use_count and the message
sending.

We need to protect the entire sof_widget_setup() and sof_widget_free()
execution to make it safe to rely on the use_count.
Move the code under an _unlocked() function and use a mutex to protect
the execution of the functions for concurrency.
On the control path we need to use the lock only for the kcontrol access,
the widget_kcontrol_setup() op is called with the lock already held.

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-18-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Avoid double decrementing use_count in sof_widget_setup on error
Peter Ujfalusi [Fri, 27 Jan 2023 12:00:29 +0000 (14:00 +0200)]
ASoC: SOF: Avoid double decrementing use_count in sof_widget_setup on error

The sof_widget_free() on the error path will decrement the use count and if
we jump to widget_free: then the use_count will be decremented by two,
which is not correct as we only incremented once with 1.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-17-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-topology: Protect pipeline free with mutex
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:28 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-topology: Protect pipeline free with mutex

When starting/stopping multiple streams in parallel, pipeline triggers
and pipeline frees can get interleaved. So use the same mutex used for
pipeline trigger to protect the pipeline frees as well. Rename the
trigger_mutex to pipeline_state_mutex for more clarity.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-16-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-pcm: Implement pipeline trigger reference counting
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:27 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-pcm: Implement pipeline trigger reference counting

Use the started_count and paused_count to implement reference counting
when making decisions to start/stop/pause pipelines during the FE DAI
trigger. This is necessary to trigger the shared pipelines in the FE DAI
trigger properly.

With IPC4, the FE trigger will issue multiple pipeline state changes,
and the triggers are propagated downstream to connected pipelines by
the SOF driver - not the firmware. This creates a window for race
conditions where an FE trigger preempts another one, which results
in inconsistent pipeline states and refcounts.

This patch introduces a mutex lock for the pcm trigger that guarantees
that IPC4 state and resources are accessed in a serialized manner.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-15-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-pcm: Rename 'data' variable to trigger_list
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:26 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-pcm: Rename 'data' variable to trigger_list

For more clarity, rename the struct ipc4_pipeline_set_state_data
variable to trigger_list instead of data. No functionality change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-14-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Introduce struct snd_sof_pipeline
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:25 +0000 (14:00 +0200)]
ASoC: SOF: Introduce struct snd_sof_pipeline

Introduce struct snd_sof_pipeline to save the information about
pipelines including the pipeline widget, their status wrt how many PCM's
are using them and whether they are complete or not.

In struct snd_sof_widget, replace pipe_widget with spipe and remove
complete. In struct snd_sof_pcm_stream_pipeline_list, replace
pipe_widgets with pipelines.

Update all users accordingly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-pcm: Use the PCM stream's pipeline_info during trigger
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:24 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-pcm: Use the PCM stream's pipeline_info during trigger

Use the list of pipelines in the PCM stream's pipeline info to trigger
the pipelines in the right order. Add a helper for triggering pipelines
in batch mode that will be used to trigger multiple pipelines at the
same time.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: sof-audio: Populate the PCM stream pipeline_info
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:23 +0000 (14:00 +0200)]
ASoC: SOF: sof-audio: Populate the PCM stream pipeline_info

Populate the pipeline_info for the PCM stream with the list of pipeline
widgets that need to be handled during the PCM trigger. This will be
used in the IPC-specific PCM trigger op to trigger the pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4: Add flag to skip triggering pipelines during FE DAI trigger
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:22 +0000 (14:00 +0200)]
ASoC: SOF: ipc4: Add flag to skip triggering pipelines during FE DAI trigger

Add a new flag, skip_during_fe_trigger, to struct sof_ipc4_pipeline to
skip triggering pipelines in the FE DAI trigger. Set this flag for the
HDA DAI BE pipelines so that their BE pipeline will not be triggered in
the FE DAI trigger. Also, move the trigger handling for all commands
include START/PAUSE_RELEASE for the HDA DAI's to the backend DAI trigger
ops.

For the SSP/DMIC/SDW cases, remove the BE DAI trigger as they involve no
DMA operations and can be triggered in the FE DAI trigger. This is in
preparation to perform batch triggering of all pipelines for the non-HDA
case.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-pcm: Define pcm_setup/free ops
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:21 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-pcm: Define pcm_setup/free ops

Define the pcm_setup/pcm_free ops for IPC4. Define a new struct
snd_sof_pcm_stream_trigger_info and add a new field trigger_info of this
type to struct snd_sof_pcm_stream. This will be used to save the list of
pipelines that need to be triggered.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Introduce PCM setup/free PCM IPC ops
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:20 +0000 (14:00 +0200)]
ASoC: SOF: Introduce PCM setup/free PCM IPC ops

These will be used to perform IPC-specific PCM setup/free.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: topology: Set IPC-specific trigger order for DAI links
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:19 +0000 (14:00 +0200)]
ASoC: SOF: topology: Set IPC-specific trigger order for DAI links

Add a new topology IPC op to set up DAI links and set the link trigger
order to match the expectation based on the IPC type. Note that the
link_setup op implementations for IPC3 and IPC4 are not identical and
have contrasting trigger orders for playback and capture.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: pcm: do not free widgets during suspend trigger
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:18 +0000 (14:00 +0200)]
ASoC: SOF: pcm: do not free widgets during suspend trigger

IPC3 and IPC4 have different requirements for the order in which the FE
CPU and BE CPU DAI trigger callbacks must be invoked. With a regular PCM
start/stop, pipeline widgets are set up during hw_params and freed
during hw_free.

But when the system is suspended when a PCM is running,
pipeline widgets are freed during the SUSPEND trigger callback for the
FE CPU DAI. In order to avoid freeing the pipeline widgets before the BE
CPU DAI trigger is executed, the trigger order was modified in previous
contributions in the PCM dai_link_fixup callback to make sure that the BE
CPU DAI trigger stop/suspend is always invoked before the FE CPU DAI
trigger. But this contradicts the firmware requirement for IPC4 w.r.t.
ordering of pipeline triggers.

So, remove the freeing of pipeline widgets during FE CPU DAI suspend
trigger and handle it during system suspend when the
tear_down_all_pipelines() IPC op is invoked. This will be followed up
with a patch to fix the trigger order for IPC4.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: sof-audio: Only process widgets in the connected widget list
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:17 +0000 (14:00 +0200)]
ASoC: SOF: sof-audio: Only process widgets in the connected widget list

When walking the list of the widgets from the source to the sink, we
accidentally also end up preparing/setting up the widgets that are not
in the list of connected DAPM widgets associated with the PCM. Avoid
this by checking if a widget is part of the connected DAPM widget list
during widget prepare, unprepare, setup or free.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: sof-audio: Set up/free DAI/AIF widgets only once
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:16 +0000 (14:00 +0200)]
ASoC: SOF: sof-audio: Set up/free DAI/AIF widgets only once

Calling the sof_widget_setup/free() for the DAI/AIF widgets inside the
snd_soc_dapm_widget_for_each_sink_path() loop will end up setting up or
freeing the widget multiple times if there are multiple paths leaving
the widget. Fix this by moving the widget setup/free for the starting
widget in each path outside the loop.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: soc-pcm: Export widget_in_list()
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:15 +0000 (14:00 +0200)]
ASoC: soc-pcm: Export widget_in_list()

Export the widget_in_list() function to be used by other modules.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-topology: No need to unbind routes within a pipeline
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:14 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-topology: No need to unbind routes within a pipeline

The FW currently ignores unbinding routes if the source and sink widgets
belong to the same pipeline. So no need to send the IPC at all in the
first place.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: remove some dead code
Dan Carpenter [Thu, 26 Jan 2023 09:26:35 +0000 (12:26 +0300)]
ASoC: mediatek: mt8188: remove some dead code

We know that "irq < 0", so delete the unnecessary check.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/Y9JHSwcfdNcfMjjt@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoUpdate lpass dt-bindings
Mark Brown [Thu, 26 Jan 2023 17:04:48 +0000 (17:04 +0000)]
Update lpass dt-bindings

Merge series from Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>:

Update va-macro driver dt-bindings and add missing properties in sc7280
machine driver dt-bindings.

Changes since v2:
    -- Update commit message and example in "Add platform property" patch.
    -- Update commit message in "Update clock name" patch.
Changes since v1:
    -- Remove sound-dai cells property patch.
    -- Update example in clock name change patch.
    -- Update commit message and add maxItems in platform proerty patch.

Srinivasa Rao Mandadapu (2):
  ASoC: qcom: dt-bindings: lpass-va-macro: Update clock name
  ASoC: dt-bindings: google,sc7280-herobrine: Add platform property

 .../devicetree/bindings/sound/google,sc7280-herobrine.yaml   | 12 ++++++++++++
 .../devicetree/bindings/sound/qcom,lpass-va-macro.yaml       |  4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

--
2.7.4

17 months agoASoC: SOF: ipc4-topology: use different channel mask for each sdw amp feedback
Bard Liao [Wed, 25 Jan 2023 14:13:17 +0000 (16:13 +0200)]
ASoC: SOF: ipc4-topology: use different channel mask for each sdw amp feedback

Currently, we use the same channel mask for aggregated speakers.
It works fine for playback because we duplicate the audio data for all
aggregated speakers. But we need to get audio data from each aggregated
speaker and combine them to the captured audio. So we need to set
non-overlapping channel mask for aggregated ALH DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230125141317.30302-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: renesas,rsnd: simplify list of compatibles
Krzysztof Kozlowski [Thu, 26 Jan 2023 10:07:22 +0000 (11:07 +0100)]
ASoC: dt-bindings: renesas,rsnd: simplify list of compatibles

The fallback compatible in a list (the last one) cannot be enum, because
it is always fixed.  Also if such fallback is used alone ("Generic"
case), it's not a list anymore.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230126100722.9473-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-topology: add buffer type support
Bard Liao [Thu, 26 Jan 2023 11:06:37 +0000 (13:06 +0200)]
ASoC: SOF: ipc4-topology: add buffer type support

The corresponding IPC4 module of snd_soc_dapm_buffer widget is module
-to-module copier.
The module-to-module copier is a buffer-like component with demuxing
capabilities.
Rename the host_token_list to common_copier_token_list since it will
be used by host copier and module-to-module copier.
The setup callback is almost the same as sof_ipc4_widget_setup_pcm except
the gtw_cfg data, and the free callback is exactly the same as
sof_ipc4_widget_free_comp_pcm. To reduce the duplication, the commit
reuses the setup and free callbacks.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230126110637.25542-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: google,sc7280-herobrine: Add platform property
Srinivasa Rao Mandadapu [Mon, 23 Jan 2023 10:13:22 +0000 (15:43 +0530)]
ASoC: dt-bindings: google,sc7280-herobrine: Add platform property

Add platform property in sc7280 machine driver bindings for including
platform subnode in dai-links.
This is required for binding the frontend dai driver to do dynamic pcm
routing in ADSP based platforms.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1674468802-14834-3-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: qcom: dt-bindings: lpass-va-macro: Update clock name
Srinivasa Rao Mandadapu [Mon, 23 Jan 2023 10:13:21 +0000 (15:43 +0530)]
ASoC: qcom: dt-bindings: lpass-va-macro: Update clock name

Update clock name from core to macro in lpass-va-macro node
to make it compatible with existing driver and existing DTS files.

Fixes: 67d99b23c881 ("ASoC: qcom: dt-bindings: add bindings for lpass va macro codec")
Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1674468802-14834-2-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Kconfig: fix spelling of "up to"
Randy Dunlap [Tue, 24 Jan 2023 18:17:46 +0000 (10:17 -0800)]
ASoC: Kconfig: fix spelling of "up to"

Fix spelling in sound/soc/ Kconfig files:
s/upto/up to/
(reported by codespell)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de> #rockchip
Link: https://lore.kernel.org/r/20230124181746.19028-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: qcom: lpass-platform: Use SNDRV_DMA_TYPE_NONCOHERENT page allocation
Judy Hsiao [Thu, 8 Dec 2022 08:42:00 +0000 (08:42 +0000)]
ASoC: qcom: lpass-platform: Use SNDRV_DMA_TYPE_NONCOHERENT page allocation

Replace SNDRV_DMA_TYPE_DEV by SNDRV_DMA_TYPE_NONCOHERENT for pcm
buffer allocation. We measured about 18x performance improvement
when accessing the snd_pcm_mmap() buffer from userspace.

Eg: aarch64 with internal speaker
==
SNDRV_DMA_TYPE_DEV
    frames_per_second=66.4557M/s
    max_time_per_4096_frames=106.094u
    time_per_4096_frames=61.6351us

SNDRV_DMA_TYPE_NONCOHERENT
    frames_per_second=1028.58M/s
    max_time_per_4096_frames=20.312u
    time_per_4096_frames=3.98221us

Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Link: https://lore.kernel.org/r/20221208084200.2136311-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: qcom: sdm845: add remark about unneeded compatibles
Krzysztof Kozlowski [Wed, 18 Jan 2023 10:15:42 +0000 (11:15 +0100)]
ASoC: qcom: sdm845: add remark about unneeded compatibles

If all devices are the same or compatible, there is no single need to
keep growing of_device_id list with new entries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230118101542.96705-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: qcom,sm8250: use fallback for SDM845 sound cards
Krzysztof Kozlowski [Wed, 18 Jan 2023 10:15:41 +0000 (11:15 +0100)]
ASoC: dt-bindings: qcom,sm8250: use fallback for SDM845 sound cards

All SDM845 sound cards are compatible with each other, so use one
generic fallback compatible for them.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230118101542.96705-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: samsung-i2s: drop unneeded assigned-clock*
Krzysztof Kozlowski [Fri, 20 Jan 2023 15:30:20 +0000 (16:30 +0100)]
ASoC: dt-bindings: samsung-i2s: drop unneeded assigned-clock*

assigned-clock-parents and assigned-clocks are coming from dtschema, so
there is no need anymore to keep them in bindings.  Their presence were
also causing false positives:

  exynos5422-odroidxu3.dtb: i2s@3830000: Unevaluated properties are not allowed ('assigned-clock-rates' was unexpected)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230120153020.320270-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: samsung,odroid: correct codec DAI phandles
Krzysztof Kozlowski [Fri, 20 Jan 2023 15:30:19 +0000 (16:30 +0100)]
ASoC: dt-bindings: samsung,odroid: correct codec DAI phandles

The order of codec DAI phandles is reversed - first comes HDMI (always
present) and then codec (physically not present on Odroid XU4).

Fixes: 97709d365bbd ("ASoC: dt-bindings: Centralize the 'sound-dai' definition")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230120153020.320270-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: codecs: wsa88xx: remove unneeded includes
Krzysztof Kozlowski [Tue, 24 Jan 2023 16:39:53 +0000 (17:39 +0100)]
ASoC: codecs: wsa88xx: remove unneeded includes

Remove unneeded includes from wsa881x and wsa883x drivers.  The drivers
do not reference anything from the headers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: codecs: constify static sdw_port_config struct
Krzysztof Kozlowski [Tue, 24 Jan 2023 16:39:52 +0000 (17:39 +0100)]
ASoC: codecs: constify static sdw_port_config struct

The struct sdw_port_config is not modified, so make it a const for code
safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: codecs: constify static sdw_slave_ops struct
Krzysztof Kozlowski [Tue, 24 Jan 2023 16:39:51 +0000 (17:39 +0100)]
ASoC: codecs: constify static sdw_slave_ops struct

The struct sdw_slave_ops is not modified and sdw_driver takes pointer to
const, so make it a const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs: Simplify probe-component implementation
Cezary Rojewski [Mon, 23 Jan 2023 12:21:44 +0000 (13:21 +0100)]
ASoC: Intel: avs: Simplify probe-component implementation

There is no need for the probe-component to be part of the PCM component
list as it does not make use of ASoC-topology and does not participate
in creating any PCM streams.

To achieve that, remove probe() and remove() functions.

Fixes: ed914a2a45a4 ("ASoC: Intel: avs: Data probing soc-component")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230123122144.1356890-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: qdsp6: audioreach: Add ADSP ready check
Srinivasa Rao Mandadapu [Thu, 12 Jan 2023 07:30:17 +0000 (13:00 +0530)]
ASoC: qdsp6: audioreach: Add ADSP ready check

Check for SPF readiness in prm driver probe to avoid race conditions
during ADSP pil loading.
This patch is to avoid, sending requests to ADSP before it's
power domains are up and ready.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Tested-by: Ratna Deepthi Kudaravalli <rkudarav@qti.qualcomm.com>
Link: https://lore.kernel.org/r/1673508617-27410-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8186: add AFE_DAC_CON0 to volatile register list
Chunxu Li [Tue, 10 Jan 2023 09:26:23 +0000 (17:26 +0800)]
ASoC: mediatek: mt8186: add AFE_DAC_CON0 to volatile register list

Mark AFE_DAC_CON0 as volatile since DSP firmware will access this
register too.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20230110092623.13035-1-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: ux500: remove stedma40 references
Arnd Bergmann [Wed, 18 Jan 2023 16:10:48 +0000 (17:10 +0100)]
ASoC: ux500: remove stedma40 references

ux500_pcm_request_chan() is never called because the dma channels
are already set up from DT. Remove this, along with the
ux500_msp_dma_params structure.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230118161110.521504-4-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: ux500: remove platform_data support
Arnd Bergmann [Wed, 18 Jan 2023 16:10:47 +0000 (17:10 +0100)]
ASoC: ux500: remove platform_data support

The platform data definition for ux500 sound devices was removed
six years ago after the DT conversion was completed, see commit
4b483ed0be8b ("ARM: ux500: cut some platform data").

Remove some leftover bits in the ASoC driver and just assume that
it always gets probed using DT.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230118161110.521504-3-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: Add support for MT8188 SoC
Mark Brown [Thu, 19 Jan 2023 15:31:47 +0000 (15:31 +0000)]
ASoC: mediatek: Add support for MT8188 SoC

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

This series of patches adds support for Mediatek AFE of MT8188 SoC.
Patches are based on broonie tree "for-next" branch.

Changes since v4:
  - refine etdm dai driver based on reviewer's suggestions
  - refine dt-binding files based on reviewer's suggestions

Changes since v3:
  - replace apll_ck with apll to sync with the relationship in CCF
  - add mtk-soundcard-driver.c to support codec parsing
  - drop mclk-always-on-rates support in mt8188-dai-etdm.c
  - refine dt-binding files based on reviewer's suggestions

Changes since v2:
  - drop CLK_IGNORE_UNUSED flag
  - include bitfield.h to reslove the issue reported by kernel test robot
  - rename mt8188-afe-pcm.yaml to mt8188-afe.yaml
  - refine dt-binding files based on reviewer's suggestions

Changes since v1:
  - remove bus protection functions in case of unmerged dependency problem
  - replace some bit operation macro with FIELD_PREP
  - simplify register control by regmap_set_bits and regmap_clear_bits
  - fix dt-binding errors
  - rename compatible string for recognition

Trevor Wu (13):
  ASoC: mediatek: common: add SMC ops and SMC CMD
  ASoC: mediatek: mt8188: add common header
  ASoC: mediatek: mt8188: support audsys clock
  ASoC: mediatek: mt8188: support adda in platform driver
  ASoC: mediatek: mt8188: support etdm in platform driver
  ASoC: mediatek: mt8188: support pcmif in platform driver
  ASoC: mediatek: mt8188: support audio clock control
  ASoC: mediatek: mt8188: add platform driver
  ASoC: mediatek: mt8188: add control for timing select
  ASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document
  ASoC: mediatek: common: add soundcard driver common code
  ASoC: mediatek: mt8188: add machine driver with mt6359
  ASoC: dt-bindings: mediatek,mt8188-mt6359: add mt8188-mt6359 document

 .../bindings/sound/mediatek,mt8188-afe.yaml   |  208 +
 .../sound/mediatek,mt8188-mt6359.yaml         |   97 +
 sound/soc/mediatek/Kconfig                    |   23 +
 sound/soc/mediatek/Makefile                   |    1 +
 sound/soc/mediatek/common/Makefile            |    2 +-
 sound/soc/mediatek/common/mtk-base-afe.h      |   19 +
 .../mediatek/common/mtk-soundcard-driver.c    |   79 +
 .../mediatek/common/mtk-soundcard-driver.h    |   14 +
 sound/soc/mediatek/mt8188/Makefile            |   15 +
 sound/soc/mediatek/mt8188/mt8188-afe-clk.c    |  658 ++++
 sound/soc/mediatek/mt8188/mt8188-afe-clk.h    |  115 +
 sound/soc/mediatek/mt8188/mt8188-afe-common.h |  151 +
 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c    | 3359 +++++++++++++++++
 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c |  205 +
 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h |   15 +
 .../soc/mediatek/mt8188/mt8188-audsys-clkid.h |   83 +
 sound/soc/mediatek/mt8188/mt8188-dai-adda.c   |  632 ++++
 sound/soc/mediatek/mt8188/mt8188-dai-etdm.c   | 2588 +++++++++++++
 sound/soc/mediatek/mt8188/mt8188-dai-pcm.c    |  367 ++
 sound/soc/mediatek/mt8188/mt8188-mt6359.c     |  785 ++++
 sound/soc/mediatek/mt8188/mt8188-reg.h        | 3180 ++++++++++++++++
 21 files changed, 12595 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8188-afe.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml
 create mode 100644 sound/soc/mediatek/common/mtk-soundcard-driver.c
 create mode 100644 sound/soc/mediatek/common/mtk-soundcard-driver.h
 create mode 100644 sound/soc/mediatek/mt8188/Makefile
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-clk.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-clk.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-common.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clkid.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-adda.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-etdm.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-pcm.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-mt6359.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-reg.h

--
2.18.0

17 months agoAdd support to compress API to ipc_msg_data /
Mark Brown [Wed, 18 Jan 2023 15:45:21 +0000 (15:45 +0000)]
Add support to compress API to ipc_msg_data /

Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This patch series adds compress API support to ipc_msg_data /
set_stream_data_offset callbacks.

Changes since v1:
- fixed reviewed-by list (+Peter, -Pierre). Since github had
  some glitches I added the reviews received manually in the
          commits.
link: https://github.com/thesofproject/linux/pull/4133
Daniel Baluta (4):
  ASoC: SOF: Prepare ipc_msg_data to be used with compress API
  ASoC: SOF: Prepare set_stream_data_offset for compress API
  ASoC: SOF: Add support for compress API for stream data/offset
  ASoC: SOF: compress: Set compress data offset

 sound/soc/sof/amd/acp-ipc.c            |  8 ++--
 sound/soc/sof/amd/acp.h                |  5 ++-
 sound/soc/sof/compress.c               |  9 +++++
 sound/soc/sof/intel/hda-ipc.c          |  8 ++--
 sound/soc/sof/intel/hda.h              |  4 +-
 sound/soc/sof/ipc3-pcm.c               |  3 +-
 sound/soc/sof/ipc3.c                   |  4 +-
 sound/soc/sof/mediatek/mt8186/mt8186.c |  2 +-
 sound/soc/sof/mediatek/mt8195/mt8195.c |  2 +-
 sound/soc/sof/ops.h                    |  8 ++--
 sound/soc/sof/sof-priv.h               | 11 ++++--
 sound/soc/sof/stream-ipc.c             | 53 +++++++++++++++++++-------
 12 files changed, 81 insertions(+), 36 deletions(-)

--
2.25.1

17 months agoASoC: Merge up 6.2 fixes
Mark Brown [Wed, 18 Jan 2023 15:33:51 +0000 (15:33 +0000)]
ASoC: Merge up 6.2 fixes

To resolve a conflict and support further development.

17 months agoASoC: SOF: sof-audio: Fixes for widget prepare and
Mark Brown [Wed, 18 Jan 2023 15:28:17 +0000 (15:28 +0000)]
ASoC: SOF: sof-audio: Fixes for widget prepare and

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

This series contains one fix (first patch) followed by a nice to have safety
belts in case we get a widget from topology which is not handled by SOF and will
not have corresponding swidget associated with.

17 months agoASoC: samsung: fsd: audio support for FSD SoC
Mark Brown [Wed, 18 Jan 2023 13:41:51 +0000 (13:41 +0000)]
ASoC: samsung: fsd: audio support for FSD SoC

Merge series from Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>:

This patch series enables audio support on FSD SoC.

Changes in v4:
1. Rebased and addressed review comments provided for v3.

Changes in v3:
1. Addressed all the review comments provided for v2 patch.
2. Fixed compilation warnings reported by kernel test robot.

Changes in v2:
1. New compatible added in Exynos I2S driver for FSD platform.
2. Added Fixup support for Exynos I2S CPU DAI.
3. Migration of manual PSR, OPCLK configuration to Exynos CPU DAI driver as
fixup.
4. Migrated from dedicated sound card to simple audio card.
5. Support added for tlv320aic3x-i2c codec on FSD platform.

Changes in v1:
1. Add TDM support on samsung I2S interface.
2. Allow sound card to directly configure I2S prescaler divider instead of
calculating it from frame clock.
3. The sound card support for FSD SoC which utilizes samsung I2S interface
as CPU DAI.

Padmanabhan Rajanbabu (5):
  ASoC: dt-bindings: Add FSD I2S controller bindings
  ASoC: samsung: i2s: add support for FSD I2S
  arm64: dts: fsd: Add I2S DAI node for Tesla FSD
  arm64: dts: fsd: Add codec node for Tesla FSD
  arm64: dts: fsd: Add sound card node for Tesla FSD

 .../bindings/sound/samsung-i2s.yaml           |  8 +++
 arch/arm64/boot/dts/tesla/fsd-evb.dts         | 53 +++++++++++++++++++
 arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi    | 14 +++++
 arch/arm64/boot/dts/tesla/fsd.dtsi            | 34 ++++++++++++
 sound/soc/samsung/i2s-regs.h                  |  1 +
 sound/soc/samsung/i2s.c                       | 53 +++++++++++++++++++
 6 files changed, 163 insertions(+)

--
2.17.1

17 months agoASoC: dt-bindings: simple-card: Document simple-audio-card,plat
Faiz Abbas [Tue, 17 Jan 2023 06:18:08 +0000 (11:48 +0530)]
ASoC: dt-bindings: simple-card: Document simple-audio-card,plat

The simple card driver already has support for a simple-audio-card,plat
property but its not reflected in the documentation. Add documentation
for this plat property.

Signed-off-by: Faiz Abbas <faiz.abbas@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230117061808.18422-1-faiz.abbas@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: keep prepare/unprepare widgets in sink path
Bard Liao [Wed, 18 Jan 2023 10:12:55 +0000 (12:12 +0200)]
ASoC: SOF: keep prepare/unprepare widgets in sink path

The existing code return when a widget doesn't need to
prepare/unprepare. This will prevent widgets in the sink path from being
prepared/unprepared.

Cc: <stable@vger.kernel.org> # 6.1
Link: https://github.com/thesofproject/linux/issues/4021
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230118101255.29139-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL
Ranjani Sridharan [Wed, 18 Jan 2023 10:12:54 +0000 (12:12 +0200)]
ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL

Skip preparing/unpreparing widgets if the swidget pointer is NULL. This
will be true in the case of virtual widgets in topology that were added
for reusing the legacy HDA machine driver with SOF.

Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines")
Cc: <stable@vger.kernel.org> # 6.1
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230118101255.29139-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: sof-audio: unprepare when swidget->use_count > 0
Bard Liao [Wed, 18 Jan 2023 10:12:53 +0000 (12:12 +0200)]
ASoC: SOF: sof-audio: unprepare when swidget->use_count > 0

We should unprepare the widget if its use_count = 1.

Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines")
Cc: <stable@vger.kernel.org> # 6.1
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230118101255.29139-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: sof-audio: start with the right widget type
Bard Liao [Tue, 17 Jan 2023 12:35:34 +0000 (14:35 +0200)]
ASoC: SOF: sof-audio: start with the right widget type

If there is a connection between a playback stream and a capture stream,
all widgets that are connected to the playback stream and the capture
stream will be in the list.
So, we have to start with the exactly right widget type.
snd_soc_dapm_aif_out is for capture stream and a playback stream should
start with a snd_soc_dapm_aif_in widget.
Contrarily, snd_soc_dapm_dai_in is for playback stream, and a capture
stream should start with a snd_soc_dapm_dai_out widget.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230117123534.2075-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: compress: Set compress data offset
Daniel Baluta [Tue, 17 Jan 2023 12:25:33 +0000 (14:25 +0200)]
ASoC: SOF: compress: Set compress data offset

Because now snd_sof_set_stream_data_offset has compress
support we use it to set posn_offset for compress stream.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Add support for compress API for stream data/offset
Daniel Baluta [Tue, 17 Jan 2023 12:25:32 +0000 (14:25 +0200)]
ASoC: SOF: Add support for compress API for stream data/offset

snd_sof_pcm_stream keeps information about both PCM (snd_pcm_substream)
and Compress (snd_compr_stream) streams.

When PCM substream pointer is NULL this means we are dealing with a
compress stream.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Prepare set_stream_data_offset for compress API
Daniel Baluta [Tue, 17 Jan 2023 12:25:31 +0000 (14:25 +0200)]
ASoC: SOF: Prepare set_stream_data_offset for compress API

Make second parameter of set_stream_data_offset generic
in order to be used for both PCM and compress streams.

Current patch doesn't introduce any functional change,
just prepare the code for compress support.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Prepare ipc_msg_data to be used with compress API
Daniel Baluta [Tue, 17 Jan 2023 12:25:30 +0000 (14:25 +0200)]
ASoC: SOF: Prepare ipc_msg_data to be used with compress API

Make second parameter of ipc_msg_data generic
in order to be able to support compressed streams.

This patch doesn't hold any functional change.

With this case we can use ipc_msg_data, to retrieve information from
DSP for both PCM/Compress API.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: samsung: i2s: add support for FSD I2S
Padmanabhan Rajanbabu [Mon, 16 Jan 2023 10:38:20 +0000 (16:08 +0530)]
ASoC: samsung: i2s: add support for FSD I2S

Add support for enabling I2S controller on FSD platform.

FSD I2S controller is based on Exynos7 I2S controller, supporting
2CH playback/capture in I2S mode and 7.1CH playback/capture in TDM
mode.

Signed-off-by: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
Link: https://lore.kernel.org/r/20230116103823.90757-3-p.rajanbabu@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: Add FSD I2S controller bindings
Padmanabhan Rajanbabu [Mon, 16 Jan 2023 10:38:19 +0000 (16:08 +0530)]
ASoC: dt-bindings: Add FSD I2S controller bindings

Add bindings for FSD CPU DAI driver which supports stereo channel
audio playback and capture on FSD platform.

Signed-off-by: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230116103823.90757-2-p.rajanbabu@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: codecs: wsa881x: Use proper shutdown GPIO polarity
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:48 +0000 (12:41 +0100)]
ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity

The shutdown GPIO is active low (SD_N), but this depends on actual board
layout.  Linux drivers should only care about logical state, where high
(1) means shutdown and low (0) means do not shutdown.

Invert the GPIO to match logical value while preserving backwards DTB
compatibility.  It is not possible to detect whether ACTIVE_HIGH flag in
DTB is because it is an old DTB (using incorrect flag) or it is a new
DTB with a correct hardware pin polarity description.  Therefore the
solution prioritizes backwards compatibility while relying on relevant
DTS being upstreamed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: codecs: wsa881x: Simplify with dev_err_probe
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:47 +0000 (12:41 +0100)]
ASoC: codecs: wsa881x: Simplify with dev_err_probe

Code can be a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: codecs: wsa881x: Simplify &pdev->dev in probe
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:46 +0000 (12:41 +0100)]
ASoC: codecs: wsa881x: Simplify &pdev->dev in probe

The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: codecs: wsa883x: Simplify &pdev->dev in probe
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:45 +0000 (12:41 +0100)]
ASoC: codecs: wsa883x: Simplify &pdev->dev in probe

The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: fsl_sai: Use dev_err_probe
Alexander Stein [Wed, 11 Jan 2023 16:11:44 +0000 (17:11 +0100)]
ASoC: fsl_sai: Use dev_err_probe

This helps figuring out why the device probe is deferred, e.g. missing
FSL_EDMA driver.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230111161144.3275546-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: fsl_sai: initialize is_dsp_mode flag
Shengjiu Wang [Mon, 16 Jan 2023 07:07:54 +0000 (15:07 +0800)]
ASoC: fsl_sai: initialize is_dsp_mode flag

Initialize is_dsp_mode flag in the beginning of function
fsl_sai_set_dai_fmt_tr().

When the DAIFMT is DAIFMT_DSP_B the first time, is_dsp_mode is
true, then the second time DAIFMT is DAIFMT_I2S, is_dsp_mode
still true, which is a wrong state. So need to initialize
is_dsp_mode flag every time.

Fixes: a3f7dcc9cc03 ("ASoC: fsl-sai: Add SND_SOC_DAIFMT_DSP_A/B support.")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://lore.kernel.org/r/1673852874-32200-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: add mt8188-mt6359 document
Trevor Wu [Mon, 16 Jan 2023 03:41:31 +0000 (11:41 +0800)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: add mt8188-mt6359 document

Add document for mt8188 board with mt6359.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230116034131.23943-14-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: add machine driver with mt6359
Trevor Wu [Mon, 16 Jan 2023 03:41:30 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add machine driver with mt6359

Add support for mt8188 board with mt6359.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20230116034131.23943-13-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: common: add soundcard driver common code
Trevor Wu [Mon, 16 Jan 2023 03:41:29 +0000 (11:41 +0800)]
ASoC: mediatek: common: add soundcard driver common code

Add common code to support of_node of codec parsing, so codec phandle
can be assigned by sound-dai in dts.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-12-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document
Trevor Wu [Mon, 16 Jan 2023 03:41:28 +0000 (11:41 +0800)]
ASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document

Add mt8188 audio afe document.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230116034131.23943-11-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: add control for timing select
Trevor Wu [Mon, 16 Jan 2023 03:41:27 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add control for timing select

Add mixer control for irq and memif timing selection.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-10-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: add platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:26 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add platform driver

Add mt8188 platform driver.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20230116034131.23943-9-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: support audio clock control
Trevor Wu [Mon, 16 Jan 2023 03:41:25 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support audio clock control

Add audio clock wrapper and audio tuner control.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-8-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: support pcmif in platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:24 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support pcmif in platform driver

Add mt8188 pcmif dai driver support

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-7-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: support etdm in platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:23 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support etdm in platform driver

Add mt8188 etdm dai driver support.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-6-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: support adda in platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:22 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support adda in platform driver

Add mt8188 adda dai driver support.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: support audsys clock
Trevor Wu [Mon, 16 Jan 2023 03:41:21 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support audsys clock

Add mt8188 audio cg clock control. Audio clock gates are registered to CCF
for reference count and clock parent management.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188: add common header
Trevor Wu [Mon, 16 Jan 2023 03:41:20 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add common header

Add header files for register definition and structure.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: common: add SMC ops and SMC CMD
Trevor Wu [Mon, 16 Jan 2023 03:41:19 +0000 (11:41 +0800)]
ASoC: mediatek: common: add SMC ops and SMC CMD

SMC call is required to communicate with ATF for some secure operations,
so we add SMC ops IDs and SMC CMD ID to common header.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoFixes for avs driver
Mark Brown [Fri, 13 Jan 2023 15:25:27 +0000 (15:25 +0000)]
Fixes for avs driver

Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:

First patch fixes problems reported when performing shutdown. Second one
is for a problem reported by LKP. Last one fixes problem reported by
checkpatch.

17 months agoASoC: Intel: avs: Use asoc_substream_to_rtd() to obtain rtd
Cezary Rojewski [Fri, 13 Jan 2023 19:14:09 +0000 (20:14 +0100)]
ASoC: Intel: avs: Use asoc_substream_to_rtd() to obtain rtd

Utilize the helper function instead of casting from ->private_data
or snd_pcm_substream_chip() directly.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230113191410.1454566-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs: Use min_t instead of min with cast
Amadeusz Sławiński [Fri, 13 Jan 2023 19:03:10 +0000 (20:03 +0100)]
ASoC: Intel: avs: Use min_t instead of min with cast

Checkpatch script recommends using min_t instead of min with the cast.

Fixes: 69b23b3937a1 ("ASoC: Intel: avs: Event tracing")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs: Correctly access topology fields
Amadeusz Sławiński [Fri, 13 Jan 2023 19:03:09 +0000 (20:03 +0100)]
ASoC: Intel: avs: Correctly access topology fields

Fixes following warning:
sound/soc/intel/avs/topology.c:1636:20: sparse: sparse: restricted __le32 degrades to integer

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs: Implement PCI shutdown
Amadeusz Sławiński [Fri, 13 Jan 2023 19:03:08 +0000 (20:03 +0100)]
ASoC: Intel: avs: Implement PCI shutdown

On shutdown reference to i915 driver needs to be released to not spam
logs with unnecessary warnings. While at it do some additional cleanup
to make sure DSP is powered down and interrupts from device are
disabled.

Fixes: 1affc44ea5dd ("ASoC: Intel: avs: PCI driver implementation")
Reported-by: Kornel Dulęba <korneld@google.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: PXA: make SND_PXA2XX_SOC_AC97 user-selectable
Arnd Bergmann [Thu, 5 Jan 2023 13:46:09 +0000 (14:46 +0100)]
ASoC: PXA: make SND_PXA2XX_SOC_AC97 user-selectable

When building a PXA kernel without legacy board file support,
the AC97 code is not built, so none of the AC97 drivers
can be used.

Add a Kconfig prompt to let users turn it on, and have it
enabled by default.

Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230105134622.254560-15-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: sof_es8336: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:52 +0000 (13:28 +0200)]
ASoC: Intel: sof_es8336: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: a164137ce91a ("ASoC: Intel: add machine driver for SOF+ES8336")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: bytcr_wm5102: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:51 +0000 (13:28 +0200)]
ASoC: Intel: bytcr_wm5102: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 9a87fc1e0619 ("ASoC: Intel: bytcr_wm5102: Add machine driver for BYT/WM5102")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: bytcr_rt5640: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:50 +0000 (13:28 +0200)]
ASoC: Intel: bytcr_rt5640: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: a232b96dcece ("ASoC: Intel: bytcr_rt5640: use HID translation util")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:49 +0000 (13:28 +0200)]
ASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 02c0a3b3047f ("ASoC: Intel: bytcr_rt5651: add MCLK, quirks and cleanups")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: bytcht_es8316: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:48 +0000 (13:28 +0200)]
ASoC: Intel: bytcht_es8316: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 3c22a73fb873 ("ASoC: Intel: bytcht_es8316: fix HID handling")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoAdd tdm support in acp machine driver
Mark Brown [Thu, 12 Jan 2023 15:01:13 +0000 (15:01 +0000)]
Add tdm support in acp machine driver

Merge series from Venkata Prasad Potturu <venkataprasad.potturu@amd.com>:

This patch set is to add new cpu dai, refactor dai format
implementation and clock enable/disable and add tdm support
in acp machine driver.

17 months agoASoC: amd: acp-es8336: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:23:56 +0000 (13:23 +0200)]
ASoC: amd: acp-es8336: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230112112356.67643-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: amd: acp: Enable i2s tdm support for skyrim platforms
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:04 +0000 (18:51 +0530)]
ASoC: amd: acp: Enable i2s tdm support for skyrim platforms

Enable i2s tdm support for skyrim platform using dmi quirks.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-6-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: amd: acp: Add i2s tdm support in machine driver
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:03 +0000 (18:51 +0530)]
ASoC: amd: acp: Add i2s tdm support in machine driver

Add i2s tdm support for amd platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-5-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: amd: acp: Refactor i2s clocks programming sequence
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:02 +0000 (18:51 +0530)]
ASoC: amd: acp: Refactor i2s clocks programming sequence

Refactor i2s clock values based on hw_params and use srate and
bclk_ratio variables in clock enable API instead hard-code values.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: amd: acp: Refactor dai format implementation
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:01 +0000 (18:51 +0530)]
ASoC: amd: acp: Refactor dai format implementation

Refactor dai format implementation in dai_link specific
snd_soc_ops.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: amd: acp: Add new cpu dai's in machine driver
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:00 +0000 (18:51 +0530)]
ASoC: amd: acp: Add new cpu dai's in machine driver

when using same cpu dai for 2 different dai links
below error is reported.
error: can't find BE for DAI ACPHS_VIRTUAL1.OUT

To avoid this error add new cpu dai.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: tlv320aic3x: Add optional clock and port properties
Jai Luthra [Fri, 30 Dec 2022 13:26:44 +0000 (18:56 +0530)]
ASoC: tlv320aic3x: Add optional clock and port properties

Describe optional properties for clocks and ports that were missing in
the original txt binding, to fix warnings like:

aic33@18: 'assigned-clock-parents', 'assigned-clock-rates',
'assigned-clocks' do not match any of the regexes:
'pinctrl-[0-9]+'
arch/arm/boot/dts/omap2420-n810.dtb

tlv320aic3106@1b: 'port' does not match any of the regexes:
'pinctrl-[0-9]+'
arch/arm/boot/dts/am335x-sl50.dtb

codec@18: 'clocks' does not match any of the regexes: 'pinctrl-[0-9]+'
arch/arm/boot/dts/imx6dl-gw5903.dtb
arch/arm/boot/dts/imx6q-gw5903.dtb

Some uses of "port" still lead to warnings because they pass clocks in
the endpoint, but that is discouraged:
https://lore.kernel.org/all/20210205152644.GA3083322@robh.at.kernel.org/

Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221230132644.6398-1-j-luthra@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: amd: yc: Add DMI support for new acer/emdoor platforms
Syed Saba Kareem [Wed, 11 Jan 2023 10:21:23 +0000 (15:51 +0530)]
ASoC: amd: yc: Add DMI support for new acer/emdoor platforms

Adding DMI entries to support new acer/emdoor platforms.

Suggested-by: shanshengwang <shansheng.wang@amd.com>
Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20230111102130.2276391-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoAdd support of MediaTek mt8188 to SOF
Mark Brown [Tue, 10 Jan 2023 16:42:44 +0000 (16:42 +0000)]
Add support of MediaTek mt8188 to SOF

Merge series from Tinghan Shen <tinghan.shen@mediatek.com>:

Add support of MediaTek mt8188 SoC DSP to SOF.
The sof driver patches in this series are taken from
thesofproject/linux/tree/topic/sof-dev-rebase.

17 months agoASoC: fsl-asoc-card: Log error code when we fail to register
Mark Brown [Fri, 6 Jan 2023 23:13:37 +0000 (23:13 +0000)]
ASoC: fsl-asoc-card: Log error code when we fail to register

The chances are that any error we see here will be EPROBE_DEFER but let's
actually tell the user so they know.

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230106-asoc-fsl-err-log-v1-1-49d845c99434@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
Tinghan Shen [Tue, 10 Jan 2023 08:43:12 +0000 (16:43 +0800)]
ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core

Set the generic iomem callback for debugfs_add_region_item to support
sof-logger.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230110084312.12953-4-tinghan.shen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: mediatek: Support mt8188 platform
Tinghan Shen [Tue, 10 Jan 2023 08:43:11 +0000 (16:43 +0800)]
ASoC: SOF: mediatek: Support mt8188 platform

Add support of SOF on MediaTek MT8188 SoC.
MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
The IPC communication between AP and DSP is based on shared DRAM and
mailbox interrupt.

The change in the mt8186.h is compatible on both mt8186 and
mt8188. The register controls booting the DSP core with the
default address or the user specified address. Both mt8186
and mt8188 should boot with the user specified boot in the driver.
The usage of the register is the same on both SoC, but the
control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
and bit 0 on mt8188. Configure the redundant bit has noside effect
on both SoCs.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230110084312.12953-3-tinghan.shen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agodt-bindings: dsp: mediatek: Add mt8188 dsp compatible
Tinghan Shen [Tue, 10 Jan 2023 08:43:10 +0000 (16:43 +0800)]
dt-bindings: dsp: mediatek: Add mt8188 dsp compatible

Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
for pre- and post- audio processing.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230110084312.12953-2-tinghan.shen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets
Mark Brown [Fri, 6 Jan 2023 23:15:07 +0000 (23:15 +0000)]
ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets

The fsl-asoc-card AC'97 support currently tries to route to Playback and
Capture widgets provided by the AC'97 CODEC. This doesn't work since the
generic AC'97 driver registers with an "AC97" at the front of the stream
and hence widget names, update to reflect reality. It's not clear to me
if or how this ever worked.

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230106-asoc-udoo-probe-v1-2-a5d7469d4f67@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>