]> www.infradead.org Git - nvme.git/log
nvme.git
9 months agoASoC: fsl-asoc-card: Dynamically allocate memory for snd_soc_dai_link_components
Shengjiu Wang [Thu, 25 Jul 2024 03:22:53 +0000 (11:22 +0800)]
ASoC: fsl-asoc-card: Dynamically allocate memory for snd_soc_dai_link_components

The static snd_soc_dai_link_components cause conflict for multiple
instances of this generic driver. For example, when there is
wm8962 and SPDIF case enabled together, the contaminated
snd_soc_dai_link_components will cause another device probe fail.

Fixes: 6d174cc4f224 ("ASoC: fsl-asoc-card: merge spdif support from imx-spdif.c")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1721877773-5229-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: yc: Support mic on Lenovo Thinkpad E16 Gen 2
Takashi Iwai [Thu, 25 Jul 2024 06:54:28 +0000 (08:54 +0200)]
ASoC: amd: yc: Support mic on Lenovo Thinkpad E16 Gen 2

Lenovo Thinkpad E16 Gen 2 AMD model (model 21M5) needs a corresponding
quirk entry for making the internal mic working.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1228269
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240725065442.9293-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: ipc4-topology: Preserve the DMA Link ID for ChainDMA on unprepare
Peter Ujfalusi [Wed, 24 Jul 2024 08:19:32 +0000 (11:19 +0300)]
ASoC: SOF: ipc4-topology: Preserve the DMA Link ID for ChainDMA on unprepare

The DMA Link ID is set to the IPC message's primary during dai_config,
which is only during hw_params.
During xrun handling the hw_params is not called and the DMA Link ID
information will be lost.

All other fields in the message expected to be 0 for re-configuration, only
the DMA Link ID needs to be preserved and the in case of repeated
dai_config, it is correctly updated (masked and then set).

Cc: stable@vger.kernel.org
Fixes: ca5ce0caa67f ("ASoC: SOF: ipc4/intel: Add support for chained DMA")
Link: https://github.com/thesofproject/linux/issues/5116
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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>
Link: https://patch.msgid.link/20240724081932.24542-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: ipc4-topology: Only handle dai_config with HW_PARAMS for ChainDMA
Peter Ujfalusi [Wed, 24 Jul 2024 08:19:31 +0000 (11:19 +0300)]
ASoC: SOF: ipc4-topology: Only handle dai_config with HW_PARAMS for ChainDMA

The DMA Link ID is only valid in snd_sof_dai_config_data when the
dai_config is called with HW_PARAMS.

The commit that this patch fixes is actually moved a code section without
changing it, the same bug exists in the original code, needing different
patch to kernel prior to 6.9 kernels.

Cc: stable@vger.kernel.org
Fixes: 3858464de57b ("ASoC: SOF: ipc4-topology: change chain_dma handling in dai_config")
Link: https://github.com/thesofproject/linux/issues/5116
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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>
Link: https://patch.msgid.link/20240724081932.24542-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: TAS2781: Fix tasdev_load_calibrated_data()
Dan Carpenter [Fri, 19 Jul 2024 23:53:48 +0000 (18:53 -0500)]
ASoC: TAS2781: Fix tasdev_load_calibrated_data()

This function has a reversed if statement so it's either a no-op or it
leads to a NULL dereference.

Fixes: b195acf5266d ("ASoC: tas2781: Fix wrong loading calibrated data sequence")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/18a29b68-cc85-4139-b7c7-2514e8409a42@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: tegra: select CONFIG_SND_SIMPLE_CARD_UTILS
Arnd Bergmann [Fri, 19 Jul 2024 07:48:03 +0000 (09:48 +0200)]
ASoC: tegra: select CONFIG_SND_SIMPLE_CARD_UTILS

This I2S client driver now uses functions exported from a helper module
but fails to link when the helper is disabled:

ERROR: modpost: "simple_util_parse_convert" [sound/soc/tegra/snd-soc-tegra210-i2s.ko] undefined!
ERROR: modpost: "simple_util_get_sample_fmt" [sound/soc/tegra/snd-soc-tegra210-i2s.ko] undefined!

Add a Kconfig select line to ensure it's always turned on here.

