]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
5 months agoMerge tag 'asoc-fix-v6.14-merge-window' of https://git.kernel.org/pub/scm/linux/kerne...
Takashi Iwai [Wed, 29 Jan 2025 13:39:55 +0000 (14:39 +0100)]
Merge tag 'asoc-fix-v6.14-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.14

A bunch of fixes that came in during the merge window, plus a few new
device IDs.  The i.MX changes are a little large since they add some new
quirk data as well as device IDs, and the audio graph card change for
picking the correct endpoint for links is large due to updating a number
of call sites.

5 months agoALSA: hda: Fix headset detection failure due to unstable sort
Kuan-Wei Chiu [Tue, 28 Jan 2025 16:54:15 +0000 (00:54 +0800)]
ALSA: hda: Fix headset detection failure due to unstable sort

The auto_parser assumed sort() was stable, but the kernel's sort() uses
heapsort, which has never been stable. After commit 0e02ca29a563
("lib/sort: optimize heapsort with double-pop variation"), the order of
equal elements changed, causing the headset to fail to work.

Fix the issue by recording the original order of elements before
sorting and using it as a tiebreaker for equal elements in the
comparison function.

Fixes: b9030a005d58 ("ALSA: hda - Use standard sort function in hda_auto_parser.c")
Reported-by: Austrum <austrum.lab@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219158
Tested-by: Austrum <austrum.lab@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://patch.msgid.link/20250128165415.643223-1-visitorckw@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: pcm: use new array-copying-wrapper
Chenyuan Yang [Mon, 27 Jan 2025 16:06:55 +0000 (10:06 -0600)]
ALSA: pcm: use new array-copying-wrapper

This is found by our static analysis tool.

pcm_native.c utilizes memdup_user() to copy an array from userspace.

There is a new wrapper, specifically designed for copying arrays. Use
this one instead.

This is similar to the
commit 3e91a38de1dc ("fbdev: viafb: use new array-copying-wrapper").

Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Link: https://patch.msgid.link/20250127160655.3119470-1-cy1yang@outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: codec: es8316: "DAC Soft Ramp Rate" is just a 2 bit control
Ondrej Jirman [Mon, 27 Jan 2025 15:04:55 +0000 (16:04 +0100)]
ASoC: codec: es8316: "DAC Soft Ramp Rate" is just a 2 bit control

Max value should be 3, otherwise "DAC Soft Ramp Switch" will be
overwritten by this control.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Link: https://patch.msgid.link/20250127150458.1489425-1-megi@xff.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: amd: acp: Fix possible deadlock
Daniel Baluta [Mon, 27 Jan 2025 08:34:22 +0000 (10:34 +0200)]
ASoC: amd: acp: Fix possible deadlock

On error path, function acp_i2s_set_tdm_slot returns without releasing
the lock and this could result in potential deadlocks in the future.

Error reported by sparse:
sound/soc/amd/acp/acp-i2s.c:95:12: error: context imbalance in
'acp_i2s_set_tdm_slot' - different lock contexts for basic block

Fixes: cd60dec8994c ("ASoC: amd: acp: Refactor TDM slots selction based on acp revision id")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250127083422.20406-1-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agofirmware: cs_dsp: FW_CS_DSP_KUNIT_TEST should not select REGMAP
Geert Uytterhoeven [Sat, 25 Jan 2025 19:32:15 +0000 (20:32 +0100)]
firmware: cs_dsp: FW_CS_DSP_KUNIT_TEST should not select REGMAP

Enabling a (modular) test should not silently enable additional kernel
functionality, as that may increase the attack vector of a product.

Fix this by making FW_CS_DSP_KUNIT_TEST (and FW_CS_DSP_KUNIT_TEST_UTILS)
depend on REGMAP instead of selecting it.

After this, one can safely enable CONFIG_KUNIT_ALL_TESTS=m to build
modules for all appropriate tests for ones system, without pulling in
extra unwanted functionality, while still allowing a tester to manually
enable REGMAP_BUILD and this test suite on a system where REGMAP is not
enabled by default.

Fixes: dd0b6b1f29b92202 ("firmware: cs_dsp: Add KUnit testing of bin file download")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://patch.msgid.link/73c81ac85e21f1c5a75b7628d90cbb0e1b4ed0fa.1737833376.git.geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: usb-audio: Add delay quirk for iBasso DC07 Pro
Lianqin Hu [Sun, 26 Jan 2025 03:51:11 +0000 (03:51 +0000)]
ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro

Audio control requests that sets sampling frequency sometimes fail on
this card. Adding delay between control messages eliminates that problem.

usb 1-1: New USB device found, idVendor=2fc6, idProduct=f0b7
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: iBasso DC07 Pro
usb 1-1: Manufacturer: iBasso
usb 1-1: SerialNumber: CTUA171130B

Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/TYUPR06MB62174A48D04E09A37996DF84D2ED2@TYUPR06MB6217.apcprd06.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda/realtek: Fix quirk matching for Legion Pro 7
Takashi Iwai [Sat, 25 Jan 2025 12:04:40 +0000 (13:04 +0100)]
ALSA: hda/realtek: Fix quirk matching for Legion Pro 7

The recent cleanup of the quirk table entries with the codec ID
matching caused a regression on some Lenovo Legion 7 models with PCI
SSID 17aa:386f: it assumed wrongly as if the codec SSID on the machine
were also 17aa:386f, but in this case, it was 17aa:38a8.  This made
the binding with a wrong sub-codec, instead of TAS2781, the Cirrus
codec was bound.

For addressing the regression, correct the quirk entry to the right
value 17aa:38a8.

Note that this makes the entry appearing in an unsorted position.
This exception is needed because the entry must match before the PCI
SSID 17aa:386f.

Also there is another entry for 17aa:38a8, but the latter is for PCI
SSID matching while the new entry is for the codec SSID matching.

Fixes: 504f052aa343 ("ALSA: hda/realtek: Use codec SSID matching for Lenovo devices")
Reported-and-tested-by: Samantha Glocker <iam@anislandsomewhere.com>
Closes: https://lore.kernel.org/CAGPQRHYd48U__UKYj2jJnT4+dnNNoWRBi+wj6zPRn=JpNMBUrg@mail.gmail.com
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250125120519.16420-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: renesas: SND_SIU_MIGOR should depend on DMADEVICES
Geert Uytterhoeven [Fri, 24 Jan 2025 08:52:45 +0000 (09:52 +0100)]
ASoC: renesas: SND_SIU_MIGOR should depend on DMADEVICES

If CONFIG_DMADEVICES=n:

    WARNING: unmet direct dependencies detected for SND_SOC_SH4_SIU
      Depends on [n]: SOUND [=y] && SND [=y] && SND_SOC [=y] && (SUPERH [=y] || ARCH_RENESAS || COMPILE_TEST [=n]) && ARCH_SHMOBILE [=y] && HAVE_CLK [=y] && DMADEVICES [=n]
      Selected by [y]:
      - SND_SIU_MIGOR [=y] && SOUND [=y] && SND [=y] && SND_SOC [=y] && (SUPERH [=y] || ARCH_RENESAS || COMPILE_TEST [=n]) && SH_MIGOR [=y] && I2C [=y]

SND_SIU_MIGOR selects SND_SOC_SH4_SIU.  As the latter depends on
DMADEVICES, the former should depend on DMADEVICES, too.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501241032.oOmsmzvk-lkp@intel.com/
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/8c17ff52584ce824b8b42d08ea1b942ebeb7f4d9.1737708688.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoAdd SOF support for new board revisions
Mark Brown [Thu, 23 Jan 2025 17:49:41 +0000 (17:49 +0000)]
Add SOF support for new board revisions

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

We introduce SOF support for new board revisions for i.MX8MP/QM/QXP
which wrt audio they replace wm8960 codec with wm8962.

Also add support for cs42888 codec on i.MX8QM/8QXP baseboard.

5 months agoASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet 5V
Hans de Goede [Thu, 23 Jan 2025 13:25:07 +0000 (14:25 +0100)]
ASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet 5V

