]> git.hungrycats.org Git - linux/log
linux
4 weeks agoASoC: tegra: Sort ADMAIF register defaults
Jon Hunter [Fri, 21 Aug 2026 15:37:33 +0000 (16:37 +0100)]
ASoC: tegra: Sort ADMAIF register defaults

Commit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted
reg_defaults array") exposed an issue in the Tegra ADMAIF driver and now
the following warning is observed:

 tegra210-admaif 290f000.admaif: Driver needs fixing: Unsorted
  reg_defaults, sorting the copy

This warning occurs because register defaults in the structures
tegra186_admaif_reg_defaults and tegra264_admaif_reg_defaults are not
specified in ascending order which is required by regmap. Fix this by
sorting the register defaults according to their address. Note that in
order to do this it is necessary to split the macro ADMAIF_REG_DEFAULTS
into separate RX and TX macros to the RX and TX registers.

Fixes: f74028e159bb ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260821153734.158426-4-jonathanh@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 weeks agoASoC: tegra: Fix the MIXER enable default value
Jon Hunter [Fri, 21 Aug 2026 15:37:32 +0000 (16:37 +0100)]
ASoC: tegra: Fix the MIXER enable default value

Commit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted
reg_defaults array") exposed an issue in the Tegra MIXER driver where
the register default for the TEGRA210_MIXER_ENABLE is specified as 1,
but the hardware default is actually 0. After this commit was added the
MIXER driver is no longer working and so fix this by correcting the
default value for this register and explicitly configuring the
MIXER_ENABLE register when runtime resuming the MIXER device.