Fixes: 2502f8dd8c30 ("ASoC: tegra: I2S client convert formats handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://patch.msgid.link/20240719074831.3253995-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable
Pierre-Louis Bossart [Mon, 22 Jul 2024 08:30:02 +0000 (10:30 +0200)]
ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable

the Intel kbuild bot reports a link failure when IOSF_MBI is built-in
but the Merrifield driver is configured as a module. The
soc-intel-quirks.h is included for Merrifield platforms, but IOSF_MBI
is not selected for that platform.

ld.lld: error: undefined symbol: iosf_mbi_read
>>> referenced by atom.c
>>>               sound/soc/sof/intel/atom.o:(atom_machine_select) in archive vmlinux.a

This patch forces the use of the fallback static inline when IOSF_MBI is not reachable.

Fixes: 536cfd2f375d ("ASoC: Intel: use common helpers to detect CPUs")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407160704.zpdhJ8da-lkp@intel.com/
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240722083002.10800-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: sof: amd: fix for firmware reload failure in Vangogh platform
Venkata Prasad Potturu [Thu, 18 Jul 2024 06:20:02 +0000 (11:50 +0530)]
ASoC: sof: amd: fix for firmware reload failure in Vangogh platform

Setting ACP ACLK as clock source when ACP enters D0 state causing
firmware load failure, as per design clock source should be internal
clock.

Remove acp_clkmux_sel field so that ACP will use internal clock
source when ACP enters into D0 state.

Fixes: d0dab6b76a9f ("ASoC: SOF: amd: Add sof support for vangogh platform")
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240718062004.581685-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: Fix RT5650 SSP lookup
Curtis Malainey [Tue, 16 Jul 2024 08:40:12 +0000 (10:40 +0200)]
ASoC: Intel: Fix RT5650 SSP lookup

Commit 8efcd4864652 ("ASoC: Intel: sof_rt5682: use common module for
sof_card_private initialization") migrated the pin assignment in the
context struct up to soc-acpi-intel-ssp-common.c. This uses a lookup
table to see if a device has a amp/codec before assigning the pin. The
issue here arises when combination parts that serve both (with 2 ports)
are used.

sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:1f.3/adl_rt5682_def/SSP0-Codec'
CPU: 1 PID: 2079 Comm: udevd Tainted: G     U             6.6.36-03391-g744739e00023 #1 3be1a2880a0970f65545a957db7d08ef4b3e2c0d
Hardware name: Google Anraggar/Anraggar, BIOS Google_Anraggar.15217.552.0 05/07/2024
Call Trace:
 <TASK>
 dump_stack_lvl+0x69/0xa0
 sysfs_warn_dup+0x5b/0x70
 sysfs_create_dir_ns+0xb0/0x100
 kobject_add_internal+0x133/0x3c0
 kobject_add+0x66/0xb0
 ? device_add+0x65/0x780
 device_add+0x164/0x780
 snd_soc_add_pcm_runtimes+0x2fa/0x800
 snd_soc_bind_card+0x35e/0xc20
 devm_snd_soc_register_card+0x48/0x90
 platform_probe+0x7b/0xb0
 really_probe+0xf7/0x2a0
 ...
kobject: kobject_add_internal failed for SSP0-Codec with -EEXIST, don't try to register things with the same name in the same directory.

The issue is that the ALC5650 was only defined in the codec table and
not the amp table which left the pin unassigned but the dai link was
still created by the machine driver.

Also patch the suffix filename code for the topology to prevent double
suffix names as a result of this change.

Fixes: 8efcd4864652 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization")
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240716084012.299257-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASOC: SOF: Intel: hda-loader: only wait for HDaudio IOC for IPC4 devices
Pierre-Louis Bossart [Tue, 16 Jul 2024 08:45:30 +0000 (10:45 +0200)]
ASOC: SOF: Intel: hda-loader: only wait for HDaudio IOC for IPC4 devices

Multiple users report a regression bisected to commit d5263dbbd8af
("ASoC: SOF: Intel: don't ignore IOC interrupts for non-audio
transfers"). The firmware version is the likely suspect, as these
users relied on SOF 2.0 while Intel only tested with the 2.2 release.

Rather than completely disable the wait_for_completion(), which can
help us gather timing information on the different stages of the boot
process, the simplest course of action is to just disable it for older
IPC versions which are no longer under active development.

Closes: https://github.com/thesofproject/linux/issues/5072
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218961
Fixes: d5263dbbd8af ("ASoC: SOF: Intel: don't ignore IOC interrupts for non-audio transfers")
Tested-by: Mike Krinkin <krinkin.m.u@gmail.com>
Tested-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240716084530.300829-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: imx8m: Fix DSP control regmap retrieval
Daniel Baluta [Mon, 15 Jul 2024 15:16:53 +0000 (18:16 +0300)]
ASoC: SOF: imx8m: Fix DSP control regmap retrieval

According to Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
fsl,dsp-ctrl is a phandle to syscon block so we need to use correct
function to retrieve it.

Currently there is no SOF DSP DTS merged into mainline so there is no
need to support the old way of retrieving the dsp control node.

Fixes: 9ba23717b292 ("ASoC: SOF: imx8m: Implement DSP start")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20240715151653.114751-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoFix the unbalanced pm_runtime_enable in wcd937x-sdw
Mark Brown [Fri, 12 Jul 2024 16:38:18 +0000 (17:38 +0100)]
Fix the unbalanced pm_runtime_enable in wcd937x-sdw

Merge series from Mohammad Rafi Shaik <quic_mohs@quicinc.com>:

This patch set change will fix the unbalanced pm_runtime_enable in wcd937x-sdw soundwire slave.

And removed the string compare with widget name in MIC BIAS settings, instead
of string compare use the MIC BIAS id's as value.

Removed separate handling for vdd-buck regulator supply which is not
required. The vdd-buck regulator supply enabled using bulk enable.

Added the error handling in wcd937x_probe() and disable the regulators in error case.

9 months agoASoC: tas2781: Add new Kontrol to set tas2563 digital Volume
Shenghao Ding [Wed, 10 Jul 2024 06:42:37 +0000 (14:42 +0800)]
ASoC: tas2781: Add new Kontrol to set tas2563 digital Volume

Requriment from customer to add new kcontrol to set tas2563 digital
Volume

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240710064238.1480-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: wcd937x: Remove separate handling for vdd-buck supply
Mohammad Rafi Shaik [Thu, 4 Jul 2024 08:17:23 +0000 (13:47 +0530)]
ASoC: codecs: wcd937x: Remove separate handling for vdd-buck supply

Remove separate handling for vdd-buck regulator supply which is not
required. The vdd-buck regulator supply enabled using bulk enable.

Add the error handling in wcd937x_probe() and disable the regulators in
error case.

Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/linux-sound/834d31cc-f4bc-4db7-a25b-f9869e550eb6@wanadoo.fr/
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Link: https://patch.msgid.link/20240704081723.3394153-4-quic_mohs@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: wcd937x: Remove the string compare in MIC BIAS widget settings
Mohammad Rafi Shaik [Thu, 4 Jul 2024 08:17:22 +0000 (13:47 +0530)]
ASoC: codecs: wcd937x: Remove the string compare in MIC BIAS widget settings

Remove the string compare with widget name in MIC BIAS settings, instead
of string compare use the MIC BIAS id's.

Reported-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Closes: https://lore.kernel.org/linux-sound/ba911ebd-aef5-46af-ace1-84d13bee6876@linaro.org/
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Link: https://patch.msgid.link/20240704081723.3394153-3-quic_mohs@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: wcd937x-sdw: Fix Unbalanced pm_runtime_enable
Mohammad Rafi Shaik [Thu, 4 Jul 2024 08:17:21 +0000 (13:47 +0530)]
ASoC: codecs: wcd937x-sdw: Fix Unbalanced pm_runtime_enable

Fix the unbalanced pm_runtime_enable! in wcd937x-sdw soundwire slave.

Fixes: c99a515ff153 ("ASoC: codecs: wcd937x-sdw: add SoundWire driver")
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Link: https://patch.msgid.link/20240704081723.3394153-2-quic_mohs@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: cirrus,cs42xx8: Convert to dtschema
Animesh Agarwal [Wed, 10 Jul 2024 07:27:52 +0000 (12:57 +0530)]
ASoC: dt-bindings: cirrus,cs42xx8: Convert to dtschema

Convert the Cirrus Logic CS42448/CS42888 audio CODEC bindings to DT
schema format. Set power supply properties to required only for CS42888.

Cc: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240710072756.99765-1-animeshagarwal28@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: convert qcom sound bindings to
Mark Brown [Wed, 10 Jul 2024 23:26:30 +0000 (00:26 +0100)]
ASoC: dt-bindings: convert qcom sound bindings to

Merge series from Rayyan Ansari <rayyan.ansari@linaro.org>:

These patches convert the remaining plain text bindings for Qualcomm
sound drivers to dt schema, so device trees can be validated against
them.

9 months agofirmware: cs_dsp: Some small coding improvements
Mark Brown [Wed, 10 Jul 2024 23:26:23 +0000 (00:26 +0100)]
firmware: cs_dsp: Some small coding improvements

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Commit series that makes some small improvements to code and the
kernel log messages.

9 months agoASoC: cs530x: Remove bclk from private structure
Paul Handrigan [Wed, 10 Jul 2024 16:04:16 +0000 (11:04 -0500)]
ASoC: cs530x: Remove bclk from private structure

Remove the bclk int from the private structure and pass it into
the set_bclk function.

Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710160416.2617173-2-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs530x: Calculate proper bclk rate using TDM
Paul Handrigan [Wed, 10 Jul 2024 16:04:15 +0000 (11:04 -0500)]
ASoC: cs530x: Calculate proper bclk rate using TDM

Calculate the proper bclk rate using the number of tdm slots
and the width of the tdm data.

Fixes: 2884c29152c0 ("ASoC: cs530x: Support for cs530x ADCs")
Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710160416.2617173-1-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: cirrus,cs4270: Convert to dtschema
Animesh Agarwal [Tue, 9 Jul 2024 18:42:25 +0000 (00:12 +0530)]
ASoC: dt-bindings: cirrus,cs4270: Convert to dtschema

Convert the Cirrus Logic CS4270 audio CODEC bindings to DT schema. Add
missing va-supply, vd-supply and vlc-supply properties, because they
are already being used in the DTS and the driver for this device.

Cc: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240709184231.125207-1-animeshagarwal28@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agofirmware: cs_dsp: Rename fw_ver to wmfw_ver
Richard Fitzgerald [Wed, 10 Jul 2024 10:36:40 +0000 (11:36 +0100)]
firmware: cs_dsp: Rename fw_ver to wmfw_ver

Rename the confusingly named struct member fw_ver to wmfw_ver. It
contains the wmfw format version of the loaded wmfw file.

This commit also contains an update to wm_adsp for the new name.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710103640.78197-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agofirmware: cs_dsp: Clarify wmfw format version log message
Richard Fitzgerald [Wed, 10 Jul 2024 10:36:39 +0000 (11:36 +0100)]
firmware: cs_dsp: Clarify wmfw format version log message

Change the log message of the wmfw format version to include
the file name, and change the message to say "format" instead
of "Firmware version". Merge this with the message that logs
the timestamp.

The wmfw format version is information that is useful to have
logged because the behaviour of firmware controls depends on
the wmfw format. So "unexpected" behaviour could be caused by
having expectations based on one format of wmfw when a
different format has been loaded.

But the original message was confusing. It reported the file
format version but didn't actually log the name of the file it
referred to. It also called it "Firmware version", which is
confusing when a later message also logs a firmware version
that is the version of the actual firmware within the wmfw.

The logging of the firmware timestamp has been merged into this.
That was originally a dbg-only message, but as we are already
logging a line of info, we might as well add a few extra
characters to log the timestamp. The timestamp is now logged
in hexadecimal - it's not particularly useful as a decimal
value.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710103640.78197-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agofirmware: cs_dsp: Make wmfw and bin filename arguments const char *
Richard Fitzgerald [Wed, 10 Jul 2024 10:36:38 +0000 (11:36 +0100)]
firmware: cs_dsp: Make wmfw and bin filename arguments const char *

The wmfw_filename and bin_filename strings passed into cs_dsp_power_up()
and cs_dsp_adsp1_power_up() should be const char *.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710103640.78197-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agofirmware: cs_dsp: Don't allocate temporary buffer for info text
Richard Fitzgerald [Wed, 10 Jul 2024 10:36:37 +0000 (11:36 +0100)]
firmware: cs_dsp: Don't allocate temporary buffer for info text

Don't allocate a temporary buffer to hold a NUL-terminated copy
of the NAME/INFO string from the wmfw/bin. It can be printed
directly to the log. Also limit the maximum number of characters
that will be logged from this string.

The NAME/INFO blocks in the firmware files are an array of
characters with a length, not a NUL-terminated C string. The
original code allocated a temporary buffer to make a
NUL-terminated copy of the string and then passed that to
dev_info(). There's no need for this: printf formatting can
use "%.*s" to print a character array of a given length.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710103640.78197-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,apq8096-sndcard: use dtschema
Rayyan Ansari [Wed, 10 Jul 2024 11:36:08 +0000 (12:36 +0100)]
ASoC: dt-bindings: qcom,apq8096-sndcard: use dtschema

Remove old txt bindings and add apq8096 soundcard entry to existing
dt schema.

Signed-off-by: Rayyan Ansari <rayyan.ansari@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240710113833.39859-4-rayyan.ansari@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dt-bindings: qcom,msm8916-wcd-digital-codec: convert to dtschema
Rayyan Ansari [Wed, 10 Jul 2024 11:36:06 +0000 (12:36 +0100)]
ASoC: dt-bindings: qcom,msm8916-wcd-digital-codec: convert to dtschema

Convert the Qualcomm MSM8916 WCD Digital Audio Codec bindings from text
to yaml dt schema format.
Make bindings complete by adding #sound-dai-cells.

Signed-off-by: Rayyan Ansari <rayyan.ansari@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240710113833.39859-2-rayyan.ansari@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: qcom: topology: Simplify with cleanup.h
Krzysztof Kozlowski [Mon, 1 Jul 2024 17:19:17 +0000 (19:19 +0200)]
ASoC: qcom: topology: Simplify with cleanup.h

Allocate memory, which is being freed at end of the scope, with
scoped/cleanup.h to reduce number of error paths and make code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701171917.596173-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: aw88395: Simplify with cleanup.h
Krzysztof Kozlowski [Mon, 1 Jul 2024 17:19:16 +0000 (19:19 +0200)]
ASoC: codecs: aw88395: Simplify with cleanup.h

Allocate memory, which is being freed at end of the scope, with
scoped/cleanup.h to reduce number of error paths and make code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701171917.596173-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: Intel: sof_sdw: Convert comma to semicolon
Chen Ni [Tue, 9 Jul 2024 03:09:21 +0000 (11:09 +0800)]
ASoC: Intel: sof_sdw: Convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240709030921.585740-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoc: TAS2781: rename the tas2781_reset as tasdevice_reset
Shenghao Ding [Tue, 9 Jul 2024 04:33:40 +0000 (12:33 +0800)]
ASoc: TAS2781: rename the tas2781_reset as tasdevice_reset

Rename the tas2781_reset as tasdevice_reset in case of misunderstanding.
RESET register for both tas2563 and tas2781 is same and the use of reset
pin is also same.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240709043342.946-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl-asoc-card: add S/PDIF controller support
Mark Brown [Mon, 8 Jul 2024 18:30:39 +0000 (19:30 +0100)]
ASoC: fsl-asoc-card: add S/PDIF controller support

Merge series from Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>:

This is a series of patches aiming to make the machine driver
`fsl-asoc-card` compatible with S/PDIF controllers on imx boards.  The
main goal is to allow the use of S/PDIF controllers with ASRC modules.

The `imx-spdif` machine driver already has specific support for S/PDIF
controllers but doesn't support using an ASRC with it. However, the
`fsl-asoc-card` machine driver has the necessary code to create a sound
card which can use an ASRC module.
It is then possible to extend the support for S/PDIF audio cards by
merging the `imx-spdif` driver into `fsl-asoc-card`.

The first three patches adapt the `fsl-asoc-card` driver to support
multiple codec use cases.
The driver can get 2 codec phandles from the device tree, and
codec-related variables are doubled.
`for_each_codecs` macros are also used when possible to ease adding
other multi-codec use cases in the future.
It makes possible to use the two S/PDIF dummy codec drivers
`spdif_receiver` and `spdif_transmitter` instead of `snd-soc-dummy`,
which was used in `imx-spdif`.

The fourth patch merges the S/PDIF support from `imx-spdif` to
`fsl-asoc-card`.
`fsl-asoc-card` offers the same functionalities as `imx-spdif` did, but
this merge also extends the S/PDIF support with the possibility of using
an ASRC.
Compatible "fsl,imx-audio-spdif" is kept, but `fsl-asoc-card` uses
different DT properties compared to `imx-spdif`:
* The "spdif-controller" property from `imx-spdif` is named "audio-cpu"
  in `fsl-asoc-card`.
* `fsl-asoc-card` uses codecs explicitly declared in DT with
  "audio-codec". With an S/PDIF, codec drivers `spdif_transmitter` and
  `spdif_receiver` should be used. Driver `imx-spdif` used instead the
  dummy codec and a pair of boolean properties, "spdif-in" and
  "spdif-out".
Backward compatibility is therefore implemented in `fsl-asoc-card`.
However, it is recommended to use the new properties when needed.
Especially, declaring and using S/PDIF transmitter and/or receiver nodes
is better than using the dummy codec.

The last three patches update the device tree bindings of
`fsl-asoc-card` and update all in-tree device trees to use the
`fsl-asoc-card` properties.
Note that as the old properties are still supported:
* previous versions of in-tree device trees are still supported.
* out-of-tree device trees are still supported.

This series of patches was successfully built for arm64 and x86 on top
of the latest "for-next" branch of the ASoC git tree on the 26th of June
2024.
These modifications have also been tested on an i.MX8MN evaluation board
with a linux kernel RT v6.1.26-rt8.

9 months agoASoC: Simplify code with cleanup.h
Mark Brown [Mon, 8 Jul 2024 15:50:14 +0000 (16:50 +0100)]
ASoC: Simplify code with cleanup.h

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Allocate the memory with scoped/cleanup.h to reduce error handling
(simpler error paths) and make the code a bit smaller.

9 months agoASoC: dt-bindings: update fsl-asoc-card bindings after imx-spdif merge
Elinor Montmasson [Thu, 27 Jun 2024 08:31:02 +0000 (10:31 +0200)]
ASoC: dt-bindings: update fsl-asoc-card bindings after imx-spdif merge

The S/PDIF audio card support with compatible "fsl,imx-audio-spdif"
was merged from imx-spdif into the fsl-asoc-card driver.
It makes possible to use an S/PDIF with an ASRC.

This merge introduces new DT bindings to use with compatible
"fsl,imx-audio-spdif" to follow the way fsl-asoc-card works:
* the "spdif-controller" property from imx-spdif is named "audio-cpu"
  in fsl-asoc-card.
* fsl-asoc-card uses codecs explicitly declared in DT
  with "audio-codec".
  With an SPDIF, codec drivers spdif_transmitter and
  spdif_receiver should be used.
  Driver imx-spdif used instead the dummy codec and a pair of
  boolean properties, "spdif-in" and "spdif-out".

In an upcoming commit, in-tree DTs will be modified to follow these new
properties:
* Property "spdif-controller" will be renamed "audio-cpu".
* spdif_transmitter and spdif_receiver nodes will be declared
  and linked to the fsl-asoc-card node with the property "audio-codec".

To keep backward compatibility with other DTs, support for
"spdif-controller", "spdif-in" and "spdif-out" properties is kept.
However, it is recommended to use the new properties if possible.
It is better to declare transmitter and/or receiver
in DT than using the dummy codec.

DTs using compatible "fsl,imx-audio-spdif" are still supported, and
fsl-asoc-card will behave the same as imx-spdif for these DTs.

Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240627083104.123357-6-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl-asoc-card: merge spdif support from imx-spdif.c
Elinor Montmasson [Thu, 27 Jun 2024 08:31:01 +0000 (10:31 +0200)]
ASoC: fsl-asoc-card: merge spdif support from imx-spdif.c

The imx-spdif machine driver creates audio card to directly use an
S/PDIF device. However, it doesn't support interacting with an ASRC.
fsl-asoc-card already has the support to create audio card which can
use the ASRC.

Merge the S/PDIF support from imx-spdif into driver fsl-asoc-card
to extend the support of S/PDIF audio card with the use of ASRC devices.

fsl-asoc-card uses slightly different DT properties than imx-spdif:
* the "spdif-controller" property from imx-spdif is named "audio-cpu" in
  fsl-asoc-card.
* fsl-asoc-card uses codecs explicitly declared in DT
  with "audio-codec".
  With an SPDIF, codec drivers spdif_transmitter and
  spdif_receiver should be used.
  Driver imx-spdif used instead the dummy codec and a pair of
  boolean properties, "spdif-in" and "spdif-out".

To keep backward compatibility, support for "spdif-controller",
"spdif-in" and "spdif-out" is also added to fsl-asoc-card.
However, it is recommended to use the new properties if possible.
It is better to declare transmitter and/or receiver in DT
than using the dummy codec.

DTs using compatible "fsl,imx-audio-spdif" are still compatible, and
fsl-asoc-card will behave the same as imx-spdif
for these DTs.

Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-5-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl-asoc-card: add compatibility to use 2 codecs in dai-links
Elinor Montmasson [Thu, 27 Jun 2024 08:31:00 +0000 (10:31 +0200)]
ASoC: fsl-asoc-card: add compatibility to use 2 codecs in dai-links

Adapt the driver to work with configurations using two codecs or more.
Modify fsl_asoc_card_probe() to handle use cases where 2 codecs are
given in the device tree.
This will be needed to add support for the SPDIF.

Use cases using one codec will ignore any given codecs other than the
first.

Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-4-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl-asoc-card: add second dai link component for codecs
Elinor Montmasson [Thu, 27 Jun 2024 08:30:59 +0000 (10:30 +0200)]
ASoC: fsl-asoc-card: add second dai link component for codecs

Add a second dai link component for codecs that will be used for use
cases with 2 codecs.
It is needed for future integration of the SPDIF support, which will
use spdif_receiver and spdif_transmitter drivers.

To prevent deferring in use cases using only one codec, also set
by default the number of codecs to 1 for the relevant dai links.

Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-3-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl-asoc-card: add support for dai links with multiple codecs
Elinor Montmasson [Thu, 27 Jun 2024 08:30:58 +0000 (10:30 +0200)]
ASoC: fsl-asoc-card: add support for dai links with multiple codecs

Add support for dai links using multiple codecs for multi-codec
use cases.

Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-2-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agofirmware: cs_dsp: Use strnlen() on name fields in V1 wmfw files
Richard Fitzgerald [Mon, 8 Jul 2024 14:48:55 +0000 (15:48 +0100)]
firmware: cs_dsp: Use strnlen() on name fields in V1 wmfw files

Use strnlen() instead of strlen() on the algorithm and coefficient name
string arrays in V1 wmfw files.

In V1 wmfw files the name is a NUL-terminated string in a fixed-size
array. cs_dsp should protect against overrunning the array if the NUL
terminator is missing.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: f6bc909e7673 ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs")
Link: https://patch.msgid.link/20240708144855.385332-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoc: TAS2781: replace beXX_to_cpup with get_unaligned_beXX for potentially broken...
Shenghao Ding [Sun, 7 Jul 2024 08:30:07 +0000 (16:30 +0800)]
ASoc: TAS2781: replace beXX_to_cpup with get_unaligned_beXX for potentially broken alignment

Use get_unaligned_be16 instead of be16_to_cpup and get_unaligned_be32
instead of be32_to_cpup for potentially broken alignment.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240707083011.98-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dapm: Simplify snd_soc_dai_link_event_pre_pmu() with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:11:05 +0000 (14:11 +0200)]
ASoC: dapm: Simplify snd_soc_dai_link_event_pre_pmu() with cleanup.h

Allocate the memory with scoped/cleanup.h in
snd_soc_dai_link_event_pre_pmu() to reduce error handling (less error
paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-11-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dapm: Simplify dapm_cnew_widget() with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:11:04 +0000 (14:11 +0200)]
ASoC: dapm: Simplify dapm_cnew_widget() with cleanup.h

Allocate the memory with scoped/cleanup.h in dapm_cnew_widget() to
reduce error handling (less error paths) and make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-10-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: ops: Simplify with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:11:03 +0000 (14:11 +0200)]
ASoC: ops: Simplify with cleanup.h

Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-9-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: simple-card: Use cleanup.h instead of devm_kfree()
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:11:02 +0000 (14:11 +0200)]
ASoC: simple-card: Use cleanup.h instead of devm_kfree()

