Commit Graph

50415 Commits

Author SHA1 Message Date
Yue Haibing
b0b228bb8d ALSA: seq: Remove unused declarations
These functions are never implemented and used.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://patch.msgid.link/20240817093334.1120002-1-yuehaibing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-17 16:32:31 +02:00
Vijendar Mukunda
a42db293e5
ASoC: SOF: amd: Fix for acp init sequence
When ACP is not powered on by default, acp power on sequence explicitly
invoked by programming pgfsm control mask. The existing implementation
checks the same PGFSM status mask and programs the same PGFSM control mask
in all ACP variants which breaks acp power on sequence for ACP6.0 and
ACP6.3 variants. So to fix this issue, update ACP pgfsm control mask and
status mask based on acp descriptor rev field, which will vary based on
acp variant.

Fixes: 846aef1d7c ("ASoC: SOF: amd: Add Renoir ACP HW support")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240816070328.610360-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-16 13:04:31 +01:00
Yue Haibing
c8a3231ae6 ALSA: oss: Remove unused declarations
These functions is never implemented and used.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://patch.msgid.link/20240816100209.879043-1-yuehaibing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-16 12:28:12 +02:00
Zhang Zekun
d32cf9fbcb ALSA: aoa: Use helper function for_each_child_of_node()
for_each_child_of_node can help to iterate through the device_node,
and we don't need to use while loop. No functional change with this
conversion.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Link: https://patch.msgid.link/20240816021826.65190-1-zhangzekun11@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-16 09:52:42 +02:00
Shenghao Ding
0a9173541b
ASoc: tas2781: Remove unnecessary line feed and space
Remove unnecessary line feed for tasdevice_dsp_create_ctrls,
and remove two unnecessary spaces in tas2563_digital_gain_get
and tas2563_digital_gain_put.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240815042138.1997-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-15 15:37:26 +01:00
Yuntao Liu
164199615a
ASoC: amd: acp: fix module autoloading
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
based on the alias from platform_device_id table.

Fixes: 9d8a7be88b ("ASoC: amd: acp: Add legacy sound card support for Chrome audio")
Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com>
Link: https://patch.msgid.link/20240815084923.756476-1-liuyuntao12@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-15 15:37:15 +01:00
tangbin
60b5c173f5
ASoC: loongson: Remove useless variable definitions
In the function loongson_pcm_trigger and loongson_pcm_open,
the 'ret' is useless, so remove it to simplify code.

Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240713153428.44858-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 22:19:19 +01:00
YR Yang
ff9f065318
ASoC: mediatek: mt8188: Mark AFE_DAC_CON0 register as volatile
Add AFE Control Register 0 to the volatile_register.
AFE_DAC_CON0 can be modified by both the SOF and ALSA drivers.
If this register is read and written in cache mode, the cached value
might not reflect the actual value when the register is modified by
another driver. It can cause playback or capture failures. Therefore,
it is necessary to add AFE_DAC_CON0 to the list of volatile registers.

Signed-off-by: YR Yang <yr.yang@mediatek.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://patch.msgid.link/20240801084326.1472-1-yr.yang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 21:56:34 +01:00
Kuninori Morimoto
c8c3d9f8e3
ASoC: soc-pcm: remove snd_soc_dpcm_stream_{lock/unlock}_irq()
soc-pcm.c has snd_soc_dpcm_stream_{lock/unlock}_irq() helper function,
but it is almost nothing help. It just makes a code complex.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/875xsnll85.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:19 +01:00
Fabio Estevam
bcbbf71306
ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.

The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the CONFIG_PM ifdefery from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-7-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:18 +01:00
Fabio Estevam
c504885a35
ASoC: imx-audmux: Switch to SYSTEM_SLEEP_PM_OPS
Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS()
alternative.

The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows
the compiler to evaluate if the suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the CONFIG_PM_SLEEP ifdefery from the
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-6-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:17 +01:00
Fabio Estevam
8ffb2fe2e9
ASoC: fsl_ssi: Switch to SYSTEM_SLEEP_PM_OPS
Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS()
alternative.

The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows
the compiler to evaluate if the suspend/resume() functions are used at
build time or are simply dead code.

This allows removing the CONFIG_PM_SLEEP ifdefery from the
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-5-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:16 +01:00
Fabio Estevam
01661bb956
ASoC: fsl_spdif: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.

The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the CONFIG_PM ifdefery from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-4-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:15 +01:00
Fabio Estevam
bbc0798c40
ASoC: fsl_rpmsg: Switch to RUNTIME_PM_OPS()
Replace SET_RUNTIME_PM_OPS() with its modern RUNTIME_PM_OPS()
alternative.

The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the
compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the CONFIG_PM ifdefery from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-3-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:14 +01:00
Fabio Estevam
b7e4dd8da0
ASoC: fsl_mqs: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.

The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the CONFIG_PM ifdefery from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-2-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:13 +01:00
Fabio Estevam
73abd96989
ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.

The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the CONFIG_PM ifdefery from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:21:12 +01:00
Krzysztof Kozlowski
2251db28ed
ASoC: codecs: wcd937x: Fix missing de-assert of reset GPIO
The device never comes online from a reset/shutdown state, because the
driver de-asserts reset GPIO when requesting it but then, at the end of
probe() through wcd937x_reset(), leaves it asserted.