Fixes: 05bb3d5ec64a ("ASoC: tegra: Add Tegra210 based Mixer driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260821153734.158426-3-jonathanh@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 weeks agoASoC: tegra: Fix the I2S enable default value
Jon Hunter [Fri, 21 Aug 2026 15:37:31 +0000 (16:37 +0100)]
ASoC: tegra: Fix the I2S enable default value

Commit 4b05ccb17f92 ("regcache: Sort the local copy of an unsorted
reg_defaults array") exposed an issue in the Tegra I2S driver where the
register default for the TEGRA210_I2S_ENABLE is specified as 1, but the
hardware default is actually 0. After this commit was added the I2S
driver is no longer working and so fix this by correcting the default
value for this register and explicitly configuring the I2S_ENABLE
register when runtime resuming the I2S device.

The I2S_ENABLE register offset is different on Tegra264 devices than
other Tegra devices and so add a 'enable_reg' variable to the SoC data
structure to specify the offset for different SoC devices.

Fixes: c0bfa98349d1 ("ASoC: tegra: Add Tegra210 based I2S driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260821153734.158426-2-jonathanh@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: tas2783-sdw: do not treat read-only Controls as writable
Andrey Golovko [Fri, 14 Aug 2026 06:40:00 +0000 (09:40 +0300)]
ASoC: tas2783-sdw: do not treat read-only Controls as writable

The regmap has no writeable_reg callback, so regmap considers every
register up to max_register writable.  That includes the read-only SDCA
Controls the driver itself describes: the Latency of every Entity, the
Clock Valid of every Clock Source, the actual power state of the Power
Domain Entity, the protection status, the algorithm ready flag and the
Extension Unit id and version.  Most of them are also listed in
tas2783_reg_default[] with a placeholder of zero, even though a default
for, say, a latency reading is meaningless.

Reading such a Control caches its real value, which no longer matches
the placeholder, so regcache_sync() then tries to write it back.  The
peripheral rejects the transaction with -ENODATA and the sync aborts,
leaving the rest of the cache unrestored.

Add a writeable_reg callback that refuses the read-only Controls and
otherwise keeps the previous behaviour.  Every selector it lists is the
read-only Control of its Entity type in sdca_function.h, and none of the
Controls the driver writes is affected: the requested power state, the
mutes, the Cluster Index, the protection mode, the algorithm enable and
the file download Controls all stay writable.

The list is static because the BIOS on the affected machines describes
no Smart Amp SDCA function, so the driver runs its fallback tables and
sdca_regmap_writeable() is not available to it.  It would be good to
have the list confirmed against the hardware documentation, and to know
whether the read-only Controls belong in tas2783_reg_default[] at all.

Signed-off-by: Andrey Golovko <andrey.golovko@gmail.com>
Link: https://patch.msgid.link/20260814094000.22118-2-andrey.golovko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: SOF: validate topology volume range before allocation
Pengpeng Hou [Fri, 14 Aug 2026 08:12:38 +0000 (16:12 +0800)]
ASoC: SOF: validate topology volume range before allocation

SOF treats the topology mixer min and max values as non-negative indices
into its volume table. It stores them in signed fields, allocates max + 1
entries through an int argument, and later indexes the table with the
stored range.

An inverted range is invalid, while a maximum at or above INT_MAX cannot
be represented safely after the increment or in the signed fields.
Validate the complete range before storing it or allocating the table.

Fixes: 311ce4fe7637 ("ASoC: SOF: Add support for loading topologies")
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20260814081238.25434-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: cs35l56: Switch to using the IRQ from the SoundWire core
Mark Brown [Fri, 14 Aug 2026 12:53:28 +0000 (13:53 +0100)]
ASoC: cs35l56: Switch to using the IRQ from the SoundWire core

Richard Fitzgerald <rf@opensource.cirrus.com> says:

At the time the cs35l56 driver was written the only way to get interrupts
from the SoundWire core was to implement a custom handler inside the
interrupt_callback() function.

The SoundWire core now provides a virtual IRQ for notifying ImpDef
interrupts, and switching to this simplifies the code and also makes it
more similar to the normal interrupt handling of I2C/SPI (though some
SoundWire specials are still needed).

Patches #1 and #2 do some preparatory code shuffling so that there is
less clutter in patch #4.

Patch #3 changes the SoundWire core code to create the virtual ImpDef IRQ
before calling the codec drive probe() so that the IRQ can be requested in
probe().

Link: https://patch.msgid.link/20260810104045.60701-1-rf@opensource.cirrus.com
5 weeks agoASoC: cs35l56: Use IRQ provided by the SoundWire core
Richard Fitzgerald [Mon, 10 Aug 2026 10:40:45 +0000 (11:40 +0100)]
ASoC: cs35l56: Use IRQ provided by the SoundWire core

Replace the custom SoundWire IRQ handling with the generic nested IRQ
provided by the SoundWire core. This removes the local IRQ work function
and the convoluted IRQ masking and pm_runtime management around it.

We still need the local functions to mask/disable and unmask/enable the
SoundWire interrupts because the devices handled by the cs35l56 driver
don't have the generic mask bit for the ImpDef1 interrupt so masking and
unmasking has to use a custom mask bit.

cs35l56_sdw_remove() doesn't need to call cs35l56_disable_sdw_interrupts()
now that there isn't a local work function to be flushed. It only masks
the custom interrupt mask bit and the rest of the handler cleanup will be
done the normal way by devm_free_irq() in cs35l56_remove().

Similar applies to cs35l56_sdw_system_suspend() - it is enough to write
the custom mask bits.

cs35l56_irq() doesn't need to be exported because cs35l56_sdw.c isn't
calling it.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260810104045.60701-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agosoundwire: bus_type: Create IRQ mapping before calling driver probe()
Richard Fitzgerald [Mon, 10 Aug 2026 10:40:44 +0000 (11:40 +0100)]
soundwire: bus_type: Create IRQ mapping before calling driver probe()

Call sdw_irq_create_mapping() before calling the peripheral driver
probe() so that it is possible to request the IRQ during probe().

Previously creation of the mapping was conditional on the use_domain_irq
flag in the driver properties. But these are filled in after probe(),
which meant it wasn't possible to request the IRQ during probe(). This
was ok for MFD drivers where only children requested the IRQ. But for
normal drivers it led to the non-standard behavior of having to defer
requesting the IRQ until after probe().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Link: https://patch.msgid.link/20260810104045.60701-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: cs35l56: Move cs35l56_irq_request() after cs35l56_irq()
Richard Fitzgerald [Mon, 10 Aug 2026 10:40:43 +0000 (11:40 +0100)]
ASoC: cs35l56: Move cs35l56_irq_request() after cs35l56_irq()

cs35l56_irq_request() references cs35l56_irq() but was above it in the
source (although they are in the other order in the header file). Switch
to convertional C ordering.

This is preparation for a future patch that will stop exporting
cs35l56_irq() and make it static.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260810104045.60701-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: cs35l56: Request IRQ in cs35l56_common_probe()
Richard Fitzgerald [Mon, 10 Aug 2026 10:40:42 +0000 (11:40 +0100)]
ASoC: cs35l56: Request IRQ in cs35l56_common_probe()

Call cs35l56_irq_request() in cs35l56_common_probe() instead of calling
it afterwards in the probe() for each bus type.

Calling cs35l56_irq_request() in each bus probe() is a legacy of dealing
with the oddities of the SoundWire framework. It's no longer serving any
useful purpose to do it outside of the main cs35l56_common_probe().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260810104045.60701-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: tas2781: Refactor calibration start kcontrol creation to separate helper
Shenghao Ding [Thu, 13 Aug 2026 08:05:40 +0000 (16:05 +0800)]
ASoC: tas2781: Refactor calibration start kcontrol creation to separate helper

Move the tas2781-specific calibration start kcontrol initialization logic
out of tasdevice_create_cali_ctrls() into a new dedicated helper function
create_tas2781_cali_start_ktrl().

This change eliminates duplicate inline code in the main calibration
control registration routine, improves code readability, and makes further
extension for custom calibration parameters much easier. No functional
behavior changes.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20260813080540.1030-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: dt-bindings: es8316: Fix supply property constraints
Hongyang Zhao [Thu, 13 Aug 2026 11:53:34 +0000 (19:53 +0800)]
ASoC: dt-bindings: es8316: Fix supply property constraints

The DT meta-schema requires a `then` clause when an `if` condition has
an `else` clause. Invert the compatible check and move the supply
property restrictions to `then` so they remain allowed only for ES8316.

Fixes: e9966d450b46 ("ASoC: dt-bindings: es8316: Add regulator supplies")
Reported-by: Rob Herring <robh@kernel.org>
Closes: https://lore.kernel.org/r/20260812194234.GA693895-robh@kernel.org
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
Link: https://patch.msgid.link/20260813-b4-es8316-binding-conditional-fix-v1-1-6cd56aa1370c@thundersoft.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: amd: acp: pass audio_drv_data to dma_irq_handler
Rosen Penev [Tue, 11 Aug 2026 04:19:25 +0000 (21:19 -0700)]
ASoC: amd: acp: pass audio_drv_data to dma_irq_handler

The IRQ handler only needs the audio_drv_data, so pass it directly
as the request_irq argument instead of the device pointer and a
dev_get_drvdata() lookup.

Assisted-by: opencode:deepseek-v4-flash-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20260811041925.25016-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: fsl-asoc-card: Restructure to support deferrable card binding
Mark Brown [Thu, 13 Aug 2026 14:49:35 +0000 (15:49 +0100)]
ASoC: fsl-asoc-card: Restructure to support deferrable card binding

Chancel Liu <chancel.liu@nxp.com> says:

The ASoC core has evolved over several kernel releases to support
deferrable card binding: when a component is not yet available,
devm_snd_soc_register_card() no longer propagates -EPROBE_DEFER back to
the machine driver. Instead the card is placed on an internal deferred
list and rebound automatically once the missing component registers.
As a result, registering a sound card no longer guarantees that all CPU
and codec components have already probed successfully.

This exposed two regressions in fsl-asoc-card:

1. The machine driver caches codec MCLK rate during probe(). On platforms
   where the MCLK is derived from the CPU DAI clock and its final rate is
   applied via assigned-clocks in the CPU DAI node, probing before the CPU
   DAI driver completes leaves fsl-asoc-card with a stale mclk_freq.

2. If a card defers due to a missing component, it queues the card onto
   the unbind_card_list and returns 0. The driver then proceeds to call
   simple_util_init_jack(). At this point, the snd_card pointer is NULL.

Patch 1 drops mclk management for nau8822 from this machine driver.

Patch 2 is a pure refactoring with no functional change. the large if/else
chain of of_device_is_compatible() calls in probe() is
replaced by a platform data table approach.

Patch 3 moves all component-dependent initialisation and jacks out of
probe() and into late_probe(), which is the correct place under the
deferrable binding model.

Link: https://patch.msgid.link/20260810093834.1511749-1-chancel.liu@oss.nxp.com
5 weeks agoASoC: fsl-asoc-card: Move bound-component setup to late_probe
Chancel Liu [Mon, 10 Aug 2026 09:35:31 +0000 (18:35 +0900)]
ASoC: fsl-asoc-card: Move bound-component setup to late_probe

Move all operations that require bound codec and CPU DAI components out
of probe() and into late_probe(), which is the correct place for them
now that ASoC supports deferrable card binding. late_probe() may be
called multiple times after an unbind/rebind cycle, so every
initialization step is guarded accordingly.

Three new helpers are introduced:
- fsl_asoc_card_init_cpu()
  CPU DAI-specific setup. Previously done in probe() while CPU DAI
  component maybe not ready.

- fsl_asoc_card_init_codecs()
  Reads codec MCLK rates from the bound component devices, invokes the
  per-compatible pdata->codec_init callback if present.

- fsl_asoc_card_init_jack()
  Registers headphone and microphone jacks.

The call site of codec_init callbacks moves from probe() to
fsl_asoc_card_init_codecs(), which runs in late_probe() after the bound
codec device is known. This makes sure codecs can get proper MCLK.

The old card-name fallback depended on codec_dev_name[], which required
looking up the codec device in probe(). This is no longer valid under
deferrable card binding because the codec component may not have probed
yet. Since the DT binding requires "model", remove the fallback and fail
with a clear error.

Assisted-by: VeroCoder:claude-sonnet-4-6
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260810093834.1511749-4-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: fsl-asoc-card: Move static compatible data to platform data
Chancel Liu [Mon, 10 Aug 2026 09:35:30 +0000 (18:35 +0900)]
ASoC: fsl-asoc-card: Move static compatible data to platform data

Replace the large if/else chain of of_device_is_compatible() calls in
probe() with a table-driven approach.  Each compatible string now has
a corresponding static const struct fsl_asoc_card_pdata descriptor
stored in the of_device_id .data field.

probe() calls of_device_get_match_data() once and reads all
per-compatible configuration from the returned pointer:
  - DAI format
  - CPU SYSCLK direction and ratio overrides
  - TDM slot width
  - Codec DAI name, MCLK id, FLL/PLL ids, PLL S24 ratio
  - playback_only / capture_only direction restrictions
  - Default DAPM route table
  - Excluded PCM format mask (for SAI + WM8960/WM8962)
  - Optional probe_init callback (SPDIF multi-codec discovery)
  - Optional codec_init callback (codec-specific post-probe logic)

This patch is a pure refactoring, no functional change is intended.

Assisted-by: VeroCoder:claude-sonnet-4-6
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260810093834.1511749-3-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: fsl-asoc-card: Drop mclk management for nau8822
Chancel Liu [Mon, 10 Aug 2026 09:35:29 +0000 (18:35 +0900)]
ASoC: fsl-asoc-card: Drop mclk management for nau8822

commit 93f12a7568269 ("ASoC: nau8822: add MCLK support") added MCLK
handling directly in the nau8822 codec driver. The machine driver no
longer needs to acquire and enable the codec MCLK on its behalf.

Remove MCLK management in this machine driver that was introduced by
commit 1075df4bdeb32 ("ASoC: fsl-asoc-card: add nau8822 support"). This
avoids a potential double-enable and removes clock resource management
from the machine driver where it does not belong.

Additionally, the sound card may be unbound and rebound multiple times
during its lifetime. Managing a codec clock resource in the machine
driver would require careful cleanup in the card remove path to avoid
reference count leaks. Leaving clock management to the codec driver,
which has the same lifetime as the codec device, is the correct
ownership model.

The nau8822 compatible entry, DAI name, and PLL/FLL clock ID
configuration are kept unchanged.

Assisted-by: VeroCoder:claude-sonnet-4-6
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260810093834.1511749-2-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: Simplify probe error handling
Mark Brown [Thu, 13 Aug 2026 14:46:10 +0000 (15:46 +0100)]
ASoC: rockchip: Simplify probe error handling

bui duc phuc <phucduc.bui@gmail.com> says:

This series simplifies probe error handling across Rockchip ASoC drivers.

It replaces open-coded error handling with dev_err_probe() where
appropriate, removes redundant probe error messages, returns the
original error code directly, and fixes handling of -EPROBE_DEFER
returned by platform_get_irq_optional() in the Rockchip SAI driver
and devm_pinctrl_get() in the Rockchip I2S driver.

Compile tested only.

Link: https://patch.msgid.link/20260806052136.21034-1-phucduc.bui@gmail.com
5 weeks agoASoC: rockchip: spdif: Return the original error code
bui duc phuc [Thu, 6 Aug 2026 05:21:36 +0000 (12:21 +0700)]
ASoC: rockchip: spdif: Return the original error code

Return the original error code directly and drop the redundant error
message since the called function already reports the failure.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-15-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_sai: Drop redundant probe error messages
bui duc phuc [Thu, 6 Aug 2026 05:21:35 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_sai: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-14-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_sai: Return the original error code
bui duc phuc [Thu, 6 Aug 2026 05:21:34 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_sai: Return the original error code

Return the original error code directly and drop the redundant error
message since the called function already reports the failure.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-13-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_sai: Propagate -EPROBE_DEFER from IRQ lookup
bui duc phuc [Thu, 6 Aug 2026 05:21:33 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_sai: Propagate -EPROBE_DEFER from IRQ lookup

Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
re-probed when the interrupt resource becomes available instead of
continuing probe without an IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-12-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_rt5645: Drop redundant probe error messages
bui duc phuc [Thu, 6 Aug 2026 05:21:32 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_rt5645: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-11-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_pdm: Drop redundant probe error messages
bui duc phuc [Thu, 6 Aug 2026 05:21:31 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_pdm: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-10-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_max98090: Drop redundant probe error messages
bui duc phuc [Thu, 6 Aug 2026 05:21:30 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_max98090: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-9-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: i2s-tdm: Drop redundant probe error messages
bui duc phuc [Thu, 6 Aug 2026 05:21:29 +0000 (12:21 +0700)]
ASoC: rockchip: i2s-tdm: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-8-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: i2s-tdm: Inline PTR_ERR() in dev_err_probe()
bui duc phuc [Thu, 6 Aug 2026 05:21:28 +0000 (12:21 +0700)]
ASoC: rockchip: i2s-tdm: Inline PTR_ERR() in dev_err_probe()

Pass PTR_ERR() directly to dev_err_probe() and avoid assigning it to
the local variable first.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-7-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_i2s: Propagate -EPROBE_DEFER from devm_pinctrl_get()
bui duc phuc [Thu, 6 Aug 2026 05:21:27 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_i2s: Propagate -EPROBE_DEFER from devm_pinctrl_get()

Return -EPROBE_DEFER from devm_pinctrl_get() instead of ignoring it and
continuing probe. This allows the driver to be reprobed once the
pinctrl provider becomes available.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_i2s: Drop redundant probe error messages
bui duc phuc [Thu, 6 Aug 2026 05:21:26 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_i2s: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rockchip_i2s: Use dev_err_probe() for error handling
bui duc phuc [Thu, 6 Aug 2026 05:21:25 +0000 (12:21 +0700)]
ASoC: rockchip: rockchip_i2s: Use dev_err_probe() for error handling

Replace dev_err() with dev_err_probe() to prevent log spam when probe
returns -EPROBE_DEFER.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rk3288_hdmi_analog: Use dev_err_probe() for error handling
bui duc phuc [Thu, 6 Aug 2026 05:21:24 +0000 (12:21 +0700)]
ASoC: rockchip: rk3288_hdmi_analog: Use dev_err_probe() for error handling

Replace dev_err() with dev_err_probe() to prevent log spam when probe
returns -EPROBE_DEFER.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: rockchip: rk3288_hdmi_analog: Drop redundant probe error messages
bui duc phuc [Thu, 6 Aug 2026 05:21:23 +0000 (12:21 +0700)]
ASoC: rockchip: rk3288_hdmi_analog: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806052136.21034-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: meson: aiu: make aiu_formatter_i2s_drv static
Jerome Brunet [Wed, 12 Aug 2026 20:50:34 +0000 (22:50 +0200)]
ASoC: meson: aiu: make aiu_formatter_i2s_drv static

aiu_formatter_i2s_drv is indeed used only in the aiu and it is not meant
to be exported. It should be static.

Cc: Valerio Setti <vsetti@baylibre.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608080634.hf6aJGPB-lkp@intel.com/
Fixes: 83b83024cdbf ("ASoC: meson: aiu: use aiu-formatter-i2s to format I2S output data")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Valerio Setti <vsetti@baylibre.com>
Link: https://patch.msgid.link/20260812-aiu-formatter-static-v1-1-67936d57ba05@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: spacemit: advertise only DMA-backed DAI streams
bui duc phuc [Wed, 5 Aug 2026 06:43:48 +0000 (13:43 +0700)]
ASoC: spacemit: advertise only DMA-backed DAI streams

The static DAI template initializes both playback and capture stream
capabilities before dma-names is examined. As a result,
snd_soc_dai_stream_valid() considers both directions valid even when the
device only provides a single DMA channel.

Move the playback and capture capability initialization into
spacemit_i2s_init_dai(), where it is performed only for the stream
directions backed by a corresponding DMA channel. This preserves the
existing capabilities for devices with both "tx" and "rx" DMA channels,
while preventing unsupported stream directions from being advertised.

Initialize rate_min and rate_max together with the other stream
capabilities to preserve the existing rate constraints.

Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260805064348.44283-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: mxs: Improve probe error handling
Mark Brown [Wed, 12 Aug 2026 17:37:48 +0000 (18:37 +0100)]
ASoC: mxs: Improve probe error handling

bui duc phuc <phucduc.bui@gmail.com> says:

This series improves probe error handling in the MXS ASoC drivers.
Use dev_err_probe() where appropriate and remove redundant dev_err() calls
when the corresponding errors are already reported by the called functions
or further down the call chain.

Compile-tested only.

Link: https://patch.msgid.link/20260812101418.37966-1-phucduc.bui@gmail.com
5 weeks agoASoC: mxs-sgtl5000: Drop redundant probe error messages
bui duc phuc [Wed, 12 Aug 2026 10:14:18 +0000 (17:14 +0700)]
ASoC: mxs-sgtl5000: Drop redundant probe error messages

Remove the probe error messages to avoid duplicate error reporting,
since the error is already reported by the called functions.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260812101418.37966-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: mxs-saif: Drop redundant probe error messages
bui duc phuc [Wed, 12 Aug 2026 10:14:17 +0000 (17:14 +0700)]
ASoC: mxs-saif: Drop redundant probe error messages

The functions called here don't log the error themselves, but the
error is already reported deeper in the call chain, so the dev_err()
calls are redundant and can be removed.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260812101418.37966-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: mxs-saif: Use dev_err_probe() for error handling
bui duc phuc [Wed, 12 Aug 2026 10:14:16 +0000 (17:14 +0700)]
ASoC: mxs-saif: Use dev_err_probe() for error handling

Replace dev_err() with dev_err_probe() to prevent log spam when probe
returns -EPROBE_DEFER.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260812101418.37966-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: pxa: Drop redundant probe error messages
bui duc phuc [Wed, 12 Aug 2026 08:43:11 +0000 (15:43 +0700)]
ASoC: pxa: Drop redundant probe error messages

devm_platform_ioremap_resource() does not report the error itself,
but the error is already reported deeper in the call chain,
so the dev_err() calls are redundant and can be removed.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260812084311.29188-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: samsung: i2s: drop secondary DAI for i2sv7 hardware variant
Marek Szyprowski [Wed, 12 Aug 2026 07:44:37 +0000 (09:44 +0200)]
ASoC: samsung: i2s: drop secondary DAI for i2sv7 hardware variant

Commit 9167f260477b ("ASoC: soc-generic-dmaengine: Handle DMA channel
request failures correctly") started reporting DMA channel request
failures during probe instead of silently ignoring them. This exposed a
bug in the Samsung I2S driver: it always registered a second DAI and its
associated "tx-sec" DMA channel, even for hardware variants that don't
actually support it, such as i2sv7 used on Exynos5433. As a result,
sound card probing on Exynos5433-based boards started failing, whereas
previously it worked only because the channel request failure was
ignored.

Drop the QUIRK_SEC_DAI flag from i2sv7, since this variant does not have
a secondary DAI and register "Secondary Playback" DAPM route only for
variants with such interface.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://patch.msgid.link/20260812074438.3225001-1-m.szyprowski@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers
Rosen Penev [Tue, 11 Aug 2026 04:24:24 +0000 (21:24 -0700)]
ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers

Simplify the probe function by using devm_platform_ioremap_resource()
for the base address and devm_platform_get_and_ioremap_resource() for
the SRAM, dropping the manual platform_get_resource() calls.

Assisted-by: opencode:deepseek-v4-flash-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20260811042424.66882-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: es8316: Add regulator support
Mark Brown [Wed, 12 Aug 2026 10:48:41 +0000 (11:48 +0100)]
ASoC: es8316: Add regulator support

Hongyang Zhao <hongyang.zhao@thundersoft.com> says:

Add regulator support for the four ES8316 power domains so board
descriptions can model and control the codec supplies.

The binding patch documents AVDD, CPVDD, DVDD and PVDD as optional
supplies for ES8316, preserving compatibility with existing device-tree
descriptions. The driver patch enables the supplies before initializing
the regmap and keeps them enabled for the lifetime of the I2C device.

The missing supply model was identified while reviewing the RubikPi 3
audio support:
https://lore.kernel.org/linux-arm-msm/c293d9c7-bdb7-4303-80c8-404228c434d7@oss.qualcomm.com/

Link: https://patch.msgid.link/20260812-es8316-regulator-next-20260722-v2-0-e7078bc9bc9c@thundersoft.com
5 weeks agoASoC: codecs: es8316: Add regulator support
Hongyang Zhao [Wed, 12 Aug 2026 09:35:44 +0000 (17:35 +0800)]
ASoC: codecs: es8316: Add regulator support

ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs.

Request and enable the supplies during I2C probe, before initializing
the regmap. Keep them enabled for the lifetime of the I2C device so the
regmap cannot access an unpowered device and its cache remains
synchronized if the ASoC component is unbound and rebound.

Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
Link: https://patch.msgid.link/20260812-es8316-regulator-next-20260722-v2-2-e7078bc9bc9c@thundersoft.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: dt-bindings: es8316: Add regulator supplies
Hongyang Zhao [Wed, 12 Aug 2026 09:35:43 +0000 (17:35 +0800)]
ASoC: dt-bindings: es8316: Add regulator supplies

The ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs for
its analog, charge pump, digital core and digital I/O domains. Describe
all four inputs so boards can model the codec power topology.

The binding also covers ES8311 and ES8323, whose supply inputs differ,
so restrict these properties to the ES8316 compatible. Keep them
optional for compatibility with existing descriptions.

Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
Link: https://patch.msgid.link/20260812-es8316-regulator-next-20260722-v2-1-e7078bc9bc9c@thundersoft.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: xilinx: formatter_pcm: fix stream_data leak on open error
Rosen Penev [Tue, 11 Aug 2026 18:51:40 +0000 (11:51 -0700)]
ASoC: xilinx: formatter_pcm: fix stream_data leak on open error

In xlnx_formatter_pcm_open(), stream_data is allocated and
adata->play_stream or adata->capture_stream is assigned early.  If a
later step, such as snd_pcm_hw_constraint_step() or
snd_pcm_hw_constraint_integer(), fails, the function returns the error
immediately.  ALSA does not call the close callback when open fails, so
stream_data is leaked and the stream pointer is left dangling, pointing
to a substream that ALSA frees.  A later interrupt would then call
snd_pcm_period_elapsed() on the freed substream.

Free stream_data and clear the stream pointer on the error paths.

Fixes: 6f6c3c36f091 ("ASoC: xlnx: add pcm formatter platform driver")
Assisted-by: opencode:deepseek-v4-flash-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/20260811185140.27149-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: amd: enable audio on HP OmniBook X Flip 14
Mark Brown [Tue, 11 Aug 2026 21:12:13 +0000 (22:12 +0100)]
ASoC: amd: enable audio on HP OmniBook X Flip 14

Ville Saarinen <wiza@saarinenkoti.fi> says:

The HP OmniBook X Flip 14-kc0xxx (board 8EA1, Strix Point, ACP 7.2) has no
usable audio on mainline at all. Its BIOS reports an ACP configuration flag
of FLAG_AMD_LEGACY_ONLY_DMIC, which binds the legacy ACP driver and
registers a PDM-only card, so the SoundWire links are never scanned. The
two TAS2783 speaker amplifiers on link 0 and the RT712-VB jack codec on
link 1 never enumerate, and the machine has no playback path whatsoever.

Patch 1 adds a DMI quirk overriding the flag so snd_pci_ps probes. Patch 2
adds the machine entry describing the link topology.

With both applied the card comes up and every path on the machine works:
internal speakers, headphone jack with detection, headset microphone and
the internal DMIC array. Two further patches are needed for the speakers
to render stereo rather than mono, and to survive a system resume; those
are in the TAS2783 codec driver and are being sent separately to the TI
maintainers, since they have no build dependency on this pair.

Related reports for the same root cause on other machines:

  - kernel bugzilla #221226 (ASUS Zenbook S16)
  - CachyOS linux-cachyos#820 (HP OmniBook X Flip 16, board 8EA2 -- the
    sibling board, which would need its own entry; I have no access to
    one and have not added it)

Tested on the affected machine only. I do not have any other ACP 7.2
board, so the gating on patch 2 is written to be conservative rather than
broad.

Testing
=======

The hardware testing was done on v7.1.6, where an equivalent version of
this pair is what makes audio work on the machine. Against the master
commit named below, both patches have been compile-tested only (gcc, W=1,
no new warnings, no new external symbol references).

Patch 2 has been reworked slightly relative to the tested build: the
RT712-VB entry now reuses the existing jack_dmic_endpoints array, which
already describes exactly the AIF1 jack + AIF3 DMIC pairing this board
needs, instead of adding a second identical copy of it. That was a
mechanical substitution, but it has not been through hardware.

Tool disclosure, per Documentation/process/generated-content.rst
================================================================

This work was done in extended interactive sessions with Claude (Anthropic,
model claude-opus-5) acting as a coding and debugging assistant, and a
substantial amount of the analysis and of the patch text originated with
it. Both patches carry an Assisted-by tag as described in
Documentation/process/coding-assistants.rst.

The division of work:

  - The assistant read the DMI data and ACP configuration flag off the
    running machine, identified the flag override as the fix, derived the
    SoundWire topology from the enumerated peripherals, and drafted both
    patches and both changelogs.
  - I ran everything that needed root or physical access, rebooted into
    each build, and did the listening tests. The left/right ordering in
    patch 2 is set by the order of the two amplifier entries; the first
    version had the sides reversed and that was caught by ear, not by the
    assistant.
  - No single prompt generated these patches. The session was iterative
    over roughly a day: inspect state, form a hypothesis, build, reboot,
    measure, discard the hypothesis if the measurement disagreed. Several
    confident intermediate conclusions were wrong and were only caught by
    measurement.

I have reviewed both patches, I understand what they do, and I take
responsibility for them.

Link: https://patch.msgid.link/20260809101439.4798-1-wiza@saarinenkoti.fi
5 weeks agoASoC: amd: acp70: add HP OmniBook X Flip 14 SoundWire machine
Ville Saarinen [Sun, 9 Aug 2026 10:15:09 +0000 (10:15 +0000)]
ASoC: amd: acp70: add HP OmniBook X Flip 14 SoundWire machine

Describe the SoundWire topology of the HP OmniBook X Flip 14-kc0xxx
(board 8EA1): two TAS2783 smart amplifiers aggregated on link 0 (unique
IDs 0xC and 0x9, group_position 0 and 1, name prefixes tas2783-1 and
tas2783-2) driving the left and right internal speakers, and an RT712-VB
on link 1 providing the headset jack on AIF1 and the internal DMIC array
on AIF3. The RT712 amplifier path (AIF2) is left unused because the
speakers are driven by the external TAS2783 pair, so the existing
jack_dmic_endpoints array describes it exactly.

The entry is gated on snd_soc_acpi_amd_sdca_is_device_rt712_vb() so it
does not capture a board carrying a different link 1 codec.

Developed with AI assistance. The assistant derived the link topology
from the enumerated peripherals and drafted the table entry. The order
of the two amplifier entries, which is what assigns the physical sides,
was corrected after a listening test by the submitter.

All hardware measurements quoted above were run by the submitter on the
affected machine. The submitter has reviewed the change, understands it
and takes responsibility for it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ville Saarinen <wiza@saarinenkoti.fi>
Link: https://patch.msgid.link/20260809101439.4798-3-wiza@saarinenkoti.fi
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: amd: acp-config: force SoundWire probe on HP OmniBook X Flip 14
Ville Saarinen [Sun, 9 Aug 2026 10:15:04 +0000 (10:15 +0000)]
ASoC: amd: acp-config: force SoundWire probe on HP OmniBook X Flip 14

The BIOS on the HP OmniBook X Flip 14-kc0xxx (board 8EA1, Strix Point,
ACP 7.2) reports acp-audio-config-flag = FLAG_AMD_LEGACY_ONLY_DMIC. That
binds the legacy ACP driver and registers a PDM-only card, so the
SoundWire links are never scanned: the two TAS2783 speaker amplifiers on
link 0 and the RT712-VB jack codec on link 1 do not enumerate and the
machine ends up with no usable playback path at all.

Add a DMI entry for the board so the flag is overridden to 0 and
snd_pci_ps probes instead.

Developed with AI assistance. The assistant read the board's ACP
configuration flag out of the running system, identified the flag
override as the fix and drafted the DMI entry.

All hardware measurements quoted above were run by the submitter on the
affected machine. The submitter has reviewed the change, understands it
and takes responsibility for it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ville Saarinen <wiza@saarinenkoti.fi>
Link: https://patch.msgid.link/20260809101439.4798-2-wiza@saarinenkoti.fi
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: dt-bindings: qcom,sm8250: Add Maili sound card
Mark Brown [Tue, 11 Aug 2026 21:10:21 +0000 (22:10 +0100)]
ASoC: dt-bindings: qcom,sm8250: Add Maili sound card

Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com> says:

This series add support for sound card on Qualcomm Maili boards.

Link: https://patch.msgid.link/20260811084605.1820056-1-prasad.kumpatla@oss.qualcomm.com
5 weeks agoASoC: qcom: sc8280xp: Add Maili sound card support
Prasad Kumpatla [Tue, 11 Aug 2026 08:46:05 +0000 (14:16 +0530)]
ASoC: qcom: sc8280xp: Add Maili sound card support

Add the Maili sound card compatible. Maili can reuse the Hawi sound card
data.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260811084605.1820056-3-prasad.kumpatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: dt-bindings: qcom,sm8250: Add Maili sound card
Prasad Kumpatla [Tue, 11 Aug 2026 08:46:04 +0000 (14:16 +0530)]
ASoC: dt-bindings: qcom,sm8250: Add Maili sound card

Add the Maili sound card compatible to the SM8450-family sound card
bindings.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260811084605.1820056-2-prasad.kumpatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: fsl-asoc-card: defer probe when the CPU DAI device is not ready
LiangCheng Wang [Wed, 5 Aug 2026 07:55:43 +0000 (15:55 +0800)]
ASoC: fsl-asoc-card: defer probe when the CPU DAI device is not ready

fsl_asoc_card_probe() hard-fails with -EINVAL when the CPU DAI (SAI)
platform device is not found. Like the codec, the CPU DAI may just be
probed later than the machine driver; the order is not guaranteed and
varies across kernel versions, so a permanent -EINVAL leaves the card
unregistered with no analog playback or capture.

Defer probe instead, mirroring commit e396dec46c56 ("ASoC:
fsl-asoc-card: Defer probe when fail to find codec device").

Tested on i.MX8MP with an ALC5672 on SAI3: the card that failed to
register on v6.18 now comes up during boot.

Fixes: 708b4351f08c ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support")
Signed-off-by: LiangCheng Wang <zaq14760@gmail.com>
Link: https://patch.msgid.link/20260805-fsl-asoc-defer-cpu-dai-v1-1-43f7f538e384@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: pxa: Use devm_clk_get_optional() for extclk clock
bui duc phuc [Tue, 11 Aug 2026 10:09:49 +0000 (17:09 +0700)]
ASoC: pxa: Use devm_clk_get_optional() for extclk clock

The Device Tree binding defines the extclk clock as an optional
property, but the driver currently uses devm_clk_get() and manually
handles the absence of the clock.

Use devm_clk_get_optional() to match the binding and simplify the
optional clock handling. This also propagates errors other than the
absence of the optional clock, including -EPROBE_DEFER.

This changes the existing behavior for errors other than
-EPROBE_DEFER. RFC to discuss whether these errors should cause probe
to fail rather than being treated as an unavailable optional clock.

Fixes: 90eb6b59d311 ("ASoC: pxa-ssp: add support for an external clock in devicetree")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260811100949.61142-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: qcom: q6apm: keep the graph start count in sync with the DSP
Jorijn van der Graaf [Sun, 26 Jul 2026 21:12:26 +0000 (23:12 +0200)]
ASoC: qcom: q6apm: keep the graph start count in sync with the DSP

q6apm_graph_start() increments start_count even when APM_CMD_GRAPH_START
fails, leaving the graph counted as running while the DSP never started
it. A later start - a retried prepare, or a resume after a failed start -
then finds a non-zero count, skips the command and returns success with
no data flowing.

Count the graph only once the DSP has accepted the start. The count then
stays at zero for a graph that never started, so also stop decrementing
below zero in q6apm_graph_stop(): the compressed free path stops
unconditionally, and a negative count would make the next start skip the
command in the same way.

Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
Link: https://patch.msgid.link/20260726211226.94059-1-jorijnvdgraaf@catcrafts.net
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: ti: omap-twl4030: Check for missing card name after parsing
bui duc phuc [Wed, 5 Aug 2026 04:45:56 +0000 (11:45 +0700)]
ASoC: ti: omap-twl4030: Check for missing card name after parsing

Return any error from snd_soc_of_parse_card_name() directly. If the
helper returns successfully but card->name remains unset, report the
missing card name explicitly before returning -ENODEV.

Suggested-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260805044556.38183-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: Intel: KMB: Propagate -EPROBE_DEFER from IRQ lookup
bui duc phuc [Thu, 6 Aug 2026 05:59:37 +0000 (12:59 +0700)]
ASoC: Intel: KMB: Propagate -EPROBE_DEFER from IRQ lookup

Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
re-probed when the interrupt resource becomes available instead of
continuing probe without an IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806055937.24600-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 weeks agoASoC: tas2781: Fix compiling warning for tasdevice_set_capture_profile_id()
Shenghao Ding [Tue, 11 Aug 2026 12:14:46 +0000 (20:14 +0800)]
ASoC: tas2781: Fix compiling warning for tasdevice_set_capture_profile_id()

Correct the mismatched function description, parameter names and return
value documentation in the comment block. No functional code change, only
comment and documentation update.

Fixes: 431c15610d01 ("ASoC: tas2781: add capture_profile_id field and update the tuning_switch function")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20260811121446.1805-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: dwc: Propagate -EPROBE_DEFER from IRQ lookup
bui duc phuc [Thu, 6 Aug 2026 06:10:45 +0000 (13:10 +0700)]
ASoC: dwc: Propagate -EPROBE_DEFER from IRQ lookup

platform_get_irq_optional() never returns 0. It returns a positive IRQ
number on success or a negative error code on failure.

Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
re-probed when the interrupt resource becomes available instead of
continuing probe without an IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260806061046.25323-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: Use auto-cleanup for firmware loading
Mark Brown [Mon, 10 Aug 2026 14:34:19 +0000 (15:34 +0100)]
ASoC: Use auto-cleanup for firmware loading

Takashi Iwai <tiwai@suse.de> says:

here is a revised series of trivial patches to use the auto-cleanup
(via __free(firmware)) for firmware management.
Now compile warnings due to the mixture with goto have been addressed
for rt1320-sdw and wm2000 drivers.  Others remain identical, just took
a few review Acks.

Link: https://patch.msgid.link/20260806140006.1412298-1-tiwai@suse.de
6 weeks agoASoC: SOF: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 14:00:03 +0000 (16:00 +0200)]
ASoC: SOF: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
and __free(kfree) auto-cleanups for the firmware data and the temporary
string or array.

Only the code refactoring, no functional changes.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-32-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: SDCA: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 14:00:02 +0000 (16:00 +0200)]
ASoC: SDCA: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Maciej Strozek <mstrozek@opensource.cirrus.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-31-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: renesas: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 14:00:01 +0000 (16:00 +0200)]
ASoC: renesas: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-30-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: qcom: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 14:00:00 +0000 (16:00 +0200)]
ASoC: qcom: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Srinivas Kandagatla <srini@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-29-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: Intel: catpt: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:59 +0000 (15:59 +0200)]
ASoC: Intel: catpt: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-28-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: Intel: avs: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:58 +0000 (15:59 +0200)]
ASoC: Intel: avs: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-27-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: fsl: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:57 +0000 (15:59 +0200)]
ASoC: fsl: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-26-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: zl38060: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:56 +0000 (15:59 +0200)]
ASoC: zl38060: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-25-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: wm2000: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:55 +0000 (15:59 +0200)]
ASoC: wm2000: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-24-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: wm0010: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:54 +0000 (15:59 +0200)]
ASoC: wm0010: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-23-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: tlv320aic31xx: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:53 +0000 (15:59 +0200)]
ASoC: tlv320aic31xx: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Shenghao Ding <shenghao-ding@ti.com>
Cc: Kevin Lu <kevin-lu@ti.com>
Cc: Baojun Xu <baojun.xu@ti.com>
Cc: Sen Wang <sen@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-22-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: tas5805m: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:52 +0000 (15:59 +0200)]
ASoC: tas5805m: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-21-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: tas2781: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:51 +0000 (15:59 +0200)]
ASoC: tas2781: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Shenghao Ding <shenghao-ding@ti.com>
Cc: Kevin Lu <kevin-lu@ti.com>
Cc: Baojun Xu <baojun.xu@ti.com>
Cc: Sen Wang <sen@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-20-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: sma1307: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:50 +0000 (15:59 +0200)]
ASoC: sma1307: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Kiseok Jo <kiseok.jo@irondevice.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-19-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: sigmadsp: se auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:49 +0000 (15:59 +0200)]
ASoC: sigmadsp: se auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Nuno Sá <nuno.sa@analog.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-18-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: rt722-sdca: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:48 +0000 (15:59 +0200)]
ASoC: rt722-sdca: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup, as well as the firmware file name being released with
__free(kfree).