Allocate the memory with scoped/cleanup.h, instead of devm interface, to
make the code more obvious that memory is not used outside this scope.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-8-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: audio-graph-card2: Use cleanup.h instead of devm_kfree()
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:11:01 +0000 (14:11 +0200)]
ASoC: audio-graph-card2: Use cleanup.h instead of devm_kfree()

Allocate the memory with scoped/cleanup.h, instead of devm interface, to
make the code more obvious that memory is not used outside this scope.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-7-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: audio-graph-card: Use cleanup.h instead of devm_kfree()
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:11:00 +0000 (14:11 +0200)]
ASoC: audio-graph-card: Use cleanup.h instead of devm_kfree()

Allocate the memory with scoped/cleanup.h, instead of devm interface, to
make the code more obvious that memory is not used outside this scope.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-6-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: simple-card-utils: Simplify with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:10:59 +0000 (14:10 +0200)]
ASoC: simple-card-utils: Simplify with cleanup.h

Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-5-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: wcd934x: Simplify with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:10:58 +0000 (14:10 +0200)]
ASoC: codecs: wcd934x: Simplify with cleanup.h

Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-4-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: wcd9335: Simplify with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:10:57 +0000 (14:10 +0200)]
ASoC: codecs: wcd9335: Simplify with cleanup.h

Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-3-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: audio-iio-aux: Simplify audio_iio_aux_probe() with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:10:56 +0000 (14:10 +0200)]
ASoC: codecs: audio-iio-aux: Simplify audio_iio_aux_probe() with cleanup.h

