]> www.infradead.org Git - users/hch/misc.git/log
users/hch/misc.git
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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.

3 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>
3 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>
3 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>
3 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.

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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
3 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>
3 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>
3 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.

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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.

3 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.

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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>
3 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>
3 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>
3 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>
3 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.

3 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>
3 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>
3 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>
3 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>
3 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>
3 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.

3 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>
3 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>
3 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.

3 months agoASoC: remove disable_route_checks
Kuninori Morimoto [Thu, 9 Jan 2025 00:14:41 +0000 (00:14 +0000)]
ASoC: remove disable_route_checks

No driver is using disable_route_checks, let's remove it.

Because snd_soc_dapm_add_routes() itself will indicate detail error
when failed, this patch removes duplicate dev_err() not only
dev_warn() in error case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Suggested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/87tta8268e.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: intel: remove disable_route_checks
Kuninori Morimoto [Thu, 9 Jan 2025 00:14:34 +0000 (00:14 +0000)]
ASoC: intel: remove disable_route_checks

It sets disable_route_checks flag after checking that parent driver
isn't SOF, but skylake driver was removed, so it is dead code.
We can remove last user of disable_route_checks.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Suggested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/87v7uo268m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: rsnd: check rsnd_adg_clk_enable() return value
Kuninori Morimoto [Thu, 9 Jan 2025 00:40:05 +0000 (00:40 +0000)]
ASoC: rsnd: check rsnd_adg_clk_enable() return value

rsnd_adg_clk_enable() might be failed for some reasons, but it doesn't
check return value for now. In such case, we might get below WARNING from
clk_disable() during probe or suspend. Check rsnd_adg_clk_enable() return
value.

    clk_multiplier already disabled
    ...
    Call trace:
     clk_core_disable+0xd0/0xd8 (P)
     clk_disable+0x2c/0x44
     rsnd_adg_clk_control+0x80/0xf4

According to Geert, it happened only 7 times during the last 2 years.
So I have reproduced the issue and created patch by Intentionally making
an error.

Link: https://lore.kernel.org/r/CAMuHMdVUKpO2rsia+36BLFFwdMapE8LrYS0duyd0FmrxDvwEfg@mail.gmail.com
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87seps2522.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Add missing includes
Cezary Rojewski [Thu, 9 Jan 2025 12:22:16 +0000 (13:22 +0100)]
ASoC: Intel: avs: Add missing includes

The debugfs file utilizes string helpers such as parse_int_array_user()
yet does not include the header.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-14-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Adjust IPC traces
Cezary Rojewski [Thu, 9 Jan 2025 12:22:15 +0000 (13:22 +0100)]
ASoC: Intel: avs: Adjust IPC traces

The firmware status and the firmware error registers are 4-bytes wide.
Update trace macros and their usage to reflect that.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-13-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Adjust DSP status register names
Cezary Rojewski [Thu, 9 Jan 2025 12:22:14 +0000 (13:22 +0100)]
ASoC: Intel: avs: Adjust DSP status register names

Both status and error are "codes". Update the wording to make code
cohesive.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Update ASRC definition
Amadeusz Sławiński [Thu, 9 Jan 2025 12:22:13 +0000 (13:22 +0100)]
ASoC: Intel: avs: Update ASRC definition

To support ASRC for playback streams, update its descriptor.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Improve logging of firmware loading
Cezary Rojewski [Thu, 9 Jan 2025 12:22:12 +0000 (13:22 +0100)]
ASoC: Intel: avs: Improve logging of firmware loading

Crucial debug information regarding the ROM/firmware status and last
known error code is missing in the code loading functions.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Clearly state assumptions of hw_params()
Cezary Rojewski [Thu, 9 Jan 2025 12:22:11 +0000 (13:22 +0100)]
ASoC: Intel: avs: Clearly state assumptions of hw_params()