Only the code refactoring, no functional changes.

Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-17-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: rt5677: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:47 +0000 (15:59 +0200)]
ASoC: rt5677: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-16-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: rt5575: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:46 +0000 (15:59 +0200)]
ASoC: rt5575: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-15-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: rt1320-sdw: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:45 +0000 (15:59 +0200)]
ASoC: rt1320-sdw: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-14-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: peb2466: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:44 +0000 (15:59 +0200)]
ASoC: peb2466: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-13-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: pcm6240: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:43 +0000 (15:59 +0200)]
ASoC: pcm6240: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Since the firmware release is cleaned up automatically, we can convert
the mutex call with guard() gracefully, too.

Only the code refactoring, no functional changes.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-12-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: ntpfw: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:42 +0000 (15:59 +0200)]
ASoC: ntpfw: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-11-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: max98390: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:41 +0000 (15:59 +0200)]
ASoC: max98390: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-10-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: hdac_hda: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:40 +0000 (15:59 +0200)]
ASoC: hdac_hda: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-9-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: fs-amp-lib: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:39 +0000 (15:59 +0200)]
ASoC: fs-amp-lib: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Cc: Nick Li <nick.li@foursemi.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-8-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: aw88399: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:38 +0000 (15:59 +0200)]
ASoC: aw88399: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-7-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: aw88395: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:37 +0000 (15:59 +0200)]
ASoC: aw88395: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-6-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: aw88261: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:36 +0000 (15:59 +0200)]
ASoC: aw88261: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-5-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: aw88166: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:35 +0000 (15:59 +0200)]
ASoC: aw88166: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: aw88081: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:34 +0000 (15:59 +0200)]
ASoC: aw88081: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: aw87390: Use auto-cleanup for firmware loading
Takashi Iwai [Thu, 6 Aug 2026 13:59:33 +0000 (15:59 +0200)]
ASoC: aw87390: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Only the code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoASoC: qcom: sc8280xp: configure codec sysclk for QCS615
Le Qi [Mon, 10 Aug 2026 03:10:32 +0000 (11:10 +0800)]
ASoC: qcom: sc8280xp: configure codec sysclk for QCS615