Allocate the memory with scoped/cleanup.h in audio_iio_aux_probe() to
reduce error handling (less error paths) and make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-2-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: audio-iio-aux: Simplify audio_iio_aux_add_dapms() with cleanup.h
Krzysztof Kozlowski [Wed, 3 Jul 2024 12:10:55 +0000 (14:10 +0200)]
ASoC: codecs: audio-iio-aux: Simplify audio_iio_aux_add_dapms() with cleanup.h

Allocate the memory with scoped/cleanup.h in audio_iio_aux_add_dapms()
to reduce error handling (less error paths) and make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-1-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoc: pcm6240: Remove unnecessary name-prefix for all the controls
Shenghao Ding [Fri, 5 Jul 2024 06:48:46 +0000 (14:48 +0800)]
ASoc: pcm6240: Remove unnecessary name-prefix for all the controls

Adding name-prefix for each audio controls is a redundant, because
name-prefix will be automatically added behind the control name when
creating a new control.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240705064846.1723-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoAdd support for non-interleaved mode in qmc_audio
Mark Brown [Thu, 4 Jul 2024 17:41:11 +0000 (18:41 +0100)]
Add support for non-interleaved mode in qmc_audio

Merge series from Herve Codina <herve.codina@bootlin.com>:

The qmc_audio driver supports only audio in interleaved mode.
Non-interleaved mode can be easily supported using several QMC channel
per DAI. In that case, data related to ch0 are sent to (received from)
the first QMC channel, data related to ch1 use the next QMC channel and
so on up to the last channel.