The Vexia EDU ATLA 10 tablet comes in 2 different versions with
significantly different mainboards. The only outward difference is that
the charging barrel on one is marked 5V and the other is marked 9V.

The 5V version mostly works with the BYTCR defaults, except that it is
missing a CHAN package in its ACPI tables and the default of using
SSP0-AIF2 is wrong, instead SSP0-AIF1 must be used. That and its jack
detect signal is not inverted as it usually is.

Add a DMI quirk for the 5V version to fix sound not working.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patch.msgid.link/20250123132507.18434-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: da7213: Initialize the mutex
Claudiu Beznea [Thu, 23 Jan 2025 12:10:36 +0000 (14:10 +0200)]
ASoC: da7213: Initialize the mutex

Initialize the struct da7213_priv::ctrl_lock mutex. Without it the
following stack trace is displayed when rebooting and lockdep is enabled:

DEBUG_LOCKS_WARN_ON(lock->magic != lock)
WARNING: CPU: 0 PID: 180 at kernel/locking/mutex.c:564 __mutex_lock+0x254/0x4e4
CPU: 0 UID: 0 PID: 180 Comm: alsactl Not tainted 6.13.0-next-20250123-arm64-renesas-00002-g132083a22d3d #30
Hardware name: Renesas SMARC EVK version 2 based on r9a08g045s33 (DT)
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __mutex_lock+0x254/0x4e4
lr : __mutex_lock+0x254/0x4e4
sp : ffff800082c13c00
x29: ffff800082c13c00 x28: ffff00001002b500 x27: 0000000000000000
x26: 0000000000000000 x25: ffff800080b30db4 x24: 0000000000000002
x23: ffff800082c13c70 x22: 0000ffffc2a68a70 x21: ffff000010348000
x20: 0000000000000000 x19: ffff00000be2e488 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 00000000000003c1 x13: 00000000000003c1 x12: 0000000000000000
x11: 0000000000000011 x10: 0000000000001420 x9 : ffff800082c13a70
x8 : 0000000000000001 x7 : ffff800082c13a50 x6 : ffff800082c139e0
x5 : ffff800082c14000 x4 : ffff800082c13a50 x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00001002b500
Call trace:
  __mutex_lock+0x254/0x4e4 (P)
  mutex_lock_nested+0x20/0x28
  da7213_volsw_locked_get+0x34/0x60
  snd_ctl_elem_read+0xbc/0x114
  snd_ctl_ioctl+0x878/0xa70
  __arm64_sys_ioctl+0x94/0xc8
  invoke_syscall+0x44/0x104
  el0_svc_common.constprop.0+0xb4/0xd4
  do_el0_svc+0x18/0x20
  el0_svc+0x3c/0xf0
  el0t_64_sync_handler+0xc0/0xc4
  el0t_64_sync+0x154/0x158
 irq event stamp: 7713
 hardirqs last  enabled at (7713): [<ffff800080170d94>] ktime_get_coarse_real_ts64+0xf0/0x10c
 hardirqs last disabled at (7712): [<ffff800080170d58>] ktime_get_coarse_real_ts64+0xb4/0x10c
 softirqs last  enabled at (7550): [<ffff8000800179d4>] fpsimd_restore_current_state+0x30/0xb8
 softirqs last disabled at (7548): [<ffff8000800179a8>] fpsimd_restore_current_state+0x4/0xb8
 ---[ end trace 0000000000000000 ]---

Fixes: 64c3259b5f86 ("ASoC: da7213: Add new kcontrol for tonegen")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20250123121036.70406-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: use to_platform_device() instead of container_of()
Luoxi Li [Thu, 23 Jan 2025 03:39:37 +0000 (11:39 +0800)]
ASoC: use to_platform_device() instead of container_of()

Use the to_platform_device() macro where possible.

Signed-off-by: Luoxi Li <lee.lockhey@gmail.com>
Link: https://patch.msgid.link/20250123033937.3587880-1-lee.lockhey@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: acp: Support microphone from Lenovo Go S
Mario Limonciello [Thu, 23 Jan 2025 02:49:13 +0000 (20:49 -0600)]
ASoC: acp: Support microphone from Lenovo Go S

On Lenovo Go S there is a DMIC connected to the ACP but the firmware
has no `AcpDmicConnected` ACPI _DSD.

Add a DMI entry for all possible Lenovo Go S SKUs to enable DMIC.

Cc: nijs1@lenovo.com
Cc: pgriffais@valvesoftware.com
Cc: mpearson-lenovo@squebb.ca
Cc: stable@vger.kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250123024915.2457115-1-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: imx8m: Add entry for new 8M Plus revision
Iuliana Prodan [Wed, 22 Jan 2025 16:35:44 +0000 (18:35 +0200)]
ASoC: SOF: imx8m: Add entry for new 8M Plus revision

The new revision for 8M Plus has wm8962 codec instead of wm8960.
Therefore add new entry in sof_imx8mp_machs, an array of snd_sof_of_mach,
where we describe topology name and driver name.
For the new revision we have new compatible value and based on this,
we select the new topology file, for wm8962 codec.

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://patch.msgid.link/20250122163544.1392869-5-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: imx8: Add entries for new 8QM and 8QXP revisions
Iuliana Prodan [Wed, 22 Jan 2025 16:35:43 +0000 (18:35 +0200)]
ASoC: SOF: imx8: Add entries for new 8QM and 8QXP revisions

The new revisions for 8QM and 8QXP have wm8962 codec instead of wm8960.
Therefore add new entries in sof_imx8_machs, an array of snd_sof_of_mach,
where we describe topology name and driver name.
For the new revisions we have new compatible values and based on these,
we select the new topology file, for wm8962 codec.

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250122163544.1392869-4-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: imx: Add mach entry to select cs42888 topology
Daniel Baluta [Wed, 22 Jan 2025 16:35:42 +0000 (18:35 +0200)]
ASoC: SOF: imx: Add mach entry to select cs42888 topology