Continuous high-amplitude noise could occur in the DA7213 microphone
capture path after a Bluetooth out-of-range/reset event followed by
reconnection. The noise was present in both the raw ALSA capture and
PipeWire input, confirming that it originated before Bluetooth
encoding.

The codec already obtains and enables MCLK through its DT clock and
bias-level handling. However, the machine driver did not explicitly
configure the codec sysclk during hw_params(). Enable
codec_sysclk_set for QCS615 so that the DA7213 clock source and rate
are configured before the codec power-up sequence.

Verified on QCS615 Talos with repeated Bluetooth disconnect and
reconnect cycles. The noise was no longer reproducible.

Signed-off-by: Le Qi <le.qi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260810031032.2001053-1-le.qi@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 weeks agoLinux 7.2-rc7
Linus Torvalds [Sun, 9 Aug 2026 21:54:50 +0000 (14:54 -0700)]
Linux 7.2-rc7

6 weeks agoMerge tag 'trace-v7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
Linus Torvalds [Sun, 9 Aug 2026 15:47:31 +0000 (08:47 -0700)]
Merge tag 'trace-v7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

 - Fix use-after-free in eventfs_remove_rec()

   The freeing of the eventfs_inode children used list_for_each_entry()
   where the child is freed via srcu, but there's still a chance that it
   gets freed. It should be using list_for_each_entry_safe().

 - Fix eventfs_inode SRCU use of list in freeing

   The iterator uses an SRCU protected list walk on the eventfs inodes.
   The eventfs inode uses its "list" field in a union with the RCU list
   head. When the inode gets added to the SRCU list it immediately
   corrupts the list pointer and can cause an issue with the iterator.
   Move the RCU list head to be shared with the children list head which
   allows the iterator to check the parent inode if is freed before
   referencing the child. Have the iterator check the parent "is_freed"
   field and break out if it is set. Also add memory barriers to make
   sure the ordering is correct.

 - Fix various RCU synchronization issues with direct_functions

   Updates to direct_functions have some missing RCU protection and
   synchronization. Restructure the code a bit to make sure updates to
   the direct_functions are protected.

 - Remove an unneeded comma from a scope_guard()

   There's a spurious comma in a scope_guard(). Remove it.

 - Fix race in per CPU buffer swap in the ring buffer

   When a per CPU buffer swap happens, it must make sure that it doesn't
   occur while a writer is active. Instead it returns an -EBUSY. But
   there's a small race window when a writer moves from one sub-buffer
   to the next that it resets the "committing" counter. If a swap
   happens at that moment, the buffer used for the commit of an event
   will not match the buffer the event is actually on. Instead of using
   the "committing" counter, use the recursive detection counter that
   does not get reset when the writer crosses sub-buffers.

 - Fix off-by-one in ftrace_free_mem()

   The function ftrace_free_mem() gets an "end_ptr" as a parameter that
   is exclusive to the rang to be freed. But its value is used to search
   for the records that expects an inclusive value. Subtract one from
   the parameter to convert it to an inclusive range.

 - Disable resizing of the ring buffer for persistent buffers

   Resizing the persistent buffer has undefined behavior. Prevent it
   from being resized.

 - Disable changing ring buffer subbuf order when resizing is disabled

   The ring buffer subbuffer order can not be changed during resizing.
   Use that instead of just checking if the buffer is mapped as mapped
   buffers also have resizing disabled.

 - Initialize subbuf_order of reader pages when they are created

   In rb_allocate_cpu_buffer() the bpage->order is not updated to the
   current subbuf_order leaving it as zero. This value is used when the
   page is freed.

 - Fix test_ringbuffer() to test for ERR_PTR before calling
   kthread_stop()

   The rb_threads[] array is assigned the output of kthread_run_on_cpu()
   which could return an ERR_PTR. At the end of the test, all threads in
   the array are cleaned up by kthread_stop() passing in the value in
   the array if it isn't zero. But if the array contains an ERR_PTR,
   kthread_stop() will not be able to handle it properly.