In terms of constraints and settings, the interleaved and
non-interleaved modes are slightly different.

In interleaved mode:
  - The sample size should fit in the number of time-slots available for
    the QMC channel.
  - The number of audio channels should fit in the number of time-slots
    (taking into account the sample size) available for the QMC channel.

In non-interleaved mode:
  - The number of audio channels is the number of available QMC
    channels.
  - Each QMC channel should have the same number of time-slots.
  - The sample size equals the number of time-slots of one QMC channel.

This series add support for the non-interleaved mode in the qmc_audio
driver and is composed of the following parts:
  - Patches 1 and 2: Fix some issues in the qmc_audio
  - Patches 3 to 6: Prepare qmc_audio for the non-interleaved mode
  - Patches 7 and 8: Extend the QMC driver API
  - Patches 9 and 10: The support for non-interleaved mode itself

Compared to the previous iteration, this v2 series mainly improves
qmc_audio_access_is_interleaved().

9 months agoASoC: codecs: lpass-rx-macro: Few code cleanups
Mark Brown [Thu, 4 Jul 2024 17:41:03 +0000 (18:41 +0100)]
ASoC: codecs: lpass-rx-macro: Few code cleanups

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Improve a bit the Qualcomm LPASS RX macro driver and align similar parts
of code with LPASS WSA macro driver for consistency.

No external dependencies.

9 months agoASoc: tas2781: Set "Speaker Force Firmware Load" as the common kcontrol for both...
Shenghao Ding [Thu, 4 Jul 2024 09:49:37 +0000 (17:49 +0800)]
ASoc: tas2781: Set "Speaker Force Firmware Load" as the common kcontrol for both tas27871 and tas2563

Set "Speaker Force Firmware Load" as the common kcontrol
for both tas27871 and tas2563 and move it into newly-created
tasdevice_snd_controls, and keep the digital gain and analog
gain in tas2781_snd_controls.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240704094939.1824-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: amd: Adjust error handling in case of absent codec device
Aleksandr Mishin [Wed, 3 Jul 2024 19:10:07 +0000 (22:10 +0300)]
ASoC: amd: Adjust error handling in case of absent codec device

acpi_get_first_physical_node() can return NULL in several cases (no such
device, ACPI table error, reference count drop to 0, etc).
Existing check just emit error message, but doesn't perform return.
Then this NULL pointer is passed to devm_acpi_dev_add_driver_gpios()
where it is dereferenced.