There are no NULL-checks for fe/be_hw_params as there is an implicit
assumption that framework opens valid DPCMs only. State that clearly.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Add MODULE_FIRMWARE to inform about FW
Amadeusz Sławiński [Thu, 9 Jan 2025 12:22:10 +0000 (13:22 +0100)]
ASoC: Intel: avs: Add MODULE_FIRMWARE to inform about FW

MODULE_FIRMWARE macro adds hint to module information about which FW is
expected to be present on file system.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Print IPC error messages in lower layer
Amadeusz Sławiński [Thu, 9 Jan 2025 12:22:09 +0000 (13:22 +0100)]
ASoC: Intel: avs: Print IPC error messages in lower layer

It is preferred to send error message in handler itself instead of
leaving it to caller.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Update hda component teardown sequences
Cezary Rojewski [Thu, 9 Jan 2025 12:22:08 +0000 (13:22 +0100)]
ASoC: Intel: avs: Update hda component teardown sequences

If case of failure cleanup recently created DAI and while at it, adjust
the remove() operation to match operation order of the probe() function.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Fix init-config parsing
Amadeusz Sławiński [Thu, 9 Jan 2025 12:22:07 +0000 (13:22 +0100)]
ASoC: Intel: avs: Fix init-config parsing

When parsing init configs correct token should be looked up.

Fixes: 1b4217ebbb3e ("ASoC: Intel: avs: Add topology parsing support for initial config")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Fix theoretical infinite loop
Cezary Rojewski [Thu, 9 Jan 2025 12:22:06 +0000 (13:22 +0100)]
ASoC: Intel: avs: Fix theoretical infinite loop

While 'stack_dump_size' is a u32 bitfield of 16 bits, u32 has a bigger
upper bound than the type u16 of loop counter 'offset' what in theory
may lead to infinite loop condition.

Found out by Coverity static analyzer.