* tag 'trace-v7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  ring-buffer: Fix crash passing ERR_PTR to kthread_stop()
  ring-buffer: Initialise reader page order in rb_allocate_cpu_buffer()
  ring-buffer: Prevent subbuf order change when resizing is disabled
  ring-buffer: Prevent resizing of persistent ring buffer
  ftrace: Fix off-by-one fentry site disable in ftrace_free_mem()
  ring-buffer: Use current_context for safe per-CPU buffer swap
  ftrace: Drop extra comma in trace_buffered_event_enable
  ftrace: Protect direct_functions in update_ftrace_direct_mod
  ftrace: Protect direct_functions in update_ftrace_direct_del
  ftrace: Protect direct_functions in ftrace_find_rec_direct
  eventfs: Use children field for rcu head and add memory barriers
  eventfs: Fix use-after-free in eventfs_remove_rec()

6 weeks agoMerge tag 's390-7.2-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Sun, 9 Aug 2026 13:31:16 +0000 (06:31 -0700)]
Merge tag 's390-7.2-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Vasily Gorbik:

 - Fix potential uninitialized memory reads and buffer overflows from
   malformed zcrypt CCA and EP11 requests by properly validating lengths
   and payloads

 - Fix possible out of bounds accesses in zcrypt EP11 domain handling by
   replacing fixed payload layout assumptions with parsing ASN.1 fields
   with bounds checks

 - Fix zcrypt CCA and EP11 request and reply buffer allocations missing
   required 4-byte padding, and scrub the full allocation on release

 - Fix zcrypt CCA and EP11 messages leaking up to 3 uninitialized bytes
   of memory by zeroing trailing alignment padding

