summaryrefslogtreecommitdiffstats
path: root/sound (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: intel: use helper functionKuninori Morimoto2023-01-314-31/+17
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87tu07ea45.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sdw-mockup: use helper functionKuninori Morimoto2023-01-311-4/+1
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v8knea4b.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: spear: use helper functionKuninori Morimoto2023-01-311-1/+2
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wn53ea4i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cirrus: use helper functionKuninori Morimoto2023-01-312-4/+4
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y1pjea4n.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt: use helper functionKuninori Morimoto2023-01-3114-48/+21
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zg9zea4w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: max: use helper functionKuninori Morimoto2023-01-311-4/+1
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/871qnbfopt.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: hda: use helper functionKuninori Morimoto2023-01-311-2/+5
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87357rfoq1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: hdmi-codec: use helper functionKuninori Morimoto2023-01-311-5/+6
| | | | | | | | | Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874js7foqb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: topology: Fixes and cleanupsMark Brown2023-01-301-110/+73
|\ | | | | | | | | | | | | | | Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>: Following is series of fixes and cleanups for core topology code. Few patches fixing various problems all around and few fixing function names.
| * ASoC: topology: Use unload() op directlyAmadeusz Sławiński2023-01-301-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | struct snd_soc_dobj only needs pointer to the unload function, instead however, there is pointer to all topology operations. Change code to use the function pointer instead of pointer to structure containing all operations. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-12-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Unify kcontrol removal codeAmadeusz Sławiński2023-01-301-42/+6
| | | | | | | | | | | | | | | | | | | | | | Functions removing bytes, enum and mixer kcontrols are identical. Unify them under one function and use it to free associated kcontrols. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-11-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Remove unnecessary check for EOFAmadeusz Sławiński2023-01-301-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Caller already checks if hdr_pos is behind EOF, before calling soc_tplg_valid_header(), so there is no need to recheck it again. This also allows to remove behaviour of return 0 - forcing the caller to break out of while loop. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-10-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Return an error on complete() failureAmadeusz Sławiński2023-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | Function soc_tplg_dapm_complete() detects an error and logs it, but doesn't return failure to the caller, fix it by returning the error. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-9-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Pass correct pointer instead of castingAmadeusz Sławiński2023-01-301-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing address of structure, the containing structure is cast to target structure. While it works - the expected structure is the first field of containing one - it is bad practice, fix this by passing pointer to structure field. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-8-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Remove unnecessary forward declarationsAmadeusz Sławiński2023-01-301-3/+0
| | | | | | | | | | | | | | | | | | | | | | There is no need to forward declare functions if their use is after their definition. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-7-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Rename remove_ handlersAmadeusz Sławiński2023-01-301-16/+16
| | | | | | | | | | | | | | | | | | | | | | Those are the only functions missing soc_tplg_ prefix, add it for consistency. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Fix function nameAmadeusz Sławiński2023-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | Functions other than soc_valid_header have soc_tplg_ prefix. Rename function to follow convention in file. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Fix typo in functions nameAmadeusz Sławiński2023-01-301-16/+16
| | | | | | | | | | | | | | | | | | | | | | Topology is being abbreviated to "tplg", not "tplc", however, few functions have typo in name, fix it. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Remove unused SOC_TPLG_PASS_PINS constantAmadeusz Sławiński2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | | | The constant is unused, so it can be safely removed. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: Properly access value coming from topology fileAmadeusz Sławiński2023-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When accessing values coming from topology, le32_to_cpu should be used. One of recent commits missed that. Fixes: 86e2d14b6d1a ("ASoC: topology: Add header payload_size verification") Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230127231111.937721-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: tas5720: set bit 7 in ANALOG_CTRL_REG for TAS5720A-Q1 during probeSteffen Aschbacher2023-01-302-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the reserved bit 7 in the ANALOG_CTRL_REG for the TAS5720A-Q1 device, when probing. The datasheet mentions that the bit should be 1 during reset/powerup. The device did not initialize before setting this value to 1. So, this could be a quirk of this device. Or it could be a quirk with the board on which it was tested. That is why this patch is separate from the patch that adds support for the TAS5720A-Q1 device. Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de> Signed-off-by: Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230128082744.41849-3-alex@shruggie.ro Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codecs: tas5720: add support for TAS5720A-Q1 (automotive) variantSteffen Aschbacher2023-01-302-13/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support the TAS5720A-Q1 audio codec, in the same driver as tas5720. Functionally, this driver is pretty similar to it's TAS5720x variant. The first 3 registers are the same, so the main control and device identification can happen with these registers. The next registers differ. This variant offers control (in the registers) for 2 speakers, which is implemented here (in a basic manner). Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de> Signed-off-by: Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230128082744.41849-2-alex@shruggie.ro Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codecs: tas5720: split a tas5720_mute_soc_component() functionAlexandru Ardelean2023-01-301-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This is to be re-used in tas5720_mute() (which is part of the dai_ops) and also in the tas5720_fault_check_work() hook. The benefit here isn't too great (now). It's only when we add support for a new device with a slightly different regmap that this becomes more useful. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230128082744.41849-1-alex@shruggie.ro Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: SMA1303: Fix spelling mistake "Invald" -> "Invalid"Colin Ian King2023-01-301-2/+2
| | | | | | | | | | | | | | | | There are spelling mistakes in dev_err messages. Fix them. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20230130092157.36446-1-colin.i.king@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: amd: acp: Refactor bit width calculationVenkata Prasad Potturu2023-01-301-4/+4
|/ | | | | | | | | | Refactor bit width calculation using params_physical_width() instead hard-code values. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230130100104.4076640-1-venkataprasad.potturu@amd.com Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: soc-compress.c: fixup private_data on snd_soc_new_compress()Kuninori Morimoto2023-01-281-1/+1
| | | | | | | | | | | | | | commit d3268a40d4b19f ("ASoC: soc-compress.c: fix NULL dereference") enables DPCM capture, but it should independent from playback. This patch fixup it. Fixes: d3268a40d4b1 ("ASoC: soc-compress.c: fix NULL dereference") Link: https://lore.kernel.org/r/87tu0i6j7j.wl-kuninori.morimoto.gx@renesas.com Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/871qnkvo1s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: kirkwood: Iterate over array indexes instead of using pointer mathKees Cook2023-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | Walking the dram->cs array was seen as accesses beyond the first array item by the compiler. Instead, use the array index directly. This allows for run-time bounds checking under CONFIG_UBSAN_BOUNDS as well. Seen with GCC 13 with -fstrict-flex-arrays: ../sound/soc/kirkwood/kirkwood-dma.c: In function 'kirkwood_dma_conf_mbus_windows.constprop': ../sound/soc/kirkwood/kirkwood-dma.c:90:24: warning: array subscript 0 is outside array bounds of 'const struct mbus_dram_window[0]' [-Warray-bounds=] 90 | if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) { | ~~^~~~~~ 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: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20230127224128.never.410-kees@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: imx-hdmi: Use dev_err_probeAlexander Stein2023-01-281-1/+1
| | | | | | | | | This silences -517 errors and helps figuring out why the device probe is deferred. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20230119073416.3064918-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: The Iron Device SMA1303 is a boosted Class-D audio amplifier.KiseokJo2023-01-284-0/+2422
| | | | | | | Signed-off-by: KiseokJo <kiseok.jo@irondevice.com> Reported-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230126020156.3252-3-kiseok.jo@irondevice.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl-asoc-card: constify fsl_asoc_card_daiLuca Ceresoli2023-01-281-1/+1
| | | | | | | | This is never modified and can be made const. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://lore.kernel.org/r/20230126152412.959574-1-luca.ceresoli@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: SOF: ipc4: Multi-stream playback and capture supportMark Brown2023-01-2816-305/+709
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: The following series will enable multi-stream support for playback and capture streams. Currently only a single PCM can be connected to a DAI, with the multi-stream support it is possible to connect multiple PCMs to a single DAI. To achieve this we need to make sure that DAIs/AIF are only set up once since other stream could be connected to it later. We also need to introduce reference or use counting for widgets to make sure that they are not going to be destroyed while other streams are still using them. With the multi-stream support we also need to extend our current locking scheme which worked well for simple paths.
| * ASoC: SOF: ipc4-pcm: Do not run the trigger pipelines if no spipe is storedPeter Ujfalusi2023-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: Protect swidget->use_count with mutex for kcontrol access racePeter Ujfalusi2023-01-276-33/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: Avoid double decrementing use_count in sof_widget_setup on errorPeter Ujfalusi2023-01-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: ipc4-topology: Protect pipeline free with mutexRanjani Sridharan2023-01-274-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: ipc4-pcm: Implement pipeline trigger reference countingRanjani Sridharan2023-01-273-50/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: ipc4-pcm: Rename 'data' variable to trigger_listRanjani Sridharan2023-01-271-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: Introduce struct snd_sof_pipelineRanjani Sridharan2023-01-279-70/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: ipc4-pcm: Use the PCM stream's pipeline_info during triggerRanjani Sridharan2023-01-272-35/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: sof-audio: Populate the PCM stream pipeline_infoRanjani Sridharan2023-01-271-17/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: ipc4: Add flag to skip triggering pipelines during FE DAI triggerRanjani Sridharan2023-01-274-91/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: ipc4-pcm: Define pcm_setup/free opsRanjani Sridharan2023-01-272-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: Introduce PCM setup/free PCM IPC opsRanjani Sridharan2023-01-272-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: topology: Set IPC-specific trigger order for DAI linksRanjani Sridharan2023-01-274-18/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: pcm: do not free widgets during suspend triggerRanjani Sridharan2023-01-274-18/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: sof-audio: Only process widgets in the connected widget listRanjani Sridharan2023-01-271-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: sof-audio: Set up/free DAI/AIF widgets only onceRanjani Sridharan2023-01-271-30/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: soc-pcm: Export widget_in_list()Ranjani Sridharan2023-01-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: SOF: ipc4-topology: No need to unbind routes within a pipelineRanjani Sridharan2023-01-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: simple-card-utils: create jack inputs forMark Brown2023-01-284-1/+92
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Astrid Rost <astrid.rost@axis.com>: Add a generic way to create jack inputs for auxiliary jack detection drivers (e.g. via i2c, spi), which are not part of any real codec. The simple-card can be used as combining card driver to add the jacks, no new one is required. Create a jack (for input-events) for jack devices in the auxiliary device list (aux_devs). A device which returns a valid value on get_jack_type counts as jack device; set_jack is required to add the jack to the device.