Adjust this error handling by adding error code return.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://patch.msgid.link/20240703191007.8524-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: wcd939x: Fix typec mux and switch leak during device removal
Krzysztof Kozlowski [Mon, 1 Jul 2024 12:26:16 +0000 (14:26 +0200)]
ASoC: codecs: wcd939x: Fix typec mux and switch leak during device removal

Driver does not unregister typec structures (typec_mux_dev and
typec_switch_desc) during removal leading to leaks.  Fix this by moving
typec registering parts to separate function and using devm interface to
release them.  This also makes code a bit simpler:
 - Smaller probe() function with less error paths and no #ifdefs,
 - No need to store typec_mux_dev and typec_switch_desc in driver state
   container structure.

Cc: stable@vger.kernel.org
Fixes: 10f514bd172a ("ASoC: codecs: Add WCD939x Codec driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20240701122616.414158-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: ak4458: remove "reset-gpios" property handler
Shengjiu Wang [Wed, 3 Jul 2024 12:26:15 +0000 (20:26 +0800)]
ASoC: ak4458: remove "reset-gpios" property handler

commit c721f189e89c0 ("reset: Instantiate reset GPIO controller for
shared reset-gpios") check if there is no "resets" property
will fallback to "reset-gpios".

So don't need to handle "reset-gpios" separately in the driver,
the "reset-gpios" handler is duplicated with "resets" control handler,
remove it.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1720009575-11677-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: ipc4-topology: Use single token list for the copiers
Peter Ujfalusi [Thu, 4 Jul 2024 08:59:44 +0000 (10:59 +0200)]
ASoC: SOF: ipc4-topology: Use single token list for the copiers

There is no need to keep separate token list for dai and 'common' copier
token list when the 'common' list is actually the aif list, the
SOF_COPIER_DEEP_BUFFER_TOKENS are not applicable for buffers.

We could have separate lists for all types but it is probably simpler to
just use a single list for all types of copiers. Function specific tokens
will be only parsed by function specific code anyways.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240704085944.371450-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl_qmc_audio: Add support for non-interleaved mode.
Herve Codina [Mon, 1 Jul 2024 11:30:37 +0000 (13:30 +0200)]
ASoC: fsl: fsl_qmc_audio: Add support for non-interleaved mode.

The current fsl_qmc_audio works in interleaved mode. The audio samples
are interleaved and all data are sent to (received from) one QMC
channel.

Using several QMC channels, non interleaved mode can be easily
supported. In that case, data related to ch0 are sent to (received from)
the first QMC channel, data related to ch1 use the next QMC channel and
so on up to the last channel.

In terms of constraints and settings, the two modes are slightly
different:
- Interleaved mode:
    - The sample size should fit in the number of time-slots available
      for the QMC channel.
    - The number of audio channels should fit in the number of
      time-slots (taking into account the sample size) available for the
      QMC channel.
- Non-interleaved mode:
    - The number of audio channels is the number of available QMC
      channels.
    - Each QMC channel should have the same number of time-slots.
    - The sample size equals the number of time-slots of one QMC
      channel.

Add support for the non-interleaved mode allowing multiple QMC channel
per DAI. The DAI switches in non-interleaved mode when more that one QMC
channel is available.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-11-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agodt-bindings: sound: fsl,qmc-audio: Add support for multiple QMC channels per DAI
Herve Codina [Mon, 1 Jul 2024 11:30:36 +0000 (13:30 +0200)]
dt-bindings: sound: fsl,qmc-audio: Add support for multiple QMC channels per DAI

The QMC audio uses one QMC channel per DAI and uses this QMC channel to
transmit interleaved audio channel samples.

In order to work in non-interleave mode, a QMC audio DAI needs to use
multiple QMC channels. In that case, the DAI maps each QMC channel to
exactly one audio channel.

Allow QMC audio DAIs with multiple QMC channels attached.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240701113038.55144-10-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agosoc: fsl: cpm1: qmc: Introduce qmc_chan_count_phandles()
Herve Codina [Mon, 1 Jul 2024 11:30:35 +0000 (13:30 +0200)]
soc: fsl: cpm1: qmc: Introduce qmc_chan_count_phandles()

No function in the QMC API is available to get the number of phandles
present in a phandle list.

Fill this lack introducing qmc_chan_count_phandles().

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-9-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agosoc: fsl: cpm1: qmc: Introduce functions to get a channel from a phandle list
Herve Codina [Mon, 1 Jul 2024 11:30:34 +0000 (13:30 +0200)]
soc: fsl: cpm1: qmc: Introduce functions to get a channel from a phandle list

qmc_chan_get_byphandle() and the resource managed version retrieve a
channel from a simple phandle.

Extend the API and introduce qmc_chan_get_byphandles_index() and the
resource managed version in order to retrieve a channel from a phandle
list using the provided index to identify the phandle in the list.

Also update qmc_chan_get_byphandle() and the resource managed version to
use qmc_chan_get_byphandles_index() and so avoid code duplication.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-8-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl_qmc_audio: Introduce qmc_dai_constraints_interleaved()
Herve Codina [Mon, 1 Jul 2024 11:30:33 +0000 (13:30 +0200)]
ASoC: fsl: fsl_qmc_audio: Introduce qmc_dai_constraints_interleaved()

Constraints are set by qmc_dai_startup(). These constraints are specific
to the interleaved mode.

With the future introduction of support for non-interleaved mode, a new
set of constraints will be set. To make the code clear and keep
qmc_dai_startup() simple, extract the current interleaved mode
constraints settings to a specific function.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-7-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl_qmc_audio: Introduce qmc_audio_pcm_{read,write}_submit()
Herve Codina [Mon, 1 Jul 2024 11:30:32 +0000 (13:30 +0200)]
ASoC: fsl: fsl_qmc_audio: Introduce qmc_audio_pcm_{read,write}_submit()

Submitting data to QMC channels is done in several places: transfer
completions and DAI start. The operation done is simple and consist in
one function call.

With the future introduction of support for non-interleaved mode,
submitting data will be more complex.

To avoid copy/paste of code in several places, introduce
qmc_audio_pcm_{read,write}_submit() whose goal is to handle this
data submission.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-6-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl_qmc_audio: Identify the QMC channel involved in completion routines
Herve Codina [Mon, 1 Jul 2024 11:30:31 +0000 (13:30 +0200)]
ASoC: fsl: fsl_qmc_audio: Identify the QMC channel involved in completion routines

The current QMC audio driver uses only one QMC channel per DAI. The
context used by QMC channel transfer (read and write) completion
routines does not contains any QMC channel and the only one available
per DAI is used to schedule the next transfer.
This works pretty well with only one QMC channel per DAI.

The future support for non-inlerleave mode will use several QMC channel
per DAI. In that case, QMC channel transfer completion routines need to
identify the QMC channel related to the completion.

In order to fill this lack, even if identifying the current QMC channel
among several QMC channels is not needed for the current code, add one
indirection level and introduce the qmc_dai_chan data structrure.
This structure contains the QMC channel involved in the completion and
refererences to the runtime context (capture and playback) used by the
DAI.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-5-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl_qmc_audio: Split channel buffer and PCM pointer handling
Herve Codina [Mon, 1 Jul 2024 11:30:30 +0000 (13:30 +0200)]
ASoC: fsl: fsl_qmc_audio: Split channel buffer and PCM pointer handling

The driver mixes some internal values for channel DMA buffer handling
and PCM pointer handling. In the currently supported interleaved mode,
this mix does not lead to any issues but in order to prepare the
support for the non-interleaved mode, having them clearly separated will
ease the support and avoid additional computation to convert values used
in channel DMA buffer management in values usable for PCM pointer.

Use a specific set of variable for PCM pointer handling and an other set
for channel DMA buffer.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-4-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl_qmc_audio: Fix issues detected by checkpatch
Herve Codina [Mon, 1 Jul 2024 11:30:29 +0000 (13:30 +0200)]
ASoC: fsl: fsl_qmc_audio: Fix issues detected by checkpatch

./scripts/checkpatch.pl --strict --codespell detected several issues
when running on the fsl_qmc_audio.c file:
  - CHECK: spaces preferred around that '*' (ctx:VxV)
  - CHECK: Alignment should match open parenthesis
  - CHECK: Comparison to NULL could be written "!prtd"
  - CHECK: spaces preferred around that '/' (ctx:VxV)
  - CHECK: Lines should not end with a '('
  - CHECK: Please don't use multiple blank lines
Some of them are present several times.

Fix all of these issues without any functional changes.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-3-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: fsl: fsl_qmc_audio: Check devm_kasprintf() returned value
Herve Codina [Mon, 1 Jul 2024 11:30:28 +0000 (13:30 +0200)]
ASoC: fsl: fsl_qmc_audio: Check devm_kasprintf() returned value

devm_kasprintf() can return a NULL pointer on failure but this returned
value is not checked.

Fix this lack and check the returned value.

Fixes: 075c7125b11c ("ASoC: fsl: Add support for QMC audio")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-2-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Intel: hda-pcm: Limit the maximum number of periods by MAX_BDL_ENTRIES
Peter Ujfalusi [Thu, 4 Jul 2024 09:01:06 +0000 (11:01 +0200)]
ASoC: SOF: Intel: hda-pcm: Limit the maximum number of periods by MAX_BDL_ENTRIES

The HDaudio specification Section 3.6.2 limits the number of BDL entries to 256.

Make sure we don't allow more periods than this normative value.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240704090106.371497-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: rt711-sdw: add missing readable registers
Bard Liao [Thu, 4 Jul 2024 09:23:27 +0000 (17:23 +0800)]
ASoC: rt711-sdw: add missing readable registers

Those registers will be used when JD source is RT711_JD2_1P8V_1PORT.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20240704092327.652609-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: SOF: Intel: hda: fix null deref on system suspend entry
Kai Vehmanen [Thu, 4 Jul 2024 08:57:08 +0000 (10:57 +0200)]
ASoC: SOF: Intel: hda: fix null deref on system suspend entry

When system enters suspend with an active stream, SOF core
calls hw_params_upon_resume(). On Intel platforms with HDA DMA used
to manage the link DMA, this leads to call chain of

   hda_dsp_set_hw_params_upon_resume()
 -> hda_dsp_dais_suspend()
 -> hda_dai_suspend()
 -> hda_ipc4_post_trigger()

A bug is hit in hda_dai_suspend() as hda_link_dma_cleanup() is run first,
which clears hext_stream->link_substream, and then hda_ipc4_post_trigger()
is called with a NULL snd_pcm_substream pointer.

Fixes: 2b009fa0823c ("ASoC: SOF: Intel: hda: Unify DAI drv ops for IPC3 and IPC4")
Link: https://github.com/thesofproject/linux/issues/5080
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240704085708.371414-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: lpass-wsa-macro: Simplify with cleanup.h
Krzysztof Kozlowski [Mon, 1 Jul 2024 07:39:38 +0000 (09:39 +0200)]
ASoC: codecs: lpass-wsa-macro: Simplify with cleanup.h

Driver's probe() has two allocations which are needed only within the
probe() itself - for devm_regmap_init_mmio().

Usage of devm interface is a bit misleading here, because these can be
freed right after each scope finishes.

This makes the code a bit more obvious and self documenting.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-6-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: lpass-rx-macro: Use unsigned for number of widgets
Krzysztof Kozlowski [Mon, 1 Jul 2024 07:39:37 +0000 (09:39 +0200)]
ASoC: codecs: lpass-rx-macro: Use unsigned for number of widgets

Driver uses ARRAY_SIZE() to get number of widgets later passed to
snd_soc_dapm_new_controls(), which is an 'unsigned int'.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-5-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: dapm: Use unsigned for number of widgets in snd_soc_dapm_new_controls()
Krzysztof Kozlowski [Mon, 1 Jul 2024 07:39:36 +0000 (09:39 +0200)]
ASoC: dapm: Use unsigned for number of widgets in snd_soc_dapm_new_controls()

Number of widgets in array passed to snd_soc_dapm_new_controls() cannot
be negative, so make it explicit by using 'unsigned int', just like
snd_soc_add_component_controls() is doing.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-4-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: lpass-rx-macro: Keep static regmap_config as const
Krzysztof Kozlowski [Mon, 1 Jul 2024 07:39:35 +0000 (09:39 +0200)]
ASoC: codecs: lpass-rx-macro: Keep static regmap_config as const

The driver has static 'struct regmap_config', which is then customized
depending on device version.  This works fine, because there should not
be two devices in a system simultaneously and even less likely that such
two devices would have different versions, thus different regmap config.
However code is cleaner and more obvious when static data in the driver
is also const - it serves as a template.

Mark the 'struct regmap_config' as const and duplicate it in the probe()
with kmemdup to allow customizing per detected device variant.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-3-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: lpass-rx-macro: Simplify with cleanup.h
Krzysztof Kozlowski [Mon, 1 Jul 2024 07:39:34 +0000 (09:39 +0200)]
ASoC: codecs: lpass-rx-macro: Simplify with cleanup.h

Allocate the default register values array with scoped/cleanup.h to
reduce number of error paths and make code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-2-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: codecs: lpass-rx-macro: Simplify PDS cleanup with devm
Krzysztof Kozlowski [Mon, 1 Jul 2024 07:39:33 +0000 (09:39 +0200)]
ASoC: codecs: lpass-rx-macro: Simplify PDS cleanup with devm

Eliminate PDS cleanup by using devm_add_action_or_reset() which results
in one less error path and smaller cleanup in remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-1-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: tas5086: Convert to GPIO descriptors
Linus Walleij [Mon, 1 Jul 2024 07:02:12 +0000 (09:02 +0200)]
ASoC: tas5086: Convert to GPIO descriptors

Switch the driver to use GPIO descriptors.

Notice that we let the gpiolib handle line inversion for the
active low reset line (nreset !reset).

There are no upstream device trees using the tas5086 compatible
string, if there were, we would need to ascertain that they all
set the GPIO_ACTIVE_LOW flag on their GPIO lines.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20240701-asoc-tas-gpios-v1-1-d69ec5d79939@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wsa884x: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:21:05 +0000 (18:21 +0200)]
ASoC: wsa884x: Constify struct regmap_config

`wsa884x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-9-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wsa883x: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:21:04 +0000 (18:21 +0200)]
ASoC: wsa883x: Constify struct regmap_config

`wsa883x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-8-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: wsa881x: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:21:03 +0000 (18:21 +0200)]
ASoC: wsa881x: Constify struct regmap_config