* tag 's390-7.2-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/zcrypt: Pad trailing CCA or EP11 message with zeros
  s390/zcrypt: Improve EP11 CPRB domain handling with ASN.1 parsing
  s390/zcrypt: Improve EP11 CPRB length and overflow checks
  s390/zcrypt: Improve CCA CPRB length and overflow checks
  s390/zcrypt: Fix CPRB memory allocation in zcrypt misc code

6 weeks agoring-buffer: Fix crash passing ERR_PTR to kthread_stop()
Hui Su [Fri, 7 Aug 2026 15:41:46 +0000 (23:41 +0800)]
ring-buffer: Fix crash passing ERR_PTR to kthread_stop()

In test_ringbuffer()'s out_free cleanup loop, the check
`!rb_threads[cpu]` only catches NULL entries and misses entries that
hold an ERR_PTR.

rb_threads[] is static, so unassigned slots are NULL. But when
kthread_run_on_cpu() fails for a cpu, it stores ERR_PTR(-ENOMEM) (or
-EINTR) in rb_threads[cpu] before the creation loop jumps to out_free.
That entry is non-NULL, so the old `!ptr` check does not break, and the
cleanup proceeds to call kthread_stop() on the ERR_PTR. kthread_stop()
then dereferences the bogus pointer, crashing the kernel during the
late_initcall self-test.