Fixes: c8c960c10971 ("ASoC: Intel: avs: APL-based platforms support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Fix the minimum firmware version numbers
Cezary Rojewski [Thu, 9 Jan 2025 12:22:05 +0000 (13:22 +0100)]
ASoC: Intel: avs: Fix the minimum firmware version numbers

For few TGL-based platforms the minor version number for AudioDSP
firmware is incorrect forcing users to utilize ignore_fw_version module
parameter.

Fixes: 5acb19ecd198 ("ASoC: Intel: avs: TGL-based platforms support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Do not readq() u32 registers
Cezary Rojewski [Thu, 9 Jan 2025 12:22:04 +0000 (13:22 +0100)]
ASoC: Intel: avs: Do not readq() u32 registers

Register reporting ROM status is 4-bytes wide.

Fixes: 092cf7b26a48 ("ASoC: Intel: avs: Code loading over HDA")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: cs42l43: Add codec force suspend/resume ops
Maciej Strozek [Thu, 9 Jan 2025 09:38:22 +0000 (09:38 +0000)]
ASoC: cs42l43: Add codec force suspend/resume ops

This ensures codec will resume after suspending during playback.

Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250109093822.5745-1-mstrozek@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoALSA: doc: Add codecs/index.rst to top-level index
Richard Fitzgerald [Thu, 9 Jan 2025 10:56:57 +0000 (10:56 +0000)]
ALSA: doc: Add codecs/index.rst to top-level index

commit 088fb4ee17fc ("ALSA: doc: cs35l56: Add information about
Cirrus Logic CS35L54/56/57") added a new subdirectory with an index
file, so this file must be added to the top-level index.

Fixes: 088fb4ee17fc ("ALSA: doc: cs35l56: Add information about Cirrus Logic CS35L54/56/57")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250109105657.96860-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoALSA: doc: cs35l56: Add information about Cirrus Logic CS35L54/56/57
Richard Fitzgerald [Wed, 8 Jan 2025 14:10:45 +0000 (14:10 +0000)]
ALSA: doc: cs35l56: Add information about Cirrus Logic CS35L54/56/57

Add documentation for the Cirrus Logic CS35L54/56/57 amps, which are
all managed by the cs35l56 drivers.

The aim and scope of this documentation is to provide troubleshooting
information for end-users.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250108141045.1032-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: Add missing depends on I2C
Charles Keepax [Wed, 8 Jan 2025 13:48:28 +0000 (13:48 +0000)]
ASoC: samsung: Add missing depends on I2C

When switching to selects for MFD_WM8994 a dependency should have also
been added for I2C, as the dependency on MFD_WM8994 will not be
considered by the select.

Fixes: fd55c6065bec ("ASoC: samsung: Add missing selects for MFD_WM8994")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501082020.2bpGGVTW-lkp@intel.com/
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250108134828.246570-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: renesas: rz-ssi: Add a check for negative sample_space
Dan Carpenter [Wed, 8 Jan 2025 09:28:46 +0000 (12:28 +0300)]
ASoC: renesas: rz-ssi: Add a check for negative sample_space

My static checker rule complains about this code.  The concern is that
if "sample_space" is negative then the "sample_space >= runtime->channels"
condition will not work as intended because it will be type promoted to a
high unsigned int value.

strm->fifo_sample_size is SSI_FIFO_DEPTH (32).  The SSIFSR_TDC_MASK is
0x3f.  Without any further context it does seem like a reasonable warning
and it can't hurt to add a check for negatives.

Cc: stable@vger.kernel.org
Fixes: 03e786bd4341 ("ASoC: sh: Add RZ/G2L SSIF-2 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/e07c3dc5-d885-4b04-a742-71f42243f4fd@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: soc-card: remove card check
Kuninori Morimoto [Wed, 8 Jan 2025 03:05:52 +0000 (03:05 +0000)]
ASoC: soc-card: remove card check

only snd_soc_card_set_bias_level() and snd_soc_card_set_bias_level_post()
are checking "card" in the function, like below

int snd_soc_card_set_bias_level(...)
{
...
=> if (card && card->xxx)
ret = card->xxxx(...);
...
}

But it should already have been an error if "card" was NULL.
remove "card" NULL check here. Otherwise it will get waring on
smatch without this patch. This is prepare for error check cleanup.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87msg2knsg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoMAINTAINERS: add missing maintainers for Simple Audio Card
Kuninori Morimoto [Wed, 8 Jan 2025 02:22:43 +0000 (02:22 +0000)]
MAINTAINERS: add missing maintainers for Simple Audio Card

Mark Brown will take the patch. Add his name.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v7uqkpye.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Merge up v6.13-rc6
Mark Brown [Wed, 8 Jan 2025 11:58:49 +0000 (11:58 +0000)]
ASoC: Merge up v6.13-rc6

This helps several of my boards in CI.

3 months agoALSA: firewire: Simplify with str_on_off()
Takashi Iwai [Tue, 7 Jan 2025 15:56:35 +0000 (16:56 +0100)]
ALSA: firewire: Simplify with str_on_off()

Use the standard helper str_on_off() to simplify the code.
Only code refactoring, no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/20250107155641.4435-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 months agoASoC: codecs: Add aw88083 amplifier driver
Mark Brown [Tue, 7 Jan 2025 18:50:45 +0000 (18:50 +0000)]
ASoC: codecs: Add aw88083 amplifier driver

Merge series from wangweidong.a@awinic.com:

Add the awinic,aw88083 property to support the aw88083 chip.

The driver is for amplifiers aw88083 of Awinic Technology
Corporation. The AW88083 is an intelligent digital audio
amplifier with low noise.

3 months agoMinor debugging improvements
Mark Brown [Tue, 7 Jan 2025 18:50:41 +0000 (18:50 +0000)]
Minor debugging improvements

Merge series from Stephen Gordon <gordoste@iinet.net.au>:

Some minor tweaks to debugging for dai_links.

4 months agoALSA: hda: Simplify with str_enable_disable()
Takashi Iwai [Tue, 7 Jan 2025 15:56:37 +0000 (16:56 +0100)]
ALSA: hda: Simplify with str_enable_disable()

Use the standard helper str_enable_disable() to simplify the code.
Only code refactoring, no behavior change.

Link: https://patch.msgid.link/20250107155641.4435-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>