`wsa881x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-7-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: jz4770: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:21:02 +0000 (18:21 +0200)]
ASoC: jz4770: Constify struct regmap_config

`jz4760_codec_regmap_config` is not modified and can be declared as
const to move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-6-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: jz4760: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:21:01 +0000 (18:21 +0200)]
ASoC: jz4760: Constify struct regmap_config

`jz4760_codec_regmap_config` is not modified and can be declared as
const to move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-5-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs53l30: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:21:00 +0000 (18:21 +0200)]
ASoC: cs53l30: Constify struct regmap_config

`cs53l30_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-4-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs35l36: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:20:59 +0000 (18:20 +0200)]
ASoC: cs35l36: Constify struct regmap_config

`cs35l36_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-3-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs35l35: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:20:58 +0000 (18:20 +0200)]
ASoC: cs35l35: Constify struct regmap_config

`cs35l35_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-2-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs35l34: Constify struct regmap_config
Javier Carrasco [Wed, 3 Jul 2024 16:20:57 +0000 (18:20 +0200)]
ASoC: cs35l34: Constify struct regmap_config

`cs35l34_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-1-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs35l56: Set correct upper volume limit
Mark Brown [Wed, 3 Jul 2024 16:30:47 +0000 (17:30 +0100)]
ASoC: cs35l56: Set correct upper volume limit

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

These two commits set the upper limit of the Speaker Volume control
to +12dB instead of +100dB.

This should have been a simple 1-line change to the #define in the
header file, but only the HDA cs35l56 driver is using this define.
The ASoC cs35l56 driver was using hardcoded numbers instead of the
header defines.

So the first commit changes the ASoC driver to use the #defined
constants. The second commit corrects the value of the constant.

9 months agoASoC: fsl_xcvr: Improve suspend/resume flow in fsl_xcvr_trigger()
Chancel Liu [Fri, 28 Jun 2024 09:43:54 +0000 (18:43 +0900)]
ASoC: fsl_xcvr: Improve suspend/resume flow in fsl_xcvr_trigger()

In the current flow all interrupts are disabled in runtime suspend
phase. However interrupts enablement only exists in fsl_xcvr_prepare().
After resume fsl_xcvr_prepare() may not be called so it will cause all
interrupts still disabled even if resume from suspend. Interrupts
should be explictily enabled after resume.

Also, DPATH reset setting only exists in fsl_xcvr_prepare(). After
resume from suspend DPATH should be reset otherwise there'll be channel
swap issue.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://patch.msgid.link/20240628094354.780720-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs35l56: Limit Speaker Volume to +12dB maximum
Richard Fitzgerald [Wed, 3 Jul 2024 09:55:17 +0000 (10:55 +0100)]
ASoC: cs35l56: Limit Speaker Volume to +12dB maximum

Change CS35L56_MAIN_RENDER_USER_VOLUME_MAX to 48, to limit the maximum
value of the Speaker Volume control to +12dB. The minimum value is
unchanged so that the default 0dB has the same integer control value.

The original maximum of 400 (+100dB) was the largest value that can be
mathematically handled by the DSP. The actual maximum amplification is
+12dB.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240703095517.208077-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: cs35l56: Use header defines for Speaker Volume control definition
Richard Fitzgerald [Wed, 3 Jul 2024 09:55:16 +0000 (10:55 +0100)]
ASoC: cs35l56: Use header defines for Speaker Volume control definition

The "Speaker Volume" control was being defined using four hardcoded magic
numbers. There are #defines in the cs35l56.h header for these numbers, so
change the code to use the defined constants.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240703095517.208077-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: tas2781: Use of_property_read_reg()
Rob Herring (Arm) [Tue, 2 Jul 2024 21:54:01 +0000 (15:54 -0600)]
ASoC: tas2781: Use of_property_read_reg()

Replace the open-coded parsing of "reg" with of_property_read_reg().
The #ifdef is also easily replaced with IS_ENABLED().

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240702215402.839673-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: PCM6240: Use of_property_read_reg()
Rob Herring (Arm) [Tue, 2 Jul 2024 21:53:49 +0000 (15:53 -0600)]
ASoC: PCM6240: Use of_property_read_reg()

Replace the open-coded parsing of "reg" with of_property_read_reg().
The #ifdef is also easily replaced with IS_ENABLED().

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240702215349.839350-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: topology: kcontrol registration cleanup
Mark Brown [Tue, 2 Jul 2024 20:32:07 +0000 (21:32 +0100)]
ASoC: topology: kcontrol registration cleanup

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

Code used to create standalone and widget controls is mostly same, with
with exception that in standalone case dynamic object needs to be
registered and control created directly.

Following patches clean up and unify kcontrol creation code in topology
code.

9 months agoAdd master clock handling for nau8824
Mark Brown [Tue, 2 Jul 2024 19:26:51 +0000 (20:26 +0100)]
Add master clock handling for nau8824

Merge series from Maxim Kochetkov <fido_max@inbox.ru>:

nau8824 has external MCLK pin. So add enable/disable external clock
management.

9 months agoASoC: dt-bindings: realtek,rt5645: Convert to dtschema
Animesh Agarwal [Tue, 2 Jul 2024 12:00:58 +0000 (17:30 +0530)]
ASoC: dt-bindings: realtek,rt5645: Convert to dtschema

Convert the RT5650/RT5645 audio CODEC bindings to DT schema.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20240702120106.17100-1-animeshagarwal28@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: topology: Unify code for creating standalone and widget enum control
Amadeusz Sławiński [Thu, 27 Jun 2024 10:18:50 +0000 (12:18 +0200)]
ASoC: topology: Unify code for creating standalone and widget enum control

Code used to create standalone and widget enum control is same, with
exception that in standalone case dynamic object needs to be registered
and control created directly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-14-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
9 months agoASoC: topology: Unify code for creating standalone and widget mixer control
Amadeusz Sławiński [Thu, 27 Jun 2024 10:18:49 +0000 (12:18 +0200)]
ASoC: topology: Unify code for creating standalone and widget mixer control

Code used to create standalone and widget mixer control is same, with
exception that in standalone case dynamic object needs to be registered
and control created directly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-13-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>