After commit 2b9cdef13648 ("ASoC: SOF: imx: Add devicetree support
to select topologies") we select topology to be used by the board
compatible string in the dts.

Now that we have a way to know when the baseboard is installed, use
the board compatible and select proper topology files when the cs42888
Audio IO card is used.

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250122163544.1392869-3-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agodt-bindings: arm: imx: Add board revisions for i.MX8MP, i.MX8QM and i.MX8QXP
Iuliana Prodan [Wed, 22 Jan 2025 16:35:41 +0000 (18:35 +0200)]
dt-bindings: arm: imx: Add board revisions for i.MX8MP, i.MX8QM and i.MX8QXP

wm8960 codec is EOL so we have i.MX8MP EVK Rev B4,
i.MX8QM MEK Rev D and i.MX8QXP MEK WCPU boards with
wm8962 codec.
Therefore, add compatibles for them.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250122163544.1392869-2-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl_asrc_m2m: select CONFIG_DMA_SHARED_BUFFER
Arnd Bergmann [Wed, 22 Jan 2025 06:53:17 +0000 (07:53 +0100)]
ASoC: fsl_asrc_m2m: select CONFIG_DMA_SHARED_BUFFER

Randconfig builds without dmabuf result in this link error from
the fasl-asrc driver:

ERROR: modpost: "dma_buf_put" [sound/core/snd-compress.ko] undefined!
ERROR: modpost: "dma_buf_export" [sound/soc/fsl/snd-soc-fsl-asrc.ko] undefined!

Add the missing 'select' statement.

Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250122065330.1423248-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: audio-graph-card2: use correct endpoint when getting link parameters
Ivaylo Dimitrov [Tue, 21 Jan 2025 06:48:15 +0000 (08:48 +0200)]
ASoC: audio-graph-card2: use correct endpoint when getting link parameters

When link DT nodes are parsed, most functions get port as a parameter,
which results in port endpoint@0 always being used. However, each endpoint
might have different settings, but those are currently ignored.

Fix that by passing endpoint instead of port when parsing link parameters.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20250121064815.741820-1-ivo.g.dimitrov.75@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: imx8m: add SAI2,5,6,7
Alexander Boehm [Wed, 22 Jan 2025 08:29:27 +0000 (10:29 +0200)]
ASoC: SOF: imx8m: add SAI2,5,6,7

Added the remaining SAIs in addition to SAI1 and SAI3. There is no SAI4.

Signed-off-by: Alexander Boehm <aboehm@eurofunk.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://patch.msgid.link/20250122082928.1321536-1-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: hda: tas2781-spi: Fix bogus error handling in tas2781_hda_spi_probe()
Takashi Iwai [Wed, 22 Jan 2025 08:47:55 +0000 (09:47 +0100)]
ALSA: hda: tas2781-spi: Fix bogus error handling in tas2781_hda_spi_probe()

The error handling in tas2781_hda_spi_probe() has quite a few
problems, as reported by Dan Carpenter.  The code jumps to err label
and calls tas2781_hda_remove(), but this call would rather crash.
In some places, no error code is set properly, and the runtime PM
setup is doubly done.

This patch tries to address those bogus error handling.  Basically we
can return immediately at each error before adding the component.
Also, the error code should be set properly for the unmatched SPI
device name.  And finally, component_add() should be added before
enabling the runtime PM.

Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/ae5fcd48-58ac-49a8-a434-5f779bad0fb7@stanley.mountain
Link: https://patch.msgid.link/20250122084756.23876-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda: tas2781-spi: Fix error code in tas2781_read_acpi()
Dan Carpenter [Wed, 22 Jan 2025 07:18:13 +0000 (10:18 +0300)]
ALSA: hda: tas2781-spi: Fix error code in tas2781_read_acpi()

Propagate the error code from devm_gpiod_get_index_optional().  The
current code returns success.

Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/6103e81a-13bf-4eab-89af-f6830c14e14c@stanley.mountain
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda: tas2781-spi: Delete some dead code
Dan Carpenter [Wed, 22 Jan 2025 07:18:06 +0000 (10:18 +0300)]
ALSA: hda: tas2781-spi: Delete some dead code

The scnprintf() function never returns negatives.  And it won't return
zero here either, plus if it did we'd need to fix the error code.
Delete this dead code.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/d57ded9e-9969-4922-8347-67b758499483@stanley.mountain
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: dt-bindings: ti,pcm1681: Fix the binding title
Fabio Estevam [Tue, 21 Jan 2025 15:57:47 +0000 (12:57 -0300)]
ASoC: dt-bindings: ti,pcm1681: Fix the binding title

The PCM1681 is an 8-channel Digital-to-Analog Converter, so fix it
accordingly.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20250121155747.3740995-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: usb: fcp: Fix return code from poll ops
Takashi Iwai [Tue, 21 Jan 2025 17:00:31 +0000 (18:00 +0100)]
ALSA: usb: fcp: Fix return code from poll ops

Fix a sparse warning due to the invalid return type from poll ops,
which is __poll_t.

Fixes: 46757a3e7d50 ("ALSA: FCP: Add Focusrite Control Protocol driver")
Link: https://patch.msgid.link/20250121170032.7236-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: usb: fcp: Fix incorrect resp->opcode retrieval
Takashi Iwai [Tue, 21 Jan 2025 17:00:30 +0000 (18:00 +0100)]
ALSA: usb: fcp: Fix incorrect resp->opcode retrieval

Fix a wrong conversion macro used for resp->opcode, which is __le32.

Fixes: 46757a3e7d50 ("ALSA: FCP: Add Focusrite Control Protocol driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501212331.SaePSmsA-lkp@intel.com/
Link: https://patch.msgid.link/20250121170032.7236-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: usb: fcp: Fix meter_levels type to __le32
Takashi Iwai [Tue, 21 Jan 2025 17:00:29 +0000 (18:00 +0100)]
ALSA: usb: fcp: Fix meter_levels type to __le32

The cached level meter values are returned from the USB core as
__le32, hence declare properly.

Fixes: 46757a3e7d50 ("ALSA: FCP: Add Focusrite Control Protocol driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501212331.SaePSmsA-lkp@intel.com/
Link: https://patch.msgid.link/20250121170032.7236-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback
Detlev Casanova [Fri, 17 Jan 2025 16:31:02 +0000 (11:31 -0500)]
ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback

In commit
9e2ab4b18ebd ("ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates"),
the set_sysclk callback was removed as considered unused as the mclk rate
can be set in the hw_params callback.
The difference between hw_params and set_sysclk is that the former is
called with the audio sampling rate set in the params (e.g.: 48000 Hz)
while the latter is called with a clock rate already computed with
  sampling_rate * mclk-fs (e.g.: 48000 * 256)

For HDMI audio using the Rockchip I2S TDM driver, the mclk-fs value must
be set to 128 instead of the default 256, and that value is set in the
device tree at the machine driver level (like a simple-audio-card
compatible node).
Therefore, the i2s_tdm driver has no idea that another mclk-fs value can
be configured and simply computes the mclk rate in the hw_params callback
with DEFAULT_MCLK_FS * params_rate(params), which is wrong for HDMI
audio.

Re-add the set_sysclk callback so that the mclk rate is computed by the
machine driver which has the correct mclk-fs value set in its device tree
node.

Fixes: 9e2ab4b18ebd ("ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates")
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Link: https://patch.msgid.link/20250117163102.65807-1-detlev.casanova@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: hda/realtek: Enable Mute LED on HP Laptop 14s-fq1xxx
Sebastian Wiese-Wagner [Mon, 20 Jan 2025 18:12:40 +0000 (19:12 +0100)]
ALSA: hda/realtek: Enable Mute LED on HP Laptop 14s-fq1xxx

This HP Laptop uses ALC236 codec with COEF 0x07 controlling the mute
LED. Enable existing quirk for this device.

Signed-off-by: Sebastian Wiese-Wagner <seb@fastmail.to>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250120181240.13106-1-seb@fastmail.to
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: fsl: two fixes for asrc memory to memory
Mark Brown [Mon, 20 Jan 2025 18:54:36 +0000 (18:54 +0000)]
ASoC: fsl: two fixes for asrc memory to memory

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

1. Fix the suspend failure for memory to peripheral function.
2. Return error value for processing function.

5 months agoMerge tag 'asoc-v6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Mon, 20 Jan 2025 15:15:07 +0000 (16:15 +0100)]
Merge tag 'asoc-v6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v6.14

This was quite a quiet release for what I imagine are holiday related
reasons, the diffstat is dominated by some Cirrus Logic Kunit tests.
There's the usual mix of small improvements and fixes, plus a few new
drivers and features.  The diffstat includes some DRM changes due to
work on HDMI audio.

 - Allow clocking on each DAI in an audio graph card to be configured
   separately.
 - Improved power management for Renesas RZ-SSI.
 - KUnit testing for the Cirrus DSP framework.
 - Memory to meory operation support for Freescale/NXP platforms.
 - Support for pause operations in SOF.
 - Support for Allwinner suinv F1C100s, Awinc AW88083, Realtek
   ALC5682I-VE

5 months agoASoC: codecs: ES8326: Improved PSRR
Zhang Yi [Mon, 20 Jan 2025 10:17:58 +0000 (18:17 +0800)]
ASoC: codecs: ES8326: Improved PSRR

Modified configuration to improve PSSR when ES8326 is working

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20250120101758.13347-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl_asrc_m2m: return error value in asrc_m2m_device_run()
Shengjiu Wang [Mon, 20 Jan 2025 08:19:38 +0000 (16:19 +0800)]
ASoC: fsl_asrc_m2m: return error value in asrc_m2m_device_run()

The asrc_m2m_device_run() function is the main process function
of converting, the error need to be returned to user, that user
can handle error case properly.

Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250120081938.2501554-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl_asrc_m2m: only handle pairs for m2m in the suspend
Shengjiu Wang [Mon, 20 Jan 2025 08:19:37 +0000 (16:19 +0800)]
ASoC: fsl_asrc_m2m: only handle pairs for m2m in the suspend

ASRC memory to memory cases and memory to peripheral cases are
sharing the same pair pools, the pairs got for m2m suspend
function may be used for memory to peripheral, which is handled
memory to peripheral driver and can't be handled in
memory to memory suspend function.

Use the "pair->dma_buffer" as a flag for memory to memory case,
when it is allocated, handle the suspend operation for the related
pairs.

Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250120081938.2501554-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: hda: tas2781-spi: Fix -Wsometimes-uninitialized in tasdevice_spi_switch_book()
Nathan Chancellor [Mon, 20 Jan 2025 13:32:48 +0000 (06:32 -0700)]
ALSA: hda: tas2781-spi: Fix -Wsometimes-uninitialized in tasdevice_spi_switch_book()

Clang warns (or errors with CONFIG_WERROR=y):

  sound/pci/hda/tas2781_hda_spi.c:110:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    110 |         if (tas_priv->cur_book != TASDEVICE_BOOK_ID(reg)) {
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sound/pci/hda/tas2781_hda_spi.c:119:9: note: uninitialized use occurs here
    119 |         return ret;
        |                ^~~
  sound/pci/hda/tas2781_hda_spi.c:110:2: note: remove the 'if' if its condition is always true
    110 |         if (tas_priv->cur_book != TASDEVICE_BOOK_ID(reg)) {
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sound/pci/hda/tas2781_hda_spi.c:108:9: note: initialize the variable 'ret' to silence this warning
    108 |         int ret;
        |                ^
        |                 = 0

Sink the declaration of ret into the if block and just return 0 at the
end of the function, as there is nothing to do if cur_book has already
been changed.

Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501192006.Hm9GmKiV-lkp@intel.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20250120-tas2781_hda_spi-fix-wsometimes-uninitialized-v1-1-d7fd104aa63e@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: ctxfi: Simplify dao_clear_{left,right}_input() functions
Ethan Carter Edwards [Mon, 20 Jan 2025 01:10:30 +0000 (20:10 -0500)]
ALSA: ctxfi: Simplify dao_clear_{left,right}_input() functions

There was a lote of code duplication in the dao_clear_left_input() and
dao_clear_right_input() functions. A new function, dao_clear_input(),
was created and now the left and right functions call it instead of
repeating themselves.

Link: https://lore.kernel.org/lkml/NyKCr2VHK_xCQDwNxFKKx2LVd2d_AC2f2j4eAvnD9uRPtb50i2AruCLOp6mHxsGiyYJ0Tgd3Z50Oy1JTi5gPhjd2WQM2skrv7asp3fLl8HU=@ethancedwards.com/
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
Link: https://patch.msgid.link/x3glr6fetk7d7hlqimkv6g5krz2oibe7yusms3d7zk4ofrhlrx@75avihssncc5
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoMerge branch 'for-linus' into for-next
Takashi Iwai [Mon, 20 Jan 2025 08:25:33 +0000 (09:25 +0100)]
Merge branch 'for-linus' into for-next

Pull pending ASoC and HD-audio fixes for 6.14-rc1

Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda: tas2781-spi: select CRC32 instead of CRC32_SARWATE
Takashi Iwai [Mon, 20 Jan 2025 07:46:54 +0000 (08:46 +0100)]
ALSA: hda: tas2781-spi: select CRC32 instead of CRC32_SARWATE

Just like the I2C driver (as in commit 86c96e7289c5 "ALSA:
hda/tas2781: select CRC32 instead of CRC32_SARWATE"), the new tas2781
SPI driver has to select CONFIG_CRC32 instead of
CONFIG_CRC32_SARWATE for fixing the build failures.

Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver")
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/20250120181744.6433557e@canb.auug.org.au
Link: https://patch.msgid.link/20250120074655.922-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: usb: fcp: Fix hwdep read ops types
Stephen Rothwell [Mon, 20 Jan 2025 03:56:17 +0000 (14:56 +1100)]
ALSA: usb: fcp: Fix hwdep read ops types

The FCP driver defined hwdep read function with ssize_t, but it should
be long due to historical reason.  This caused build errors on 32bit
archs.

Fixes: 46757a3e7d50 ("ALSA: FCP: Add Focusrite Control Protocol driver")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://patch.msgid.link/20250120145617.07945574@canb.auug.org.au
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: scarlett2: Add device_setup option to use FCP driver
Geoffrey D. Bennett [Thu, 16 Jan 2025 17:47:58 +0000 (04:17 +1030)]
ALSA: scarlett2: Add device_setup option to use FCP driver

Add a new device_setup option (SCARLETT2_USE_FCP_DRIVER = 0x08) that
allows users to opt in to using the new FCP driver instead of the
existing scarlett2 driver for their device. This provides a way to
test the new FCP driver on existing supported hardware while keeping
the Scarlett2 driver as the default.

When the SCARLETT2_USE_FCP_DRIVER bit is set in device_setup, the
scarlett2 driver initialisation will hand off to the FCP driver
instead of proceeding with its own initialisation. The FCP driver then
provides access to the device via its hwdep interface.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://patch.msgid.link/94ffd7971d73cb0cbea6933b28f7528ce5b9edde.1737048528.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: FCP: Add Focusrite Control Protocol driver
Geoffrey D. Bennett [Thu, 16 Jan 2025 17:47:38 +0000 (04:17 +1030)]
ALSA: FCP: Add Focusrite Control Protocol driver

Add a new kernel driver for the Focusrite Control Protocol (FCP),
which is used by Focusrite Scarlett 2nd Gen, 3rd Gen, 4th Gen, Clarett
USB, Clarett+, and Vocaster series audio interfaces. This driver
provides a user-space control interface via ALSA's hwdep subsystem.

Unlike the existing Scarlett2 driver which implements all ALSA
controls in kernel space, this new FCP driver takes a different
approach by providing a minimal kernel interface that allows a
user-space driver to send FCP commands and receive notifications. The
only control implemented in kernel space is the Level Meter, since it
requires frequent polling of volatile data.

While this driver supports all interfaces that the Scarlett2 driver
works with, it is initially enabled only for 4th Gen 16i16, 18i16,
and 18i20 interfaces that are not supported by the Scarlett2 driver.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://patch.msgid.link/597741a9b1198b965561547511d3d345f91cba20.1737048528.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoMerge tag 'asoc-fix-v6.13-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Sat, 18 Jan 2025 08:14:40 +0000 (09:14 +0100)]
Merge tag 'asoc-fix-v6.13-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.13

A few final driver specific fixes - a couple of x86 ID field changes,
plus bug fixes for simple-card-utils and nau8824.

5 months agoALSA: hda/tas2781: Add tas2781 hda SPI driver
Baojun Xu [Mon, 16 Dec 2024 12:20:08 +0000 (20:20 +0800)]
ALSA: hda/tas2781: Add tas2781 hda SPI driver

This patch was used to add TAS2781 devices on SPI support in sound/pci/hda.
It use ACPI node descript about parameters of TAS2781 on SPI, it like:
    Scope (_SB.PC00.SPI0)
    {
        Device (GSPK)
        {
            Name (_HID, "TXNW2781")  // _HID: Hardware ID
            Method (_CRS, 0, NotSerialized)
            {
                Name (RBUF, ResourceTemplate ()
                {
                    SpiSerialBusV2 (...)
                    SpiSerialBusV2 (...)
                }
            }
        }
    }

And in platform/x86/serial-multi-instantiate.c, those spi devices will be
added into system as a single SPI device, so TAS2781 SPI driver will
probe twice for every single SPI device. And driver will also parser
mono DSP firmware binary and RCA binary for itself.
The code support Realtek as the primary codec.
In patch version-10, add multi devices firmware binary support,
to compatble with windows driver, they can share same firmware binary.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>
Link: https://patch.msgid.link/20241216122008.15425-1-baojun.xu@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda/realtek - Fixed headphone distorted sound on Acer Aspire A115-31 laptop
Kailang Yang [Mon, 30 Dec 2024 06:44:01 +0000 (14:44 +0800)]
ALSA: hda/realtek - Fixed headphone distorted sound on Acer Aspire A115-31 laptop

Sound played through headphones is distorted.

Fixes: 34ab5bbc6e82 ("ALSA: hda/realtek - Add Headset Mic supported Acer NB platform")
Closes: https://lore.kernel.org/linux-sound/e142749b-7714-4733-9452-918fbe328c8f@gmail.com/
Signed-off-by: Kailang Yang <kailang@realtek.com>
Link: https://lore.kernel.org/0a89b6c18ed94378a105fa61e9f290e4@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: xilinx: xlnx_spdif: Simpify using devm_clk_get_enabled()
Michal Simek [Thu, 16 Jan 2025 14:55:46 +0000 (15:55 +0100)]
ASoC: xilinx: xlnx_spdif: Simpify using devm_clk_get_enabled()

Clock handling can be very simlified with using devm_clk_get_enabled() as
was done by commit 8d2aaf4382b7 ("gpio: zynq: Simplify using
devm_clk_get_enabled()").

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/90075f57ceff7cdf958d0d146f46f50661335236.1737039345.git.michal.simek@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Fix DMI match entries for a
Mark Brown [Wed, 15 Jan 2025 19:50:01 +0000 (19:50 +0000)]
ASoC: Intel: sof_sdw: Fix DMI match entries for a

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

Those laptops use host DMIC. Correct the DMI match entries.

5 months agoALSA: hda: Support for Ideapad hotkey mute LEDs
Jackie Dong [Wed, 15 Jan 2025 16:25:15 +0000 (00:25 +0800)]
ALSA: hda: Support for Ideapad hotkey mute LEDs

New ideapad helper file with support for handling FN key mute LEDs.
Update conexant and realtec codec to add LED support.

Suggested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Jackie Dong <xy-jackie@139.com>
Link: https://patch.msgid.link/20250115162515.15026-1-xy-jackie@139.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83JX, 83MC and 83NM
Simon Trimmer [Thu, 2 Jan 2025 12:33:35 +0000 (20:33 +0800)]
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83JX, 83MC and 83NM

Update the DMI match for a Lenovo laptop to a new DMI identifier.

This laptop ships with a different DMI identifier to what was expected
and now has three match entries. It also has the DMICs connected to the
host rather than the cs42l43 codec.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Fixes: 83c062ae81e8 ("ASoC: Intel: sof_sdw: Add quirks for some new Lenovo laptops")
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250102123335.256698-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83LC
Simon Trimmer [Thu, 2 Jan 2025 12:33:34 +0000 (20:33 +0800)]
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83LC

Update the DMI match for a Lenovo laptop to the new DMI identifier.

This laptop ships with a different DMI identifier to what was expected,
and also has the DMICs connected to the host rather than the cs42l43
codec.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Fixes: 83c062ae81e8 ("ASoC: Intel: sof_sdw: Add quirks for some new Lenovo laptops")
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250102123335.256698-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dapm: add support for preparing streams
Martin Blumenstingl [Tue, 14 Jan 2025 21:56:17 +0000 (22:56 +0100)]
ASoC: dapm: add support for preparing streams

Codec driver can implement .hw_params and/or .prepare from struct
snd_soc_dai_ops. For codec-to-codec links only the former (.hw_params)
callback has been called.

On platforms like Amlogic Meson8/8b/8m2 the SoC's sound card
(sound/soc/meson/gx-card.c) uses a codec-to-codec link for the HDMI
codec output because further digital routing is required after the
backend. The new DRM HDMI (audio) codec framework (which internally
uses sound/soc/codecs/hdmi-codec.c) relies on the .prepare callback
of the hdmi-codec to be called. Implement calls to
snd_soc_dai_prepare() so the .prepare callback is called. In this
case the mandatory part is the call to prepare the sink (which is
the hdmi-codec on those platforms). Also call snd_soc_dai_prepare()
for the source to stay consistent with the rest of the code (even
though it's not strictly necessary to make the DRM HDMI codec
framework work on Amlogic Meson8/8b/8m2).

For platforms or sound cards without a codec-to-codec link with
additional parameters (which applies to most hardware) this changes
nothing as the .prepare callback is already called via
snd_pcm_do_prepare() (as well as dpcm_fe_dai_prepare() and
dpcm_be_dai_prepare()) on those.

Suggested-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://patch.msgid.link/20250114215617.336105-3-martin.blumenstingl@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: soc-dai: add snd_soc_dai_prepare() and use it internally
Martin Blumenstingl [Tue, 14 Jan 2025 21:56:16 +0000 (22:56 +0100)]
ASoC: soc-dai: add snd_soc_dai_prepare() and use it internally

Add a new snd_soc_dai_prepare() which can be used (in an upcoming patch)
by soc-dapm.c. Use this new function internally in
snd_soc_pcm_dai_prepare() to avoid duplicating code.

Suggested-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20250114215617.336105-2-martin.blumenstingl@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: simple-card-utils: fix priv->dai_props indexing
Laurentiu Mihalcea [Tue, 14 Jan 2025 18:43:14 +0000 (13:43 -0500)]
ASoC: simple-card-utils: fix priv->dai_props indexing

As of commit cb18cd26039f ("ASoC: soc-core: do rtd->id trick at
snd_soc_add_pcm_runtime()") the ID stored in the PCM runtime data can
no longer be safely used to index the priv->dai_props array. This is
because the ID may be modified during snd_soc_add_pcm_runtime(), thus
resulting in an ID that's no longer a valid array index.

To fix this, use the position of the dai_link stored inside the PCM
runtime data relative to the start of the dai_link array as index into
the priv->dai_props array.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20250114184314.3583-2-laurentiumihalcea111@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: usb-audio: Add delay quirk for USB Audio Device
Lianqin Hu [Wed, 15 Jan 2025 09:32:35 +0000 (09:32 +0000)]
ALSA: usb-audio: Add delay quirk for USB Audio Device

Audio control requests that sets sampling frequency sometimes fail on
this card. Adding delay between control messages eliminates that problem.

usb 1-1: New USB device found, idVendor=0d8c, idProduct=0014
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: USB Audio Device
usb 1-1: Manufacturer: C-Media Electronics Inc.

Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/TYUPR06MB6217E94D922B9BF422A73F32D2192@TYUPR06MB6217.apcprd06.prod.outlook.com
5 months agoALSA: hda: Transfer firmware in two chunks
Cezary Rojewski [Tue, 14 Jan 2025 18:42:39 +0000 (19:42 +0100)]
ALSA: hda: Transfer firmware in two chunks

As per specification, SDxLVI shall be at least 1 i.e.: two chunks to
perform a valid transfer. This is true for the PCM transfer code but
not firmware-transfer one.

Technical background:
- the LVI > 0 rule shall be obeyed in PCM transfer
- HW permits LVI == 0 when transfer is SW-controlled (SPIB)
- FW download is not a PCM transfer and is SW-controlled (SPIB)

The above is the fundament which AudioDSP firmware loading functions
have been built upon and worked since 2016. The presented changes are to
align the loading flows and avoid rising more questions in the future.

Achieve the goal by splitting snd_hdac_stream_setup_periods() into
substream-dependent and -independent part. Let snd_hdac_dsp_prepare()
utilize the latter so that both DSP-loading and PCM flows utilize same
BLDE setup loop which already takes care of cutting the buffer based on
azx_dev->period_bytes.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250114184239.120002-1-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda/realtek: Enable headset mic on Positivo C6400
Edson Juliano Drosdeck [Tue, 14 Jan 2025 17:06:19 +0000 (14:06 -0300)]
ALSA: hda/realtek: Enable headset mic on Positivo C6400

Positivo C6400 is equipped with ALC269VB, and it needs
ALC269VB_FIXUP_ASUS_ZENBOOK quirk to make its headset mic work.
Also must to limits the microphone boost.

Signed-off-by: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250114170619.11510-1-edson.drosdeck@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: fsl: Support micfil on i.MX943
Mark Brown [Tue, 14 Jan 2025 16:35:46 +0000 (16:35 +0000)]
ASoC: fsl: Support micfil on i.MX943

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

On i.MX943, the FIFO data address is changed and the bit width
of CICOSR is changed.
Add a new compatible string and update driver for these changes.

5 months agoALSA: rawmidi: Make tied_device=0 as default / unknown
Takashi Iwai [Tue, 14 Jan 2025 10:47:01 +0000 (11:47 +0100)]
ALSA: rawmidi: Make tied_device=0 as default / unknown

In the original change, rawmidi_info.tied_device showed -1 for the
unknown or untied device.  But this would require the user-space to
check the protocol version and judge the value conditionally, which
is rather error-prone.

Instead, set the tied_device = 0 to be default as unknown, and
indicate the real device with the offset 1, for achieving more
backward compatibility.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20250114104711.19197-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: sun4i-codec: Use new devm clk and reset APIs
Bence Csókás [Tue, 14 Jan 2025 09:59:07 +0000 (10:59 +0100)]
ASoC: sun4i-codec: Use new devm clk and reset APIs

Clean up error handling by using the new devm_
clock and reset functions. This should make it
easier to add new code, as we can eliminate the
"goto ladder" in probe().

Signed-off-by: Bence Csókás <csokas.bence@prolan.hu>
Link: https://patch.msgid.link/20250114095909.798559-1-csokas.bence@prolan.hu
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: soc-dapm: remove !card check from snd_soc_dapm_set_bias_level()
Kuninori Morimoto [Tue, 14 Jan 2025 01:06:22 +0000 (01:06 +0000)]
ASoC: soc-dapm: remove !card check from snd_soc_dapm_set_bias_level()

dapm is setup by snd_soc_dapm_init(), thus dapm->card never been NULL.
We don't need if (!card) check for it.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/877c6ytd9t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl,micfil: Add compatible string for i.MX943 platform
Shengjiu Wang [Tue, 14 Jan 2025 10:27:20 +0000 (18:27 +0800)]
ASoC: dt-bindings: fsl,micfil: Add compatible string for i.MX943 platform

Add compatible string "fsl,imx943-micfil" for i.MX943 platform.
The definition of register map and some register bit map is
different on the i.MX943 platform.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20250114102720.3664667-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl_micfil: Add i.MX943 platform support
Shengjiu Wang [Tue, 14 Jan 2025 10:27:19 +0000 (18:27 +0800)]
ASoC: fsl_micfil: Add i.MX943 platform support

On i.MX943, the FIFO data address is changed to 0x20~0x3c,
compared to previous version, there is a minus 4 offset,
so add a new regmap configuration for it.
And the bit width of CICOSR is changed to 5 bits, from bit
16th to 20th in REG_MICFIL_CTRL2 register, so update its
definition header file.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20250114102720.3664667-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: hda: Add AZX_DCAPS_NO_TCSEL flag for Loongson HDA devices
Qunqin Zhao [Tue, 14 Jan 2025 08:07:00 +0000 (16:07 +0800)]
ALSA: hda: Add AZX_DCAPS_NO_TCSEL flag for Loongson HDA devices

Loongson's HDA devices do not support TCSEL functionality.

Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn>
Link: https://patch.msgid.link/20250114080700.23029-1-zhaoqunqin@loongson.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: extra format on each DAI
Mark Brown [Mon, 13 Jan 2025 20:08:47 +0000 (20:08 +0000)]
ASoC: extra format on each DAI

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Current clock provider/consumer setting is set by dai_link->dai_fmt, and it
is Codec base on Sound Card driver (= SND_SOC_DAIFMT_CBx_CFx).

Current CPU/Codec drivers are already based on its own base
(= SND_SOC_DAIFMT_Bx_Fx). So, Codec clock setting uses dai_link->dai_fmt
as-is, and CPU side clock setting is created from Codec base setting by
flipping. Because of this, we can't set both CPU/Codec clock consumer for
example.

To solve this issue, this patch-set adds new ext_fmt on each DAI.
It can keep compatible with legacy style.

1. SND_SOC_DAIFMT_FORMAT_MASK
2. SND_SOC_DAIFMT_CLOCK
3. SND_SOC_DAIFMT_INV
4. SND_SOC_DAIFMT_CLOCK_PROVIDER

dai_fmt : dai_link->dai_fmt = common settings
ext_fmt : each DAI settings

Legacy
dai_fmt  includes 1, 2, 3, 4

New style
dai_fmt  includes 1, 2, 3
ext_fmt  includes 4

Audio-Graph-Card2 will use this new style by this patch-set.
By this patch, Card2 default behavior (= no "clock-master / frame-master"
settings on DT) will be changed, but no drivers are using it.

In case of no DAI has "clock-master / frame-master" property on DT,
it will be...

Legacy
CPU  : provider (because flipped from Codec)
Codec: consumer

New style
CPU  : consumer
Codec: consumer

One note is that Simple-Card, Audio-Graph-Card don't implement
this new style to keep compatiblily.

In Overlay case, port order can be random, so we shouldn't use get_next()
function to get next port.

5 months agoASoC: fsl: Support MQS on i.MX943
Mark Brown [Mon, 13 Jan 2025 18:33:14 +0000 (18:33 +0000)]
ASoC: fsl: Support MQS on i.MX943

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

There are two MQS instances on the i.MX943 platform.
The definition of bit positions in the control register are
different. In order to support these MQS modules, define
two compatible strings to distinguish them.

5 months agoASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
Thorsten Blum [Mon, 13 Jan 2025 00:10:01 +0000 (01:10 +0100)]
ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE

Use the ARRAY_SIZE() macro to calculate PEB2466_TLV_SIZE and improve the
code's readability.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20250113001001.400669-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: Use str_yes_no() to improve bdw_dump()
Thorsten Blum [Tue, 7 Jan 2025 11:08:59 +0000 (12:08 +0100)]
ASoC: SOF: Intel: Use str_yes_no() to improve bdw_dump()

Remove hard-coded strings by using the str_yes_no() helper function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250107110900.3716-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: audio-graph-card2: Use extra format on each DAI
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:49 +0000 (05:49 +0000)]
ASoC: audio-graph-card2: Use extra format on each DAI

Current ASoC is using dai_link->dai_fmt to set DAI format for both
CPU/Codec. But because it is using same settings, and
SND_SOC_DAIFMT_CLOCK_PROVIDER is flipped for CPU, we can't set both
CPU/Codec as clock consumer, for example.

To solve this issue, this patch uses extra format for each DAI which can
keep compatibility with legacy system,

1. SND_SOC_DAIFMT_FORMAT_MASK
2. SND_SOC_DAIFMT_CLOCK
3. SND_SOC_DAIFMT_INV
4. SND_SOC_DAIFMT_CLOCK_PROVIDER

Legacy
dai_fmt  includes 1, 2, 3, 4

New idea
dai_fmt  includes 1, 2, 3
ext_fmt  includes 4

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87pll0o5j6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: soc-core: Enable to use extra format on each DAI
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:45 +0000 (05:49 +0000)]
ASoC: soc-core: Enable to use extra format on each DAI

Current ASoC is using dai_link->dai_fmt to set DAI format for both
CPU/Codec. But because it is using same settings, and
SND_SOC_DAIFMT_CLOCK_PROVIDER is flipped for CPU, we can't set both
CPU/Codec as clock consumer, for example.

To solve this issue, this patch enable to use extra format for each
DAI which can keep compatibility with legacy system,

1. SND_SOC_DAIFMT_FORMAT_MASK
2. SND_SOC_DAIFMT_CLOCK
3. SND_SOC_DAIFMT_INV
4. SND_SOC_DAIFMT_CLOCK_PROVIDER

Legacy
dai_fmt  includes 1, 2, 3, 4

New idea
dai_fmt  includes 1, 2, 3
ext_fmt  includes 4

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87r05go5ja.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: audio-graph-card2: use of_graph_get_port_by_id() at graph_get_next_multi_ep()
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:41 +0000 (05:49 +0000)]
ASoC: audio-graph-card2: use of_graph_get_port_by_id() at graph_get_next_multi_ep()

Audio Graph Card2 is assuming "port" are necessarily in order, but there
is no guarantee in case of overlay. Use of_graph_get_port_by_id() instead
to handle it correctly.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87sepwo5jf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: soc-core: return 0 if np was NULL on snd_soc_daifmt_parse_clock_provider_raw()
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:33 +0000 (05:49 +0000)]
ASoC: soc-core: return 0 if np was NULL on snd_soc_daifmt_parse_clock_provider_raw()

snd_soc_daifmt_parse_clock_provider_raw() might be called with NULL np.
Return 0 in such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87ttaco5jm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: simple-card: use __free(device_node) for device node
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:28 +0000 (05:49 +0000)]
ASoC: simple-card: use __free(device_node) for device node

simple-card handles many type of device_node, thus need to
use of_node_put() in many place. Let's use __free(device_node)
and avoid it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87v7uso5js.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: audio-graph-card: use __free(device_node) for device node
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:18 +0000 (05:49 +0000)]
ASoC: audio-graph-card: use __free(device_node) for device node

audio-graph-card handles many type of device_node, thus need to
use of_node_put() in many place. Let's use __free(device_node)
and avoid it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87wmf8o5k1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: audio-graph-card2: use __free(device_node) for device node
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:07 +0000 (05:49 +0000)]
ASoC: audio-graph-card2: use __free(device_node) for device node

audio-graph-card2 handles many type of device_node, thus need to
use of_node_put() in many place. Let's use __free(device_node)
and avoid it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Stephen Gordon <gordoste@iinet.net.au>
Link: https://patch.msgid.link/87y0zoo5kc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: nau8824: fix max volume for Speaker output
Maxim Kochetkov [Thu, 19 Dec 2024 04:22:27 +0000 (07:22 +0300)]
ASoC: codecs: nau8824: fix max volume for Speaker output

There is no audio output if Speaker volume is set above 25.
According to datasheet Rev 2.5 maximum allowed value for the
Speaker output is 0b11001 (25)

0x6D CLASSD_GAIN_1/ 0x6E CLASSD_GAIN_2:

Left/Right Channel Class-D Driver Gain For DAC Left/Right
Input
(Step size is 1dB.)
00000 = Mute (DEFAULT)
00001 = 0dB
00002 = 1dB
...
11000 = 23dB
11001 = 24dB

So adjust this value in accordance with the datasheet.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://patch.msgid.link/20241219042227.7075-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl,mqs: Add compatible string for i.MX943 platform
Shengjiu Wang [Mon, 13 Jan 2025 09:03:21 +0000 (17:03 +0800)]
ASoC: dt-bindings: fsl,mqs: Add compatible string for i.MX943 platform

There are two MQS instances on the i.MX943 platform.
The definition of bit positions in the control register are
different. In order to support these MQS modules, define
two compatible strings to distinguish them.

As one instance is in the always-on domain, another is in the
wakeup domain, so the compatible strings are
"fsl,imx943-aonmix-mqs", "fsl,imx943-wakeupmix-mqs".

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250113090321.3193464-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl_mqs: Add i.MX943 platform support
Shengjiu Wang [Mon, 13 Jan 2025 09:03:20 +0000 (17:03 +0800)]
ASoC: fsl_mqs: Add i.MX943 platform support

There are two MQS instances on the i.MX943 platform.
The definition of bit positions in the control register are
different. In order to support these MQS modules, define
two compatible strings to distinguish them.

On i.MX943 one instance is in Always-on mix, another is in
Wakeup-mix.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250113090321.3193464-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: hda/realtek: Fix volume adjustment issue on Lenovo ThinkBook 16P Gen5
Yage Geng [Mon, 13 Jan 2025 08:52:08 +0000 (16:52 +0800)]
ALSA: hda/realtek: Fix volume adjustment issue on Lenovo ThinkBook 16P Gen5

This patch fixes the volume adjustment issue on the Lenovo ThinkBook 16P Gen5
by applying the necessary quirk configuration for the Realtek ALC287 codec.

The issue was caused by incorrect configuration in the driver,
which prevented proper volume control on certain systems.

Signed-off-by: Yage Geng <icoderdev@gmail.com>
Link: https://patch.msgid.link/20250113085208.15351-1-icoderdev@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: seq: Notify UMP EP and FB changes
Takashi Iwai [Fri, 10 Jan 2025 15:59:41 +0000 (16:59 +0100)]
ALSA: seq: Notify UMP EP and FB changes

So far we notify the sequencer client and port changes upon UMP FB
changes, but those aren't really corresponding to the UMP updates.
e.g. when a FB info gets updated, it's not notified but done only when
some of sequencer port attribute is changed.  This is no ideal
behavior.

This patch adds the two new sequencer event types for notifying the
UMP EP and FB changes via the announce port.  The new event takes
snd_seq_ev_ump_notify type data, which is compatible with
snd_seq_addr (where the port number is replaced with the block
number).

The events are sent when the EP and FB info gets updated explicitly
via ioctl, or the backend UMP receives the corresponding UMP
messages.

The sequencer protocol version is bumped to 1.0.5 along with it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-9-tiwai@suse.de
5 months agoALSA: seq: Allow system notification in atomic
Takashi Iwai [Fri, 10 Jan 2025 15:59:40 +0000 (16:59 +0100)]
ALSA: seq: Allow system notification in atomic

Currently the system notification helper assumes only the non-atomic
delivery.  For allowing an event delivery in non-atomic context, add
the atomic flag to the helper function.

This is a preliminary change for the support of UMP EP/FB
notification.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-8-tiwai@suse.de
5 months agoALSA: ump: Update rawmidi name per EP name update
Takashi Iwai [Fri, 10 Jan 2025 15:59:39 +0000 (16:59 +0100)]
ALSA: ump: Update rawmidi name per EP name update

The rawmidi name string should be updated dynamically when the device
receives the UMP EP name update, too.  Both the core and legacy
rawmidi names are updated.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-7-tiwai@suse.de
5 months agoALSA: ump: Copy safe string name to rawmidi
Takashi Iwai [Fri, 10 Jan 2025 15:59:38 +0000 (16:59 +0100)]
ALSA: ump: Copy safe string name to rawmidi

The UMP helper didn't set up the rawmidi name string by itself but
left it to the driver.  But since the only user (USB MIDI2 driver)
picks up the UMP info name string to the rawmidi name as default, it's
better to set up in the UMP core side.

Meanwhile, UMP receives the EP name string from the device, and it
might contain garbage letters.  We should purify the string to be
usable for the kernel as done previously for UMP Group names.

This implements the copy of the UMP info name string into the rawmidi
name at the creation of UMP EP object in a safe way to strip the
non-ASCII or non-printable characters.  Also, change the reference
from the legacy rawmidi and other places to rawmidi name field instead
of ump info; this assures the sane strings.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-6-tiwai@suse.de
5 months agoALSA: ump: Copy FB name string more safely
Takashi Iwai [Fri, 10 Jan 2025 15:59:37 +0000 (16:59 +0100)]
ALSA: ump: Copy FB name string more safely

The UMP group names are referred as the corresponding sequencer port
names, hence they should be proper ASCII strings.  OTOH, the UMP group
names are composed from the UMP FB strings that are received from the
device; i.e. a device may give some bogus letters and we can't trust
them fully.

To assure that the group names consist of the proper ASCII strings,
replace the normal string copy and append operations with special ones
that strip the non-printable letters.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-5-tiwai@suse.de
5 months agoALSA: rawmidi: Bump protocol version to 2.0.5
Takashi Iwai [Fri, 10 Jan 2025 15:59:36 +0000 (16:59 +0100)]
ALSA: rawmidi: Bump protocol version to 2.0.5

Bump the protocol version to 2.0.5, as we extended the rawmidi ABI for
the new tied_device info and the substream inactive flag.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-4-tiwai@suse.de
5 months agoALSA: rawmidi: Show substream activity in info ioctl
Takashi Iwai [Fri, 10 Jan 2025 15:59:35 +0000 (16:59 +0100)]
ALSA: rawmidi: Show substream activity in info ioctl

The UMP legacy rawmidi may turn on/off the substream dynamically
depending on the UMP Function Block information.  So far, there was no
direct way to know whether the substream is disabled (inactive) or
not; at most one can take a look at the substream name string or try
to open and get -ENODEV.

This patch extends the rawmidi info ioctl to show the current inactive
state of the given substream.  When the selected substream is
inactive, info flags field contains the new bit flag
SNDRV_RAWMIDI_INFO_STREAM_INACTIVE.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-3-tiwai@suse.de
5 months agoALSA: rawmidi: Expose the tied device number in info ioctl
Takashi Iwai [Fri, 10 Jan 2025 15:59:34 +0000 (16:59 +0100)]
ALSA: rawmidi: Expose the tied device number in info ioctl

The UMP legacy rawmidi is derived from the UMP rawmidi, but currently
there is no way to know which device is involved in other side.

This patch extends the rawmidi info ioctl to show the tied device
number.  As default it stores -1, indicating that no tied device.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-2-tiwai@suse.de
5 months agoALSA: hda/realtek: fixup ASUS H7606W
Luke D. Jones [Sat, 11 Jan 2025 02:27:54 +0000 (15:27 +1300)]
ALSA: hda/realtek: fixup ASUS H7606W

The H7606W laptop has almost the exact same codec setup as the GA403
and so the same quirks apply to it.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250111022754.177551-2-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda/realtek: fixup ASUS GA605W
Luke D. Jones [Sat, 11 Jan 2025 02:27:53 +0000 (15:27 +1300)]
ALSA: hda/realtek: fixup ASUS GA605W

The GA605W laptop has almost the exact same codec setup as the GA403
and so the same quirks apply to it.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250111022754.177551-1-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda: Fix compilation of snd_hdac_adsp_xxx() helpers
Cezary Rojewski [Fri, 10 Jan 2025 11:33:25 +0000 (12:33 +0100)]
ALSA: hda: Fix compilation of snd_hdac_adsp_xxx() helpers

The snd_hdac_adsp_xxx() wrap snd_hdac_reg_xxx() helpers to simplify
register access for AudioDSP drivers e.g.: the avs-driver. Byte- and
word-variants of said helps do not expand to bare readx/writex()
operations but functions instead and, due to pointer type
incompatibility, cause compilation to fail.

As the macros are utilized by the avs-driver alone, relocate the code
introduced with commit c19bd02e9029 ("ALSA: hda: Add helper macros for
DSP capable devices") into the avs/ directory and update it to operate
on 'adev' i.e.: the avs-driver-context directly to fix the issue.

Fixes: c19bd02e9029 ("ALSA: hda: Add helper macros for DSP capable devices")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250110113326.3809897-2-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check
Rob Herring (Arm) [Thu, 9 Jan 2025 18:22:02 +0000 (12:22 -0600)]
ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check

It doesn't matter whether "dai-tdm-slot-width-map" is not present or
there is some other issue parsing it in of_property_count_elems_of_size()
causing an error. Drop the presence check and rely on
of_property_count_elems_of_size() error return if not present.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20250109182202.3971965-2-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoMerge tag 'asoc-fix-v6.13-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Fri, 10 Jan 2025 14:30:28 +0000 (15:30 +0100)]
Merge tag 'asoc-fix-v6.13-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.13

A collection of device specific fixes that came in over the holidays,
plus a MAINTAINERS update and some documentation to help users debug
problems with some of the Cirrus CODECs found in modern laptops.

5 months agoALSA: sb: Use str_enabled_disabled() helper in info_read()
Thorsten Blum [Thu, 9 Jan 2025 23:05:19 +0000 (00:05 +0100)]
ALSA: sb: Use str_enabled_disabled() helper in info_read()

Remove hard-coded strings by using the str_enabled_disabled() helper
function.

Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250109230521.237162-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: emu10k1: Use str_yes_no() helper
Thorsten Blum [Thu, 9 Jan 2025 22:38:08 +0000 (23:38 +0100)]
ALSA: emu10k1: Use str_yes_no() helper

Remove hard-coded strings by using the str_yes_no() helper function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250109223809.198582-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda/realtek: Add support for Ayaneo System using CS35L41 HDA
Stefan Binding [Thu, 9 Jan 2025 16:54:48 +0000 (16:54 +0000)]
ALSA: hda/realtek: Add support for Ayaneo System using CS35L41 HDA

Add support for Ayaneo Portable Game System.

System use 2 CS35L41 Amps with HDA, using Internal boost, with I2C

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250109165455.645810-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: Use of_property_present() for non-boolean properties
Rob Herring (Arm) [Thu, 9 Jan 2025 18:23:00 +0000 (12:23 -0600)]
ASoC: Use of_property_present() for non-boolean properties

The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250109182303.3973082-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: amd: Add ACPI dependency to fix build error
Yu-Chun Lin [Thu, 9 Jan 2025 17:15:47 +0000 (01:15 +0800)]
ASoC: amd: Add ACPI dependency to fix build error

As reported by the kernel test robot, the following error occurs:

   sound/soc/amd/yc/acp6x-mach.c: In function 'acp6x_probe':
>> sound/soc/amd/yc/acp6x-mach.c:573:15: error: implicit declaration of function 'acpi_evaluate_integer'; did you mean 'acpi_evaluate_object'? [-Werror=implicit-function-declaration]
     573 |         ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
         |               ^~~~~~~~~~~~~~~~~~~~~
         |               acpi_evaluate_object
   cc1: some warnings being treated as errors

The function 'acpi_evaluate_integer' and its prototype in 'acpi_bus.h'
are only available when 'CONFIG_ACPI' is enabled. Add a 'depends on ACPI'
directive in Kconfig to ensure proper compilation.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501090345.pBIDRTym-lkp@intel.com/
Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
Link: https://patch.msgid.link/20250109171547.362412-1-eleanor15x@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: remove disable_route_checks
Mark Brown [Thu, 9 Jan 2025 16:50:34 +0000 (16:50 +0000)]
ASoC: remove disable_route_checks

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

ASoC framwork has disable_route_checks flag. Intel is the last user of it,
but it seems it exists in dead code. So we can remove it.

5 months agoALSA: rme9652: Simplify with str_yes_no()
Takashi Iwai [Thu, 9 Jan 2025 16:23:17 +0000 (17:23 +0100)]
ALSA: rme9652: Simplify with str_yes_no()

Use the standard helper for simplifying the code.
Merely cleanup, no behavior change.

Link: https://patch.msgid.link/20250109162318.9172-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoALSA: hda/realtek: Simplify with str_yes_no()
Takashi Iwai [Thu, 9 Jan 2025 16:23:16 +0000 (17:23 +0100)]
ALSA: hda/realtek: Simplify with str_yes_no()

Use the standard helper for simplifying the code.
Merely cleanup, no behavior change.

Link: https://patch.msgid.link/20250109162318.9172-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 months agoASoC: Intel: avs: Fixes and cleanups
Mark Brown [Thu, 9 Jan 2025 15:55:24 +0000 (15:55 +0000)]
ASoC: Intel: avs: Fixes and cleanups

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

A set of loosely connected changes, fixing few outstanding issues as
well as improving readability of the existing code.

The fixes lead the series, first five patches. The goal is to make sure
proper read() is used when accessing the registers, probe() and remove()
sequences for HDAudio streaming are synced, minimal AudioDSP firmware
version points to correct values and recent additions to the topology
are parsed properly.

The only patch that points to 'new functionality' is:
  ASoC: Intel: avs: Update ASRC definition

as with the struct definition updates, one can utilize the ASRC module
in both streaming directions now (previously limited to Capture).
Everything else either improves the logging or provides comments vital
for long-term maintenance of the code.