summaryrefslogtreecommitdiff
path: root/include/sound
AgeCommit message (Collapse)Author
5 daysMerge tag 'sound-6.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "The majority of changes at this time were about ASoC with a lot of code refactoring works. From the functionality POV, there isn't much to see, but we have a wide range of device-specific fixes and updates. Here are some highlights: - Continued ASoC API cleanup work, spanned over many files - Added a SoundWire SCDA generic class driver with regmap support - Enhancements and fixes for Cirrus, Intel, Maxim and Qualcomm. - Support for ASoC Allwinner A523, Mediatek MT8189, Qualcomm QCM2290, QRB2210 and SM6115, SpacemiT K1, and TI TAS2568, TAS5802, TAS5806, TAS5815, TAS5828 and TAS5830 - Usual HD-audio and USB-audio quirks and fixups - Support for Onkyo SE-300PCIE, TASCAM IF-FW/DM MkII Some gpiolib changes for shared GPIOs are included along with this PR for covering ASoC drivers changes" * tag 'sound-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (739 commits) ALSA: hda/realtek: Add PCI SSIDs to HP ProBook quirks ALSA: usb-audio: Simplify with usb_endpoint_max_periodic_payload() ALSA: hda/realtek: fix mute/micmute LEDs don't work for more HP laptops ALSA: rawmidi: Fix inconsistent indenting warning reported by smatch ALSA: dice: fix buffer overflow in detect_stream_formats() ASoC: codecs: Modify awinic amplifier dsp read and write functions ASoC: SDCA: Fixup some more Kconfig issues ASoC: cs35l56: Log a message if firmware is missing ASoC: nau8325: Delete a stray tab firmware: cs_dsp: Add test cases for client_ops == NULL firmware: cs_dsp: Don't require client to provide a struct cs_dsp_client_ops ASoC: fsl_micfil: Set channel range control ASoC: fsl_micfil: Add default quality for different platforms ASoC: intel: sof_sdw: Add codec_info for cs42l45 ASoC: sdw_utils: Add cs42l45 support functions ASoC: intel: sof_sdw: Add ability to have auxiliary devices ASoC: sdw_utils: Move codec_name to dai info ASoC: sdw_utils: Add codec_conf for every DAI ASoC: SDCA: Add terminal type into input/output widget name ASoC: SDCA: Align mute controls to ALSA expectations ...
7 daysMerge tag 'asoc-v6.19' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.19 This is a very large set of updates, as well as some more extensive cleanup work from Morimto-san we've also added a generic SCDA class driver for SoundWire devices enabling us to support many chips with no custom code. There's also a batch of new drivers added for both SoCs and CODECs. - Added a SoundWire SCDA generic class driver, pulling in a little regmap work to support it. - A *lot* of cleaup and API improvement work from Morimoto-san. - Lots of work on the existing Cirrus, Intel, Maxim and Qualcomm drivers. - Support for Allwinner A523, Mediatek MT8189, Qualcomm QCM2290, QRB2210 and SM6115, SpacemiT K1, and TI TAS2568, TAS5802, TAS5806, TAS5815, TAS5828 and TAS5830. This also pulls in some gpiolib changes supporting shared GPIOs in the core there so we can convert some of the ASoC drivers open coding handling of that to the core functionality.
11 daysASoC: cs35l56: Log a message if firmware is missingRichard Fitzgerald
If the amp is still reporting FIRMWARE_MISSING after cs35l56_patch() has completed it is helpful to log a warning. After a complete firmware download the FIRMWARE_MISSING flag will be clear. If this isn't the case, the driver should log a message to report this. The amp can produce basic audio output without firmware, as a fallback, so this wasn't originally logged as a warning condition because the amp is still in an operational state - just not with full functionality. However, it was not at all obvious to an end user that anything is unusual. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251128112520.40067-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
12 daysASoC: sdw_utils: Add cs42l45 support functionsCharles Keepax
Add the helper functions into the machine driver for the cs42l45, this will register a jack for jack detection and add things into to the components string if they are needed. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251127163426.2500633-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
12 daysASoC: intel: sof_sdw: Add ability to have auxiliary devicesCharles Keepax
Currently the sof_sdw machine driver assumes that all devices involved in the sound card are connected through a DAI link. However for SDCA devices we still want the HID (Human Interface Device, used for jack buttons) to be part of the sound card, but it contains no DAI links. Add support into the machine driver to specify a list of auxiliary devices to merged into the card. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251127163426.2500633-6-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
12 daysASoC: sdw_utils: Move codec_name to dai infoCharles Keepax
As SDCA devices will support each DAI link on a different child device, move the codec name from codec_info to each dai_info. To allow the appropriate function device to be bound to each DAI link. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251127163426.2500633-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
12 daysASoC: SDCA: Add terminal type into input/output widget nameCharles Keepax
There have been some complaints around the UCM files for SDCA devices that the control system is quite hard to follow. This is definitely true without the specification handy the naming can be a little cryptic. However, as most of the information is parsed from DisCo there are some limits to what the driver can safely do to improve this. However, one area that can be improved is the non-streaming input/output terminals. These have a field (enum sdca_terminal_type) that describes the usage of that terminal. These types can be appended to the entity name to give the users a better clue as to the purpose. For example "OT 43", would now become "OT 43 Headphone". This would follow through into the jack controls which would change from "OT 43 Jack" to "OT 43 Headphone Jack", making the purpose much more obvious to the user. This provides slightly more readable controls without relying on implicit knowledge that individual parts might not conform to. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251127163426.2500633-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
12 daysASoC: SDCA: Align mute controls to ALSA expectationsCharles Keepax
Currently mute controls will be called "FU xx Mute Switch" (note the switch is added programmatically outside the coverage of this patch) and the accompanying volume control would be called "FU xx Channel Volume". These names are taken from the SDCA specification, however, this does not mesh well with the ALSA naming system. ALSA generally expects enables rather than mutes and expects that mutes and volumes have matching names. Update the names and invert the mute controls to make them more standard "FU XX Channel Switch", this does slightly deviate from the SDCA specification but it makes the rest of the Linux ecosystem a lot happier. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251127163426.2500633-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-21ASoC: cs35l56: Set access permissions on volatileMark Brown
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: The CAL_SET_STATUS and CAL_DATA_RB controls are volatile and read-only, but the existing ASoC macros to define controls don't allow setting access permissions, so those controls were marked as non-volatile read/write. These four patches fix that. The first two patches add two new control macros to soc.h. I really don't like codec drivers open-coding a kcontrol_new content for a control that will be managed by the ASoC info/get/put handlers. If a new type of ASoC control definition is needed it's better to have it in soc.h so all the dependencies between ASoC and the kcontrol_new content are in one place.
2025-11-21Add SDCA class driverMark Brown
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>: This series adds an initial SDCA class driver, this consists of a primary driver attached to the SoundWire device, and auxiliary drivers representing each of the functions of the SDCA device. These drivers all use the APIs added over the past series's to provide the class functionality, as such these final drivers themselves are quite thin. Also a few fix ups at the start of the series that have gathered up whilst the last SDCA series was in review.
2025-11-20ASoC: SDCA: add function devicesPierre-Louis Bossart
Use the auxiliary bus to register/unregister subdevices for each function. Each function will be handled with a separate driver, matched using a name. If a vendor wants to override a specific function driver, they could use a custom name to match with a custom function driver. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Tested-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251120153023.2105663-12-ckeepax@opensource.cirrus.com Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-20ASoC: SDCA: Add helper to write initialization writesCharles Keepax
Add a helper function to write out the SDCA blind initialization writes. Acked-by: Vinod Koul <vkoul@kernel.org> Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Tested-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251120153023.2105663-11-ckeepax@opensource.cirrus.com Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-20ASoC: SDCA: Add missing forward declaration in headerCharles Keepax
The structure sdca_function_desc contains a fwnode_handle which is undefined if the user doesn't pull in an appropriate header. Add a forward declaration to avoid this. Fixes: 996bf834d0b6 ("ASoC: SDCA: Add code to parse Function information") Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Tested-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251120153023.2105663-4-ckeepax@opensource.cirrus.com Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-20ASoC: SDCA: Add stubs for FDL helper functionsCharles Keepax
In the case the SDCA IRQ is built in but FDL support is not stub functions are required for the FDL helpers to avoid build failures. The FDL IRQs likely shouldn't get triggered in this case, however they would still be a part of the build. Fixes: 71f7990a34cd ("ASoC: SDCA: Add FDL library for XU entities") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202511200419.SbU6YvjE-lkp@intel.com/ Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251120155657.2181751-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-20ASoC: soc.h: Add SND_SOC_BYTES_E_ACC() to allow setting access flagsRichard Fitzgerald
Add a macro SND_SOC_BYTES_E_ACC() to allow the access permission flags to be set. This is the same as SND_SOC_BYTES_E() but with an extra argument for the access flags. This will be used by the cs35l56.c driver to create a read-only volatile byte control. It's preferable to avoid custom control macros in codec drivers. Code maintenance is easier if all control macros are defined together in soc.h. This commit only creates this one macro that is actually going to be used. There's no point cluttering soc.h with unused macros - that just adds a maintenance burden. People can add equivalents for the other macros if they need them. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251120134437.1179191-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-20ASoC: soc.h: Add SOC_ENUM_EXT_ACC() to allow setting access flagsRichard Fitzgerald
Add a macro SOC_ENUM_EXT_ACC() to allow the access permission flags to be set. This is the same as SOC_ENUM_EXT() but with an extra argument for the access flags. This will be used by the cs35l56.c driver to create a read-only volatile enum. It's preferable to avoid custom control macros in codec drivers. Code maintenance is easier if all control macros are defined together in soc.h. This commit only creates this one macro that is actually going to be used. There's no point cluttering soc.h with unused macros - that just adds a maintenance burden. People can add equivalents for the other macros if they need them. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251120134437.1179191-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-20ASoC: tas2781: Add tas2568/2574/5806m/5806md/5830 supportBaojun Xu
TAS5806M, TAS5806MD, TAS5830 has on-chip DSP without current/voltage feedback, and in same family with TAS58XX. TAS2568, TAS2574 is in family with TAS257X. Signed-off-by: Baojun Xu <baojun.xu@ti.com> Link: https://patch.msgid.link/20251117102153.30644-2-baojun.xu@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-18ASoC: SDCA: Add companion amp FunctionCharles Keepax
Add companion amp into the list of allowed SDCA Functions. More work will be required to fully support companion amp, but this will let parts including companion amp functions boot and it is a good first step to proper support. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Tested-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251111140617.2997454-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-18ALSA: hda/tas2781: fix speaker id retrieval for multiple probesAntheas Kapenekakis
Currently, on ASUS projects, the TAS2781 codec attaches the speaker GPIO to the first tasdevice_priv instance using devm. This causes tas2781_read_acpi to fail on subsequent probes since the GPIO is already managed by the first device. This causes a failure on Xbox Ally X, because it has two amplifiers, and prevents us from quirking both the Xbox Ally and Xbox Ally X in the realtek codec driver. It is unnecessary to attach the GPIO to a device as it is static. Therefore, instead of attaching it and then reading it when loading the firmware, read its value directly in tas2781_read_acpi and store it in the private data structure. Then, make reading the value non-fatal so that ASUS projects that miss a speaker pin can still work, perhaps using fallback firmware. Fixes: 4e7035a75da9 ("ALSA: hda/tas2781: Add speaker id check for ASUS projects") Cc: stable@vger.kernel.org # 6.17 Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Reviewed-by: Baojun Xu <baojun.xu@ti.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251026191635.2447593-1-lkml@antheas.dev
2025-11-17ASoC: Intel: soc-acpi: add NVL match tablesPeter Ujfalusi
For now the tables are basic for mockup devices Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251104121650.21872-4-peter.ujfalusi@linux.intel.com
2025-11-17ASoC: soc.h: convert to snd_soc_dapm_xxx()Kuninori Morimoto
This patch converts below functions. dapm->dev -> snd_soc_dapm_to_dev() dapm->card -> snd_soc_dapm_to_card() dapm->component -> snd_soc_dapm_to_component() dapm_kcontrol_get_value() -> snd_soc_dapm_kcontrol_get_value() snd_soc_component_enable_pin() -> snd_soc_dapm_enable_pin() snd_soc_component_enable_pin_unlocked() -> snd_soc_dapm_enable_pin_unlocked() snd_soc_component_disable_pin() -> snd_soc_dapm_disable_pin() snd_soc_component_disable_pin_unlocked() -> snd_soc_dapm_disable_pin_unlocked() snd_soc_component_nc_pin() -> snd_soc_dapm_nc_pin() snd_soc_component_nc_pin_unlocked() -> snd_soc_dapm_nc_pin_unlocked() snd_soc_component_get_pin_status() -> snd_soc_dapm_get_pin_status() snd_soc_component_force_enable_pin() -> snd_soc_dapm_force_enable_pin() snd_soc_component_force_enable_pin_unlocked() -> snd_soc_dapm_force_enable_pin_unlocked() snd_soc_component_force_bias_level() -> snd_soc_dapm_force_bias_level() snd_soc_component_get_bias_level() -> snd_soc_dapm_get_bias_level() snd_soc_component_init_bias_level() -> snd_soc_dapm_init_bias_level() snd_soc_component_get_dapm() -> snd_soc_component_to_dapm() snd_soc_dapm_kcontrol_component() -> snd_soc_dapm_kcontrol_to_component() snd_soc_dapm_kcontrol_widget() -> snd_soc_dapm_kcontrol_to_widget() snd_soc_dapm_kcontrol_dapm() -> snd_soc_dapm_kcontrol_to_dapm() snd_soc_dapm_np_pin() -> snd_soc_dapm_disable_pin() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/874ir1a0cz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-11ASoC: cs35l56: Allow restoring factory calibration through ALSA controlRichard Fitzgerald
Add an ALSA control (CAL_DATA) that can be used to restore amp calibration, instead of using debugfs. A readback control (CAL_DATA_RB) is also added for factory testing. On ChromeOS the process that restores amp calibration from NVRAM has limited permissions and cannot access debugfs. It requires an ALSA control that it can write the calibration blob into. ChromeOS also restricts access to ALSA controls, which avoids the risk of accidental or malicious overwriting of good calibration data with bad data. As this control is not needed for normal Linux-based distros it is a Kconfig option. A separate control, CAL_DATA_RB, provides a readback of the current calibration data, which could be either from a write to CAL_DATA or the result of factory production-line calibration. The write and read are intentionally separate controls to defeat "dumb" save-and-restore tools like alsa-restore that assume it is safe to save all control values and write them back in any order at some undefined future time. Such behavior carries the risk of restoring stale or bad data over the top of good data. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251111130850.513969-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-11ASoC: cs35l56: Add control to read CAL_SET_STATUSRichard Fitzgerald
Create an ALSA control to read the value of the firmware CAL_SET_STATUS control. This reports whether the firmware is using a calibration blob or the default calibration from the .bin file. The firmware only reports a valid value in this register while audio is actually playing and the internal PLL is locked to the audio clock. Otherwise it returns a status of "unknown". Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251111130850.513969-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-10ASoC: cs35l56: Alter error codes for calibration routineRichard Fitzgerald
Adjust the error codes returned by the calibration debugfs files to provide a wider range of errors and make them more consistent. There is a limited number of standard errors and it's not always easy to find an error code that accurately describes what happened. Additionally, user code often uses strerror() or something similar to report a generic error description. The original calibration code used a limited set of errors to attempt to avoid user error strings that would be confusing or unclear on a file read/write. However, this restricts the ability to provide informative errors. This limited error range didn't help very much with debugging so it has been expanded, rather than worrying about what strerror() would return. The errors are now more consistent: ENXIO Calibration is not supported by the driver. EOPNOTSUPP The given calibration command is not supported. EBUSY Cannot calibrate because the amp is playing audio. ERANGE Calibration result was out-of-range. ETIMEDOUT Calibration did not complete. EMSGSIZE Blob written to cal_data is the wrong size. ENODATA No calibration data available to read from cal_data, or Blob written to cal_data does not contain calibration, or No calibration data available to save to UEFI. EIO General failure to communicate with the firmware, mainly indicating that firmware controls are missing. EINVAL Has its normal meaning that an invalid argument was passed. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251110114327.84370-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-06ASoC: SDCA: support Q7.8 volume formatShuming Fan
The SDCA specification uses Q7.8 volume format. This patch adds a field to indicate whether it is SDCA volume control and supports the volume settings. Signed-off-by: Shuming Fan <shumingf@realtek.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251106093335.1363237-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-04ASoC: tas2781: Add tas5822 supportBaojun Xu
TAS5822 has on-chip DSP without current/voltage feedback. Signed-off-by: Baojun Xu <baojun.xu@ti.com> Link: https://patch.msgid.link/20251104041314.792-1-baojun.xu@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-29Add SDCA UMP/FDL supportMark Brown
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>: Next installment of the SDCA changes, hopefully the next series after this should be the full class driver. It is worth noting this series has a build dependency on a patch working its way through the PM/ACPI tree: commit ac46f5b6c661 ("ACPICA: Add SoundWire File Table (SWFT) signature") git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git But we can probably worry about that later, as normally there is a reasonable amount of review on these SDCA series'. This series broadly breaks down into 3 chunks, first there are several changes to remove the assumption that the struct device used for SDCA purposes represents the SoundWire slave. This is because the SDCA class driver will be made of an auxiliary driver for each SDCA Function, thus the SoundWire slave will be on the parent device for each individual driver. Then there are patches to add support for UMP/FDL. And then finally since the rest of the HID support is there and UMP was the last missing part required a small patch to add a function to allow reporting of HID events from SDCA devices.
2025-10-28ALSA: cs35l56: Add support for factory calibrationMark Brown
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-27ASoC: SDCA: Add HID button IRQCharles Keepax
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 Keepax
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 Keepax
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 Keepax
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 library for XU entitiesMaciej Strozek
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 Strozek
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 Keepax
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 Keepax
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 Keepax
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 Keepax
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 Keepax
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: Update externally_requested flag to cover all requestsCharles Keepax
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 Keepax
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 Keepax
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: cs-amp-lib-test: Add test cases for cs_amp_set_efi_calibration_data()Richard Fitzgerald
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-27ASoC: cs35l56: Add calibration command to store into UEFIRichard Fitzgerald
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 Fitzgerald
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 Fitzgerald
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 Fitzgerald
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-27ASoC: cs35l56: Add common code for factory calibrationRichard Fitzgerald
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 Fitzgerald
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 Fitzgerald
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>