A moderately large pile of fixes, though none of them are super major,
plus a few new quirks and device IDs.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmmpqoUACgkQJNaLcl1U
h9BTHQf+MnXcY+kp+Ou9SsrMyrZE7htz3tbjF1SLSAyZeM7OysDVPiHnx2qkDT4N
gM/I3lTmF3nyK2CN0aKvTcUQml0Hdjs3lEDO59uIeBI6SK7tcrQQkh74N2EI4UgH
rbLusOWMGIoUONXZQNns0zpYx8W562SgcW3O6ZW3cRJo6rwKd1UPlM6ywgPtYC+j
Eb7MPjaz1Q2+IReQ6ewOD68k07PWB7cyYjqlQj/v2GT09MFP5uDmOIw82igsqw+Z
af7yKDbg7QNCGgYYu3OT5l/zGBm1CqDMxvgUNtf9d2MN9+hjyI2i3ZtzvDNj6cAl
IUBgqZXE/Tf2tJIMIK77fSFJBYWNGw==
=v+Al
-----END PGP SIGNATURE-----
Merge tag 'asoc-fix-v7.0-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v7.0
A moderately large pile of fixes, though none of them are super major,
plus a few new quirks and device IDs.
In cs35l56_process_xu_onchip_speaker_id() the warning that the number
of pulls != number of GPIOs should only be printed if pulls are defined.
Pull settings are optional because there would normally be an external
resistor providing the pull. The warning would still be true if pulls
are not defined, but in that case is just log noise.
While we're changing that block of code, also fix the indenting of the
arguments to the dev_warn().
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260226113511.1768838-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Move the ASP register patches to a separate struct and apply this from the
ASP DAI probe() function so that the registers are only patched if the DAI
is part of a DAI link.
Some systems use the ASP as a special-purpose interconnect and on these
systems the ASP registers are configured by a third party (the firmware,
the BIOS, or another device using the amp's secondary host control
interface).
If the machine driver does not hook up the ASP DAI then the ASP registers
must be omitted from the patch to prevent overwriting the third party
configuration.
If the machine driver includes the ASP DAI in a DAI link, this implies that
the machine driver and higher components (such as alsa-ucm) are taking
ownership of the ASP. In this case the ASP registers are patched to known
defaults and the machine driver should configure the ASP.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260226110137.1664562-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
On TAS2781, if the Speaker calibrated impedance is lower than default
value hard-coded inside the TAS2781, it will cuase vol lower than
normal. In order to fix this issue, the parameter of SineGainI need
updating.
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Tested-by: Matthew Schwartz <matthew.schwartz@linux.dev>
Link: https://patch.msgid.link/20260227144641.1243-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
For some exotic peripherals the type detect can return a reserved value
of 0x4. This will currently return an error and not report anything to
user-space, update this to report the insert normally.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260223093616.3800350-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This converts some of the visually simpler cases that have been split
over multiple lines. I only did the ones that are easy to verify the
resulting diff by having just that final GFP_KERNEL argument on the next
line.
Somebody should probably do a proper coccinelle script for this, but for
me the trivial script actually resulted in an assertion failure in the
middle of the script. I probably had made it a bit _too_ trivial.
So after fighting that far a while I decided to just do some of the
syntactically simpler cases with variations of the previous 'sed'
scripts.
The more syntactically complex multi-line cases would mostly really want
whitespace cleanup anyway.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.
As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
here are a bunch of updates, but there should be no big surprises;
mostly device-specific quirks and fix-ups or non-code changes.
- Quirks for ASoC AMD, HD-audio and USB-audio
- Fixes in ASoC fsl, rockchip, renesas, aw codecs
- Fixes for USB-audio packet handling in the implicit feedback mode
- Updates of SPDX license IDs in some files
-----BEGIN PGP SIGNATURE-----
iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmmYYzwOHHRpd2FpQHN1
c2UuZGUACgkQLtJE4w1nLE8DiQ/7BwjUmvBH3Tee+FTVv3uHp8ThkAMJ2FDs9hQI
iUIzik8IMrBxW0r9DvwZEbWt5z5U74lKO7DVyTpdFhz+zXFcpHzl0/RLmKfBF0cQ
KEVgIQ0F3AtwRs9nU4pnpoQvlU6cg8G7t0FhqvCnUaE0nt369Wm38QPJLqp/rrxK
wuT8S6nVcSei6f3tPXsfR1Pm8MO224O6s9UFz3VppG0KRJRdMqkyWdccxq5qJyi0
qgUeYHHq+PelQKIr2sKHnKPcTf8BRGhWNI9CD5fuyvKqAa2mX/1fOnOXqe6GOHur
oeBu9tjmnQeBksp7ulVkGQgUKXjFIXNY6MsJ0GRRa23IDTNg4FENB6yqrUrsZnm3
vzvXvOAcp51SlaI0vavnMStOQNM22/W08qsTTyfTaPOuWI7gsld5m1QKyh2GR7Re
sFE5nvGcQpyrvQuh4dUYawsaPFlmJWWE/kris3jhsNb1imYfVLpaBjBiUwdSn/t8
aJTv9pmFAgWPPcrnkbigdmsxzW6Wkss3oP+IxCcqi3B/bmgRfQ8rxm9Qq/AdJvYu
ln5DnkzUGmyGeDdaJcjU4K7T8YoqYA1iKgRFHuWJ4gL2gSgDyDQH3IhbHWnTKT2l
NE0oWEZRRaSyAV4+f5b59JNAuXmFz/tUo+oZS5LkD2RIlf/sU/rYvU9UORCuw1F9
VZIOqsQ=
=01P5
-----END PGP SIGNATURE-----
Merge tag 'sound-fix-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Here are a bunch of updates, but there should be no big surprises;
mostly device-specific quirks and fix-ups or non-code changes:
- Quirks for ASoC AMD, HD-audio and USB-audio
- Fixes in ASoC fsl, rockchip, renesas, aw codecs
- Fixes for USB-audio packet handling in the implicit feedback mode
- Updates of SPDX license IDs in some files"
* tag 'sound-fix-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (28 commits)
ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
ALSA: hda/hdmi: Add quirk for TUXEDO IBS14G6
ASoC: dt-bindings: asahi-kasei,ak5558: Fix the supply names
ASoC: dt-bindings: asahi-kasei,ak4458: Fix the supply names
ASoC: dt-bindings: asahi-kasei,ak4458: set unevaluatedProperties:false
ASoC: amd: amd_sdw: add machine driver quirk for Lenovo models
ASoC: amd: acp: Add ACP7.0 match entries for Realtek parts
ALSA: echoaudio: Add SPDX ids to some files
ALSA: isa: Add SPDX id lines to some files
ALSA: core: Add SPDX license id to files
ASoC: tas2783A: add explicit port prepare handling
ASoC: renesas: rz-ssi: Fix playback and capture
ALSA: hda/realtek: Fix headset mic on ASUS Zenbook 14 UX3405MA
ALSA: hda/conexant: Fix headphone jack handling on Acer Swift SF314
ASoC: qcom: sm8250: Add quinary MI2S support
ASoC: amd: yc: Add DMI quirk for ASUS Vivobook Pro 15X M6501RR
ALSA: usb-audio: Avoid potentially repeated XRUN error messages
ALSA: usb-audio: Add sanity check for OOB writes at silencing
ALSA: usb-audio: Optimize the copy of packet sizes for implicit fb handling
ALSA: usb-audio: Update the number of packets properly at receiving
...
- support for Qualcomm v2.2.0 controllers
- Bus method updates for .probe(), .remove() and .shutdown() and remove
function return value updates
- Avell B.ON dmi-quirks mapping
- Mark cs42l45 codec as wake capable
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmmUhN4ACgkQfBQHDyUj
g0dTsA//fQDx9kf1Dt6p6np/IBj0mXW4gFTMUjFL6ziuyfm8On/i2FgMjEoFjPIJ
zdLj1G1klyv9G5jxBw1yeW5Nyb7gN2o/OyOm38zKFOmDhLQu1LIGrhyu7USKzuK6
yg42GMX4yYJF2VohKhdYXtldcqqEg+I6UGrm7qmJdqitLA2Eqwzwjyho0V+eq6Vw
HBaq0plZkUCgYz6KIiNTRSF6qBBPhaP0hM51LGpPTXpv3VVhOR07qWjEamOSrbvA
fzOwCHJjV0yLKsUauxMCgVub6iaTaw1Vo7RU7cp3D1FJm+AeG6wWAOUefRCxfL4a
j6Cq7GPoAYzevNAtcVJ2aKBBREl+DDlCMA8GNGOdp9mStTjDkHmRqcRK+q7jmWLb
JMuWSRfOkBx1a58T+eS/VFI5l+5seQKL9nFstGnITdmxa+J2lTbBOkKFripW/yL0
F/enIWV5rtg8sQ/WG8CEwUucg+KXQggCCrJ5gVmzDTmShu6tFxalpjf/rEa4NwdL
gL+iMiMobZW06l1IrV0IdOR40NVQWumfUFASsC/iEPBSxVvgNQio/3lvs0oQ9JM6
lbWxvmD0L+hMmRlj4ETR7QDGCu/DhOYukhZkBhhqeqrI6GVzOW2KqkAM4Qzmm/d+
XoUhflgsXC1/owXiyGsV7alyrBf5ewELC8vi6sHm5yIxgdK6CVQ=
=BCe3
-----END PGP SIGNATURE-----
Merge tag 'soundwire-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire
Pull soundwire updates from Vinod Koul:
- support for Qualcomm v2.2.0 controllers
- bus method updates for .probe(), .remove() and .shutdown()
and remove function return value updates
- Avell B.ON dmi-quirks mapping
- mark cs42l45 codec as wake capable
* tag 'soundwire-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
soundwire: intel_ace2x: add SND_HDA_CORE dependency
dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible
soundwire: Use bus methods for .probe(), .remove() and .shutdown()
soundwire: Make remove function return no value
soundwire: dmi-quirks: add mapping for Avell B.ON (OEM rebranded of NUC15)
soundwire: qcom: Use guard to avoid mixing cleanup and goto
soundwire: intel_auxdevice: add cs42l45 codec to wake_capable_list
TAS2783a required port prepare bits to be set during playback
even when it is using simplified CP_SM.
Normally, SoundWire core handles prepare sequencing automatically
depending on the type of the device available. For simplified CP_SM
there is no need to set the prepare bits. However, due to a hardware
limitation in TAS2783A, the port must still be explicitly prepared and
de-prepared by the driver to ensure reliable playback.
Add a custom .port_prep() callback to program DPN_PREPARECTRL during
PRE_PREP and PRE_DEPREP operations.
Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
Link: https://patch.msgid.link/20260214104710.632-1-niranjan.hy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The aw88261_dev_reg_update() function sets the Awinic registers in a
rather nonuniform way:
- most registers get directly overwritten from the firmware blob
- but a handful of them need more delicate logic to preserve
some bits from their current value, according to a register-
specific mask
For the latter, the logic is basically
NEW = (OLD & MASK) | (VAL & ~MASK)
However, the ~MASK value is hand-computed, and in the specific case
of the SYSCTRL register, in a buggy way.
This patch restores the proper ~MASK value.
Fixes: 028a2ae256 ("ASoC: codecs: Add aw88261 amplifier driver")
Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com>
Link: https://patch.msgid.link/20260211-aw88261-fwname-v1-1-e24e833a019d@fairphone.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-----BEGIN PGP SIGNATURE-----
iQFSBAABCgA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmmI+h8eHHRvcnZhbGRz
QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGeJ0H/1edmtw9WEqIuD4g
UUUJLnzP8ckmgX2lHIvxDfblhmjR9PAo01fxRmtmDmVpFpnSfnrTeaDqQVXhJi+9
rPH7T2TE0tTWjzeJzedwIEHoLg/OowsA/IsGsCMABp2KeWgBNT90S4dPl++DtX4L
c2LaXkqLBELD/gZQJPiTqrf7Fq8BJlmENv0PWc1OoyHKM+6ZbxNQSsHlmGCgtiGY
MgQlJfY9qbG+Znnp6WEdRizt5/dy26kRFaamiKaRSUvrQ8YooAAIeDB4U9FtQF8M
krvVl4ntl8mTjBf+o6TAKXbzAmY/zJL7HqdAAGuU8VkiXQGGMoH90yYwrN+UyrPG
frCw6ws=
=PRHM
-----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmmLhacACgkQJNaLcl1U
h9D5Tgf+Is9f+QCENzaBx71wKwno3RgmsaN6dGd08IXbXq24HL2jJS3y5nd63jYU
TdFC7nfVDn3kXpAwNsGVi/WBT7mBv1e872D15xap1D8BcXjbyqvm8TFTXSePIfJx
CfytKfM4c+/CGbnaJj2IkDFFUIjyARH+5/r4hm7yZYT7RdyO0sw2Ql+Cufpbk6WZ
hsQ3M6qP7CadWYKj5hjYha/aDUhrhKB2/lhVqaYRMdUgd8finF+REmqeX5/ln4G4
epTeZHZA90TOi2PjPeuhcYiWVSAPNZZb+ix+Zk6nuYxQhKqbG3uA4HVOiNjX1wd8
vqaW34NXhq3Su57ChN7yuGi+nj4tMw==
=mMl1
-----END PGP SIGNATURE-----
ASoC: Merge up release
We need to fix some commits that went into the final release.
This release is almost all abut driers, there's very little core work
here, although some of that driver work is in more generic areas like
SDCA and SOF:
- Generic SDCA support for reporting jack events.
- Continuing platform support, cleanup and feature improements for the
AMD, Intel, Qualcomm and SOF code.
- Platform description improvements for the Cirrus drivers.
- Support for NXP i.MX952, Realtek RT1320 and RT5575, and Sophogo
CV1800B.
We also pulled in one small SPI API update and some more substantial
regmap work (cache description improvements) for use in drivers.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmmKCo0ACgkQJNaLcl1U
h9AU7Af/Tu4SmEmMFW58Rn6DYPzX6P/eRvRW1wiazt+b3pyO8qPjRxhvpsBtSbVz
/TyhaO90QnBM7+31p6Hes4nHyC5HcOXXRNb/drt26kQmRpJPMH6NErm7Js6LXDyY
Yk/hzfyqG+DOFFlVoh9vnVE4jr1c4Oasqp8+FCzWbx8l1Y4ZgMEj2T7eQdfiowME
ILjislHqjoPPK4ZPCsGtbmVVYhT4+FMJLZaUDsaCLNRyWxVt1vutrWyvI6w6sA7d
9MUIECfE7MtLy1TaZRT2x0we+eWIjV1ji/7LalKmGvLPCSwTSbRh7A25RqZgL1lf
4/g08iQxIG37yEAmImxxqJnjsfS0yg==
=iwVH
-----END PGP SIGNATURE-----
Merge tag 'asoc-v6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v7.0
This release is almost all abut driers, there's very little core work
here, although some of that driver work is in more generic areas like
SDCA and SOF:
- Generic SDCA support for reporting jack events.
- Continuing platform support, cleanup and feature improements for the
AMD, Intel, Qualcomm and SOF code.
- Platform description improvements for the Cirrus drivers.
- Support for NXP i.MX952, Realtek RT1320 and RT5575, and Sophogo
CV1800B.
We also pulled in one small SPI API update and some more substantial
regmap work (cache description improvements) for use in drivers.
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:
Some new Dell models use spare pins on the amp as a binary integer
value to indicate the speaker type. The driver must use this to
select the correct firmware files for the hardware.
Patch #1 is the new support.
The other patches are for KUnit testing.
Add KUnit test cases for:
- cs35l56_process_xu_properties() which reads the onchip GPIO definitions.
- cs35l56_set_fw_name() calls functions to configure and set the GPIOs.
- cs35l56_set_fw_name() saves the ID value in cs35l56_priv.speaker_id.
- cs35l56_set_fw_name() does not overwrite a speaker ID that was already
found some other way.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260205164838.1611295-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add KUnit testing of:
cs35l56_check_and_save_onchip_spkid_gpios()
cs35l56_configure_onchip_spkid_pads()
cs35l56_read_onchip_spkid()
The test consists of:
- A mock regmap that simulates the pad and pin config registers.
- Parameterization of the pin list, pulls list, a simulated value for
each pin and the speaker ID value that this should produce.
- A self-test of the simulated pin and GPIO registers.
- A test that the value returned by cs35l56_read_onchip_spkid() is
correct.
- A test that the pin pull-up/down are set correctly by
cs35l56_configure_onchip_spkid_pads()
- A test that cs35l56_configure_onchip_spkid_pads() and
cs35l56_read_onchip_spkid(0 return the expected values if
cs35l56_base->num_onchip_spkid_gpios == 0.
- A test that cs35l56_check_and_save_onchip_spkid_gpios() saves
the configuration.
- A test that cs35l56_check_and_save_onchip_spkid_gpios() rejects
illegal GPIO numbers.
- A test that cs35l56_check_and_save_onchip_spkid_gpios() rejects
illegal pull types.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260205164838.1611295-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support for using the state of pins on the amplifier to indicate
the type of speaker fitted.
Previously, where there were alternate speaker vendors, this was
indicated using host CPU GPIOs.
Some new Dell models use spare pins on the CS35L63 as GPIOs for the
speaker ID detection.
Cirrus-specific SDCA Disco properties provide a list of the pins to be
used, and pull-up/down settings for the pads. This list is ordered,
MSbit to LSbit.
The code to set the firmware filename has been modified to check for
using chip pins for speaker ID. The entire block of code to set
firmware name has been moved out of cs35l56_component_probe() into
its own function to make it easier to KUnit test.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260205164838.1611295-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Smatch detects this resource leak:
sound/soc/codecs/cs4271.c:548 cs4271_soc_resume() warn:
'cs4271->clk' from clk_prepare_enable() not released on lines: 540,546.
Instead of direct returns, unprepare the clock and disable regulators on
the error paths.
Fixes: cf6bf51b53 ("ASoC: cs4271: Add support for the external mclk")
Fixes: 9a397f4736 ("ASoC: cs4271: add regulator consumer support")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://patch.msgid.link/20260110195337.2522347-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Mark Brown <broonie@kernel.org>
TAS2781 driver supports three solutions of calibrated data. The first is
from the driver itself: driver reads the calibrated files directly during
probe; The second is from user space: during init of audio hal, the audio
hal will pass the calibrated data via kcontrol interface. Driver will
store this data in "struct calidata" for use. The third is from UEFI,
mainly used in hda device. These three solutions save the calibrated data
into different data structures. It is time to put them together into
"struct calidata" for use.
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20260202102757.532-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Merge series from Chris Morgan <macroalpha82@gmail.com>:
Add support for the Anbernic RG-DS Speaker Amplifiers. The Anbernic
RG-DS uses two AW87391 ICs at 0x58 and 0x5B on i2c2. However, the
manufacturer did not provide a firmware file, only a sequence of
register writes to each device to enable and disable them.
Add support for this *specific* configuration in the AW87390 driver.
Since we are relying on a device specific sequence I am using a
device specific compatible string. This driver does not currently
support the aw87391 for any other device as I have none to test
with valid firmware. Attempts to create firmware with the AwinicSCPv4
have not been successful.
The wcd-mbhc-v2 driver has unnecessary empty module_init and
module_exit functions. Remove them. Note that if a module_init function
exists, a module_exit function must also exist; otherwise, the module
cannot be unloaded.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260131020111.46108-1-enelsonmoore@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Handle failures in the resume path by unwinding previously enabled
resources.
If enabling regulators or syncing the regcache fails, disable regulators
and unprepare the clock to avoid leaking resources and leaving the device
in a partially resumed state.
Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
Link: https://patch.msgid.link/20260130160017.2630-6-hungen3108@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use the regmap stored in the driver private data when restoring the
register cache on resume, instead of looking it up from the device.
This keeps the resume path consistent with the regmap instance used by
the driver and avoids relying on a separate dev_get_regmap() lookup.
Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
Link: https://patch.msgid.link/20260130160017.2630-5-hungen3108@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Check and propagate return values from snd_soc_component_update_bits() in
es8328_set_dai_fmt().
This avoids silent failures when register updates fail and ensures the DAI
format is not left in an inconsistent state.
Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
Link: https://patch.msgid.link/20260130160017.2630-4-hungen3108@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Register writes and updates in set_bias_level() ignored return values,
potentially masking I/O failures during bias level transitions.
Check and propagate errors from component register writes and updates.
Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
Link: https://patch.msgid.link/20260130160017.2630-3-hungen3108@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The DAC deemphasis control updated the hardware before updating the cached
state, causing the previous setting to be applied.
Update the cached deemphasis state first and then apply the setting.
Also check and propagate errors from es8328_set_deemph() in hw_params().
Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
Link: https://patch.msgid.link/20260130160017.2630-2-hungen3108@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support for Anbernic's RG-DS audio amplifiers, powered by
Awinic AW87391 amplifier ICs. These chips typically require an
init sequence provided by firmware, but the manufacturer did not
provide firmware in this case. As a result we had to hard-code
the init sequence and use a device specific binding (rather than
a binding just for the aw87391).
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://patch.msgid.link/20260128174608.1498-3-macroalpha82@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The rt5575 driver fails to link when SPI support is in a loadable
module but the codec is built-in:
x86_64-linux-ld: vmlinux.o: in function `rt5575_i2c_probe':
rt5575.c:(.text+0x9792ce): undefined reference to `rt5575_spi_get_device'
rt5575.c:(.text+0x979332): undefined reference to `rt5575_spi_fw_load'
Change the symbol in to a 'bool' and add a dependency that rules
out the broken configuration.
Fixes: 420739112e ("ASoC: rt5575: Add the codec driver for the ALC5575")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260202095432.1234133-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The load detection process for 3-pole jacks requires slightly
updated reference values to ensure an accurate result. Update
the code to apply different tunings for the 3-pole and 4-pole
cases. This also updates the thresholds overall so update the
relevant comments to match.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260130150927.2964664-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The devm_gpiod_get_optional() function may return an error pointer
(ERR_PTR) in case of a genuine failure during GPIO acquisition,
not just NULL which indicates the legitimate absence of an optional
GPIO.
Add an IS_ERR() check after the function call to catch such errors and
propagate them to the probe function, ensuring the driver fails to load
safely rather than proceeding with an invalid pointer.
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20260130091904.3426149-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
The slot_width can be different with the params_width(), for example,
DSP_A mode, slot_width = 32, but data format is S16_LE, if the word
length is configured to be 16, there is no sound on the right speaker.
So add .set_tdm_slot() callback function to configure the slot_width and
update the word length according to slot_width in hw_params().
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260128025955.2562331-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Now, all DAPM users are using function to handling it.
We can capsuling it. This patchset moves struct snd_soc_dapm_context into
soc-dapm.c, and remove un-used functions.
Link: https://lore.kernel.org/r/87zf7jrx52.wl-kuninori.morimoto.gx@renesas.com
Merge series from "Peng Fan (OSS)" <peng.fan@oss.nxp.com>:
The main goal is to convert drivers to use GPIO descriptors. While reading
the code, I think it is time to remove ak4641 and pxa2xx-ac97 driver,
more info could be found in commit log of each patch.
Then only need to convert sound/arm/pxa2xx-ac97-lib.c to use GPIO
descriptors. Not have hardware to test the pxa2xx ac97.
Since commit d6df7df7ae ("ARM: pxa: remove unused board files"), there
has been no in-tree user of the AK4641 codec driver. The last user
(HP iPAQ hx4700) was a non-DT PXA board file that instantiated the device
via I2C board data; that code was removed as part of the PXA board-file
purge.
The AK4641 driver was introduced ~2011 and still probes only via the I2C
device-ID table ('.id_table'), without an 'of_match_table', so there are
no upstream Devicetree users to retain. With no in-tree users left, remove
the driver.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260122-sound-cleanup-v1-1-0a91901609b8@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
clk_prepare_enable() and clk_disable_unprepare() already checked NULL
clock parameter.
Remove unneeded NULL check for wm8731->mclk here.
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260126073528.1826406-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Compiler is not happy about used stack frames in a couple of functions:
sound/soc/codecs/rt1320-sdw.c: In function 'rt1320_rae_load':
sound/soc/codecs/rt1320-sdw.c:1570:1: error: the frame size of 1336 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]
sound/soc/codecs/rt1320-sdw.c: In function 'rt1320_dspfw_load_code':
sound/soc/codecs/rt1320-sdw.c:1786:1: error: the frame size of 1520 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]
Refactor the code to fix these.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260124101824.3424793-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
snd_soc_component_get_bias_level() will be removed.
Let's use snd_soc_dapm_get_bias_level() instead.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o6mpqgxc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Passing IRQF_ONESHOT ensures that the interrupt source is masked until
the secondary (threaded) handler is done. If only a primary handler is
used then the flag makes no sense because the interrupt can not fire
(again) while its handler is running.
The flag also disallows force-threading of the primary handler and the
irq-core will warn about this.
Remove IRQF_ONESHOT from irqflags.
Cc: Oder Chiou <oder_chiou@realtek.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20260123113708.416727-13-bigeasy@linutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Add a new KUnit test for testing the creation of firmware name
qualifiers in the cs35l56 driver. The initial set of test cases
are for cs35l56_set_fw_suffix().
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260121132243.1256019-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add Kconfig symbol CONFIG_SND_SOC_CS_AMP_LIB_TEST_HOOKS to enable
calling into functions that would normally abort because of missing
EFI functionality. Before this the code paths were only enabled if
the KUnit test for cs-amp-lib was enabled.
This change allows KUnit tests for clients of cs-amp-lib to install
redirection hooks in cs-amp-lib.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260121132243.1256019-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Adds test cases for getting a Dell SSIDExV2 string by calling
cs_amp_devm_get_vendor_specific_variant_id().
This is a fairly simple test harness, the redirected call to
cs_amp_get_efi_variable() returns a test string to simulate
reading a string from UEFI. The returned string should be
the second field in the SSIDExV2 string (if valid).
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260121132243.1256019-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
If cs_amp_devm_get_vendor_specific_variant_id() returns a string, use it
as part of the firmware filename. If this firmware isn't found, fall back
to the standard firmware name.
This re-uses the fwf_suffix fallback mechanism that was introduced in
commit e5d5b3aebd ("ASoC: cs35l56: Use SoundWire address as alternate
firmware suffix on L56 B0").
This is for handling vendors that use the same PCI SSID on systems with
various audio hardware and have a custom vendor-specific way to identify
the hardware variant.
This is currently used on Dell laptops. Dell create a UEFI variable that
indicates varations to the base hardware. This variance can be any part
of the hardware (not necessarily affecting the audio). It would be
impractical to publish many aliases for the same firmware files to match
every possible variance to that base hardware. Hence the fallback to the
standard firmware name. This allows alternate firmware files to be
published only for variants that need it. For all other variants the
fallback will load the firmware for the base SSID.
This is not done for CS35L56 B0 because the fallback mechanism is already
used for a different purpose for these parts. None of the products with
the older L56 B0 silicon revision need the additional vendor-specific
descriptor.
For SoundWire the resulting firmware searches with a variant descriptor
will be:
1. cs35l??-dsp1-misc-SSID-VARIANT-l?u?.wmfw
2. cs35l??-dsp1-misc-SSID-VARIANT.wmfw
3. cs35l??-dsp1-misc-SSID-VARIANT-l?u?.bin
4. cs35l??-dsp1-misc-SSID-VARIANT.bin
If this doesn't find a wmfw and bin file it will then fallback to:
5. cs35l??-dsp1-misc-SSID-l?u?.wmfw
6. cs35l??-dsp1-misc-SSID.wmfw
7. cs35l??-dsp1-misc-SSID-l?u?.bin
8. cs35l??-dsp1-misc-SSID.bin
With the typical published firmware names and qualifiers (a single wmfw but
amp-specific bin file) this will load either:
cs35l??-dsp1-misc-SSID-VARIANT.wmfw
and cs35l??-dsp1-misc-SSID-VARIANT-l?u?.bin
or
cs35l??-dsp1-misc-SSID.wmfw
and cs35l??-dsp1-misc-SSID-l?u?.bin
For non-Soundwire (I2S/TDM) systems the searches and fallbacks are
as above except that the "l?u?" component of the name is instead the
ALSA name prefix, usually of the form "AMPn".
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260121132243.1256019-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>