crash logs:
  BUG: kernel NULL pointer dereference, address: 000000000000001c
  Oops: 0002 [#1] SMP NOPTI
  CPU: 1 PID: 1 Comm: swapper/0 Not tainted 7.2.0-rc6-dirty #7 PREEMPT(lazy)
  RIP: 0010:kthread_stop+0x2e/0x220
  RBX: fffffffffffffff4
  CR2: 000000000000001c
  Call Trace:
   <TASK>
   test_ringbuffer+0x1ec/0x650
   do_one_initcall+0x6c/0x2c0
   kernel_init_freeable+0x21d/0x420
   kernel_init+0x15/0x1c0
   ret_from_fork+0x21b/0x320
   </TASK>
  Kernel panic - not syncing: Fatal exception

Cc: stable@vger.kernel.org
Fixes: 64ed3a049e3e ("ring-buffer: make use of the helper function kthread_run_on_cpu()")
Link: https://patch.msgid.link/20260807154145.2846521-2-sh_def@163.com
Signed-off-by: Hui Su <sh_def@163.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
6 weeks agoring-buffer: Initialise reader page order in rb_allocate_cpu_buffer()
Vincent Donnefort [Thu, 6 Aug 2026 21:13:03 +0000 (22:13 +0100)]
ring-buffer: Initialise reader page order in rb_allocate_cpu_buffer()

In rb_allocate_cpu_buffer(), bpage->order was omitted, leaving it as 0.
This is an issue for a ring-buffer with subbufs bigger than PAGE_SIZE if
when freed: free_buffer_page() relies on this value. Align the value
with the actual allocation size (buffer::subbuf_order).

Cc: stable@vger.kernel.org
Fixes: f9b94daa542a ("ring-buffer: Set new size of the ring buffer sub page")
Link: https://patch.msgid.link/20260806211306.3704194-4-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
6 weeks agoring-buffer: Prevent subbuf order change when resizing is disabled
Vincent Donnefort [Thu, 6 Aug 2026 21:13:02 +0000 (22:13 +0100)]
ring-buffer: Prevent subbuf order change when resizing is disabled

Because ring_buffer_subbuf_order_set() frees buffer pages, we can't
allow it when resizing is disabled. A non-consuming reader is at risk of
use-after-free (rb_advance_iter()).

Return -EBUSY on resize_disabled, matching ring_buffer_resize()
behaviour.

Cc: stable@vger.kernel.org
Fixes: f9b94daa542a ("ring-buffer: Set new size of the ring buffer sub page")
Link: https://patch.msgid.link/20260806211306.3704194-3-vdonnefort@google.com
Reported-by: syzbot+e0cc44465d6bae735679@syzkaller.appspotmail.com
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
6 weeks agoring-buffer: Prevent resizing of persistent ring buffer
Vincent Donnefort [Thu, 6 Aug 2026 21:13:01 +0000 (22:13 +0100)]
ring-buffer: Prevent resizing of persistent ring buffer

Dynamically resizing a persistent ring buffer is not possible. Disable
the feature.

Cc: stable@vger.kernel.org
Fixes: be68d63a139b ("ring-buffer: Add ring_buffer_alloc_range()")
Link: https://patch.msgid.link/20260806211306.3704194-2-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
6 weeks agoftrace: Fix off-by-one fentry site disable in ftrace_free_mem()
Josh Poimboeuf [Thu, 6 Aug 2026 04:56:46 +0000 (21:56 -0700)]
ftrace: Fix off-by-one fentry site disable in ftrace_free_mem()

When a module's init text is freed, do_init_module() calls
ftrace_free_mem() with a half-open [start, end) range.  However the
ftrace_cmp_recs() comparator treats the upper bound as inclusive, as all
its other users do, passing 'ip + size - 1'.  So ftrace_free_mem() can
delete a record sitting exactly at 'end', which is outside the freed
range.

For a kernel without CFI or IBT, the first record of a function is at
the function start, which for the first function in a module is also the
base of its text allocation.  As the module allocator packs its regions,
that address is often the 'end' passed by a neighboring module's
do_init_module(), causing the first function's ftrace location to get
disabled, preventing an attempt to livepatch it:

  livepatch: failed to find location for function 'pcspkr_probe'

Convert the exclusive end to the inclusive 'end - 1' the comparator
expects, and return early for an empty range to avoid the subtraction
from underflowing when the init text size is zero.

Cc: stable@vger.kernel.org
Fixes: 42c269c88dc1 ("ftrace: Allow for function tracing to record init functions on boot up")
Link: https://patch.msgid.link/1b5ccfa8095bdb1277f84af1c2c2e2205aca03ae.1785992188.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
6 weeks agoring-buffer: Use current_context for safe per-CPU buffer swap
Tengda Wu [Mon, 3 Aug 2026 00:56:39 +0000 (00:56 +0000)]
ring-buffer: Use current_context for safe per-CPU buffer swap

The ring_buffer_swap_cpu() function currently checks the per-CPU
committing counter to determine if a buffer is actively being written to
before performing the swap. However, there exists a race window where
this check can be bypassed:

    ring_buffer_lock_reserve
        cpu_buffer = buffer->buffers[cpu];       // cpu_buffer_a
        rb_reserve_next_event
            rb_start_commit // inc committing
            if (unlikely(READ_ONCE(cpu_buffer->buffer) != buffer)) {...}
            __rb_reserve_next
                rb_move_tail
                    rb_end_commit(cpu_buffer);   // dec committing => 0
                    /* interrupt hits here, successfully swaps! */
                    local_inc(&cpu_buffer->committing);

    ring_buffer_unlock_commit
        cpu_buffer = buffer->buffers[cpu];      // cpu_buffer_b
        rb_commit
            rb_end_commit
            RB_WARN_ON(cpu_buffer, !local_read(&cpu_buffer->committing))
                                                // triggers warning

The committing counter can temporarily drop to 0 during a single write
operation (within rb_move_tail), creating a window where swap can
succeed even though the write is still in progress. This leads to
inconsistent buffer state and triggers the RB_WARN_ON in rb_commit().

Replace the committing counter check with current_context checks, which
are set at the entry of ring_buffer_lock_reserve() and remain valid
throughout the entire write operation, providing a reliable indicator of
buffer busy state during swap.

Cc: stable@vger.kernel.org
Fixes: 4239c38fe0b3 ("ring-buffer: Process commits whenever moving to a new page.")
Link: https://patch.msgid.link/20260803005640.2445666-2-wutengda@huaweicloud.com
Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>