summaryrefslogtreecommitdiffstats
path: root/sound
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: cs35l45: DSP SupportVlad.Karpovich2023-03-215-13/+579
| | | | | | | | | | The CS35L45 digital core incorporates one programmable DSP block, capable of running a wide range of audio enhancement and speaker and battery protection functions. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/167933510679.26.5992985447093367768@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs35l45: IRQ supportVlad.Karpovich2023-03-215-4/+245
| | | | | | | | Adds IRQ handlers Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/167933510218.26.11092784685990338045@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs35l45: Support for GPIO pins configuration.Vlad.Karpovich2023-03-213-2/+95
| | | | | | | | Adds device tree configuration for cs35l45 GPIOs Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230315154722.3911463-1-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs35l41: Add 12288000 clk freq to cs35l41_fs_mon clk configJianhua Lu2023-03-201-0/+1
| | | | | | | | | | | | | There are 8 cs35l41 speaker amplifier connected to TDM in my Xiaomi Mi Pad 5 Pro tablet. In this case, it's necessary to set 12288000 (48000 * 32 * 8) clk freq for it. rate=48000, slot_width=32, slots=8. Signed-off-by: Jianhua Lu <lujianhua000@gmail.com> Reviewed-by: David Rhodes <David.Rhodes@cirrus.com> Link: https://lore.kernel.org/r/20230318141440.29023-1-lujianhua000@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Enable I2S support for RK3588/RK3588S SoCsMark Brown2023-03-201-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Cristian Ciocaltea <cristian.ciocaltea@collabora.com>: There are five I2S/PCM/TDM controllers and two I2S/PCM controllers embedded in the RK3588 and RK3588S SoCs. Furthermore, RK3588 provides four additional I2S/PCM/TDM controllers. This patch series adds the required device tree nodes to support all the above. Additionally, it enables analog audio support for the Rock 5B SBC, which has been used to test both audio playback and recording.
| * ASoC: rockchip: i2s: Add compatible for RK3588Cristian Ciocaltea2023-03-201-0/+1
| | | | | | | | | | | | | | | | | | The Rockchip I2S driver supports the RK3588/RK3588S SoCs, hence add the corresponding compatible string. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Link: https://lore.kernel.org/r/20230315114806.3819515-9-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | Fix sound on ASUS TransformersMark Brown2023-03-202-4/+139
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Svyatoslav Ryhel <clamor95@gmail.com>: - add quirk for headset detection used by some T30 devices (ASUS Transformers, LG Optimus 4X HD and Vu); - add RT5631 and MAX9808x machine drivers - update bindings --- Changes from v1 - fm34 dropped for re-work - quirk for headset detection and rt5631 bringup splitted - minor adjustments in binding updates - improvement of rt5631 rate asignment --- David Heidelberg (1): dt-bindings: sound: nvidia,tegra-audio: add RT5631 CODEC Svyatoslav Ryhel (7): dt-bindings: sound: nvidia,tegra-audio-common: add coupled-mic-hp-detect property ASoC: tegra: Support coupled mic-hp detection ARM: tegra: transformers: update sound nodes ASoC: tegra: Support RT5631 by machine driver ARM: tegra: transformers: bind RT5631 sound nodes dt-bindings: sound: nvidia,tegra-audio: add MAX9808x CODEC ASoC: tegra: Support MAX9808x by machine driver .../sound/nvidia,tegra-audio-common.yaml | 4 + .../sound/nvidia,tegra-audio-max9808x.yaml | 90 +++++++++++++ .../sound/nvidia,tegra-audio-rt5631.yaml | 85 ++++++++++++ arch/arm/boot/dts/tegra20-asus-tf101.dts | 7 +- arch/arm/boot/dts/tegra30-asus-tf201.dts | 17 +++ arch/arm/boot/dts/tegra30-asus-tf300t.dts | 5 +- arch/arm/boot/dts/tegra30-asus-tf300tg.dts | 17 +++ arch/arm/boot/dts/tegra30-asus-tf700t.dts | 17 +++ .../dts/tegra30-asus-transformer-common.dtsi | 9 +- sound/soc/tegra/Kconfig | 18 +++ sound/soc/tegra/tegra_asoc_machine.c | 125 +++++++++++++++++- 11 files changed, 380 insertions(+), 14 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-rt5631.yaml -- 2.37.2
| * | ASoC: tegra: Support MAX9808x by machine driverSvyatoslav Ryhel2023-03-202-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Maxim MAX9808x codec support to the Tegra ASoC machine driver. This codec is found on LG T30 devices like Optimus 4X HD and Optimus Vu. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Link: https://lore.kernel.org/r/20230308073502.5421-9-clamor95@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: tegra: Support RT5631 by machine driverSvyatoslav Ryhel2023-03-202-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Realtek ALC5631/RT5631 codec support to the Tegra ASoC machine driver. The RT5631 codec is found on devices like ASUS Transformer TF201, TF700T and other Tegra-based Android tablets. Signed-off-by: Ion Agorria <ion@agorria.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Link: https://lore.kernel.org/r/20230308073502.5421-6-clamor95@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: tegra: Support coupled mic-hp detectionSvyatoslav Ryhel2023-03-201-0/+18
| |/ | | | | | | | | | | | | | | | | | | | | This quirk is used for cases when there is GPIO which detects any type of 3.5 Jack insertion and actual type of jack is defined by other GPIO. 3.5 Jack GPIO generates interrupt and MIC GPIO indicates type of Jack only if 3.5 Jack GPIO is active. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Link: https://lore.kernel.org/r/20230308073502.5421-3-clamor95@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl: Specify driver name in ASoC cardAlexander Stein2023-03-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | Set the snd_soc_card driver name which fixes the warning: fsl-asoc-card sound: ASoC: driver name too long 'imx-audio-tlv320aic32x4' -> 'imx-audio-tlv32' 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/20230316123611.3495597-2-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl: define a common DRIVER_NAMEAlexander Stein2023-03-201-2/+4
|/ | | | | | | | | | Instead of copying the driver name manually, use a common define. No functional change. 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/20230316123611.3495597-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: SOF: ipc4-topology: Add support for effectMark Brown2023-03-172-16/+396
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: The following series will add support for IPC4 process modules as effect widgets. We can cover wide range of modules as a generic process or effect module, the patches will lay down the fundation and the generic code to handle them. At initialization time process modules can receive additional information on top of the base_cfg, which is defined as base_cfg_ext, an extension for the base configuration struct. Other parameters or blobs for these modules are sent as a separate message via LARGE_CONFIG message, which is handled by the existing bytes control support.
| * ASoC: SOF: ipc4-topology: update pipeline_params in process prepareLibin Yang2023-03-171-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some modules may modify the audio format during processing. So, update the pipeline params based on pin 0's output format during process prepare. Signed-off-by: Libin Yang <libin.yang@intel.com> Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> 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> Reviewed-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230316151137.7598-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: ipc4-topology: set copier output format for process moduleChao Song2023-03-171-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The copier output pin 0 format is set with module instance initialization, format for additional copier output pin should be set before the pin is used. If a process module is connected to additional copier output pin, the copier output pin format should be set according to the corresponding input pin format of the process module. Signed-off-by: Chao Song <chao.song@linux.intel.com> Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@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/20230316151137.7598-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: ipc4-topology: Add support for base config extensionRanjani Sridharan2023-03-172-15/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some processing modules need the audio formats for all their input and output pins appended to the base config during module init. So add support for building the base config extension using the available pin formats from topology. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@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/20230316151137.7598-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: ipc4-topology: add base module config extension structureChao Song2023-03-171-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The modules currently supported by the SOF firmware use the base module config containing the audio format for the input/output pin 0 for initialization. But some processing modules with multiple input/output pins require the audio formats to be sent with the init instance IPC payload. Modules that require the base config extension will need to indicate this in the module information in the firmware manifest. Introduce a new struct sof_ipc4_base_module_cfg_ext which contains the pin formats for the input and output pins. This will be appended to the init instance IPC payload for modules that require it. Signed-off-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@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/20230316151137.7598-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: ipc4-topology: add effect widget supportLibin Yang2023-03-172-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the general support of IPC4 effect widgets. IPC4 effect widgets, known as process modules, can be EQFIR, EQIIR, KEYWORD_DETECT, KPB, CHAN_SELECTOR, SMART_AMP and etc. Signed-off-by: Libin Yang <libin.yang@intel.com> Reviewed-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/20230316151137.7598-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: ipc4-topology: Move the kcontrol module_id update to helperPeter Ujfalusi2023-03-171-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a helper function to update the message template for a kcontrol associated with a widget. In this way the helper can be re-used by other components later. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230316151137.7598-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: SOF: ipc4: upport multiple configs for BE DAIsMark Brown2023-03-172-30/+128
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: Backend DAIs may support multiple audio formats. Modify pipeline setup to select a suitable configuration based on topology and frontend DAI runtime configuration. The prime use case is BT offload support where we need the abality to select different configuration on the BE side.
| * | ASoC: SOF: ipc4-topology: use common helper function in copier prepareKai Vehmanen2023-03-171-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the ipc4_set_fmt_mask() helper function instead of open-coding the logic in multiple places. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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/20230316141458.13940-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-pcm: support multiple configs for BE DAIsKai Vehmanen2023-03-172-15/+125
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backend DAIs may support multiple audio formats. Modify pipeline setup to select a suitable configuration based on topology and frontend DAI runtime configuration. For sampling rate, if one of the BE DAI configurations has a sampling rate matching that of FE DAI, configure BE DAI to this rate. For sample format, the current code hardcodes DAI copier sample format to 32bit for both playback and capture pipelines. This is not always desired, so lift the limitation and set the sample format based on topology definitions for the copiers. For capture pipelines, we want to set the BE DAI pipeline format based on topology instead of using the FE DAI format. This covers the common use-case where BE DAI outputs data at a higher sample precision and sample width is reduced later in the pipeline. Instead of hardcoding to 32bit, use the BE DAI copier output format defined in topology. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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/20230316141458.13940-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: SOF: ipc4-topology: Initialize in_format to NULL in sof_ipc4_get_audio_fmtPeter Ujfalusi2023-03-171-1/+2
|/ | | | | | | | | | | | | | | | If the available_fmt->num_input_formats is 0 and there is a failure during the output format parsing then a kfree() would be called on the uninitialized in_format pointer. By initializing the in_format to NULL, this error can be avoided. Fixes: 7ab6b1e8302c ("ASoC: SOF: ipc4-topology: Modify the type of available input/output formats") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20230317063524.8280-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mt8192: Address spammy log messagesMark Brown2023-03-144-31/+19
|\ | | | | | | | | | | Merge series from "Nícolas F. R. A. Prado" <nfraprado@collabora.com>: A couple commits to make the mt8192 sound driver not spam the console.
| * ASoC: mt8192: Move spammy messages to debug levelNícolas F. R. A. Prado2023-03-143-19/+19
| | | | | | | | | | | | | | | | | | | | | | There are many log messages throughout the mt8192 sound drivers that print to the info level and are triggered very frequently. Move these messages to the debug level to avoid spamming the console. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230313212908.2282961-3-nfraprado@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: mt8192: Remove function name log messagesNícolas F. R. A. Prado via Alsa-devel2023-03-144-12/+0
| | | | | | | | | | | | | | | | | | | | | | There are some log messages in the mt8192 sound code that print the function name, presumably to aid in tracing. However this can also be achieved by ftrace and without spamming the console, so remove these messages. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Link: https://lore.kernel.org/r/167874298172.26.17917791030607314817@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: soc-pcm.c: remove indirect runtime copyKuninori Morimoto2023-03-142-13/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | substream->runtime will be attached when substream was opened at snd_pcm_attach_substream(). When it uses DPCM, FE substream->runtime is attached, but BE substream->runtime is not. Thus, we are copying FE substream->runtime to BE. But, we are copyig FE substream->runtime to FE dpcm->runtime first (A), and copy it to BE dpcm->runtime (B), and copy it to BE substream->runtime (C). static int dpcm_fe_dai_open(...) { ... (A) fe->dpcm[stream].runtime = fe_substream->runtime; ... } static int dpcm_be_connect(...) { ... (B) be->dpcm[stream].runtime = fe->dpcm[stream].runtime; ... } int dpcm_be_dai_startup(...) { ... (C) be_substream->runtime = be->dpcm[stream].runtime; ... } It is too roundabout and troublesome. OTOH, it is directly copying fe_substream->runtime at dpcm_be_reparent() without using be->dpcm[stream].runtime. static void dpcm_be_reparent(...) { ... for_each_dpcm_fe(be, stream, dpcm) { ... => be_substream->runtime = fe_substream->runtime; break; } } This patch removes indirect copying. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v8je64dh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: soc-dai.c: add missing flag check at snd_soc_pcm_dai_probe()Kuninori Morimoto2023-03-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dai->probed is used at snd_soc_pcm_dai_probe/remove(), and used to call real remove() function only when it was probed. int snd_soc_pcm_dai_probe(...) { ... for_each_rtd_dais(rtd, i, dai) { ... if (dai->driver->probe) { (A) int ret = dai->driver->probe(dai); if (ret < 0) return soc_dai_ret(dai, ret); } => dai->probed = 1; } ... } int snd_soc_pcm_dai_remove(...) { ... for_each_rtd_dais(rtd, i, dai) { ... => if (dai->probed && ...) { ... } => dai->probed = 0; } ... } But on probe() case, we need to check dai->probed before calling real probe() function at (A), otherwise real probe() might be called multi times (but real remove() will be called only once). This patch checks it at probe(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wn3u64e6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: SOF: ipc4: Add support for formats per pinsMark Brown2023-03-145-367/+359
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: The modules in IPC4 can have multiple 'pins' on their input and output and these pins can receive or output audio in different formats. Currently we assume that all pins are using the same format which is a limitation that needs to be lifted in order to support more complex components. This series will extend and rework the format handling to allow different formats on pins.
| * | ASoC: SOF: ipc4-topology: Search only pin 0 formatsRanjani Sridharan2023-03-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Base config only contains the input/output audio formats for pin 0. So match only the pin 0 formats during runtime format selection. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Add new tokens for input/output pin format countRanjani Sridharan2023-03-133-77/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for handling processing modules with different input/output pin counts, introduce two new tokens for input/output audio format counts. Use these token values to parse all the available audio formats from topology. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-11-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Remove the ref_audio_fmt fieldRanjani Sridharan2023-03-132-26/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the field in struct sof_ipc4_available_audio_format and pass the format list to be searched as an argument to sof_ipc4_init_audio_fmt() directly. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Modify the signature of sof_ipc4_init_audio_fmt()Ranjani Sridharan2023-03-131-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only the copier needs to set the output format in its IPC payload. So move the code to set the output format inside sof_ipc4_prepare_copier_module() and modify the signature of sof_ipc4_init_audio_fmt() to remove the out_format argument. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Modify the type of available input/output formatsRanjani Sridharan2023-03-135-117/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new struct sof_ipc4_pin_format which contains the pin index and the buffer size. Replace the type of available input/output audio formats in struct sof_ipc4_available_audio_format with this new struct type and rename them to input_pin_fmts and output_pin_fmts. Also, add a new token, SOF_TKN_CAVS_AUDIO_FORMAT_PIN_INDEX that will be used to parse the pin index for the audio format from topology. Currently we only set the audio format for Pin 0 in topology, so the default value will be 0 for all audio formats. Finally, parse the pin_index and the input/output buffer sizes along with audio formats into the pin_format arrays in struct sof_ipc4_available_audio_format. This makes the base_config array in struct sof_ipc4_available_audio_format redundant. So remove it. This change will allow the addition of audio formats for the non-zero pins in topology transparent to the topology parser in the kernel. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Always parse the output formats in topologyRanjani Sridharan2023-03-131-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parse the output formats available in topology always. Whether the output format is sent in the init instance payload or not is decided when sof_ipc4_init_audio_fmt() is invoked. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Parse the SOF_COMP_TOKENS only onceRanjani Sridharan2023-03-131-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to parse the cpc and is_pages values multiple times. It is enough to parse the 2 tokens directly into the base_config field in each module's init_instance IPC payload. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Do not parse the DMA_BUFFER_SIZE tokenRanjani Sridharan2023-03-134-69/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not parse the SOF_TKN_CAVS_AUDIO_FORMAT_DMA_BUFFER_SIZE token as the dma_buffer_size can be derived from the input/output buffer size and the type of widget during copier prepare. For the deep buffer case, introduce a new token that will be used to get the deep buffer DMA size for the host copier from topology. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Add a new field in struct ↵Ranjani Sridharan2023-03-133-58/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sof_ipc4_available_audio_format Add a new field, input_audio_fmts, in struct sof_ipc4_available_audio_format and parse all the available input audio formats into this new field and not into the base_config field. This is preparation to remove the base_config array from the struct sof_ipc4_available_audio_format. This simplifies the sof_ipc4_init_audio_fmt() function as the reference audio format for matching with input params has the same size. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: Use input/output pin consistentlyRanjani Sridharan2023-03-133-80/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we use input/output and sink/source pins interchangeably. Remove the references to sink/source pins and replace with input/output pins everywhere for consistency and clarity. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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> 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/20230313124856.8140-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: SOF: ipc4: Add support for bytes controlMark Brown2023-03-143-70/+347
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: This series will add support for bytes control and topology types. With IPC4 only the binary payload is sent to the firmware via LARGE_CONFIG message (which does similar multi-part message handling as the IPC3 control message did). The bytes payload itself is not checked by the kernel but user space expected to wrap it in sof_abi_hdr struct in order to get the target information of the binary data. The SOF firmware and sof-ctl have been updated to support blobs used in IPC4 setups.
| * | | ASoC: SOF: ipc4-control: Add support for bytes control get and putPeter Ujfalusi2023-03-131-7/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for bytes control by implementing bytes_get/put and bytes_ext_get/put and blobs with either module init instance or large config type. For module init instance type the put will only update the stored configuration blob and it is going to be taken into use next time the module is (re-)initialized. Large config type of blobs are sent to the firmware whenever the DSP is powered up. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230313110344.16644-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: SOF: ipc4-topology: Add support for TPLG_CTL_BYTESLibin Yang2023-03-131-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add byte type support for IPC4. The bytes controls are used to transfer configuration blobs to/from firmware via large_config messages. Signed-off-by: Libin Yang <libin.yang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230313110344.16644-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: SOF: ipc4-control: set_volume_data only applies to VOLSW familyLibin Yang2023-03-131-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure sof_ipc4_set_volume_data() is only called for the SND_SOC_TPLG_CTL_VOLSW, SND_SOC_TPLG_CTL_VOLSW_SX and SND_SOC_TPLG_CTL_VOLSW_XR_SX info_type. Signed-off-by: Libin Yang <libin.yang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230313110344.16644-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: SOF: ipc3-control: Merge functions to handle bytes_ext get variantsPeter Ujfalusi2023-03-131-57/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for bytes_ext_get and bytes_ext_volatile_get is identical with the only difference is that in case of volatile_get we refresh the data from the DSP before returning it to user space. Convert the callbacks to a simple wrapper for the same function. 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/20230313110344.16644-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: SOF: ipc3-control: Rename snd_sof_refresh_control()Peter Ujfalusi2023-03-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the snd_sof_refresh_control() to sof_ipc3_refresh_control() to follow the function naming convention for IPC specific code. 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/20230313110344.16644-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | | ASoC: Intel: sof_rt5682: Enable Bluetooth offload on adl_rt1019_rt5682Ajye Huang2023-03-131-1/+3
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Bluetooth audio offload for drv_name "adl_rt1019_rt5682" with following board configuration specifically: SSP0 - rt5682 Headset SSP1 - alc1019p speaker amp SSP2 - Bluetooth audio Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com> Signed-off-by: Mac Chiang <mac.chiang@intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230310184201.1302232-1-ajye_huang@compal.corp-partner.google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: mediatek: fix coverity problemsMark Brown2023-03-136-38/+188
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Trevor Wu <trevor.wu@mediatek.com>: Coverity reports some UNINIT and CERT STR31-C problems, so we add initialization and dai id check to resolve problems.
| * | | ASoC: mediatek: mt6359: fix UNINIT problemTrevor Wu2023-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity shows decaring variable reg without initializer. When regmap_read returns an error, reg keeps the value left from earlier computation. To prevent from the unexpected result in the case, assign 0 to reg. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230307040938.7484-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: mediatek: mt6358: fix UNINIT problemTrevor Wu2023-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity shows decaring variable reg without initializer. When regmap_read returns an error, reg keeps the value left from earlier computation. To prevent from the unexpected result in the case, assign 0 to reg. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230307040938.7484-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: mediatek: mt9195-mt6359: fix UNINIT problemTrevor Wu2023-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity shows using uninitialized value monitor. When regmap_read returns an error, monitor keeps the value left from earlier computation. To prevent from the unexpected result in the case, assign 0 to monitor. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230307040938.7484-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>