summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)AuthorFilesLines
2025-10-28allwinner: a523: Enable I2S and SPDIF TXMark Brown1-2/+24
Merge series from Chen-Yu Tsai <wens@kernel.org>: This series enables the SPDIF and I2S hardware found on the Allwinner A523/A527/T527 family SoCs. These SoCs have one SPDIF interface and four I2S interfaces. All of them are capable of both playback and capture, however the SPDIF driver only supports playback.
2025-10-28Sndcard compatible for qrb2210/qcm2290Mark Brown1-0/+1
Merge series from Alexey Klimov <alexey.klimov@linaro.org>: This is a small patch series that serves as a preparation for adding HDMI audio playback support on QRB2210 RB1 board. The patches here are for sound subsystem. The other series will focus on qcom DT files. The original series where one of the patches here were taken from is https://lore.kernel.org/linux-sound/20250302-rb1_hdmi_sound_first-v1-0-81a87ae1503c@linaro.org/ and sndcard compable patch was added as new one. Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> --- Changes in v2: - rewrote commit description and subjects/titles where applicable; - switched to SoC-level compatible for qrb2210 sndcard, therefore adjusted DT schema changes; - Link to v1: https://lore.kernel.org/r/20251007-qrb2210-qcm2290-sndcard-v1-0-8222141bca79@linaro.org --- Alexey Klimov (2): ASoC: dt-bindings: qcom,sm8250: add QRB2210 soundcard ASoC: qcom: sm8250: add qrb2210-sndcard compatible string Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 1 + sound/soc/qcom/sm8250.c | 1 + 2 files changed, 2 insertions(+) --- base-commit: fe45352cd106ae41b5ad3f0066c2e54dbb2dfd70 change-id: 20251007-qrb2210-qcm2290-sndcard-da54245aae3f Best regards, -- Alexey Klimov <alexey.klimov@linaro.org>
2025-10-28ALSA: cs35l56: Add support for factory calibrationMark Brown9-48/+2466
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: Until now, all products with an amplifier supported by the cs35l56 driver have shipped with Microsoft Windows pre-installed. The factory calibration of speaker protection has therefore been done using the Windows driver. However, products that ship with a Linux-based distro must be able to perform the factory calibration procedure from within the Linux-based environment. This patch series adds that support. NOTE: unfortunately this is yet another series that is mainly ASoC but also needs some changes to the HDA driver, and they have build dependencies on the ASoC code. I suggest taking this all through Mark's tree and we'll avoid sending any other commits to the HDA driver until it has all landed in Takashi's tree.
2025-10-28ASoC: soc_sdw_utils: remove cs42l43 component_nameBard Liao1-1/+0
"spk:cs42l43-spk" component string will be added conditionally by asoc_sdw_cs42l43_spk_rtd_init(). We should not add "spk:cs42l43" unconditionally. Fixes: c61da55412a0 ("ASoC: sdw_utils: Add missed component_name strings for speaker amps") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251027140012.966306-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-28ASoC: fsl_sai: Fix sync error in consumer modeMaarten Zanders1-4/+4
When configured for default synchronisation (Rx syncs to Tx) and the SAI operates in consumer mode (clocks provided externally to Tx), a synchronisation error occurs on Tx on the first attempt after device initialisation when the playback stream is started while a capture stream is already active. This results in channel shift/swap on the playback stream. Subsequent streams (ie after that first failing one) always work correctly, no matter the order, with or without the other stream active. This issue was observed (and fix tested) on an i.MX6UL board connected to an ADAU1761 codec, where the codec provides both frame and bit clock (connected to TX pins). To fix this, always initialize the 'other' xCR4 and xCR5 registers when we're starting a stream which is synced to the opposite one, irregardless of the producer/consumer status. Fixes: 51659ca069ce ("ASoC: fsl-sai: set xCR4/xCR5/xMR for SAI master mode") Signed-off-by: Maarten Zanders <maarten@zanders.be> Reviewed-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://patch.msgid.link/20251024135716.584265-1-maarten@zanders.be Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-28ASoC: Fix build for sdw_utilsMark Brown1-1/+0
Revert 3293d3d7b0 ("ASoC: sdw_utils: add name_prefix for rt1321 part id") due to dependencies on -next which for some reason don't show up in my builds. Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-28ASoC: spacemit: add failure check for spacemit_i2s_init_dai()Troy Mitchell1-1/+3
Add error handling when memory allocation for dai fails in spacemit_i2s_init_dai() call. Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: tag. It would be easy to make the argument that the Link: https://patch.msgid.link/20251024-fix-k1-i2s-dai-mem-v1-1-15f5f1ec294a@linux.spacemit.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-28ASoC: spacemit: use `depends on` instead of `select`Troy Mitchell1-2/+1
Selecting DMA_CMA directly bypasses its dependency chain. This can cause build warnings or errors if the required dependencies are not enabled. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Closes: https://lore.kernel.org/all/20251022141705.714b19b5@canb.auug.org.au/ Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC") Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Link: https://patch.msgid.link/20251028-fix-k1-i2s-v2-2-a547c15ed5c3@linux.spacemit.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-28ASoC: spacemit: add failure check for spacemit_i2s_init_dai()Troy Mitchell1-1/+3
Add error handling when memory allocation for dai fails in spacemit_i2s_init_dai() call. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC") Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Closes: tag. It would be easy to make the argument that the Link: https://patch.msgid.link/20251028-fix-k1-i2s-v2-1-a547c15ed5c3@linux.spacemit.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: sun4i-spdif: Support SPDIF output on A523 familyChen-Yu Tsai1-2/+24
The TX side of the SPDIF block on the A523 is almost the same the previous generations, the only difference being that it has separate module clock inputs for the TX and RX side. Since this driver currently only supports TX, add support for a different clock name so that TX and RX clocks can be separated if RX support is ever added. Then add support for the A523. Signed-off-by: Chen-Yu Tsai <wens@kernel.org> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20251027125655.793277-5-wens@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add HID button IRQCharles Keepax2-0/+74
Now full support for the UMP buffers is available, it is possible to read the SDCA HID descriptors from the device and pass them to user-space. Add a helper function to process HID events from an SDCA device. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-20-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add early IRQ handlingCharles Keepax1-0/+71
Some IRQs (FDL) require processing before the primary soundcard is brought up, as the downloaded files could be firmware required for operation of the audio functions of the device. Add a new helper function which registers the required IRQs. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-19-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add UMP timeout handling for FDLCharles Keepax2-1/+64
Several of the UMP transactions in the FDL process should timeout if the device does not respond within a certain time, add handling into the UMP helpers and the FDL code to handle this. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-18-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add completion for FDL start and stopCharles Keepax1-0/+75
Add some completions and a helper function to allow other parts of the system to wait for FDL to complete. The sdca_fdl_sync() function will wait until it completes a full time out without a new FDL request happening, this ensures that even parts requiring multiple rounds of FDL should be fully downloaded before the driver boot continues. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-17-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add FDL-specific IRQ processingMaciej Strozek1-0/+34
Hookup the XU IRQs required for the FDL process. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-16-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add FDL library for XU entitiesMaciej Strozek3-0/+385
Some instances of the XU Entity have a need for Files to be downloaded from the Host. In these XUs, there is one instance of a Host to Device (Consumer) UMP, identified by the FDL_CurrentOwner Control. FDL Library introduced here implements the FDL flow triggered by FDL_CurrentOwner irq, which sends a file from SoundWire File Table (SWFT) or from the firmware directory in specific cases, to the Device FDL UMP. Currently only Direct method of FDL is implemented. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-15-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add SDCA FDL data parsingMaciej Strozek2-0/+113
Add parsing of ACPI DisCo information specific to FDL (File DownLoad). DisCo contains a list of File Sets which can be requested by the device and within each of those a list of individual files to be downloaded to the device. Optionally the contents of the files may also be present in a special ACPI table, called SWFT (SoundWire File Table). Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-14-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add UMP buffer helper functionsCharles Keepax2-1/+249
Add helper functions for handling Universal Message Passing (UMP) buffers on SDCA devices. These are generic mechanisms to pass blocks of binary data between the host and the device, in both directions. They are used for things like passing HID descriptors and the File Download process. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-13-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Parse Function Reset max delayCharles Keepax1-2/+8
Parse the DisCo property to get the timeout for a Function Reset. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-12-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Parse XU Entity propertiesCharles Keepax1-0/+25
Parse the DisCo properties for XU Entities. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-11-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Force some SDCA Controls to be volatileCharles Keepax2-8/+59
Whilst SDCA does specify an Access Mode for each Control, there is not a 1-to-1 mapping between that and ASoC's internal representation. Some registers require being treated as volatile from the hosts perspective even in their Access Mode is Read-Write. Add an explicit list of SDCA controls that should be forced volatile. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-10-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Rely less on the ASoC component in IRQ handlingCharles Keepax1-12/+25
In the future some IRQs (mostly the UMPs used during File DownLoad) will need to run after the device has enumerated on the bus but before the soundcard is actually constructed. As such refactor more of the IRQ handling to use raw device and regmap pointers, rather than accessing things through the component. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-9-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Factor out a helper to find SDCA IRQ dataCharles Keepax1-14/+22
Add a helper function to locate the sdca_interrupt structure for a given SDCA IRQ, this makes the code a little more readable and will facilitate some additions in the future. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-8-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Update externally_requested flag to cover all requestsCharles Keepax1-4/+4
Currently there is a flag to indicate if an IRQ has been requested by something outside the SDCA core, such that the core can skip requesting that IRQ. However, it is simpler and more useful to always store the allocated IRQ number. This will allow the core to see if the IRQ has been requested, to perform additional operations on the IRQ, and request IRQs in multiple phases. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Pass device register map from IRQ alloc to handlersCharles Keepax1-1/+4
Store a copy of the device register map in the structure for the IRQ handlers. This will allow the individual IRQ handlers access to the device level register map if required. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-6-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Pass SoundWire slave to HIDCharles Keepax2-15/+17
The SDCA HID code can't assume that the struct device it is passed is the SoundWire slave device. HID is represented by a Function in SDCA and will thus likely be implemented by a child driver. Update the code to explicitly pass in the SoundWire slave device. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Add manual PM runtime gets to IRQ handlersCharles Keepax1-10/+32
SDCA interrupt handling is a bit odd, the SDCA IRQ registers are defined on a device level but the handling of the IRQ is at the Function level. As such the regmap IRQ's PM runtime operations need to be on the device itself to ensure those registers are available but an additional runtime get is required for the Function child when the IRQ is actually handled. Add the required manual PM runtime gets. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27regmap: sdw-mbq: Don't assume the regmap device is the SoundWire slaveCharles Keepax1-1/+3
Currently, the code assumes that the device that registered the MBQ register map is the actual SoundWire slave device. This works fine for all current users, however future SDCA devices will likely be implemented with the SoundWire slave as a parent device and separate child drivers with regmaps for each audio Function. Update the regmap_init_sdw_mbq_cfg macro to allow these two to be specified separately. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: SDCA: Rename SoundWire struct device variablesCharles Keepax2-10/+10
The SDCA core processes two different struct device's at various times, usually it is processing the struct device associated with an individual SDCA Function driver. However, there are times that it is processing the struct device associated with the actual SoundWire peripheral, usually the parent of the Function device. To ensure this distinction remains clear in the code, rename the variable when handling the actual SoundWire device to sdev. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ALSA: hda/realtek: Fix mute led for HP Victus 15-fa1xxx (MB 8C2D)Eren Demir1-0/+1
The quirk for Victus 15-fa1xxx wasn't working on Victus 15-fa1031nt due to a different board id. This patch enables the existing quirk for the board id 8BC8. Tested on HP Victus 15-fa1031nt (MB 8C2D). The LED behaviour works as intended. Signed-off-by: Eren Demir <eren.demir2479090@gmail.com> Link: https://patch.msgid.link/20251027110208.6481-1-eren.demir2479090@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-27ASoC: cs-amp-lib-test: Add test cases for cs_amp_set_efi_calibration_data()Richard Fitzgerald2-8/+1392
Add a set of test cases for cs_amp_set_efi_calibration_data(). Broadly there are two type of behavior being tested: How the EFI is updated: - Create a new EFI - Overwrite part of existing content - Overwrite part of zero-filled preallocated content - Grow the file to append new content And how the location within the content is chosen: - Overwrite a specific array entry - Overwrite an entry with the same calTarget (silicon ID) - Overwrite a free entry - Append after existing data Plus some cases for error conditions. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-12-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ALSA: hda/cs35l56: Set cal_index to the amp indexRichard Fitzgerald1-1/+1
Set cs35l56_base->cal_index to the (zero-based) amp index derived from cirrus,dev-index property. This is so that factory calibration data will be written to the UEFI array in the slot equal to the amp index, for compatibility with the Windows driver. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-11-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs35l56: Add calibration command to store into UEFIRichard Fitzgerald1-3/+18
Add a new command 'store_uefi' to the calibrate debugfs file. Writing this command will call cs_amp_set_efi_calibration_data() to save the new data into a UEFI variable. This is intended to be used after a successful factory calibration. On systems without UEFI the write to the debugfs file will return an error. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-10-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs-amp-lib: Add function to write calibration to UEFIRichard Fitzgerald1-4/+186
Add cs_amp_set_efi_calibration_data() to write an amp calibration blob to UEFI calibration variable. The UEFI variable will be updated or created as necessary. - If a Vendor-specific variable exists it will be updated, else if the Cirrus variable exists it will be update else the Cirrus variable will be created. Some collateral changes are required: - cs_amp_convert_efi_status() now specifically handles EFI_WRITE_PROTECTED error. - cs_amp_get_cal_efi_buffer() can optionally return the name, guid and attr of the variable it found. - cs_amp_get_cal_efi_buffer() will update the 'size' field of the returned data blob if it is zero. The BIOS could have pre-allocated the UEFI variable as zero-filled Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-9-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs-amp-lib: Return attributes from cs_amp_get_efi_variable()Richard Fitzgerald2-5/+33
Add a pointer argument to cs_amp_get_efi_variable() to optionally return the EFI variable attributes. Originally this function internally consumed the attributes from efi.get_variable(). The calling code did not use the attributes so this was a small simplification. However, when writing to a pre-existing variable we would want to pass the existing attributes to efi.set_variable(). This patch deals with the change to return the attribute in preparation for adding code to update the variable. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-8-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs-amp-lib-test: Add cases for factory calibration helpersRichard Fitzgerald2-1/+75
Add test cases for the cs_amp_read_cal_coeffs() and cs_amp_write_ambient_temp() functions. In both cases the test is simply to confirm that the correct data value(s) get passed back to the caller. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-7-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ALSA: hda/cs35l56: Create debugfs files for factory calibrationRichard Fitzgerald3-5/+130
Create debugfs files that can be used to perform factory calibration. During manufacture, the production line must perform a factory calibration of the amps. This commit adds this functionality via debugfs files. As this is only needed during manufacture, there is no need for this to be available in a normal system so a Kconfig item has been added to enable this. The new Kconfig option is inside a sub-menu because items do not group and indent if the parent is invisible or there are multiple parent dependencies. Anyway the sub-menu reduces the clutter. cs35l56_hda_apply_calibration() has been changed to return an error code that can be reported back through the debugfs write. The original call to this function doesn't check the return code because in normal use it doesn't matter whether this fails - the firmware will default to a safe calibration for the platform. But tooling using the debugfs files might want to know if there was an error. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs35l56: Create debugfs files for factory calibrationRichard Fitzgerald3-0/+180
Create debugfs files that can be used to perform factory calibration. During manufacture, the production line must perform a factory calibration of the amps. This patch adds this functionality via debugfs files. As this is only needed during manufacture, there is no need for this to be available in a normal system so a Kconfig item has been added to enable this. The new Kconfig option is inside a sub-menu because items do not group and indent if the parent is invisible or there are multiple parent dependencies. Anyway the sub-menu reduces the clutter. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs35l56: Add common code for factory calibrationRichard Fitzgerald2-5/+298
Add core code to support factory calibration. This can be used by both the ASoC and HDA drivers. This code consists of implementations of debugfs handlers for three debugfs files used to start factory calibration and read the results. This is not a full implementation of debugfs files. There are some requirements to synchronize with the rest of the amp driver, and the way this is done is significantly different between ASoC and HDA. Therefore cs35l56-shared.c provides the main part of the file handlers, but the files themselves are defined in the ASoC and HDA drivers with suitable handling before calling into this shared code. The cal_data file allows the calibration to be read and also for a previous calibration to be written (for systems where the storage is not something directly accessible to drivers, such as on filesystems). Code outside the kernel should treat the content of cal_data as an opaque blob, so the struct definition is not exported as a user API. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs-amp-lib: Add helpers for factory calibrationRichard Fitzgerald1-5/+143
Add helper functions for performing factory calibration. cs_amp_read_cal_coeffs() reads the results of a calibration into a struct cirrus_amp_cal_data. The calTime member is also filled in with the current time (which is defined to be in Windows format). cs_amp_write_ambient_temp() writes a given temperature value to the firmware control for ambient temperature. The cs_amp_cal_target_u64() has been moved into the header file so that it can be used by the calling code and by KUnit tests. cs_amp_create_debugfs() creates a debugfs directory to contain debugfs files related to calibration. This is placed in a directory in debugfs root, named "cirrus_logic". The purpose of this is to make it easier for tooling to find the files it needs by keeping control of the layout under this directory. By contrast the ASoC debugfs can vary between kernel releases and doesn't have a strictly stable naming convention. HDA does not have a debugfs directory at all and enabling the general ALSA debugfs (which is normally disabled) has other side-effects. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs35l56: Read silicon ID during initialization and save itRichard Fitzgerald1-27/+26
Read the silicon ID from the amp during one-time cs35l56_hw_init() and store it in struct cs35l56_base, instead of reading it from registers every time it is needed. Note that marking it non-volatile without a default in regmap isn't a suitable alternative because this causes regcache_sync() to always write the cached value out to the registers. This could trigger a bus fault interrupt inside the amp, which we want to avoid. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251021105022.1013685-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: renesas: fsi: Constify struct fsi_stream_handlerChristophe JAILLET1-4/+4
'struct fsi_stream_handler' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increases overall security, especially when the structure holds some function pointers. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 51837 12312 64 64213 fad5 sound/soc/renesas/fsi.o After: ===== text data bss dec hex filename 52125 12024 64 64213 fad5 sound/soc/renesas/fsi.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/88ca34df9006b74a7596b91714e700bcff666c4b.1761507792.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: rt721: fix prepare clock stop failedShuming Fan2-0/+5
This patch adds settings to prevent the 'prepare clock stop failed' error. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://patch.msgid.link/20251027103333.38353-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs530x: Add SPI bus support for cs530x partsVitaly Rodionov5-0/+126
Cirrus Logic cs530x device family has 2 control buses I2C and SPI. This patch adds SPI support. Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://patch.msgid.link/20251023090327.58275-13-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs530x: Rename i2c related structuresSimon Trimmer3-4/+4
In preparation for SPI support these structures should be renamed to reflect that they are for i2c. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://patch.msgid.link/20251023090327.58275-11-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs530x: Correct MCLK reference frequency valuesVitaly Rodionov2-3/+12
The MCLK frequency must be 49.152 MHz (for 48 kHz-related sample rates) or 45.1584 MHz (for 44.1 kHz-related sample rates). Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://patch.msgid.link/20251023090327.58275-10-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs530x: Check the DEVID matches the devtypeSimon Trimmer2-7/+13
If the read device ID is not the expected devtype derived from the compatible device match then fail the probe as other configuration details may be incorrect. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://patch.msgid.link/20251023090327.58275-9-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs530x: Rename bitfield to reflect common use for ADC and DACVitaly Rodionov1-2/+2
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://patch.msgid.link/20251023090327.58275-8-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs530x: Add CODEC and DAC supportSimon Trimmer3-45/+440
- Added DAC register address constants - Add the new registers to the regmap config - Renamed constants that are shared between the DACs and ADCs - Add the device IDs and device names of the CODEC and DACs along with their different capabilities - Add DAPM widgets, ALSA controls and event handling for the DAC functionality - Add Playback DAI support Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://patch.msgid.link/20251023090327.58275-7-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27ASoC: cs530x: Correct constant namingVitaly Rodionov2-10/+10
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://patch.msgid.link/20251023090327.58275-5-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>