Cc: stable@vger.kernel.org
Fixes: 9be3ec196d ("ASoC: codecs: wcd937x: add wcd937x codec driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240806114913.40022-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-14 18:15:02 +01:00
Takashi Iwai
829e2a2312 ALSA: hda/tas2781: Use correct endian conversion
The data conversion is done rather by a wrong function.  We convert to
BE32, not from BE32.  Although the end result must be same, this was
complained by the compiler.

Fix the code again and align with another similar function
tas2563_apply_calib() that does already right.

Fixes: 3beddef84d ("ALSA: hda/tas2781: fix wrong calibrated data order")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408141630.DiDUB8Z4-lkp@intel.com/
Link: https://patch.msgid.link/20240814100500.1944-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-14 16:58:26 +02:00
Takashi Iwai
d79e13f8e8 ALSA: usb-audio: Replace complex quirk lines with macros
Apply the newly introduced macros for reduce the complex expressions
and cast in the quirk table definitions.  It results in a significant
code reduction, too.

There should be no functional changes.

Link: https://patch.msgid.link/20240814134844.2726-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-14 16:52:04 +02:00
Takashi Iwai
0c3ad39b79 ALSA: usb-audio: Define macros for quirk table entries
Many entries in the USB-audio quirk tables have relatively complex
expressions.  For improving the readability, introduce a few macros.
Those are applied in the following patch.

Link: https://patch.msgid.link/20240814134844.2726-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-14 16:51:54 +02:00
Juan José Arboleda
c286f204ce ALSA: usb-audio: Support Yamaha P-125 quirk entry
This patch adds a USB quirk for the Yamaha P-125 digital piano.

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240813161053.70256-1-soyjuanarbol@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-14 14:09:22 +02:00
Shenghao Ding
8f712c12f3
ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781
Rename dai_driver name to unify the name between TAS2563 and
TAS2781.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240811135144.178-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 16:19:48 +01:00
Albert Jakieła
c0196faaa9
ASoC: SOF: mediatek: Add missing board compatible
Add Google Dojo compatible.

Signed-off-by: Albert Jakieła <jakiela@google.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20240809135627.544429-1-jakiela@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 15:46:29 +01:00
Richard Fitzgerald
8475a1d9bb ALSA: hda: cs35l41: Remove redundant call to hda_cs_dsp_control_remove()
The driver doesn't create any ALSA controls for firmware controls, so it
shouldn't be calling hda_cs_dsp_control_remove().

commit 312c04cee4 ("ALSA: hda: cs35l41: Stop creating ALSA Controls for
firmware coefficients") removed the call to hda_cs_dsp_add_controls() but
didn't remove the call for destroying those controls.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 312c04cee4 ("ALSA: hda: cs35l41: Stop creating ALSA Controls for firmware coefficients")
Link: https://patch.msgid.link/20240813113209.648-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-13 13:43:00 +02:00
Vijendar Mukunda
c6f3abbbdc
ASoC: amd: acp: add legacy driver support for ACP7.1 based platforms
Add acp pci driver and machine driver changes for ACP7.1 based platforms
for legacy stack.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240813080850.3107409-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 12:41:41 +01:00
Christophe JAILLET
ab73c7c0e5
ASoC: rt1318: Constify struct reg_sequence
'struct reg_sequence' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security.

While at it, remove rt1318_INIT_REG_LEN which is ununsed.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  22062	   4859	     32	  26953	   6949	sound/soc/codecs/rt1318.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  24742	   2171	     32	  26945	   6941	sound/soc/codecs/rt1318.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/96561dd2962d4312eb0e68ab850027f44350d070.1722952334.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 12:41:40 +01:00
Vijendar Mukunda
6024b86b4a
ASoC: amd: acp: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.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/20240812100429.2594745-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 12:41:40 +01:00
Christophe JAILLET
86297bb30a
ASoC: cs43130: Constify struct reg_sequence and reg_sequences
'struct reg_sequence' and 'struct reg_sequences' are not modified in this
drivers.

Constifying these structures moves some data to a read-only section, so
increase overall security.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  54409	   7881	     64	  62354	   f392	sound/soc/codecs/cs43130.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  55562	   6729	     64	  62355	   f393	sound/soc/codecs/cs43130.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/5b906a0cc9b7be15d0d6310069f54254a75ea767.1722951770.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 12:41:39 +01:00
Vijendar Mukunda
897e91e995
ASoC: SOF: amd: Fix for incorrect acp error register offsets
Addition of 'dsp_intr_base' to ACP error register offsets points to
wrong register offsets in irq handler. Correct the acp error register
offsets. ACP error status register offset and acp error reason register
offset got changed from ACP6.0 onwards. Add 'acp_error_stat' and
'acp_sw0_i2s_err_reason' as descriptor fields in sof_amd_acp_desc
structure and update the values based on the ACP variant.
>From Rembrandt platform onwards, errors related to SW1 Soundwire manager
instance/I2S controller connected on P1 power tile is reported with
ACP_SW1_I2S_ERROR_REASON register. Add conditional check for the same.

Fixes: 96eb818510 ("ASoC: SOF: amd: add interrupt handling for SoundWire manager devices")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240813105944.3126903-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 12:39:19 +01:00
Vijendar Mukunda
c56ba3e447
ASoC: SOF: amd: move iram-dram fence register programming sequence
The existing code modifies IRAM and DRAM size after sha dma start for
vangogh platform. The problem with this sequence is that it might cause
sha dma failure when firmware code binary size is greater than the default
IRAM size. To fix this issue, Move the iram-dram fence register sequence
prior to sha dma start.

Fixes: 094d11768f ("ASoC: SOF: amd: Skip IRAM/DRAM size modification for Steam Deck OLED")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240813105944.3126903-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-13 12:39:18 +01:00
Richard Fitzgerald
12d82c7b0a ALSA: hda: cs35l56: Remove redundant call to hda_cs_dsp_control_remove()
The driver doesn't create any ALSA controls for firmware controls, so it
shouldn't be calling hda_cs_dsp_control_remove().

commit 34e1b1bb73 ("ALSA: hda: cs35l56: Stop creating ALSA controls for
firmware coefficients") removed the call to hda_cs_dsp_add_controls() but
didn't remove the call for destroying those controls.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 34e1b1bb73 ("ALSA: hda: cs35l56: Stop creating ALSA controls for firmware coefficients")
Link: https://patch.msgid.link/20240813110750.2814-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-13 13:18:49 +02:00
Baojun Xu
3beddef84d ALSA: hda/tas2781: fix wrong calibrated data order
Wrong calibration data order cause sound too low in some device.
Fix wrong calibrated data order, add calibration data converssion
by get_unaligned_be32() after reading from UEFI.

Fixes: 5be27f1e3e ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Baojun Xu <baojun.xu@ti.com>
Link: https://patch.msgid.link/20240813043749.108-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-13 08:58:42 +02:00
Karol Kosik
6aa8700150 ALSA: usb-audio: Support multiple control interfaces
Registering Numark Party Mix II fails with error 'bogus bTerminalLink 1'.
The problem stems from the driver not being able to find input/output
terminals required to configure audio streaming. The information about
those terminals is stored in AudioControl Interface. Numark device
contains 2 AudioControl Interfaces and the driver checks only one of them.

According to the USB standard, a device can have multiple audio functions,
each represented by Audio Interface Collection. Every audio function is
considered to be closed box and will contain unique AudioControl Interface
and zero or more AudioStreaming and MIDIStreaming Interfaces.

The Numark device adheres to the standard and defines two audio functions:
- MIDIStreaming function
- AudioStreaming function
It starts with MIDI function, followed by the audio function. The driver
saves the first AudioControl Interface in `snd_usb_audio` structure
associated with the entire device. It then attempts to use this interface
to query for terminals and clocks. However, this fails because the correct
information is stored in the second AudioControl Interface, defined in the
second Audio Interface Collection.

This patch introduces a structure holding association between each
MIDI/Audio Interface and its corresponding AudioControl Interface,
instead of relying on AudioControl Interface defined for the entire
device. This structure is populated during usb probing phase and leveraged
later when querying for terminals and when sending USB requests.

Alternative solutions considered include:
- defining a quirk for Numark where the order of interface is manually
changed, or terminals are hardcoded in the driver. This solution would
have fixed only this model, though it seems that device is USB compliant,
and it also seems that other devices from this company may be affected.
What's more, it looks like products from other manufacturers have similar
problems, i.e. Rane One DJ console
- keeping a list of all AudioControl Interfaces and querying all of them
to find required information. That would have solved my problem and have
low probability of breaking other devices, as we would always start with
the same logic of querying first AudioControl Interface. This solution
would not have followed the standard though.

This patch preserves the `snd_usb_audio.ctrl_intf` variable, which holds
the first AudioControl Interface, and uses it as a fallback when some
interfaces are not parsed correctly and lack an associated AudioControl
Interface, i.e., when configured via quirks.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217865
Signed-off-by: Karol Kosik <k.kosik@outlook.com>
Link: https://patch.msgid.link/AS8P190MB1285893F4735C8B32AD3886BEC852@AS8P190MB1285.EURP190.PROD.OUTLOOK.COM
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-12 16:17:46 +02:00
Masahiro Yamada
e332a5aba8 treewide: remove unnecessary <linux/version.h> inclusion
These files do not use any macros defined in <linux/version.h>.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
2024-08-12 18:36:44 +09:00
Jonathan LoBue
ebfb5a57ca ALSA: hda/realtek: tas2781: Fix ROG ALLY X audio
This patch enables the TI TAS2781 amplifier SoC for the ASUS ROG ALLY X.
This is a design change from the original ASUS ROG ALLY, creating the need
for this patch. All other Realtek Codec settings seem to be re-used from
the original ROG ALLY design (on the ROG ALLY X). This patch maintains the
previous settings for the Realtek codec portion, but enables the I2C
binding for the TI TAS2781 amplifier (instead of the Cirrus CS35L41 amp
used on the original ASUS ROG ALLY).

One other requirement must be met for audio to work on the ASUS ROG ALLY X.
A proper firmware file in the correct location with a proper symlink. We
had reached out to TI engineers and confirmed that the firmware found in
the Windows' driver package has a GPL license. Bazzite Github is hosting
this firmware file for now until proper linux-firmware upstreaming can
occur. https://github.com/ublue-os/bazzite

This firmware file should be placed in
/usr/lib/firmware/ti/tas2781/TAS2XXX1EB3.bin with a symlink to it from
/usr/lib/firmware/TAS2XXX1EB3.bin

Co-developed by: Kyle Gospodnetich <me@kylegospodneti.ch>
Signed-off-by: Kyle Gospodnetich <me@kylegospodneti.ch>
Co-developed by: Jan Drogehoff <sentrycraft123@gmail.com>
Signed-off-by: Jan Drogehoff <sentrycraft123@gmail.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Tested-by: Richard Alvarez <alvarez.richard@gmail.com>
Tested-by: Miles Montierth <cyber_dopamine@intheblackmedia.com>
Signed-off-by: Jonathan LoBue <jlobue10@gmail.com>
Link: https://patch.msgid.link/20240812045325.47736-1-jlobue10@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-12 09:25:40 +02:00
Takashi Iwai
ddf1a21290 Merge branch 'for-linus' into for-next
Pull 6.11 devel branch for further development

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-12 09:25:07 +02:00
Lianqin Hu
004eb8ba77 ALSA: usb-audio: Add delay quirk for VIVO USB-C-XE710 HEADSET
Audio control requests that sets sampling frequency sometimes fail on
this card. Adding delay between control messages eliminates that problem.

Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/TYUPR06MB6217FF67076AF3E49E12C877D2842@TYUPR06MB6217.apcprd06.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-12 09:22:24 +02:00
Takashi Iwai
eb75d05d96 Merge branch 'topic/cirrus-hp-g12' into for-linus
Pull Cirrus HD-audio quirks for HP G12 laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-12 09:17:57 +02:00
Simon Trimmer
03c5c350e3 ALSA: hda/realtek: Add support for new HP G12 laptops
Some of these laptop models have quirk IDs that are identical but have
different amplifier parts fitted, this difference is described in the
ACPI information.

The solution introduced for this product family can derive the required
component binding information from ACPI instead of hardcoding it,
supports the new variants of the CS35L56 being used and has generalized
naming that makes it applicable to other ALC+amp combinations.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240802152215.20831-4-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-12 09:17:17 +02:00
Parsa Poorshikhian
ef9718b3d5 ALSA: hda/realtek: Fix noise from speakers on Lenovo IdeaPad 3 15IAU7
Fix noise from speakers connected to AUX port when no sound is playing.
The problem occurs because the `alc_shutup_pins` function includes
a 0x10ec0257 vendor ID, which causes noise on Lenovo IdeaPad 3 15IAU7 with
Realtek ALC257 codec when no sound is playing.
Removing this vendor ID from the function fixes the bug.

Fixes: 70794b9563 ("ALSA: hda/realtek: Add more codec ID to no shutup pins list")
Signed-off-by: Parsa Poorshikhian <parsa.poorsh@gmail.com>
Link: https://patch.msgid.link/20240810150939.330693-1-parsa.poorsh@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-11 10:17:44 +02:00
Takashi Iwai
ccbfcac058 ALSA: timer: Relax start tick time check for slave timer elements
The recent addition of a sanity check for a too low start tick time
seems breaking some applications that uses aloop with a certain slave
timer setup.  They may have the initial resolution 0, hence it's
treated as if it were a too low value.

Relax and skip the check for the slave timer instance for addressing
the regression.

Fixes: 4a63bd179f ("ALSA: timer: Set lower bound of start tick time")
Cc: <stable@vger.kernel.org>
Link: https://github.com/raspberrypi/linux/issues/6294
Link: https://patch.msgid.link/20240810084833.10939-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-10 10:49:14 +02:00
Norman Bintang
72c0f57dbe ALSA: pcm: Add xrun counter for snd_pcm_substream
This patch adds an xrun counter to snd_pcm_substream as an alternative
to using logs from XRUN_DEBUG_BASIC. The counter provides a way to track
the number of xrun occurences, accessible through the /proc interface.

The counter is enabled when CONFIG_SND_PCM_XRUN_DEBUG is set.

Example output:

$ cat /proc/asound/card0/pcm9p/sub0/status

owner_pid   : 1425
trigger_time: 235.248957291
tstamp      : 0.000000000
delay       : 1912
avail       : 480
avail_max   : 1920
-----
hw_ptr      : 672000
appl_ptr    : 673440
xrun_counter: 3  # (new row)

Signed-off-by: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Link: https://patch.msgid.link/20240809140648.3414349-1-normanbt@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-10 10:40:58 +02:00
Stefan Stistrup
e9606148a6 ALSA: usb-audio: Add input gain and master output mixer elements for RME Babyface Pro
Add missing input gain and master output mixer controls for
RME Babyface Pro.

This patch implements:

1. Input gain controls for 2 mic and 2 line inputs
2. Master output volume controls for all 12 output channels

These additions allow for more complete control of the Babyface Pro under
Linux.

Signed-off-by: Stefan Stistrup <sstistrup@gmail.com>
Link: https://patch.msgid.link/20240809204922.20112-1-sstistrup@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-10 10:40:11 +02:00
Takashi Iwai
4004f3029e Merge branch 'topic/control-lookup-rwlock' into for-next
Pull control lookup optimization changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-09 14:25:24 +02:00
Takashi Iwai
9cacb32a0b ASoC: Drop snd_soc_*_get_kcontrol_locked()
The recent cleanup in ALSA control core made no difference between
snd_ctl_find_id_mixer() and snd_ctl_find_id_mixer_locked(), and the
latter is to be dropped.  The only user of the left API was ASoC, and
that's snd_soc_card_get_kcontrol_locked() and
snd_soc_component_get_kcontrol_locked().

This patch drops those functions and rewrites those users to call the
variant without locked instead.  The test of the API became
superfluous, hence dropped as well.

As all callers of snd_ctl_find_id_mixer_locked() are gone,
snd_ctl_find_id_mixer_locked() is finally dropped, too.

Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240809104234.8488-4-tiwai@suse.de
2024-08-09 14:24:55 +02:00
Takashi Iwai
38ea4c3dc3 ALSA: control: Optimize locking for look-up
For a fast look-up of a control element via either numid or name
matching (enabled via CONFIG_SND_CTL_FAST_LOOKUP), a locking isn't
needed at all thanks to Xarray.  OTOH, the locking is still needed for
a slow linked-list traversal, and that's rather a rare case.

In this patch, we reduce the use of locking at snd_ctl_find_*() API
functions, and switch from controls_rwsem to controls_rwlock for
avoiding unnecessary lock inversions.  This also resulted in a nice
cleanup, as *_unlocked() version of snd_ctl_find_*() APIs can be
dropped.

snd_ctl_find_id_mixer_unlocked() is still left just as an alias of
snd_ctl_find_id_mixer(), since soc-card.c has a wrapper and there are
several users.  Once after converting there, we can remove it later.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240809104234.8488-3-tiwai@suse.de
2024-08-09 14:24:55 +02:00
Takashi Iwai
f428cc9eac ALSA: control: Rename ctl_files_rwlock to controls_rwlock
We'll re-use the existing rwlock for the protection of control list
lookup, too, and now rename it to a more generic name.

This is a preliminary change, only the rename of the struct field
here, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240809104234.8488-2-tiwai@suse.de
2024-08-09 14:24:55 +02:00
Takashi Iwai
d3e82ced46 ASoC: Fixes for v6.11
Quite a lot of fixes have come in since the merge window, there's some
 repetitive fixes over the Qualcomm drivers increasing the patch count,
 along with a large batch of fixes from Cirrus.  We also have some quirks
 and some individual fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAma1PWoACgkQJNaLcl1U
 h9BWNgf+PMiOLGbC57S4FRI0Ve05jGbfX5HTFAsgCy0D1TnjJTt8XM8fAqkDux1f
 fvcjRVpaIrBIu9XY2vtC35C6XcHBcB7WsgiIF+pFCe9vwZy1avB+lA0vCogyM1Fv
 ToK/ssVWUnjKl2ClJ2faBhyYivleXZoTCSSXYOu3NL6owC8jWXPe9zMlfBGGkqUV
 bIz6hQCJPhAm7j0H07zvT/ItwoWsvPRiHPkHbzHp7tb8rH09m4JWAseufQ+HSIRj
 QzQ4u/S0HEt/e2fV+TFqfBgZzHIaKhx8uUnIhvCTGhz+42a+niyiV9du987IaLqW
 QmL5YDASem7UnlTil+mpaQBy5k/NIQ==
 =P4XX
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.11-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.11

Quite a lot of fixes have come in since the merge window, there's some
repetitive fixes over the Qualcomm drivers increasing the patch count,
along with a large batch of fixes from Cirrus.  We also have some quirks
and some individual fixes.
2024-08-09 09:58:07 +02:00
Takashi Iwai
f6c9a097b5 ALSA: usx2y: Drop no longer used variable
The recent conversion to the standard print API included some cleanups
and that changed the code no longer referring to a variable iters at
usb_stream_start().  This caused a compiler warning in the end.
Let's drop the unused variable.

Fixes: f8466d91f3 ("ALSA: usx2y: Use standard print API")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408090249.8LE9qrae-lkp@intel.com/
Link: https://patch.msgid.link/20240809075700.7320-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-09 09:57:33 +02:00
Takashi Iwai
af1d53b6e0 ALSA: caiaq: Fix unused variable warning
The recent cleanup of caiaq driver forgot to remove the unused loop
variable:
sound/usb/caiaq/audio.c: In function 'snd_usb_caiaq_pcm_prepare':
sound/usb/caiaq/audio.c:179:41: error: unused variable 'i' [-Werror=unused-variable]

Fixes: e95b9f7f2e ("ALSA: snd-usb-caiaq: use snd_pcm_rate_to_rate_bit")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/20240809112252.5af8025f@canb.auug.org.au
Link: https://patch.msgid.link/20240809074254.5290-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-09 09:43:56 +02:00
Takashi Iwai
528baf4f62 ALSA: sparc: Fix a typo at dev_*() conversion
There was a stupid typo left that broke the build.  Fix it.

Fixes: d41abde894 ("ALSA: sparc: Use standard print API")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408090648.J2EAijjH-lkp@intel.com/
Link: https://patch.msgid.link/20240809073923.3735-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-09 09:39:48 +02:00
Mark Brown
5552cccb0b
ASoC: codecs: warn on unknown codec version
Merge series from Dmitry Baryshkov <dmitry.baryshkov@linaro.org>:

While debugging broken audio issues on some of Qualcomm platforms I
stumbled upon the kernel not providing the actual error information.
It prints an error from the wsa_macro driver, but the actual issue is in
the VA macro driver. Add error message to point to the actual error
location.

va_macro 3370000.codec: Unknown VA Codec version, ID: 00 / 0f / 00
wsa_macro 3240000.codec: Unsupported Codec version (0)
2024-08-08 22:47:19 +01:00
Mark Brown
5db564d424
ASoC: tas*: Fix up GPIO usage
Merge series from Linus Walleij <linus.walleij@linaro.org>:

The TI TAS drivers use some legacy GPIO code and headers,
this series fixes it up.

The TAS2781 is a special case since it adds a handful of
lines of deviating code to reconfigure a GPIO line for
IRQ mode and then never actually use the IRQ obtained in
the code. Is the line used by autonomous hardware? I'm
puzzled by this.

Anyways the patch suggest how to solve this properly by
fixing the parent irqchip and I'm happy to help.
2024-08-08 21:57:13 +01:00
Simon Trimmer
72776774b5
ASoC: cs35l56: Patch CS35L56_IRQ1_MASK_18 to the default value
Device tuning files made with early revision tooling may contain
configuration that can unmask IRQ signals that are owned by the host.

Adding a safe default to the regmap patch ensures that the hardware
matches the driver expectations.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/20240807142648.46932-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 20:34:56 +01:00
Jerome Brunet
5003d0ce5c
ASoC: meson: axg-fifo: fix irq scheduling issue with PREEMPT_RT
With PREEMPT_RT enabled a spinlock_t becomes a sleeping lock.

This is usually not a problem with spinlocks used in IRQ context since
IRQ handlers get threaded. However, if IRQF_ONESHOT is set, the primary
handler won't be force-threaded and runs always in hardirq context. This is
a problem because spinlock_t requires a preemptible context on PREEMPT_RT.

In this particular instance, regmap mmio uses spinlock_t to protect the
register access and IRQF_ONESHOT is set on the IRQ. In this case, it is
actually better to do everything in threaded handler and it solves the
problem with PREEMPT_RT.

Reported-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Closes: https://lore.kernel.org/linux-amlogic/20240729131652.3012327-1-avkrasnov@salutedevices.com
Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Fixes: b11d26660d ("ASoC: meson: axg-fifo: use threaded irq to check periods")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20240807162705.4024136-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 20:34:55 +01:00
Takashi Iwai
6675e76a5c
ASoC: amd: yc: Add quirk entry for OMEN by HP Gaming Laptop 16-n0xxx
Fix the missing mic on OMEN by HP Gaming Laptop 16-n0xxx by adding the
quirk entry with the board ID 8A44.

Cc: stable@vger.kernel.org
Link: https://bugzilla.suse.com/show_bug.cgi?id=1227182
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807170249.16490-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 20:34:50 +01:00
Zhang Yi
4684a2df9c
ASoC: codecs: ES8326: button detect issue
We find that we need to set snd_jack_types to 0. If not,
there will be a probability of button detection errors

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240807025356.24904-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 20:34:49 +01:00
Krzysztof Stępniak
23a58b782f
ASoC: amd: yc: Support mic on Lenovo Thinkpad E14 Gen 6
Lenovo Thinkpad E14 Gen 6 (model type 21M3)
needs a quirk entry for internal mic to work.

Signed-off-by: Krzysztof Stępniak <kfs.szk@gmail.com>
Link: https://patch.msgid.link/20240807001219.1147-1-kfs.szk@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 20:34:48 +01:00
Takashi Iwai
c46fc83e3f ALSA: vxpocket: Fix a typo at conversion to dev_*()
There was a typo in the previous conversion to dev_*() that caused a
build error.  Fix it.

Fixes: 2acbb5e572 ("ALSA: vxpocket: Use standard print API")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408090110.t0mWbTyh-lkp@intel.com/
Link: https://patch.msgid.link/20240808182308.28418-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 20:23:41 +02:00
Jerome Brunet
e95b9f7f2e ALSA: snd-usb-caiaq: use snd_pcm_rate_to_rate_bit
Use snd_pcm_rate_to_rate_bit() helper provided by Alsa instead
re-implementing it. This reduce code duplication and helps when
changing some Alsa definition is necessary.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20240808134857.86749-1-jbrunet@baylibre.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 18:32:56 +02:00
Takashi Iwai
a1066453b5 ALSA: control: Fix power_ref lock order for compat code, too
In the previous change for swapping the power_ref and controls_rwsem
lock order, the code path for the compat layer was forgotten.
This patch covers the remaining code.

Fixes: fcc62b1910 ("ALSA: control: Take power_ref lock primarily")
Link: https://patch.msgid.link/20240808163128.20383-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 18:31:54 +02:00
Takashi Iwai
c37f7cd7e5 ALSA: vxpocket: Drop no longer existent chip->dev assignment
The recent cleanup change for vx_core overlooked the code in vxpocket
pcmcia driver.  Kill the superfluous line as well.

Fixes: b426b3ba9f ("ALSA: vx_core: Drop unused dev field")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408090016.kW0TA6fc-lkp@intel.com/
Link: https://patch.msgid.link/20240808162902.20082-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 18:29:34 +02:00
Takashi Iwai
9b88d0890e ALSA: usb-audio: Check shutdown at endpoint_set_interface()
The call of usb_set_interface() and a delay are superfluous when the
device has been already disconnected.  Add a disconnection check
before doing it.

Link: https://patch.msgid.link/20240808091522.31415-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 11:16:15 +02:00
Takashi Iwai
c01f381545 ALSA: hdsp: Break infinite MIDI input flush loop
The current MIDI input flush on HDSP and HDSPM drivers relies on the
hardware reporting the right value.  If the hardware doesn't give the
proper value but returns -1, it may be stuck at an infinite loop.

Add a counter and break if the loop is unexpectedly too long.

Link: https://patch.msgid.link/20240808091513.31380-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 11:16:06 +02:00
Takashi Iwai
7b986c7430 ALSA: asihpi: Fix potential OOB array access
ASIHPI driver stores some values in the static array upon a response
from the driver, and its index depends on the firmware.  We shouldn't
trust it blindly.

This patch adds a sanity check of the array index to fit in the array
size.

Link: https://patch.msgid.link/20240808091454.30846-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 11:15:55 +02:00
Takashi Iwai
03898691d4 ALSA: usb-audio: Re-add ScratchAmp quirk entries
At the code refactoring of USB-audio quirk handling, I assumed that
the quirk entries of Stanton ScratchAmp devices were only about the
device name, and moved them completely into the rename table.
But it seems that the device requires the quirk entry so that it's
probed by the driver itself.

This re-adds back the quirk entries of ScratchAmp, but in a
minimalistic manner.

Fixes: 5436f59bc5 ("ALSA: usb-audio: Move device rename and profile quirks to an internal table")
Link: https://patch.msgid.link/20240808081803.22300-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-08 10:34:49 +02:00
Vijendar Mukunda
001f8443d4
ASoC: SOF: amd: update conditional check for cache register update
Instead of desc->rev, use acp pci revision id(pci_rev) for cache register
conditional check.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.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/20240807051341.1616925-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 09:17:17 +01:00
Gustavo A. R. Silva
5dde0cd243
ASoC: SOF: sof-audio: Avoid -Wflex-array-member-not-at-end warnings
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Move the conflicting declaration to the end of the structure. Notice
that `struct snd_sof_pcm` ends in a flexible-array member through
`struct snd_soc_tplg_pcm` -> `struct snd_soc_tplg_private`.

Whith this, fix the following warnings:
sound/soc/sof/sof-audio.h:350:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
./include/trace/events/../../../sound/soc/sof/sof-audio.h:350:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
sound/soc/amd/../sof/amd/../sof-audio.h:350:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
sound/soc/sof/amd/../sof-audio.h:350:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
sound/soc/sof/intel/../sof-audio.h:350:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
sound/soc/sof/mediatek/mt8186/../../sof-audio.h:350:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
sound/soc/sof/mediatek/mt8195/../../sof-audio.h:350:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://patch.msgid.link/ZrDvt6eyeFyajq6l@cute
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 09:17:16 +01:00
Vijendar Mukunda
c35fad6f7e
ASoC: amd: acp: add ZSC control register programming sequence
Add ZSC Control register programming sequence for ACP D0 and D3 state
transitions for ACP7.0 onwards. This will allow ACP to enter low power
state when ACP enters D3 state. When ACP enters D0 State, ZSC control
should be disabled.

Tested-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240807085154.1987681-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 09:17:15 +01:00
Vijendar Mukunda
20288905e1
ASoC: amd: acp: remove MODULE_ALIAS for SoundWire machine driver
As module device table added for AMD SoundWire machine driver MODULE_ALIAS
is not required. Remove MODULE_ALIAS for AMD SoundWire machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240807050846.1616725-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 09:17:15 +01:00
Zhang Yi
be942e3d20
ASoC: codecs: ES8326: input issue after init
We found an input issue after initiation.So we added the default
input source at initiation.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240807025356.24904-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 09:17:14 +01:00
Simon Trimmer
7063a71083
ASoC: cs35l56: Use regmap_read_bypassed() to wake the device
Now that regmap_read_bypassed() has been added to the kernel it is
preferable to wake the device with a read rather than a write as the
utility function can be called at a time before the device has been
identified.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/20240807142715.47077-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08 09:17:13 +01:00
Mark Brown
1a4f796501
ASoC: Merge fixes
So we can apply AMD patches that rely on them.
2024-08-08 09:14:57 +01:00
Takashi Iwai
504dc9f5e6 ALSA: core: Drop snd_print stuff and co
Now that all users of snd_print*() are gone, let's drop the functions
completely.  This also makes CONFIG_SND_VERBOSE_PRINTK redundant, and
it's dropped, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-55-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
7f5485c4d3 ALSA: asihpi: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The debug prints with a special macro snd_printddd() are replaced with
the conditional pr_debug().  Unfortunately dev_dbg() can't be applied
well due to the lack of the reference to the device pointer.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-53-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
d41abde894 ALSA: sparc: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-52-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
7e88541f00 ALSA: sh: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-51-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
76a6ef90d5 ALSA: ppc: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-50-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
7ba0212231 ALSA: pdaudiocf: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-49-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
2acbb5e572 ALSA: vxpocket: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-48-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
c7e58049a2 ALSA: intel8x0: Drop unused snd_printd() calls
There are commented out debug prints, which are utterly superfluous.
Let's drop them.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-47-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
df04b43fee ALSA: usb-audio: Use standard print API
Use pr_*() instead of open-coded printk() for code simplicity.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-46-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
f8466d91f3 ALSA: usx2y: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Some superfluous debug prints are dropped, and some ambiguous messages
are slightly rephrased.  The sk.dev pointer is set properly for
allowing to call dev_*() functions, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-45-tiwai@suse.de
2024-08-08 07:49:47 +02:00
Takashi Iwai
fea1510719 ALSA: emux: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Some functions are changed to receive snd_card object for calling
dev_*() functions, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-44-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
def358f9ba ALSA: trident: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-43-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
1b28f418e7 ALSA: emu10k1: Use dev_warn()
Replace an open-coded printk warning with dev_warn() for code
simplicity and consistency.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-42-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
594508d5f3 ALSA: azt3328: Use pr_warn()
Replace with the standard print API from the home-baked one.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-41-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
8455587c89 ALSA: lx6464es: Cleanup the print API usages
Use pr_debug() instead of open-coded printk().
Also drop a few snd_printdd() calls that can be better done via
ftrace.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-40-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
adf72c3648 ALSA: korg1212: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-39-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
8aee49444f ALSA: riptide: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The device pointer is stored in struct cmdif for calling dev_*()
functions.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-38-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
661c43fcdf ALSA: wss: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-37-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
8b4ac54299 ALSA: wavefront: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-36-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
610f04ca71 ALSA: sscape: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The device pointer is stored in struct soundscape for calling
dev_*().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-35-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
e7c475b920 ALSA: sc6000: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Some functions are changed to receive a device pointer to be passed to
dev_*() calls.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-34-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
55c531bd81 ALSA: pcm: oss: Use pr_debug()
Use the standard print API instead of open-coded printk().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-33-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
56887daf2f ALSA: control_led: Use dev_err()
Use the standard print API instead of open-coded printk().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-32-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
b8986876e7 ALSA: sb: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Some functions are changed to receive snd_card pointer for referring
to the device pointer for dev_*() calls, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-31-tiwai@suse.de
2024-08-08 07:49:46 +02:00
Takashi Iwai
40b15de3c4 ALSA: opti9xx: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The card pointer is stored in struct snd_opti9xx and snd_miro to be
referred for dev_*() calls.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-30-tiwai@suse.de
2024-08-08 07:49:45 +02:00
Takashi Iwai
764a55bb8d ALSA: opl3sa2: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The card pointer is stored in struct snd_opl3sa2 to be referred for
dev_*() calls.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-29-tiwai@suse.de
2024-08-08 07:49:45 +02:00
Takashi Iwai
b48601834d ALSA: msnd: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-28-tiwai@suse.de
2024-08-08 07:49:41 +02:00
Takashi Iwai
a6676811de ALSA: gus: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Some commented-out debug prints and dead code are dropped as well.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-27-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
12174dfee0 ALSA: es18xx: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

For referring to the device, introduce snd_card pointer to struct
snd_es18xx.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-26-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
7f7eff209e ALSA: es1688: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

For referring to the device, introduce snd_card pointer to struct
snd_es1688.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-25-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
257d0c813b ALSA: cs4236: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-24-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
6aa5cb8540 ALSA: cmi8330: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-23-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
09d1e9b4c1 ALSA: cmi8328: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-22-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
80134f1bc7 ALSA: azt2320: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-21-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
2508acd403 ALSA: als100: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Use the standard print API instead of open-coded printk().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-20-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
20869176d7 ALSA: ad1816a: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-19-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
ae1873eeb8 ALSA: i2c: Drop commented old debug prints
There are quite a few commented-out debug prints that have never been
used in the production code.  Let's rip them off for code cleanness.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-18-tiwai@suse.de
2024-08-08 07:47:24 +02:00
Takashi Iwai
1ac6352e50 ALSA: i2c: pt2258: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-17-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
e71391ba94 ALSA: i2c: cs8427: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-16-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
9cbe416b93 ALSA: pcsp: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-15-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
650dcf25e1 ALSA: dummy: Use standard print API
Use pr_*() macro instead of open-coded printk() just for code
simplification.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-14-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
ca2f73ffaa ALSA: aloop: Use standard print API
Use pr_err() instead of open-coded printk() just for code
simplification.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-13-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
41abc8056d ALSA: vx_core: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The commented old debug prints are dropped, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-12-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
b426b3ba9f ALSA: vx_core: Drop unused dev field
The vx_core.dev field has never been set but referred incorrectly at
firmware loading.  Pass the proper device pointer from card->dev at
request_firmware(), and drop the unused dev field from vx_core, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-11-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
b5557ef985 ALSA: virmidi: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-10-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
4d82bf10d1 ALSA: serial-u16550: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-9-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
7debf0350e ALSA: opl4: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-8-tiwai@suse.de
2024-08-08 07:47:23 +02:00
Takashi Iwai
a2fa882d6d ALSA: opl3: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Some debug prints are cleaned up with a macro, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-7-tiwai@suse.de
2024-08-08 07:47:22 +02:00
Takashi Iwai
1e594f9a7b ALSA: mtpav: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The commented-out debug prints got removed, too.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-6-tiwai@suse.de
2024-08-08 07:47:22 +02:00
Takashi Iwai
1fa884ebeb ALSA: mpu401_uart: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

The assignment of mpu->rmidi was moved to an earlier place, so that
dev_*() can access to the proper device pointer.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-5-tiwai@suse.de
2024-08-08 07:47:22 +02:00
Takashi Iwai
2bddeda8ac ALSA: mpu401: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-4-tiwai@suse.de
2024-08-08 07:47:22 +02:00
Takashi Iwai
f7d4adacc5 ALSA: mts64: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-3-tiwai@suse.de
2024-08-08 07:47:22 +02:00
Takashi Iwai
94cd66f8dc ALSA: portman2x4: Use standard print API
Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-2-tiwai@suse.de
2024-08-08 07:47:22 +02:00
Linus Walleij
caab9a1cbb
ASoC: tas*: Drop unused GPIO includes
These drivers all use <linux/gpio/consumer.h> and has no business
including the legacy headers <linux/gpio.h> or <linux/of_gpio.h>.
Drop the surplus includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20240807-asoc-tas-gpios-v2-3-bd0f2705d58b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07 23:45:17 +01:00
Linus Walleij
1c4b509eda
ASoC: tas2781-i2c: Get the right GPIO line
The code is obtaining a GPIO reset using the reset GPIO
name "reset-gpios", but the gpiolib is already adding the
suffix "-gpios" to anything passed to this function and
will be looking for "reset-gpios-gpios" which is most
certainly not what the author desired.

Fix it up.

Fixes: ef3bcde75d ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20240807-asoc-tas-gpios-v2-2-bd0f2705d58b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07 23:45:16 +01:00
Linus Walleij
c2c0b67dca
ASoC: tas2781-i2c: Drop weird GPIO code
The tas2781-i2c driver gets an IRQ from either ACPI or device tree,
then proceeds to check if the IRQ has a corresponding GPIO and in
case it does enforce the GPIO as input and set a label on it.

This is abuse of the API:

- First we cannot guarantee that the numberspaces of the GPIOs and
  the IRQs are the same, i.e that an IRQ number corresponds to
  a GPIO number like that.

- Second, GPIO chips and IRQ chips should be treated as orthogonal
  APIs, the irqchip needs to ascertain that the backing GPIO line
  is set to input etc just using the irqchip.

- Third it is using the legacy <linux/gpio.h> API which should not
  be used in new code yet this was added just a year ago.

Delete the offending code.

If this creates problems the GPIO and irqchip maintainers can help
to fix the issues.

It *should* not create any problems, because the irq isn't
used anywhere in the driver, it's just obtained and then
left unused.

Fixes: ef3bcde75d ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20240807-asoc-tas-gpios-v2-1-bd0f2705d58b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07 23:45:16 +01:00
Dmitry Baryshkov
a9a7a2d807
ASoC: codecs: lpass-va-macro: warn on unknown version
Warn the users if the driver doesn't know the codec version. This helps
in debugging the issues with other codec not detecting the correct
version.

va_macro 3370000.codec: Unknown VA Codec version, ID: 00 / 0f / 00

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240803-codec-version-v1-2-bc29baa5e417@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07 23:44:54 +01:00
Dmitry Baryshkov
49f6202ce9
ASoC: codecs: lpass-macro: fix version strings returned for 1.x codecs
Add missing cases to lpass_macro_get_codec_version_string() to let it
print the correct codec version for 1.x codec platforms.

Fixes: 378918d591 ("ASoC: codecs: lpass-macro: add helpers to get codec version")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240803-codec-version-v1-1-bc29baa5e417@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07 23:44:53 +01:00
Takashi Iwai
b977831342 ALSA: seq: Fix missing seq port info bit return for MIDI 1.0 block
The recent extension added a new ALSA sequencer port info flag bit
SNDRV_SEQ_PORT_FLG_IS_MIDI1, but it's not reported back when
inquired.  Fix it to report properly.

Fixes: 0079c9d1e5 ("ALSA: ump: Handle MIDI 1.0 Function Block in MIDI 2.0 protocol")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807092303.1935-7-tiwai@suse.de
2024-08-07 11:31:38 +02:00
Takashi Iwai
8e3f30b8dc ALSA: seq: Print MIDI 1.0 specific port in proc output
When a sequencer port assigned to a UMP Group that is specific to MIDI
1.0 among MIDI 2.0 client, mark it explicitly in the proc output, so
that user can see it easily.  This is an exceptional case where the
message isn't converted to MIDI 1.0 even if the client is running in
MIDI 2.0 mode.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807092303.1935-6-tiwai@suse.de
2024-08-07 11:31:38 +02:00
Takashi Iwai
ebaa86c0bd ALSA: usb-audio: Update UMP group attributes for GTB blocks, too
When a FB is created from a GTB instead of UMP FB Info inquiry, we
missed the update of the corresponding UMP Group attributes.
Export the call of updater and let it be called from the USB driver.

Fixes: 0642a3c5ca ("ALSA: ump: Update substream name from assigned FB names")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807092303.1935-5-tiwai@suse.de
2024-08-07 11:31:38 +02:00
Takashi Iwai
ac3a9185bd ALSA: usb-audio: Set MIDI1 flag appropriately for GTB MIDI 1.0 entry
When a MIDI 1.0 protocol is specified in a GTB entry while others are
set in MIDI 2.0, it should be seen as a legacy MIDI 1.0 port.  Since
recently we allow drivers to set a flag SNDRV_UMP_BLOCK_IS_MIDI1 to a
FB for that purpose.  This patch tries to set that flag when the
device shows such a configuration.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807092303.1935-4-tiwai@suse.de
2024-08-07 11:31:37 +02:00
Takashi Iwai
b28654233f ALSA: usb-audio: Accept multiple protocols in GTBs
It's valid to give different protocols via multiple GTBs; e.g. a MIDI
1.0 port is embedded in a MIDI 2.0 device that talks with MIDI 2.0
protocol.  However, the current driver implementation assumes only a
single protocol over the whole Endpoint, and it can't handle such a
scenario.

This patch changes the driver's behavior to parse GTBs to accept
multiple protocols.  Instead of switching to the last given protocol,
it adds the protocol capability bits now.  Meanwhile, the default
protocol is chosen by the first given protocol in GTBs.

Practically seen, this should be a minor issue, as new devices should
specify the protocols properly via UMP Endpoint Info messages, so this
is rather just covering a corner case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807092303.1935-3-tiwai@suse.de
2024-08-07 11:31:37 +02:00
Takashi Iwai
08713dcc49 ALSA: ump: Choose the protocol when protocol caps are changed
When the protocol capability bits are changed via Endpoint Info update
notification, we should check the validity of the current protocol and
reset it if needed, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807092303.1935-2-tiwai@suse.de
2024-08-07 11:31:37 +02:00
Dustin L. Howett
eb91c456f3 ALSA: hda/realtek: Add Framework Laptop 13 (Intel Core Ultra) to quirks
The Framework Laptop 13 (Intel Core Ultra) has an ALC285 that ships in a
similar configuration to the ALC295 in previous models. It requires the
same quirk for headset detection.

Signed-off-by: Dustin L. Howett <dustin@howett.net>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240806-alsa-hda-realtek-add-framework-laptop-13-intel-core-ultra-to-quirks-v1-1-42d6ce2dbf14@howett.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-07 08:28:13 +02:00
Takashi Iwai
901e85677e ALSA: usb-audio: Add input value sanity checks for standard types
For an invalid input value that is out of the given range, currently
USB-audio driver corrects the value silently and accepts without
errors.  This is no wrong behavior, per se, but the recent kselftest
rather wants to have an error in such a case, hence a different
behavior is expected now.

This patch adds a sanity check at each control put for the standard
mixer types and returns an error if an invalid value is given.

Note that this covers only the standard mixer types.  The mixer quirks
that have own control callbacks would need different coverage.

Link: https://patch.msgid.link/20240806124651.28203-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-06 18:27:08 +02:00
Kuninori Morimoto
7d2fb3812a
ASoC: remove bespoke trigger support
Bespoke trigger support was added when Linux v3.5 by this patch.

	commit 07bf84aaf7
	("ASoC: dpcm: Add bespoke trigger()")

test-component driver is using it, but this is because it indicates used
function for debug/trace purpose. Except test-component driver, bespoke
trigger has never been used over 10 years in upstream.

We can re-support it if needed in the future, but let's remove it for now,
because it just noise in upstream.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v80ewmdi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-06 13:56:21 +01:00
Mark Brown
a44b7b57ef
ASoC: Extend wm_adsp so cs35l56 can suppress controls
Merge series from Simon Trimmer <simont@opensource.cirrus.com>:

This pair of patches extend wm_adsp to add a callback that can be used
to control whether ALSA controls are added and then tweak cs35l56 to use
it to suppress controls made from firmware coefficients.
2024-08-06 13:42:45 +01:00
Takashi Iwai
176fd1511d ALSA: hda/hdmi: Yet more pin fix for HP EliteDesk 800 G4
HP EliteDesk 800 G4 (PCI SSID 103c:83e2) is another Kabylake machine
where BIOS misses the HDMI pin initializations.  Add the quirk entry.

Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240806064918.11132-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-06 09:02:00 +02:00
Takashi Iwai
0079c9d1e5 ALSA: ump: Handle MIDI 1.0 Function Block in MIDI 2.0 protocol
The UMP v1.1 spec says in the section 6.2.1:
"If a UMP Endpoint declares MIDI 2.0 Protocol but a Function Block
represents a MIDI 1.0 connection, then may optionally be used for
messages to/from that Function Block."

It implies that the driver can (and should) keep MIDI 1.0 CVM
exceptionally for those FBs even if UMP Endpoint is running in MIDI
2.0 protocol, and the current driver lacks of it.

This patch extends the sequencer port info to indicate a MIDI 1.0
port, and tries to send/receive MIDI 1.0 CVM as is when this port is
the source or sink.  The sequencer port flag is set by the driver at
parsing FBs and GTBs although application can set it to its own
user-space clients, too.

Link: https://patch.msgid.link/20240806070024.14301-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-06 09:01:23 +02:00
Steven 'Steve' Kendall
7e1e206b99 ALSA: hda: Add HP MP9 G4 Retail System AMS to force connect list
In recent HP UEFI firmware (likely v2.15 and above, tested on 2.27),
these pins are incorrectly set for HDMI/DP audio. Tested on
HP MP9 G4 Retail System AMS. Tested audio with two monitors connected
via DisplayPort.

Link: https://forum.manjaro.org/t/intel-cannon-lake-pch-cavs-conexant-cx20632-no-sound-at-hdmi-or-displayport/133494
Link: https://bbs.archlinux.org/viewtopic.php?id=270523
Signed-off-by: Steven 'Steve' Kendall <skend@chromium.org>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240806-hdmi-audio-hp-wrongpins-v2-1-d9eb4ad41043@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-06 08:46:30 +02:00
Richard Fitzgerald
e42066df07
ASoC: cs35l56: Handle OTP read latency over SoundWire
Use the late-read buffer in the CS35L56 SoundWire interface to
read OTP memory.

The OTP memory has a longer access latency than chip registers
and cannot guarantee to return the data value in the SoundWire
control response if the bus clock is >4.8 MHz. The Cirrus
SoundWire peripheral IP exposes the bridge-to-bus read buffer
and status bits. For a read from OTP the bridge status bits are
polled to wait for the OTP data to be loaded into the read buffer
and the data is then read from there.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: e1830f66f6 ("ASoC: cs35l56: Add helper functions for amp calibration")
Link: https://patch.msgid.link/20240805140839.26042-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05 18:26:29 +01:00
Johan Hovold
9a1af1e218
ASoC: codecs: lpass-macro: fix missing codec version
Recent changes that started checking the codec version broke audio on
the Lenovo ThinkPad X13s:

	wsa_macro 3240000.codec: Unsupported Codec version (0)
	wsa_macro 3240000.codec: probe with driver wsa_macro failed with error -22
	rx_macro 3200000.rxmacro: Unsupported Codec version (0)
	rx_macro 3200000.rxmacro: probe with driver rx_macro failed with error -22

Add the missing codec version to the lookup table so that the codec
drivers probe successfully.

Note that I'm just assuming that this is a 2.0 codec based on the fact
that this device uses the older register layout.

Fixes: 378918d591 ("ASoC: codecs: lpass-macro: add helpers to get codec version")
Fixes: dbacef0589 ("ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions")
Fixes: 727de4fbc5 ("ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240729131351.27886-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05 18:26:28 +01:00
Takashi Iwai
15b7a03205 ALSA: line6: Fix racy access to midibuf
There can be concurrent accesses to line6 midibuf from both the URB
completion callback and the rawmidi API access.  This could be a cause
of KMSAN warning triggered by syzkaller below (so put as reported-by
here).

This patch protects the midibuf call of the former code path with a
spinlock for avoiding the possible races.

Reported-by: syzbot+78eccfb8b3c9a85fc6c5@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/00000000000000949c061df288c5@google.com
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240805130129.10872-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-05 15:03:03 +02:00
Richard Fitzgerald
dc268085e4
ASoC: cs-amp-lib: Fix NULL pointer crash if efi.get_variable is NULL
Call efi_rt_services_supported() to check that efi.get_variable exists
before calling it.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 1cad8725f2 ("ASoC: cs-amp-lib: Add helpers for factory calibration data")
Link: https://patch.msgid.link/20240805114222.15722-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05 13:54:09 +01:00
Simon Trimmer
2c3640b822
ASoC: cs35l56: Stop creating ALSA controls for firmware coefficients
A number of laptops have gone to market with old firmware versions that
export controls that have since been hidden, but we can't just install a
newer firmware because the firmware for each product is customized and
qualified by the OEM. The issue is that alsactl save and restore has no
idea what controls are good to persist which can lead to
misconfiguration.

There is no reason that the UCM or user should need to interact with any
of the ALSA controls for the firmware coefficients so they can be
removed entirely.

Fixes: e496112529 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/20240805102721.30102-3-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05 13:53:50 +01:00
Simon Trimmer
45b4acab4c
ASoC: wm_adsp: Add control_add callback and export wm_adsp_control_add()
The callback allows codec drivers to affect how firmware coefficients
are added as controls.

For example a codec driver may selectively add controls by choosing to
call wm_adsp_control_add() based on some filter logic.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/20240805102721.30102-2-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05 13:53:49 +01:00
Stefan Binding
312c04cee4 ALSA: hda: cs35l41: Stop creating ALSA Controls for firmware coefficients
When the CS35L41 loads its firmware, it has a number of controls to
affect its behaviour. Currently, these controls are exposed as ALSA
Controls.

These controls were never intended to be exposed to users but the
firmware doesn't mark them hidden, so make the driver ignore them.

Any changes in the coefficients handled by these controls needs to
be matched to the individual system by SSID, which is already handled
using the tuning file, when firmware is loaded, so UCM should not be
setting these controls anyway.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://patch.msgid.link/20240801155047.456540-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-05 09:49:37 +02:00
Simon Trimmer
34e1b1bb73 ALSA: hda: cs35l56: Stop creating ALSA controls for firmware coefficients
A number of laptops have gone to market with old firmware versions that
export controls that have since been hidden, but we can't just install a
newer firmware because the firmware for each product is customized and
qualified by the OEM. The issue is that alsactl save and restore has no
idea what controls are good to persist which can lead to
misconfiguration.

There is no reason that the UCM or user should need to interact with any
of the ALSA controls for the firmware coefficients so they can be
removed entirely, this also simplifies the driver.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/20240801143139.34549-1-simont@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-05 09:49:03 +02:00
Mark Brown
cf410c1bea
ASoC/SOF/PCI/Intel: add PantherLake support
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Add initial support for the PantherLake platform, and initial ACPI
configurations.
2024-08-02 22:26:55 +01:00
Mark Brown
218c900785
ASoC: SOF: reshuffle and optimize structures
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

pahole reports a number of sub-optimal structure definitions with
holes and cache-line alignment problems, this patchset optimizes a
couple of structure frequently used.

No functionality change, only re-ordering of structure members.
2024-08-02 22:26:47 +01:00
Christophe JAILLET
839e231a53
ASoC: cs43130: Constify snd_soc_component_driver struct
In order to constify `snd_soc_component_driver` struct, duplicate
`soc_component_dev_cs43130` into a `soc_component_dev_cs43130_digital` and
`soc_component_dev_cs43130_analog`.

These 2 new structures share the same .dapm_widgets and .dapm_routes
arrays but differ for .num_dapm_widgets and .num_dapm_routes.

In the digital case, the last entries are not taken into account.

Doing so has several advantages:
  - `snd_soc_component_driver` can be declared as const to move their
    declarations to read-only sections.
  - code in the probe is simpler. There is no need to concatenate some
    arrays to handle the "analog" case
  - this saves some memory because all_hp_widgets and analog_hp_routes can
    be removed.

Before :
======
   text	   data	    bss	    dec	    hex	filename
  53965	   8265	   4512	  66742	  104b6	sound/soc/codecs/cs43130.o

After :
=====
   text	   data	    bss	    dec	    hex	filename
  54409	   7881	     64	  62354	   f392	sound/soc/codecs/cs43130.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/1f04bb0366d9640d7ee361dae114ff79e4b381c1.1722274212.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 19:21:24 +01:00
Linus Torvalds
6b779f8a86 sound fixes for 6.11-rc2
A small collection of fixes:
 - Revert of FireWire changes that caused a long-time regression
 - Another long-time regression fix for AMD HDMI
 - MIDI2 UMP fixes
 - HD-audio Conexant codec fixes and a qurik
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmaslGMOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8cXw/+MXYSGLdac8hALz3hxYBqVDo1Lr4NBJar6d8/
 1sngToZa3hb74uwvRctJ/+7bMV6/kIh76cwk+rM8PNSVtidivuTzlcASg8k1DMDq
 Zqxtba7UE8iC94BInu+GyVRlvYqQ41EwrFNu89oldlffYg+WInLVUe/genMf6NjT
 PycaFnxsmW1XTBXFqAEJqjNI9VkCyG3/6veOOtKJRPM+yTwjdH2tXGrgdXtVG47e
 lI10CxT6BFdBG7pmqVejOAMXVSJFKfGpLoyzlIiMr3NR4/qNhzMcQ092qX25CkHu
 37MzVXuxlHZFAlk9S28P+ReLRiTc2SdTGDA3zCnkex9kMOF9P8LbMN5gmY7m/6pa
 Wpq3U5sO/S9peaBtuR1ryGTqkt0jG9aXbRYVuaFMGQu8BVaERj6KEOoYcAeWGxiZ
 cZHhg4YDqgBExDhU2fPoLwTu1fRlm0RYwW+aiuaXIOXezPfph1M/pTnZR0FhDtd0
 BzCSLSaDPV/mWQM8ql8QzHjkHdb3SLhaGiBlQC0U9X5DA1J2KTtpXibG9+tzPQGx
 7naXLqswq33gLvWW1SpzhGPODBPRrddFsTRBrg2TlX6cywVmB/ylAl1f6EeZiKyA
 UWG5lMmXfB4jyDqUJC0mlVl/DQcsRsaChh+NdLeubfaGn8OBPEIDzzHM7GDjPHTQ
 CXTIxzI=
 =tMqd
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A small collection of fixes:

   - Revert of FireWire changes that caused a long-time regression

   - Another long-time regression fix for AMD HDMI

   - MIDI2 UMP fixes

   - HD-audio Conexant codec fixes and a quirk"

* tag 'sound-6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda: Conditionally use snooping for AMD HDMI
  ALSA: usb-audio: Correct surround channels in UAC1 channel map
  ALSA: seq: ump: Explicitly reset RPN with Null RPN
  ALSA: seq: ump: Transmit RPN/NRPN message at each MSB/LSB data reception
  ALSA: seq: ump: Use the common RPN/bank conversion context
  ALSA: ump: Explicitly reset RPN with Null RPN
  ALSA: ump: Transmit RPN/NRPN message at each MSB/LSB data reception
  Revert "ALSA: firewire-lib: operate for period elapse event in process context"
  Revert "ALSA: firewire-lib: obsolete workqueue for period update"
  ALSA: hda/realtek: Add quirk for Acer Aspire E5-574G
  ALSA: seq: ump: Optimize conversions from SysEx to UMP
  ALSA: hda/conexant: Mute speakers at suspend / shutdown
  ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
  ALSA: hda: conexant: Fix headset auto detect fail in the polling mode
2024-08-02 09:04:57 -07:00
Yue Haibing
a1c2716738
ASoC: fsl: lpc3xxx: Make some symbols static
These symbols are not used outside of the files, make them static to fix
sparse warnings:

sound/soc/fsl/lpc3xxx-i2s.c:261:30: warning: symbol 'lpc3xxx_i2s_dai_ops' was not declared. Should it be static?
sound/soc/fsl/lpc3xxx-i2s.c:271:27: warning: symbol 'lpc3xxx_i2s_dai_driver' was not declared. Should it be static?
sound/soc/fsl/lpc3xxx-pcm.c:55:39: warning: symbol 'lpc3xxx_soc_platform_driver' was not declared. Should it be static?

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://patch.msgid.link/20240802101044.3302251-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:05:32 +01:00
Christophe JAILLET
11c2d22371
ASoC: sti-sas: Constify snd_soc_component_driver struct
In order to constify `snd_soc_component_driver` struct, simplify the logic
and the `sti_sas_dev_data` struct.

Since commit 165a57a3df ("ASoC: sti-sas: clean legacy in sti-sas") only
only chip is supported and `sti_sas_driver` can be fully defined at
compilation time.

Before:
======
   text	   data	    bss	    dec	    hex	filename
   8033	   1547	     16	   9596	   257c	sound/soc/codecs/sti-sas.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   8257	   1163	     16	   9436	   24dc	sound/soc/codecs/sti-sas.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/2c08558813e3bbfae0a5302199cf6ca226e7cde1.1722544073.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:05:31 +01:00
Shenghao Ding
92b796845a
ASoC: tas2781: Fix a compiling warning reported by robot kernel test due to adding tas2563_dvc_table
Move tas2563_dvc_table into a separate Header file, as only tas2781
codec driver use this table, and hda side codec driver won't use it.

Fixes: 75ed63a5ab ("ASoC: tas2781: Add new Kontrol to set tas2563 digital Volume")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240802072055.1462-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:05:30 +01:00
Pierre-Louis Bossart
5821d7b498
ASoC: SOF: sof-audio.h: optimize snd_sof_pcm_stream_pipeline_list
Invert members to remove hole.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20240802124609.188954-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:05:16 +01:00
Pierre-Louis Bossart
5a4413d0fa
ASoC: SOF: sof-priv.h: optimize snd_sof_ipc_msg
Move waitq to make sure it's entirely in the same cache line, and move
ipc_complete to reduce padding.

struct snd_sof_ipc_msg {
	void *                     msg_data;             /*     0     8 */
	void *                     reply_data;           /*     8     8 */
	size_t                     msg_size;             /*    16     8 */
	size_t                     reply_size;           /*    24     8 */
	int                        reply_error;          /*    32     4 */
	bool                       ipc_complete;         /*    36     1 */

	/* XXX 3 bytes hole, try to pack */

	wait_queue_head_t          waitq;                /*    40    88 */
	/* --- cacheline 2 boundary (128 bytes) --- */
	void *                     rx_data;              /*   128     8 */

	/* size: 136, cachelines: 3, members: 8 */
	/* sum members: 133, holes: 1, sum holes: 3 */
	/* last cacheline: 8 bytes */
};

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20240802124609.188954-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:05:15 +01:00
Pierre-Louis Bossart
e9e7eeaf19
ASoC: SOF: sof-priv.h: optimize snd_sof_mailbox
Reverse the two members to remove a hole.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20240802124609.188954-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:05:14 +01:00
Pierre-Louis Bossart
cac88e96ba
ASoC: SOF: sof-priv.h: optimize snd_sof_platform_stream_params
reshuffle members to remove hole.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20240802124609.188954-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:05:13 +01:00
Bard Liao
2786d3f494
ASoC: Intel: soc-acpi-intel-ptl-match: Add rt722 support
This patch adds match table for rt722 multiple function codec on link
0 and link3.

The topology does not internally refer to link0 or link3, so we can
simplify and use the same topology file name. We do need different
tables though.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240802124011.173820-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:58 +01:00
Bard Liao
77a6869afb
ASoC: Intel: soc-acpi-intel-ptl-match: add rt711-sdca table
Add rt711-sdca on sdw link0.

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240802124011.173820-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:58 +01:00
Pierre-Louis Bossart
3f8c802777
ASoC: SOF: Intel: add initial support for PTL
Clone LNL for now.

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240802124011.173820-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:57 +01:00
Fred Oh
42b4763ab3
ASoC: SOF: Intel: add PTL specific power control register
PTL has some differences from MTL/LNL. Need to use different register
to power up.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240802124011.173820-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:56 +01:00
Pierre-Louis Bossart
6a965fbaac
ASoC: Intel: soc-acpi: add PTL match tables
For now the tables are basic for mockup devices and headset codec support

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240802124011.173820-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:55 +01:00
Charles Keepax
93afd028fb
ASoC: cs42l43: Cache shutter IRQ control pointers
The microphone/speaker privacy shutter ALSA control handlers need to
call pm_runtime_resume, since the hardware needs to be powered up to
check the hardware state of the shutter. The IRQ handler for the
shutters also needs to notify the ALSA control to inform user-space
the shutters updated. However this leads to a mutex inversion,
between the sdw_dev_lock and the controls_rwsem.

To avoid this mutex inversion cache the kctl pointers before the IRQ
handler, which avoids the need to lookup the control and take the
controls_rwsem.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20240802105734.2309788-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:41 +01:00
Charles Keepax
4791c42298
ASoC: cs35l45: Use new snd_soc_component_get_kcontrol_locked() helper
No longer any need to hard code the addition of the name prefix, use the
new helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20240802105734.2309788-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:40 +01:00
Charles Keepax
c8a132e2e0
ASoC: soc-component: Add new snd_soc_component_get_kcontrol() helpers
Add new helper functions snd_soc_component_get_kcontrol() and
snd_soc_component_get_kcontrol_locked() that returns a kcontrol
by name, but will factor in the components name_prefix, to handle
situations where multiple components are present with the same
controls.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20240802105734.2309788-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:39 +01:00
Charles Keepax
becfa08bfe
ASoC: cs42l43: Remove redundant semi-colon at end of function
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20240802105734.2309788-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02 14:04:38 +01:00
Mark Brown
9aafe1dd03
ALSA/ASoC: use snd_pcm_direction_name()
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Many drivers are selecting strings "playback" / "capture" by own
handling, but we have snd_pcm_direction_name() function for it.
This patch use it.

One note is that snd_pcm_direction_name() will select
"Playback" and "Capture", instead of "playback" / "capture".
Almost all drivers are using it as dev_dbg() or dev_err()
so no problem. But some other drivers are using it as other
purpose. It might be issue (?). For example ASoC debugfs dir name
will be changed by this patch.
2024-08-01 20:15:22 +01:00
Mark Brown
bb2bf8568a
AMD SOF based generic SoundWire machine driver
Merge series from Vijendar Mukunda <Vijendar.Mukunda@amd.com>:

This patch series majorly consists of below changes.
- Rename structures, macros and codec helper names used in Intel
SoundWire generic driver to make it generic.
- Move Intel SoundWire driver common structures, macros and codec
helper functions to common placeholder so that it can be used by
other platform machine driver.
- Refactor few SoundWire common codec helper functions.
- AMD SOF based generic SoundWire machine driver for ACP 6.3 variant.

This work started a couple of months ago to avoid duplication of code
that wasn't really Intel-specific in the "sof_sdw" machine driver.
The code went through multiple iterations, was tested for multiple weeks
and a couple of build issues reported by the Intel kbuild bots were
corrected.

This is the initial version of SoundWire machine driver for AMD
platforms. Additional code refactoring will be done in the next step on
the AMD side.

Link: https://github.com/thesofproject/linux/pull/5068
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-08-01 16:50:43 +01:00
Kuninori Morimoto
bb66013286
ASoC: soc-dapm: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87frrrk50n.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 14:54:54 +01:00
Kuninori Morimoto
ebbd6703d4
ASoC: soc-pcm: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87h6c7k50t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 14:54:53 +01:00
Kuninori Morimoto
d6db65bc62
ASoC: tegra: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ikwnk510.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 14:54:52 +01:00
Kuninori Morimoto
8156921e62
ASoC: fsl: lpc3xxx-i2s: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87jzh3k515.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 14:54:51 +01:00
Kuninori Morimoto
baa7799020
ASoC: sof: intel: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87le1jk51b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 14:54:50 +01:00
Kuninori Morimoto
cda4aa0069
ASoC: sof: pcm: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87mslzk51h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 14:54:49 +01:00
Kuninori Morimoto
7dfdcde201
ASoC: stm: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o76fk51p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 14:54:48 +01:00
Rob Herring (Arm)
69dd15a8ef
ASoC: Use of_property_read_bool()
Use of_property_read_bool() to read boolean properties rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240731191312.1710417-20-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:51:45 +01:00
Rob Herring (Arm)
a1c8929b0e
ASoC: Use of_property_present()
Use of_property_present() to test for property presence rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240731191312.1710417-19-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:51:44 +01:00
Vijendar Mukunda
cb8ea62e64
ASoC: amd/sdw_utils: add sof based soundwire generic machine driver
Add sof based Soundwire generic driver for amd platforms.
Currently support added for ACP6.3 based platforms.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-11-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:19 +01:00
Vijendar Mukunda
b7cdb4a89c
ASoC: SOF: amd: update mach params subsystem_rev variable
Add pci_rev variable in acp sof driver private data structure and assign
this value to mach_params structure subsystem_rev variable.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:18 +01:00
Vijendar Mukunda
15049b6a6c
ASoC: SOF: amd: add alternate machines for acp6.3 based platform
Add SoundWire machines as alternate machines for acp6.3 based platform.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:17 +01:00
Vijendar Mukunda
57677ccde7
ASoC: amd: acp: add soundwire machines for acp6.3 based platform
Add Soundwire machines for acp6.3 based platform.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:16 +01:00
Vijendar Mukunda
59f8b622d5
ASoC: intel/sdw_utils: refactor init_dai_link() and init_simple_dai_link()
To make it generic, refactor existing implementation for
init_dai_link() and init_simple_dai_link() as mentioned below.
- Move init_dai_link() and init_simple_dai_link() to common place holder
- Rename the functions with "asoc_sdw" as prefix.
- Pass the platform specific 'platform_component' structure and its size as
arguments for init_simple_dai_link() function and allocate one more
extra dlc for platform component.
- Pass the 'platform_component' and 'num_platforms' as arguments for
init_dai_link().

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:15 +01:00
Vijendar Mukunda
5bd414c7b8
ASoC: sdw_utils: refactor sof_sdw_card_late_probe function
Refactor sof_sdw_card_late_probe() function and derive a generic
function soc_sdw_card_late_probe() function which can be used by
SoundWire generic machine driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:14 +01:00
Vijendar Mukunda
778dcb0883
ASoC: intel/sdw_utils: move machine driver dai link helper functions
Move machine driver dai link helper functions to common place holder,
So that it can be used by other platform machine driver.
Rename these functions with "asoc_sdw" tag as a prefix.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:13 +01:00
Vijendar Mukunda
e377c94773
ASoC: intel/sdw_utils: move soundwire codec_info_list structure
SoundWire 'codec_info_list' structure is not a platform specific one.
Move codec_info_list structure to common file soc_sdw_utils.c.
Move codec helper functions which uses codec_info_list structure to common
place holder and rename the function by adding _sdw tag. This will allow
to use 'codec_info_list' structure and it's helper functions in other
platform machine driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:12 +01:00
Vijendar Mukunda
6e7af1fdf7
ASoC: intel/sdw_utils: move soundwire dai type macros
Move SoundWire dai type macros to common header file(soc_sdw_util.h).
So that these macros will be used by other platform machine driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:11 +01:00
Vijendar Mukunda
8f87e292a3
ASoC: intel/sdw_utils: move dai id common macros
Move dai id common macros from intel SoundWire generic driver to
soc_sdw_utils.h file so that it can be used by other platform machine
driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801111821.18076-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:10 +01:00
Vijendar Mukunda
051b7cb3fd
ASoC: intel/sdw_utils: move maxim codec helper functions
Move maxim codec helper functions to common place holder so that
it can be used by other platform machine driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-21-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:09 +01:00
Vijendar Mukunda
5fa46627d5
ASoC: intel/sdw_utils: move cirrus soundwire codec helper functions
To make it generic, move Cirrus Soundwire codec helper functions to
common place holder so that it can be used by other platform machine
driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-20-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:08 +01:00
Vijendar Mukunda
ccc96ae281
ASoC: intel/sdw_utils: move rtk amp codec helper functions
Move RTK amp codec helper functions related implementation to common
place holder to make it generic so that these helper functions will be
used by other platform machine driver modules.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-19-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:07 +01:00
Vijendar Mukunda
8e84fd22dc
ASoC: intel/sdw_utils: move rt700 and rt711 codec helper functions
Move RT700 and RT711 Soundwire codec helper functions to common
place holder so that it can be used by other platform machine driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-18-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:06 +01:00
Vijendar Mukunda
da5b183167
ASoC: intel/sdw_utils: move rtk jack common helper functions
Move RTK codec jack common helper functions to common place holder
(sdw_utils folder) to make it generic so that it will be used by
other platform machine driver code.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-17-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:05 +01:00
Vijendar Mukunda
139e177402
ASoC: intel/sdw_utils: move rt5682 codec helper function
Move rt5682 sdw codec helper function to common place holder to make it
generic.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-16-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:04 +01:00
Vijendar Mukunda
4f54856b4e
ASoC: intel: split soundwire machine driver private data
Split intel generic SoundWire machine driver private data into two
structures. One structure is generic one which can be used by other
platform machine driver and the other one is intel specific one.
Move generic machine driver private data to soc_sdw_utils.h.
Define a void pointer in generic machine driver private data structure
and assign the vendor specific structure in mc_probe() call.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-15-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:03 +01:00
Vijendar Mukunda
89b3456e9a
ASoC: intel/sdw_utils: move rt722 sdca helper functions
Move RT722 SDCA codec helper file to sdw_utils folder to make it generic.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-14-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:02 +01:00
Vijendar Mukunda
09c60bc9da
ASoC: intel/sdw_utils: move rt712 sdca helper functions
Move RT712 SDCA codec helper file to sdw_utils folder so that these
helper functions can be used by other platform machine drivers.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-13-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:01 +01:00
Vijendar Mukunda
a9831fd1c0
ASoC: intel/sdw_utils: move rtk dmic helper functions
Move rtk SoundWire dmic helper functions implementation to sdw_utils
folder to make it generic.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-12-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:01 +01:00
Vijendar Mukunda
4776d0c908
ASoC: intel/sdw_utils: move dmic codec helper function
Move generic dmic codec helper function implementation to
sdw_utils folder so that this function can be used by other platform
machine drivers.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-11-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:44:00 +01:00
Vijendar Mukunda
941d6933eb
ASoC: intel/sdw_utils: move soundwire machine driver helper functions
Move below Intel SoundWire machine driver helper functions to
soc_sdw_utils.c file so that it can be used by other platform machine
driver.
- asoc_sdw_is_unique_device()
- asoc_sdw_get_codec_name()

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:59 +01:00
Vijendar Mukunda
73619137c6
ASoC: intel: move soundwire machine driver common structures
Move intel generic SoundWire machine driver common structures to
soc_sdw_utils.h file. These structures will be used in other platform
SoundWire machine driver code.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:58 +01:00
Vijendar Mukunda
d39388e655
ASoC: intel/sdw-utils: move soundwire machine driver soc ops
Move Intel SoundWire generic machine driver soc ops to common place
so that it can be used by other platform machine driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:57 +01:00
Vijendar Mukunda
b1f7cbf0d5
ASoC: intel: rename ignore_pch_dmic variable name
Rename 'ignore_pch_dmic' variable name as 'ignore_internal_dmic'.
This variable will be moved to common header file and will be used by other
platform machine driver code.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:56 +01:00
Vijendar Mukunda
a2b5ec0ca5
ASoC: intel: rename maxim codec macros
Rename maxim codec part id macros.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:55 +01:00
Vijendar Mukunda
bd5838c899
ASoC: intel: rename soundwire codec helper functions
Rename SoundWire codec helper functions with "asoc_sdw" tag.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:54 +01:00
Vijendar Mukunda
96990cfeff
ASoC: intel: rename soundwire machine driver soc ops
Rename Soundwire generic machine driver soc ops with tag "asoc".

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:53 +01:00
Vijendar Mukunda
408a454ee8
ASoC: intel: rename soundwire common header macros
Rename sof quirk macros, dai type and dai link macros with "SOC_SDW" tag.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:52 +01:00
Vijendar Mukunda
6588fcc883
ASoC: intel: rename codec_info and dai_info structures names
To make it generic, rename structure 'sof_sdw_codec_info' as
'asoc_sdw_codec_info' and 'sof_sdw_dai_info' as 'asoc_sdw_dai_info'.
These structures will be moved to common header file so that it can
be used by other platform machine driver.

Link: https://github.com/thesofproject/linux/pull/5068
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:51 +01:00
Curtis Malainey
7354eb7f15
ASoC: SOF: Remove libraries from topology lookups
Default firmware shipped in open source are not licensed for 3P
libraries, therefore topologies should not reference them.

If a OS wants to use 3P (that they have licensed) then they should use
the appropriate topology override mechanisms.

Fixes: 8a7d5d85ed ("ASoC: SOF: mediatek: mt8195: Add devicetree support to select topologies")
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Cc: Wojciech Macek <wmacek@google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20240731212153.921327-1-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01 12:43:31 +01:00
Kuninori Morimoto
a48fee68a8 ALSA: pcm_timer: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plqvk51y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-01 12:50:13 +02:00
Kuninori Morimoto
e1a642aba4 ALSA: aloop: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87r0bbk528.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-01 12:50:08 +02:00
Kuninori Morimoto
fc5aeeabd2 ALSA: pci: rme9652: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ttg7k52k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-01 12:49:56 +02:00
Kuninori Morimoto
7ca1d0ed1a ALSA: pci: pcxhr: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v80nk52q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-01 12:49:50 +02:00
Takashi Iwai
e469e2045f ALSA: memalloc: Let IOMMU handle S/G primarily
The recent changes in IOMMU made the non-contiguous page allocations
as default, hence we can simply use the standard DMA allocation for
the S/G pages as well.  In this patch, we simplify the code by trying
the standard DMA allocation at first, instead of
dma_alloc_noncontiguous().

For the case without IOMMU, we still need to manage the S/G pages
manually, so we keep the same fallback routines like before.

The fallback types (SNDRV_DMA_TYPE_DEV_SG_FALLBACK & co) are dropped /
folded into SNDRV_DMA_TYPE_DEV_SG and co now.  The allocation via the
standard DMA call overrides the type accordingly, hence we don't have
to have extra fallback types any longer.  OTOH, SNDRV_DMA_TYPE_DEV_SG
is no longer an alias but became its own type back again.

Note that this patch requires another prerequisite fix for memmalloc
helper to use the DMA API for WC pages on x86.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=219087
Link: https://patch.msgid.link/20240801064808.31205-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-01 12:45:49 +02:00
Takashi Iwai
9c27301342 ALSA: memalloc: Use DMA API for x86 WC page allocations, too
The memalloc helper used a house-made code for allocation of WC pages
on x86, since the standard DMA API doesn't cover it well.  Meanwhile,
the manually allocated pages won't work together with IOMMU, resulting
in faults, so we should switch to the DMA API in that case, instead.

This patch tries to switch back to DMA API for WC pages on x86, but
with some additional tweaks that are missing.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=219087
Link: https://patch.msgid.link/20240801064808.31205-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-01 12:45:41 +02:00
Takashi Iwai
fef1ac950c ALSA: control: Fix leftover snd_power_unref()
One snd_power_unref() was forgotten and left at __snd_ctl_elem_info()
in the previous change for reorganizing the locking order.

Fixes: fcc62b1910 ("ALSA: control: Take power_ref lock primarily")
Link: https://github.com/thesofproject/linux/pull/5127
Link: https://patch.msgid.link/20240801064203.30284-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-01 08:42:42 +02:00
Takashi Iwai
478689b599 ALSA: hda: Conditionally use snooping for AMD HDMI
The recent regression report revealed that the use of WC pages for AMD
HDMI device together with AMD IOMMU leads to unexpected truncation or
noises.  The issue seems triggered by the change in the kernel core
memory allocation that enables IOMMU driver to use always S/G
buffers.  Meanwhile, the use of WC pages has been a workaround for the
similar issue with standard pages in the past.  So, now we need to
apply the workaround conditionally, namely, only when IOMMU isn't in
place.

This patch modifies the workaround code to check the DMA ops at first
and apply the snoop-off only when needed.

Fixes: f5ff79fddf ("dma-mapping: remove CONFIG_DMA_REMAP")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=219087
Link: https://patch.msgid.link/20240731170521.31714-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-31 19:05:58 +02:00
Takashi Iwai
b7b7e1ab76 ALSA: usb-audio: Correct surround channels in UAC1 channel map
USB-audio driver puts SNDRV_CHMAP_SL and _SR as left and right
surround channels for UAC1 channel map, respectively.  But they should
have been SNDRV_CHMAP_RL and _RR; the current value *_SL and _SR are
rather "side" channels, not "surround".  I guess I took those
mistakenly when I read the spec mentioning "surround left".

This patch corrects those entries to be the right channels.

Suggested-by: Sylvain BERTRAND <sylvain.bertrand@legeek.net>
Closes: https://lore.kernel.orgZ/qIyJD8lhd8hFhlC@freedom
Fixes: 04324ccc75 ("ALSA: usb-audio: add channel map support")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240731142018.24750-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-31 16:22:51 +02:00
Francesco Dolcini
9da8aa3b3c
ASoC: nau8822: Lower debug print priority
NAU8822 codec PLL parameters are not an information that the general
user should care about, this print is supposed to be used for debugging,
adjust the debug print priority accordingly.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://patch.msgid.link/20240731114828.61238-1-francesco@dolcini.it
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-31 15:03:15 +01:00
Takashi Iwai
98ea612dd1 ALSA: seq: ump: Explicitly reset RPN with Null RPN
RPN with 127:127 is treated as a Null RPN, just to reset the
parameters, and it's not translated to MIDI2.  Although the current
code can work as is in most cases, better to implement the RPN reset
explicitly for Null message.

Link: https://patch.msgid.link/20240731130528.12600-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-31 15:08:54 +02:00
Takashi Iwai
a4ff92ff0b ALSA: seq: ump: Transmit RPN/NRPN message at each MSB/LSB data reception
Just like the core UMP conversion helper, we need to deal with the
partially-filled RPN/NRPN data in the sequencer UMP converter as
well.

Link: https://patch.msgid.link/20240731130528.12600-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-31 15:08:50 +02:00
Takashi Iwai
a683030606 ALSA: seq: ump: Use the common RPN/bank conversion context
The UMP core conversion helper API already defines the context needed
to record the bank and RPN/NRPN values, and we can simply re-use the
same struct instead of re-defining the same content as a different
name.

Link: https://patch.msgid.link/20240731130528.12600-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-31 15:08:45 +02:00
Takashi Iwai
50a6dd19dc ALSA: ump: Explicitly reset RPN with Null RPN
RPN with 127:127 is treated as a Null RPN, just to reset the
parameters, and it's not translated to MIDI2.  Although the current
code can work as is in most cases, better to implement the RPN reset
explicitly for Null message.

Link: https://patch.msgid.link/20240731130528.12600-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-31 15:08:39 +02:00
Takashi Iwai
e6ce8a28c7 ALSA: ump: Transmit RPN/NRPN message at each MSB/LSB data reception
The UMP 1.1 spec says that an RPN/NRPN should be sent when one of the
following occurs:
* a CC 38 is received
* a subsequent CC 6 is received
* a CC 98, 99, 100, and 101 is received, indicating the last RPN/NRPN
  message has ended and a new one has started

That said, we should send a partial data even if it's not fully
filled.  Let's change the UMP conversion helper code to follow that
rule.

Link: https://patch.msgid.link/20240731130528.12600-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-31 15:08:18 +02:00
Yue Haibing
d5742b5d4d
ASoC: fsl: lpc3xxx-i2s: Remove set but not used variable 'savedbitclkrate'
The variable savedbitclkrate is assigned and never used, so can be removed.

sound/soc/fsl/lpc3xxx-i2s.c:42:13: warning: variable ‘savedbitclkrate’ set but not used [-Wunused-but-set-variable]

Fixes: 0959de657a ("ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs")
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://patch.msgid.link/20240731022949.135016-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-31 12:50:44 +01:00
Edmund Raile
3dab73ab92 Revert "ALSA: firewire-lib: operate for period elapse event in process context"
Commit 7ba5ca32fe ("ALSA: firewire-lib: operate for period elapse event
in process context") removed the process context workqueue from
amdtp_domain_stream_pcm_pointer() and update_pcm_pointers() to remove
its overhead.

With RME Fireface 800, this lead to a regression since
Kernels 5.14.0, causing an AB/BA deadlock competition for the
substream lock with eventual system freeze under ALSA operation:

thread 0:
    * (lock A) acquire substream lock by
	snd_pcm_stream_lock_irq() in
	snd_pcm_status64()
    * (lock B) wait for tasklet to finish by calling
    	tasklet_unlock_spin_wait() in
	tasklet_disable_in_atomic() in
	ohci_flush_iso_completions() of ohci.c

thread 1:
    * (lock B) enter tasklet
    * (lock A) attempt to acquire substream lock,
    	waiting for it to be released:
	snd_pcm_stream_lock_irqsave() in
    	snd_pcm_period_elapsed() in
	update_pcm_pointers() in
	process_ctx_payloads() in
	process_rx_packets() of amdtp-stream.c

? tasklet_unlock_spin_wait
 </NMI>
 <TASK>
ohci_flush_iso_completions firewire_ohci
amdtp_domain_stream_pcm_pointer snd_firewire_lib
snd_pcm_update_hw_ptr0 snd_pcm
snd_pcm_status64 snd_pcm

? native_queued_spin_lock_slowpath
 </NMI>
 <IRQ>
_raw_spin_lock_irqsave
snd_pcm_period_elapsed snd_pcm
process_rx_packets snd_firewire_lib
irq_target_callback snd_firewire_lib
handle_it_packet firewire_ohci
context_tasklet firewire_ohci

Restore the process context work queue to prevent deadlock
AB/BA deadlock competition for ALSA substream lock of
snd_pcm_stream_lock_irq() in snd_pcm_status64()
and snd_pcm_stream_lock_irqsave() in snd_pcm_period_elapsed().

revert commit 7ba5ca32fe ("ALSA: firewire-lib: operate for period
elapse event in process context")

Replace inline description to prevent future deadlock.

Cc: stable@vger.kernel.org
Fixes: 7ba5ca32fe ("ALSA: firewire-lib: operate for period elapse event in process context")
Reported-by: edmund.raile <edmund.raile@proton.me>
Closes: https://lore.kernel.org/r/kwryofzdmjvzkuw6j3clftsxmoolynljztxqwg76hzeo4simnl@jn3eo7pe642q/
Signed-off-by: Edmund Raile <edmund.raile@protonmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240730195318.869840-3-edmund.raile@protonmail.com
2024-07-31 11:28:33 +02:00
Edmund Raile
6ccf9984d6 Revert "ALSA: firewire-lib: obsolete workqueue for period update"
prepare resolution of AB/BA deadlock competition for substream lock:
restore workqueue previously used for process context:

revert commit b5b519965c ("ALSA: firewire-lib: obsolete workqueue
for period update")

Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/kwryofzdmjvzkuw6j3clftsxmoolynljztxqwg76hzeo4simnl@jn3eo7pe642q/
Signed-off-by: Edmund Raile <edmund.raile@protonmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240730195318.869840-2-edmund.raile@protonmail.com
2024-07-31 11:28:13 +02:00
Mark Brown
af441750df
ASoC: fsl_micfil: Check the difference for i.MX8 and
Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

There are some register difference for i.MX8 and i.MX9
REG_MICFIL_FIFO_CTRL definition is updated.
REG_MICFIL_FSYNC_CTRL, REG_MICFIL_VERID, REG_MICFIL_PARAM are added from
i.MX9.
2024-07-30 17:01:12 +01:00
Kuninori Morimoto
22c406c9bf
ASoC: rsnd: use pcm_dmaengine code
rsnd is implementing own DMAEngine code, but we can replace it with
pcm_dmaengine code, because these are almost same.
Let's use existing and stable code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87cymvk3t5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-30 13:29:52 +01:00
Kuninori Morimoto
80565764c7
ASoC: rsnd: remove rsnd_mod_confirm_ssi() under DEBUG
rsnd_mod_confirm_ssi() confirms mod sanity, it should always be
confirmed, not only when DEBUG. This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ed7bk4qt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-30 13:29:51 +01:00
Takashi Iwai
fcc62b1910 ALSA: control: Take power_ref lock primarily
The code path for kcontrol accesses have often nested locks of both
card's controls_rwsem and power_ref, and applies in that order.
However, what could take much longer is the latter, power_ref; it
waits for the power state of the device, and it pretty much depends on
the user's action.

This patch swaps the locking order of those locks to a more natural
way, namely, power_ref -> controls_rwsem, in order to shorten the time
of possible nested locks.  For consistency, power_ref is taken always
in the top-level caller side (that is, *_user() functions and the
ioctl handler itself).

Link: https://patch.msgid.link/20240729160659.4516-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-30 07:46:00 +02:00
Takashi Iwai
3bb668264d ALSA: hda: Enhance pm_blacklist option
We want sometimes to keep the runtime PM disabled persistently just
like we did for the PM deny-list in the previous change, e.g. for
testing some buggy device.  This patch enhances the existing
pm_blacklist option for achieving it easily.

The default behavior doesn't change -- the driver looks up the deny
list and disables the runtime PM if matches.  However, when
pm_blacklist=1 option is set, now the driver disables the runtime PM
completely, just like the deny-list does.

Update the documentation for this option, too.

Link: https://patch.msgid.link/20240729141519.18398-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-30 07:45:55 +02:00
Takashi Iwai
8abe0423dd ALSA: hda: Keep PM disablement for deny-listed instance
We have a runtime PM deny-list for the devices that show the problems
(typically click noises) at runtime suspend/resume, and when it
matches, the driver disables the default runtime PM.  However, we
still allow the runtime PM changed via power_save module option
dynamically, and the desktop system often tweaks it.  This ended up
with a re-enablement of the runtime PM that surprises users, suddenly
suffering from the noises.

This patch changes the driver behavior slightly: when the device is
listed in the deny-list, ignore the power_save option change and keep
the original (that is, off) runtime PM state.

Link: https://patch.msgid.link/20240729141519.18398-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-30 07:45:49 +02:00
Takashi Iwai
0642a3c5ca ALSA: ump: Update substream name from assigned FB names
We had a nice name scheme in ALSA sequencer UMP binding for each
sequencer port referring to each assigned Function Block name, while
the legacy rawmidi refers only to the UMP Endpoint name.  It's better
to align both.

This patch moves the UMP Group attribute update functions into the
core UMP code from the sequencer binding code, and improve the
substream name of the legacy rawmidi.

Link: https://patch.msgid.link/20240729141315.18253-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-30 07:45:43 +02:00
Takashi Iwai
4e9652003b ALSA: control: Annotate snd_kcontrol with __counted_by()
struct snd_kcontrol contains a flex array of snd_kcontrol_volatile
objects at its end, and the array size is stored in count field.
This can be annotated gracefully with __counted_by() for catching
possible array overflows.

One additional change is the order of the count field initialization;
The assignment of the count field is moved before assignment of vd[]
elements for avoiding false-positive warnings from compilers.

Link: https://patch.msgid.link/20240726152840.8629-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-30 07:45:37 +02:00
Takashi Iwai
3c0e1ed9c8 Merge branch 'for-linus' into for-next
Pull 6.11-devel branch for further development.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-30 07:45:13 +02:00
Mark Brown
e2d124de00
ASoC: codecs: wcd93xx/wsa88xx: Correct Soundwire ports
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Incorrect mask of Soundwire ports - one bit too long/big - was passed.

Theoretically, too wide mask could cause an out of bounds read in
sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy
driver, e.g. adding incorrect number of ports via
sdw_stream_add_slave().

Not adding Cc-stable because I don't think the issue can lead to real
out-of-bounds read.
2024-07-29 19:34:05 +01:00
Shenghao Ding
e620b496c7
ASoC: tas2781: Add TAS2563 into the Header
Add TAS2563 into the Header in case of misunderstanding and add
channel No information for error debug in tasdevice_dev_read.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240716064120.158-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 17:40:09 +01:00
Mark Brown
7803693988
ASoC: codecs: wsa88xx and wcd93xx: Soundwire port
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Few cleanups to make the code more robust or readable.  No functional
impact (compiled objects stay the same).
2024-07-29 17:03:08 +01:00
Mark Brown
d0296adb0d
ASoC: codecs: wsa88xx: Few cleanups
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

A few cleanups around wsa88xx codecs.
2024-07-29 17:03:00 +01:00
Paul Handrigan
45d763fe50
ASoC: cs530x: Change IN HPF Select kcontrol name
Change to the IN HPF Select kcontrol to the correct name
IN DEC Filter Select.

Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://patch.msgid.link/20240726151111.3247774-1-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:58 +01:00
Bruno Ancona
c118478665
ASoC: amd: yc: Support mic on HP 14-em0002la
Add support for the internal microphone for HP 14-em0002la laptop using
a quirk entry.

Signed-off-by: Bruno Ancona <brunoanconasala@gmail.com>
Link: https://patch.msgid.link/20240729045032.223230-1-brunoanconasala@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:57 +01:00
Jerome Audu
6b99068d5e
ASoC: sti: add missing probe entry for player and reader
This patch addresses a regression in the ASoC STI drivers that was
introduced in Linux version 6.6.y. The issue originated from a series of
patches (see https://lore.kernel.org/all/87wmy5b0wt.wl-kuninori.morimoto.gx@renesas.com/)
that unintentionally omitted necessary probe functions for the player
and reader components.

Probe function in `sound/soc/sti/sti_uniperif.c:415` is being replaced
by another probe function located at `sound/soc/sti/sti_uniperif.c:453`,
which should instead be derived from the player and reader components.
This patch correctly reinserts the missing probe entries,
restoring the intended functionality.

Fixes: 9f625f5e6c ("ASoC: sti: merge DAI call back functions into ops")
Signed-off-by: Jerome Audu <jau@free.fr>
Link: https://patch.msgid.link/20240727-sti-audio-fix-v2-1-208bde546c3f@free.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:56 +01:00
Krzysztof Kozlowski
dcb6631d05
ASoC: codecs: wsa884x: Correct Soundwire ports mask
Device has up to WSA884X_MAX_SWR_PORTS number of ports and the array
assigned to prop.sink_dpn_prop has 0..WSA884X_MAX_SWR_PORTS-1 elements.
On the other hand, GENMASK(high, low) creates an inclusive mask between
<high, low>, so we need the mask from 0 up to WSA884X_MAX_SWR_PORTS-1.

Theoretically, too wide mask could cause an out of bounds read in
sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy
driver, e.g. adding incorrect number of ports via
sdw_stream_add_slave().

Fixes: aa21a7d4f6 ("ASoC: codecs: wsa884x: Add WSA884x family of speakers")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-6-d4d7a8b56f05@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:37 +01:00
Krzysztof Kozlowski
6801ac36f2
ASoC: codecs: wsa883x: Correct Soundwire ports mask
Device has up to WSA883X_MAX_SWR_PORTS number of ports and the array
assigned to prop.sink_dpn_prop has 0..WSA883X_MAX_SWR_PORTS-1 elements.
On the other hand, GENMASK(high, low) creates an inclusive mask between
<high, low>, so we need the mask from 0 up to WSA883X_MAX_SWR_PORTS-1.

Theoretically, too wide mask could cause an out of bounds read in
sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy
driver, e.g. adding incorrect number of ports via
sdw_stream_add_slave().

Fixes: 43b8c7dc85 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-5-d4d7a8b56f05@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:36 +01:00
Krzysztof Kozlowski
eb11c3bb64
ASoC: codecs: wsa881x: Correct Soundwire ports mask
Device has up to WSA881X_MAX_SWR_PORTS number of ports and the array
assigned to prop.sink_dpn_prop has 0..WSA881X_MAX_SWR_PORTS-1 elements.
On the other hand, GENMASK(high, low) creates an inclusive mask between
<high, low>, so we need the mask from 0 up to WSA881X_MAX_SWR_PORTS-1.

Theoretically, too wide mask could cause an out of bounds read in
sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy
driver, e.g. adding incorrect number of ports via
sdw_stream_add_slave().

Fixes: a0aab9e140 ("ASoC: codecs: add wsa881x amplifier support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-4-d4d7a8b56f05@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:35 +01:00
Krzysztof Kozlowski
74a79977c4
ASoC: codecs: wcd939x-sdw: Correct Soundwire ports mask
Device has up to WCD939X_MAX_TX_SWR_PORTS (or WCD939X_MAX_RX_SWR_PORTS
for sink) number of ports and the array assigned to prop.src_dpn_prop
and prop.sink_dpn_prop has 0..WCD939X_MAX_TX_SWR_PORTS-1 elements.  On
the other hand, GENMASK(high, low) creates an inclusive mask between
<high, low>, so we need the mask from 0 up to WCD939X_MAX_TX_SWR_PORTS-1.

Theoretically, too wide mask could cause an out of bounds read in
sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy
driver, e.g. adding incorrect number of ports via
sdw_stream_add_slave().

Fixes: be2af391ce ("ASoC: codecs: Add WCD939x Soundwire devices driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-3-d4d7a8b56f05@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:34 +01:00
Krzysztof Kozlowski
3f6fb03dae
ASoC: codecs: wcd938x-sdw: Correct Soundwire ports mask
Device has up to WCD938X_MAX_SWR_PORTS number of ports and the array
assigned to prop.src_dpn_prop and prop.sink_dpn_prop has
0..WCD938X_MAX_SWR_PORTS-1 elements.  On the other hand, GENMASK(high,
low) creates an inclusive mask between <high, low>, so we need the mask
from 0 up to WCD938X_MAX_SWR_PORTS-1.

Theoretically, too wide mask could cause an out of bounds read in
sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy
driver, e.g. adding incorrect number of ports via
sdw_stream_add_slave().

Fixes: 16572522ae ("ASoC: codecs: wcd938x-sdw: add SoundWire driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-2-d4d7a8b56f05@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:33 +01:00
Krzysztof Kozlowski
aebb1813c2
ASoC: codecs: wcd937x-sdw: Correct Soundwire ports mask
Device has up to WCD937X_MAX_TX_SWR_PORTS (or WCD937X_MAX_SWR_PORTS
for sink) number of ports and the array assigned to prop.src_dpn_prop
and prop.sink_dpn_prop has 0..WCD937X_MAX_TX_SWR_PORTS-1 elements.  On
the other hand, GENMASK(high, low) creates an inclusive mask between
<high, low>, so we need the mask from 0 up to WCD937X_MAX_TX_SWR_PORTS-1.

Theoretically, too wide mask could cause an out of bounds read in
sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy
driver, e.g. adding incorrect number of ports via
sdw_stream_add_slave().

Fixes: c99a515ff1 ("ASoC: codecs: wcd937x-sdw: add SoundWire driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-1-d4d7a8b56f05@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:32 +01:00
Shengjiu Wang
aa4f76ef09
ASoC: fsl_micfil: Differentiate register access permission for platforms
On i.MX9x platforms, the REG_MICFIL_FSYNC_CTRL, REG_MICFIL_VERID,
REG_MICFIL_PARAM are added, but they are not existed on i.MX8x
platforms.

Use the existed micfil->soc->use_verid to distinguish the access
permission for these platforms.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1721897694-6088-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:14 +01:00
Shengjiu Wang
4ddd51ccff
ASoC: fsl_micfil: Expand the range of FIFO watermark mask
On the i.MX9x platforms, the mask of FIFO watermark
is 0x1F, on i.MX8x platforms, the mask of FIFO watermark
is 0X7. So use the mask 0x1F for all platforms to make them
compatible.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1721897694-6088-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 13:36:13 +01:00
Mavroudis Chatzilazaridis
3c0b6f924e ALSA: hda/realtek: Add quirk for Acer Aspire E5-574G
ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST fixes combo jack detection and
limits the internal microphone boost that causes clipping on this model.

Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240728123601.144017-1-mavchatz@protonmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-29 13:49:27 +02:00
Krzysztof Kozlowski
a9d843e6b2
ASoC: codecs: wcd939x: Move max port number defines to enum
Instead of having separate define to indicate number of TX and RX
Soundwire ports, move it to the enums defining actual port
indices/values.  This makes it more obvious why such value was chosen as
number of TX/RX ports.
Note: the enums start from 1, thus number of ports equals to the last
vaue in the enum.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-7-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:21 +01:00
Krzysztof Kozlowski
5e388488f0
ASoC: codecs: wcd938x: Move max port number defines to enum
Instead of having separate define to indicate number of TX and RX
Soundwire ports, move it to the enums defining actual port
indices/values.  This makes it more obvious why such value was chosen as
number of TX/RX ports.
Note: the enums start from 1, thus number of ports equals to the last
vaue in the enum.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-6-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:20 +01:00
Krzysztof Kozlowski
42f3a2caf8
ASoC: codecs: wcd937x: Move max port number defines to enum
Instead of having separate define to indicate number of TX and RX
Soundwire ports, move it to the enums defining actual port
indices/values.  This makes it more obvious why such value was chosen as
number of TX/RX ports.
Note: the enums start from 1, thus number of ports equals to the last
vaue in the enum.

WCD937X_MAX_SWR_PORTS is used in one of structures in the header, so
entire enum must be moved to the top of the header file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-5-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:19 +01:00
Krzysztof Kozlowski
06fa827127
ASoC: codecs: wcd938x: Drop unused defines and enums
Drop defines and enums not used in the driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-4-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:18 +01:00
Krzysztof Kozlowski
125ed86b0d
ASoC: codecs: wsa884x: Use designator array initializers for Soundwire ports
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config')
store configuration of Soundwire ports, thus each of their element is
indexed according to the port number (enum wsa884x_port_ids, e.g.
WSA884X_PORT_DAC).  Except the indexing, they also store port number
offset by one in member 'num'.

Entire code depends on that correlation between array index and port
number, thus make it explicit by using designators.  The code is
functionally the same, but more obvious for reading.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-3-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:17 +01:00
Krzysztof Kozlowski
add41ea550
ASoC: codecs: wsa883x: Use designator array initializers for Soundwire ports
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config')
store configuration of Soundwire ports, thus each of their element is
indexed according to the port number (enum wsa_port_ids, e.g.
WSA883X_PORT_DAC).  Except the indexing, they also store port number
offset by one in member 'num'.

Entire code depends on that correlation between array index and port
number, thus make it explicit by using designators.  The code is
functionally the same, but more obvious for reading.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-2-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:16 +01:00
Krzysztof Kozlowski
874d04fe15
ASoC: codecs: wsa881x: Use designator array initializers for Soundwire ports
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config')
store configuration of Soundwire ports, thus each of their element is
indexed according to the port number (enum wsa_port_ids, e.g.
WSA881X_PORT_DAC).  Except the indexing, they also store port number
offset by one in member 'num'.

Entire code depends on that correlation between array index and port
number, thus make it explicit by using designators.  The code is
functionally the same, but more obvious for reading.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-1-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:16 +01:00
Chen Ni
275d57ae44
ASoC: cs42l42: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Fixes: 90f6a2a20b ("ASoC: cs42l42: Add SoundWire support")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Link: https://patch.msgid.link/20240716025307.400156-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:44 +01:00
Takashi Iwai
aaa5e1aa39
ASoC: Use __counted_by() annotation for snd_soc_pcm_runtime
The struct snd_soc_pcm_runtime has a flex array of snd_soc_component
objects at its end, and the size is kept in num_components field.
We can add __counted_by() annotation for compiler's assistance to
catch array overflows.

A slight additional change is the assignment of rtd->components[];
the array counter has to be incremented at first for avoiding
false-positive reports from compilers.

Also, the allocation size of snd_soc_pcm_runtime is cleaned up with
the standard struct_size() helper, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240726155237.21961-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:42 +01:00
Chen Ni
42eb47310f
ASoC: mediatek: mt8192: remove redundant null pointer check before of_node_put
of_node_put() has taken the null pointer check into account. So it is safe
to remove the duplicated check before of_node_put().

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20240709085131.1436128-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:41 +01:00
Biju Das
4f8cd05a43
ASoC: sh: rz-ssi: Add full duplex support
Add full duplex support, to support simultaneous
playback/record on the same ssi channel.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20240715092322.119879-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:40 +01:00
Krzysztof Kozlowski
b3f35bae68
ASoC: codecs: lpass-wsa-macro: Do not hard-code dai in VI mixer
The wsa_macro_vi_feed_mixer_put() callback for setting VI feedback mixer
value could be used for different DAIs (planned in the future CPS DAI),
so make the code a bit more generic by using DAI ID from widget->shift,
instead of hard-coding it.  The get() callback already follows such
convention.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240723144607.123240-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:39 +01:00
Ma Ke
3ff810b9be
ASoC: rt5682s: Return devm_of_clk_add_hw_provider to transfer the error
Return devm_of_clk_add_hw_provider() in order to transfer the error, if it
fails due to resource allocation failure or device tree clock provider
registration failure.

Fixes: bdd229ab26 ("ASoC: rt5682s: Add driver for ALC5682I-VS codec")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Link: https://patch.msgid.link/20240717115436.3449492-1-make24@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:38 +01:00
Zhang Yi
6024f3429f
ASoC: codecs: ES8326: suspend issue
We find that we need to disable micbias for the codec to enter suspend
So We modify the trigger conditions for enable_micbias and disable_micbias

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240726031002.35055-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:36 +01:00
Krzysztof Kozlowski
7eb62acd43
ASoC: codecs: wsa884x: Simplify handling variant
Driver does not use detected variant variable past the init function, so
do not store it in the state container structure.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-4-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:19 +01:00
Krzysztof Kozlowski
cd15fded0e
ASoC: codecs: wsa883x: Simplify handling variant/version
Driver does not use detected variant/version variables past the init
function, so do not store them in the state container structure.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-3-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:18 +01:00
Krzysztof Kozlowski
2fbf16992e
ASoC: codecs: wsa883x: Handle reading version failure
If reading version and variant from registers fails (which is unlikely
but possible, because it is a read over bus), the driver will proceed
and perform device configuration based on uninitialized stack variables.
Handle it a bit better - bail out without doing any init and failing the
update status Soundwire callback.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-2-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:17 +01:00
Krzysztof Kozlowski
3d2a69eb50
ASoC: codecs: wsa881x: Drop unused version readout
Driver does not use the device version after reading it from the
registers, so simplify by dropping unneeded code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-1-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:16 +01:00
Linus Torvalds
bf80f1391a Devicetree fixes for 6.11, part 1
- Treewide conversion of of_property_for_each_u32() to drop internal
   arguments making struct property opaque
 
 - Add binding for Amlogic A4 SoC watchdog
 
 - Fix constraints for AD7192 'single-channel' property
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmaj8ncACgkQ+vtdtY28
 YcMwZRAAh618Xfw+J8pxv62PMw11r0hgMNYoHPYDMt47D7g9Wwa71xdR6OpfIpf+
 EyHUXrnXJT6f5sm8mVe9Gsni0MZfgdkwchxlCQej0rJKchdLdAFNXbg4GbhF+0Ht
 tA3Y6bPB9FYKHExd87flnt4AO3ypF+1ihjSAAoy4EyEZUfyKgQVPyebDGwlPYlkH
 dmhF+q9d94LVw3lj/C7htWGELProogsU3i498ey7m/w8jwiJav2DVJ0cRuld/aPG
 7VwGQhJzdndlH1MPcl9slzIPadUrZ0S3/7V4c9cC0E22XpHJzp4RSdGmzsXJ7adp
 Q+OlQYiyZLLhEA/alVO/j5SJtfxt+T6+lrpbbu1wcJMFoukXusvL+0KbxxbExEn0
 /3MrZuxEq3F+jcKtMR/1PFcO7o1uEzzyTZcdufV3siABjZqmG4AFzBhHWP4Xh2Uw
 6hs7R/Ktf2lmacCK9fawfJF6Qq4RtFIakUuI6S3Q3oHHTRw6kr1Lsw+Wko/K20mO
 BEdfhocxEk5vf/kGxcBfM+GTybhagbBh0GxYB/Lm8vATfLHzhunipbc0ZwozDfPu
 IWiY+Nv+hGeGhfvSfNFUcsknF+QwtSjGis7hQjHkJc/siahaXJVAaf+tvtL1xm/p
 0CGPIJFZgzkcbjCT3iPVaJjfyRlMe9l7HJ6XiBSrMpiFpZPTgT8=
 =Nn/d
 -----END PGP SIGNATURE-----

Merge tag 'devicetree-fixes-for-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull more devicetree updates from Rob Herring:
 "Most of this is a treewide change to of_property_for_each_u32() which
  was small enough to do in one go before rc1 and avoids the need to
  create of_property_for_each_u32_some_new_name().

   - Treewide conversion of of_property_for_each_u32() to drop internal
     arguments making struct property opaque

   - Add binding for Amlogic A4 SoC watchdog

   - Fix constraints for AD7192 'single-channel' property"

* tag 'devicetree-fixes-for-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  dt-bindings: iio: adc: ad7192: Fix 'single-channel' constraints
  of: remove internal arguments from of_property_for_each_u32()
  dt-bindings: watchdog: add support for Amlogic A4 SoCs
2024-07-27 12:46:16 -07:00
Linus Torvalds
0421621158 firewire fixes for 6.11-rc1
Two commits are included to fix some regressions. These commits should also
 be applied to the v6.10 kernel as well.
 
 The recent integration of compiler collections introduced the technology
 to check flexible array length at runtime by providing proper annotations.
 In v6.10 kernel, a patch was merged into firewire subsystem to utilize it,
 however the annotation was inadequate. There is also the related change for
 the flexible array in sound subsystem, but it causes a regression where
 the data in the payload of isochronous packet is incorrect for some
 devices. These bugs are now fixed.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQE66IEYNDXNBPeGKSsLtaWM8LwEwUCZqRPbgAKCRCsLtaWM8Lw
 E4IDAQCr4s3/W1fwkUcxvaFKn4ngELXtZ8D2BtI0I3x+axOvggEA4NhtbSwusyKK
 r3Zsyf8r9WrzIOMFASqqV7LlaiWTogI=
 =eq44
 -----END PGP SIGNATURE-----

Merge tag 'firewire-fixes-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394

Pull firewire fixes from Takashi Sakamoto:
 "The recent integration of compiler collections introduced the
  technology to check flexible array length at runtime by providing
  proper annotations. In v6.10 kernel, a patch was merged into firewire
  subsystem to utilize it, however the annotation was inadequate.

  There is also the related change for the flexible array in sound
  subsystem, but it causes a regression where the data in the payload of
  isochronous packet is incorrect for some devices. These bugs are now
  fixed"

* tag 'firewire-fixes-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
  ALSA: firewire-lib: fix wrong value as length of header for CIP_NO_HEADER case
  Revert "firewire: Annotate struct fw_iso_packet with __counted_by()"
2024-07-27 12:35:12 -07:00
Takashi Sakamoto
c1839501fe ALSA: firewire-lib: fix wrong value as length of header for CIP_NO_HEADER case
In a commit 1d717123bb ("ALSA: firewire-lib: Avoid
-Wflex-array-member-not-at-end warning"), DEFINE_FLEX() macro was used to
handle variable length of array for header field in struct fw_iso_packet
structure. The usage of macro has a side effect that the designated
initializer assigns the count of array to the given field. Therefore
CIP_HEADER_QUADLETS (=2) is assigned to struct fw_iso_packet.header,
while the original designated initializer assigns zero to all fields.

With CIP_NO_HEADER flag, the change causes invalid length of header in
isochronous packet for 1394 OHCI IT context. This bug affects all of
devices supported by ALSA fireface driver; RME Fireface 400, 800, UCX, UFX,
and 802.

This commit fixes the bug by replacing it with the alternative version of
macro which corresponds no initializer.

Cc: stable@vger.kernel.org
Fixes: 1d717123bb ("ALSA: firewire-lib: Avoid -Wflex-array-member-not-at-end warning")
Reported-by: Edmund Raile <edmund.raile@proton.me>
Closes: https://lore.kernel.org/r/rrufondjeynlkx2lniot26ablsltnynfaq2gnqvbiso7ds32il@qk4r6xps7jh2/
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240725155640.128442-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-27 10:28:36 +09:00
Linus Torvalds
eb966e0c5f sound fixes for 6.11-rc1
A collection of the fixes gathered since the previous PR.
 We see a bit large LOCs at a HD-audio quirk, but that's only bulk
 COEF data, hence it's safe to take.  In addition to that, there
 were two minor fixes for MIDI 2.0 handling for ALSA core, and the
 rest are all rather random small and device-specific fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmajSFIOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8SjBAAyynx5t5Ui/Gp9VqvyFzUAl9zpHn4hIz5T/SN
 +XRNcq9VN+anqu+55PqWpoX5E0WRQW36AyCeMO7yA0RLhTCvPAtH2OmLfHQhvh48
 +Zpw89molMP19KdRi+nezJlrTQby8zHBGConN3jalovRrM1bqpGeiQ3bdydhqSdt
 dAfhCEn3ckOhNZU0PTASnZGScqTpl+OP0XKXSD3KBceT7EEsUodTcq1NqDcoHbBS
 V/4hJct7vDcbA64P+zo3rrhEkbeDa3s152ajcs589aElIKQVTQhZNNvxe7ygDXHe
 30qXjCI6gQDUWuGHwuN0IlNiI/GkhLExvK+Wa1xBP+vjTqWtpxzuQ8rMwa+EM48Y
 AZ7Rk7GUsvceCzGIto6p+ZRlt1LG2dJFYbfqw9fUA6JvMDhStDcrFzSooWrmcl8Z
 8EN7L9viYEDl15TzSA6FKTeFh1gSPe+/hsZ9r3XuTL611/paqPs+HTnQ3T7ua9mr
 EylSfEeJ3NKbcJqwnCLClSzmgClPaBkseDwnHS0OT4xMmbI5Q1/WIzjdvF+EM2RN
 RxgkvJyhdpp/9bxtkeojekKcK4qeuGcY4Gaqd6etBX9KgfyTh/n098dlI0BJmZrV
 y3cZNH9zojzzTmP7+UcTjVp+LocF5nswB3rhMJgYKJPFXJMoj5xzHIm8LyRt7qTQ
 9xIYlAY=
 =RcQQ
 -----END PGP SIGNATURE-----

Merge tag 'sound-fix-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of fixes gathered since the previous pull.

  We see a bit large LOCs at a HD-audio quirk, but that's only bulk COEF
  data, hence it's safe to take. In addition to that, there were two
  minor fixes for MIDI 2.0 handling for ALSA core, and the rest are all
  rather random small and device-specific fixes"

* tag 'sound-fix-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: fsl-asoc-card: Dynamically allocate memory for snd_soc_dai_link_components
  ASoC: amd: yc: Support mic on Lenovo Thinkpad E16 Gen 2
  ALSA: hda/realtek: Implement sound init sequence for Samsung Galaxy Book3 Pro 360
  ALSA: hda/realtek: cs35l41: Fixup remaining asus strix models
  ASoC: SOF: ipc4-topology: Preserve the DMA Link ID for ChainDMA on unprepare
  ASoC: SOF: ipc4-topology: Only handle dai_config with HW_PARAMS for ChainDMA
  ALSA: ump: Force 1 Group for MIDI1 FBs
  ALSA: ump: Don't update FB name for static blocks
  ALSA: usb-audio: Add a quirk for Sonix HD USB Camera
  ASoC: TAS2781: Fix tasdev_load_calibrated_data()
  ASoC: tegra: select CONFIG_SND_SIMPLE_CARD_UTILS
  ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable
  ALSA: usb-audio: Move HD Webcam quirk to the right place
  ALSA: hda: tas2781: mark const variables as __maybe_unused
  ALSA: usb-audio: Fix microphone sound on HD webcam.
  ASoC: sof: amd: fix for firmware reload failure in Vangogh platform
  ASoC: Intel: Fix RT5650 SSP lookup
  ASOC: SOF: Intel: hda-loader: only wait for HDaudio IOC for IPC4 devices
  ASoC: SOF: imx8m: Fix DSP control regmap retrieval
2024-07-26 11:01:31 -07:00
Takashi Iwai
952b13c215 ALSA: seq: ump: Optimize conversions from SysEx to UMP
The current conversion from the legacy SysEx event to UMP SysEx packet
in the sequencer core has a couple of issues:

* The first packet trims the SysEx start byte (0xf0), hence it
  contains only 5 bytes instead of 6.  This isn't wrong, per
  specification, but it's strange not to fill 6 bytes.

* When the SysEx end marker (0xf7) is placed at the first byte of the
  next packet, it'll end up with an empty data just with the END
  status.  It can be rather folded into the previous packet with the
  END status.

This patch tries to address those issues.  The first packet may have 6
bytes even with the SysEx start, and an empty packet with the SysEx
end marker is omitted.

Fixes: e9e02819a9 ("ALSA: seq: Automatic conversion of UMP events")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240726143455.3254-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-26 16:36:25 +02:00
Takashi Iwai
4f61c8fe35 ALSA: hda/conexant: Mute speakers at suspend / shutdown
Use the new helper to mute speakers at suspend / shutdown for avoiding
click noises.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1228269
Link: https://patch.msgid.link/20240726142625.2460-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-26 16:36:10 +02:00
Takashi Iwai
6cd23b26b3 ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
Some devices indicate click noises at suspend or shutdown when the
speakers are unmuted.  This patch adds a helper,
snd_hda_gen_shutup_speakers(), to work around it.  The new function is
supposed to be called at suspend or shutdown by the codec driver, and
it mutes the speakers.

The mute status isn't cached, hence the original mute state will be
restored at resume again.

Link: https://patch.msgid.link/20240726142625.2460-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-26 16:36:01 +02:00
songxiebing
e60dc98122 ALSA: hda: conexant: Fix headset auto detect fail in the polling mode
The previous fix (7aeb259086) only handles the unsol_event reporting
during interrupts and does not include the polling mode used to set
jackroll_ms, so now we are replacing it with
snd_hda_jack_detect_enable_callback.

Fixes: 7aeb259086 ("ALSA: hda/conexant: Fix headset auto detect fail in cx8070 and SN6140")
Co-developed-by: bo liu <bo.liu@senarytech.com>
Signed-off-by: bo liu <bo.liu@senarytech.com>
Signed-off-by: songxiebing <songxiebing@kylinos.cn>
Link: https://patch.msgid.link/20240726100726.50824-1-soxiebing@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-26 16:17:27 +02:00
Linus Torvalds
c2a96b7f18 Driver core changes for 6.11-rc1
Here is the big set of driver core changes for 6.11-rc1.
 
 Lots of stuff in here, with not a huge diffstat, but apis are evolving
 which required lots of files to be touched.  Highlights of the changes
 in here are:
   - platform remove callback api final fixups (Uwe took many releases to
     get here, finally!)
   - Rust bindings for basic firmware apis and initial driver-core
     interactions.  It's not all that useful for a "write a whole driver
     in rust" type of thing, but the firmware bindings do help out the
     phy rust drivers, and the driver core bindings give a solid base on
     which others can start their work.  There is still a long way to go
     here before we have a multitude of rust drivers being added, but
     it's a great first step.
   - driver core const api changes.  This reached across all bus types,
     and there are some fix-ups for some not-common bus types that
     linux-next and 0-day testing shook out.  This work is being done to
     help make the rust bindings more safe, as well as the C code, moving
     toward the end-goal of allowing us to put driver structures into
     read-only memory.  We aren't there yet, but are getting closer.
   - minor devres cleanups and fixes found by code inspection
   - arch_topology minor changes
   - other minor driver core cleanups
 
 All of these have been in linux-next for a very long time with no
 reported problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZqH+aQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymoOQCfVBdLcBjEDAGh3L8qHRGMPy4rV2EAoL/r+zKm
 cJEYtJpGtWX6aAtugm9E
 =ZyJV
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is the big set of driver core changes for 6.11-rc1.

  Lots of stuff in here, with not a huge diffstat, but apis are evolving
  which required lots of files to be touched. Highlights of the changes
  in here are:

   - platform remove callback api final fixups (Uwe took many releases
     to get here, finally!)

   - Rust bindings for basic firmware apis and initial driver-core
     interactions.

     It's not all that useful for a "write a whole driver in rust" type
     of thing, but the firmware bindings do help out the phy rust
     drivers, and the driver core bindings give a solid base on which
     others can start their work.

     There is still a long way to go here before we have a multitude of
     rust drivers being added, but it's a great first step.

   - driver core const api changes.

     This reached across all bus types, and there are some fix-ups for
     some not-common bus types that linux-next and 0-day testing shook
     out.

     This work is being done to help make the rust bindings more safe,
     as well as the C code, moving toward the end-goal of allowing us to
     put driver structures into read-only memory. We aren't there yet,
     but are getting closer.

   - minor devres cleanups and fixes found by code inspection

   - arch_topology minor changes

   - other minor driver core cleanups

  All of these have been in linux-next for a very long time with no
  reported problems"

* tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (55 commits)
  ARM: sa1100: make match function take a const pointer
  sysfs/cpu: Make crash_hotplug attribute world-readable
  dio: Have dio_bus_match() callback take a const *
  zorro: make match function take a const pointer
  driver core: module: make module_[add|remove]_driver take a const *
  driver core: make driver_find_device() take a const *
  driver core: make driver_[create|remove]_file take a const *
  firmware_loader: fix soundness issue in `request_internal`
  firmware_loader: annotate doctests as `no_run`
  devres: Correct code style for functions that return a pointer type
  devres: Initialize an uninitialized struct member
  devres: Fix memory leakage caused by driver API devm_free_percpu()
  devres: Fix devm_krealloc() wasting memory
  driver core: platform: Switch to use kmemdup_array()
  driver core: have match() callback in struct bus_type take a const *
  MAINTAINERS: add Rust device abstractions to DRIVER CORE
  device: rust: improve safety comments
  MAINTAINERS: add Danilo as FIRMWARE LOADER maintainer
  MAINTAINERS: add Rust FW abstractions to FIRMWARE LOADER
  firmware: rust: improve safety comments
  ...
2024-07-25 10:42:22 -07:00
Takashi Iwai
e8b96a66ae ASoC: Fixes for v6.11
A selection of routine fixes and quirks that came in since the merge
 window.  The fsl-asoc-card change is a fix for systems with multiple
 cards where updating templates in place leaks data from one card to
 another.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmaidTQACgkQJNaLcl1U
 h9C1ygf+IVXH3RKe68UKPzUrOvsBj+231vxRXiisq6p7DHx/IgVpK/hShbh7AKQc
 5Fm4RBqOYo7FCffmDYKc+DcBFj4X1GpixzpW5n9J6bTWcHyC9r0/k9HFB8D00aF9
 fVCJGkIKDFzRlag+EGnF38qNmPBLlJgLfa9LA7vJYv6GCrNZ4dYJtG1Fdun5fOSF
 r0pzmw03/I9HwpUzBuCa1Dz8Fdvs653scDRTs4bed6y9OJ3LUMfwrt1+jXuoge0k
 3hi3MZU8XyBLFfVVrUdv7X0FwdsOBYmihrECNZWu90xwa8F5XBxwlH5OQQn2uOGf
 Z/+jV0i4XtYkOhOxbnNtCHwd7ZBXGQ==
 =kr40
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.11-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.11

A selection of routine fixes and quirks that came in since the merge
window.  The fsl-asoc-card change is a fix for systems with multiple
cards where updating templates in place leaks data from one card to
another.
2024-07-25 18:04:55 +02:00
Shengjiu Wang
ab53dfdcdd
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: 6d174cc4f2 ("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>
2024-07-25 14:20:30 +01:00
Luca Ceresoli
9722c3b66e of: remove internal arguments from of_property_for_each_u32()
The of_property_for_each_u32() macro needs five parameters, two of which
are primarily meant as internal variables for the macro itself (in the
for() clause). Yet these two parameters are used by a few drivers, and this
can be considered misuse or at least bad practice.

Now that the kernel uses C11 to build, these two parameters can be avoided
by declaring them internally, thus changing this pattern:

  struct property *prop;
  const __be32 *p;
  u32 val;

  of_property_for_each_u32(np, "xyz", prop, p, val) { ... }

to this:

  u32 val;

  of_property_for_each_u32(np, "xyz", val) { ... }

However two variables cannot be declared in the for clause even with C11,
so declare one struct that contain the two variables we actually need. As
the variables inside this struct are not meant to be used by users of this
macro, give the struct instance the noticeable name "_it" so it is visible
during code reviews, helping to avoid new code to use it directly.

Most usages are trivially converted as they do not use those two
parameters, as expected. The non-trivial cases are:

 - drivers/clk/clk.c, of_clk_get_parent_name(): easily doable anyway
 - drivers/clk/clk-si5351.c, si5351_dt_parse(): this is more complex as the
   checks had to be replicated in a different way, making code more verbose
   and somewhat uglier, but I refrained from a full rework to keep as much
   of the original code untouched having no hardware to test my changes

All the changes have been build tested. The few for which I have the
hardware have been runtime-tested too.

Reviewed-by: Andre Przywara <andre.przywara@arm.com> # drivers/clk/sunxi/clk-simple-gates.c, drivers/clk/sunxi/clk-sun8i-bus-gates.c
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> # drivers/gpio/gpio-brcmstb.c
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> # drivers/irqchip/irq-atmel-aic-common.c
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # drivers/iio/adc/ti_am335x_adc.c
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> # drivers/pwm/pwm-samsung.c
Acked-by: Richard Leitner <richard.leitner@linux.dev> # drivers/usb/misc/usb251xb.c
Acked-by: Mark Brown <broonie@kernel.org> # sound/soc/codecs/arizona.c
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> # sound/soc/codecs/arizona.c
Acked-by: Michael Ellerman <mpe@ellerman.id.au> # arch/powerpc/sysdev/xive/spapr.c
Acked-by: Stephen Boyd <sboyd@kernel.org> # clk
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20240724-of_property_for_each_u32-v3-1-bea82ce429e2@bootlin.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-07-25 06:53:47 -05:00
Takashi Iwai
1d9ce44404
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>
2024-07-25 12:12:38 +01:00
Nick Weihs
dcfed70874 ALSA: hda/realtek: Implement sound init sequence for Samsung Galaxy Book3 Pro 360
Samsung Galaxy Book3 Pro 360 sends a large amount of data to the codec
through hda processing coefficients.  This data was captured using a
modified version of QEMU, but the actual content of the data remains
opaque to me.  Elliding any part of the data seems to cause sound to
not work.

Signed-off-by: Nick Weihs <nick.weihs@gmail.com>

Link: https://patch.msgid.link/20240725054722.42597-1-nick.weihs@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-25 10:54:45 +02:00
Luke D. Jones
e6e18021dd ALSA: hda/realtek: cs35l41: Fixup remaining asus strix models
Adjust quirks for 0x3a20, 0x3a30, 0x3a50 to match the 0x3a60. This
set has now been confirmed to work with this patch.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Fixes: 811dd426a9 ("ALSA: hda/realtek: Add quirks for Asus ROG 2024 laptops using CS35L41")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240723011224.115579-1-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-24 17:55:35 +02:00
Peter Ujfalusi
e6fc5fcaef
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: ca5ce0caa6 ("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>
2024-07-24 11:29:13 +01:00
Peter Ujfalusi
ae67ed9010
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: 3858464de5 ("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>
2024-07-24 11:29:12 +01:00
Takashi Iwai
ac29d8ae05 ALSA: ump: Force 1 Group for MIDI1 FBs
When a Function Block declares it being a legacy MIDI1 device, it has
to be only with a single UMP Group.  Correct the attribute when a
device declares it wrongly.

Fixes: 37e0e14128 ("ALSA: ump: Support UMP Endpoint and Function Block parsing")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240722140610.10845-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 16:17:51 +02:00
Takashi Iwai
9a4ab167cf ALSA: ump: Don't update FB name for static blocks
When a device tries to update the FB name string even if its Endpoint
is declared as static, we should skip it, just already done for the FB
info update reply.

Fixes: 37e0e14128 ("ALSA: ump: Support UMP Endpoint and Function Block parsing")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240722135929.8612-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 16:17:40 +02:00
wangdicheng
21451dfd85 ALSA: usb-audio: Add a quirk for Sonix HD USB Camera
Sonix HD USB Camera does not support reading the sample rate which leads
to many lines of "cannot get freq at ep 0x84".
This patch adds the USB ID to quirks.c and avoids those error messages.

(snip)
[1.789698] usb 3-3: new high-speed USB device number 2 using xhci_hcd
[1.984121] usb 3-3: New USB device found, idVendor=0c45, idProduct=6340, bcdDevice= 0.00
[1.984124] usb 3-3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[1.984127] usb 3-3: Product: USB 2.0 Camera
[1.984128] usb 3-3: Manufacturer: Sonix Technology Co., Ltd.
[5.440957] usb 3-3: 3:1: cannot get freq at ep 0x84
[12.130679] usb 3-3: 3:1: cannot get freq at ep 0x84
[12.175065] usb 3-3: 3:1: cannot get freq at ep 0x84

Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240722084822.31620-1-wangdich9700@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 14:45:14 +02:00
Dan Carpenter
92c7822216
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: b195acf526 ("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>
2024-07-22 13:04:51 +01:00
Arnd Bergmann
83340b855d
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: 2502f8dd8c ("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>
2024-07-22 13:04:50 +01:00
Pierre-Louis Bossart
9931f7d5d2
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: 536cfd2f37 ("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>
2024-07-22 13:04:49 +01:00
Takashi Iwai
7010d9464f ALSA: usb-audio: Move HD Webcam quirk to the right place
The quirk_flags_table[] is sorted in the USB ID order, while the last
fix was put at a wrong position.  Adjust the entry at the right
position.

Fixes: 74dba24088 ("ALSA: usb-audio: Fix microphone sound on HD webcam.")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240722080605.23481-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 10:10:58 +02:00
Linus Torvalds
acc5965b9f Char/Misc and other driver changes for 6.11-rc1
Here is the "big" set of char/misc and other driver subsystem changes
 for 6.11-rc1.  Nothing major in here, just loads of new drivers and
 updates.  Included in here are:
   - IIO api updates and new drivers added
   - wait_interruptable_timeout() api cleanups for some drivers
   - MODULE_DESCRIPTION() additions for loads of drivers
   - parport out-of-bounds fix
   - interconnect driver updates and additions
   - mhi driver updates and additions
   - w1 driver fixes
   - binder speedups and fixes
   - eeprom driver updates
   - coresight driver updates
   - counter driver update
   - new misc driver additions
   - other minor api updates
 
 All of these, EXCEPT for the final Kconfig build fix for 32bit systems,
 have been in linux-next for a while with no reported issues.  The
 Kconfig fixup went in 29 hours ago, so might have missed the latest
 linux-next, but was acked by everyone involved.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZppR4w8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykwoQCeIaW3nbOiNTmOupvEnZwrN3yVNs8An3Q5L+Br
 1LpTASaU6A8pN81Z1m5g
 =6U1z
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char / misc and other driver updates from Greg KH:
 "Here is the "big" set of char/misc and other driver subsystem changes
  for 6.11-rc1. Nothing major in here, just loads of new drivers and
  updates. Included in here are:

   - IIO api updates and new drivers added

   - wait_interruptable_timeout() api cleanups for some drivers

   - MODULE_DESCRIPTION() additions for loads of drivers

   - parport out-of-bounds fix

   - interconnect driver updates and additions

   - mhi driver updates and additions

   - w1 driver fixes

   - binder speedups and fixes

   - eeprom driver updates

   - coresight driver updates

   - counter driver update

   - new misc driver additions

   - other minor api updates

  All of these, EXCEPT for the final Kconfig build fix for 32bit
  systems, have been in linux-next for a while with no reported issues.
  The Kconfig fixup went in 29 hours ago, so might have missed the
  latest linux-next, but was acked by everyone involved"

* tag 'char-misc-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (330 commits)
  misc: Kconfig: exclude mrvl-cn10k-dpi compilation for 32-bit systems
  misc: delete Makefile.rej
  binder: fix hang of unregistered readers
  misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI
  virtio: add missing MODULE_DESCRIPTION() macro
  agp: uninorth: add missing MODULE_DESCRIPTION() macro
  spmi: add missing MODULE_DESCRIPTION() macros
  dev/parport: fix the array out-of-bounds risk
  samples: configfs: add missing MODULE_DESCRIPTION() macro
  misc: mrvl-cn10k-dpi: add Octeon CN10K DPI administrative driver
  misc: keba: Fix missing AUXILIARY_BUS dependency
  slimbus: Fix struct and documentation alignment in stream.c
  MAINTAINERS: CC dri-devel list on Qualcomm FastRPC patches
  misc: fastrpc: use coherent pool for untranslated Compute Banks
  misc: fastrpc: support complete DMA pool access to the DSP
  misc: fastrpc: add missing MODULE_DESCRIPTION() macro
  misc: fastrpc: Add missing dev_err newlines
  misc: fastrpc: Use memdup_user()
  nvmem: core: Implement force_ro sysfs attribute
  nvmem: Use sysfs_emit() for type attribute
  ...
2024-07-19 15:55:08 -07:00