Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' into for-next

Pull pending ASoC and HD-audio fixes for 6.14-rc1

Signed-off-by: Takashi Iwai <tiwai@suse.de>

+418 -36
+292
Documentation/sound/codecs/cs35l56.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0-only 2 + 3 + ===================================================================== 4 + Audio drivers for Cirrus Logic CS35L54/56/57 Boosted Smart Amplifiers 5 + ===================================================================== 6 + :Copyright: 2025 Cirrus Logic, Inc. and 7 + Cirrus Logic International Semiconductor Ltd. 8 + 9 + Contact: patches@opensource.cirrus.com 10 + 11 + Summary 12 + ======= 13 + 14 + The high-level summary of this document is: 15 + 16 + **If you have a laptop that uses CS35L54/56/57 amplifiers but audio is not 17 + working, DO NOT ATTEMPT TO USE FIRMWARE AND SETTINGS FROM ANOTHER LAPTOP, 18 + EVEN IF THAT LAPTOP SEEMS SIMILAR.** 19 + 20 + The CS35L54/56/57 amplifiers must be correctly configured for the power 21 + supply voltage, speaker impedance, maximum speaker voltage/current, and 22 + other external hardware connections. 23 + 24 + The amplifiers feature advanced boost technology that increases the voltage 25 + used to drive the speakers, while proprietary speaker protection algorithms 26 + allow these boosted amplifiers to push the limits of the speakers without 27 + causing damage. These **must** be configured correctly. 28 + 29 + Supported Cirrus Logic amplifiers 30 + --------------------------------- 31 + 32 + The cs35l56 drivers support: 33 + 34 + * CS35L54 35 + * CS35L56 36 + * CS35L57 37 + 38 + There are two drivers in the kernel 39 + 40 + *For systems using SoundWire*: sound/soc/codecs/cs35l56.c and associated files 41 + 42 + *For systems using HDA*: sound/pci/hda/cs35l56_hda.c 43 + 44 + Firmware 45 + ======== 46 + 47 + The amplifier is controlled and managed by firmware running on the internal 48 + DSP. Firmware files are essential to enable the full capabilities of the 49 + amplifier. 50 + 51 + Firmware is distributed in the linux-firmware repository: 52 + https://gitlab.com/kernel-firmware/linux-firmware.git 53 + 54 + On most SoundWire systems the amplifier has a default minimum capability to 55 + produce audio. However this will be 56 + 57 + * at low volume, to protect the speakers, since the speaker specifications 58 + and power supply voltages are unknown. 59 + * a mono mix of left and right channels. 60 + 61 + On some SoundWire systems that have both CS42L43 and CS35L56/57 the CS35L56/57 62 + receive their audio from the CS42L43 instead of directly from the host 63 + SoundWire interface. These systems can be identified by the CS42L43 showing 64 + in dmesg as a SoundWire device, but the CS35L56/57 as SPI. On these systems 65 + the firmware is *mandatory* to enable receiving the audio from the CS42L43. 66 + 67 + On HDA systems the firmware is *mandatory* to enable HDA bridge mode. There 68 + will not be any audio from the amplifiers without firmware. 69 + 70 + Cirrus Logic firmware files 71 + --------------------------- 72 + 73 + Each amplifier requires two firmware files. One file has a .wmfw suffix, the 74 + other has a .bin suffix. 75 + 76 + The firmware is customized by the OEM to match the hardware of each laptop, 77 + and the firmware is specific to that laptop. Because of this, there are many 78 + firmware files in linux-firmware for these amplifiers. Firmware files are 79 + **not interchangeable between laptops**. 80 + 81 + Cirrus Logic submits files for known laptops to the upstream linux-firmware 82 + repository. Providing Cirrus Logic is aware of a particular laptop and has 83 + permission from the manufacturer to publish the firmware, it will be pushed 84 + to linux-firmware. You may need to upgrade to a newer release of 85 + linux-firmware to obtain the firmware for your laptop. 86 + 87 + **Important:** the Makefile for linux-firmware creates symlinks that are listed 88 + in the WHENCE file. These symlinks are required for the CS35L56 driver to be 89 + able to load the firmware. 90 + 91 + How do I know which firmware file I should have? 92 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 + All firmware file names are qualified with a unique "system ID". On normal 94 + x86 PCs with PCI audio this is the Vendor Subsystem ID (SSID) of the host 95 + PCI audio interface. 96 + 97 + The SSID can be viewed using the lspci tool:: 98 + 99 + lspci -v -nn | grep -A2 -i audio 100 + 0000:00:1f.3 Audio device [0403]: Intel Corporation Meteor Lake-P HD Audio Controller [8086:7e28] 101 + Subsystem: Dell Meteor Lake-P HD Audio Controller [1028:0c63] 102 + 103 + In this example the SSID is 10280c63. 104 + 105 + The format of the firmware file names is: 106 + 107 + cs35lxx-b0-dsp1-misc-SSID[-spkidX]-ampN 108 + 109 + Where: 110 + 111 + * cs35lxx-b0 is the amplifier model and silicon revision. This information 112 + is logged by the driver during initialization. 113 + * SSID is the 8-digit hexadecimal SSID value. 114 + * ampN is the amplifier number (for example amp1). This is the same as 115 + the prefix on the ALSA control names except that it is always lower-case 116 + in the file name. 117 + * spkidX is an optional part, used for laptops that have firmware 118 + configurations for different makes and models of internal speakers. 119 + 120 + Sound Open Firmware and ALSA topology files 121 + ------------------------------------------- 122 + 123 + All SoundWire systems will require a Sound Open Firmware (SOF) for the 124 + host CPU audio DSP, together with an ALSA topology file (.tplg). 125 + 126 + The SOF firmware will usually be provided by the manufacturer of the host 127 + CPU (i.e. Intel or AMD). The .tplg file is normally part of the SOF firmware 128 + release. 129 + 130 + SOF binary builds are available from: https://github.com/thesofproject/sof-bin/releases 131 + 132 + The main SOF source is here: https://github.com/thesofproject 133 + 134 + ALSA-ucm configurations 135 + ----------------------- 136 + Typically an appropriate ALSA-ucm configuration file is needed for 137 + use-case managers and audio servers such as PipeWire. 138 + 139 + Configuration files are available from the alsa-ucm-conf repository: 140 + https://git.alsa-project.org/?p=alsa-ucm-conf.git 141 + 142 + Kernel log messages 143 + =================== 144 + 145 + SoundWire 146 + --------- 147 + A successful initialization will look like this (this will be repeated for 148 + each amplifier):: 149 + 150 + [ 7.568374] cs35l56 sdw:0:0:01fa:3556:01:0: supply VDD_P not found, using dummy regulator 151 + [ 7.605208] cs35l56 sdw:0:0:01fa:3556:01:0: supply VDD_IO not found, using dummy regulator 152 + [ 7.605313] cs35l56 sdw:0:0:01fa:3556:01:0: supply VDD_A not found, using dummy regulator 153 + [ 7.939279] cs35l56 sdw:0:0:01fa:3556:01:0: Cirrus Logic CS35L56 Rev B0 OTP3 fw:3.4.4 (patched=0) 154 + [ 7.947844] cs35l56 sdw:0:0:01fa:3556:01:0: Slave 4 state check1: UNATTACHED, status was 1 155 + [ 8.740280] cs35l56 sdw:0:0:01fa:3556:01:0: supply VDD_B not found, using dummy regulator 156 + [ 8.740552] cs35l56 sdw:0:0:01fa:3556:01:0: supply VDD_AMP not found, using dummy regulator 157 + [ 9.242164] cs35l56 sdw:0:0:01fa:3556:01:0: DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx.wmfw: format 3 timestamp 0x66b2b872 158 + [ 9.242173] cs35l56 sdw:0:0:01fa:3556:01:0: DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx.wmfw: Tue 05 Dec 2023 21:37:21 GMT Standard Time 159 + [ 9.991709] cs35l56 sdw:0:0:01fa:3556:01:0: DSP1: Firmware: 1a00d6 vendor: 0x2 v3.11.23, 41 algorithms 160 + [10.039098] cs35l56 sdw:0:0:01fa:3556:01:0: DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx-amp1.bin: v3.11.23 161 + [10.879235] cs35l56 sdw:0:0:01fa:3556:01:0: Slave 4 state check1: UNATTACHED, status was 1 162 + [11.401536] cs35l56 sdw:0:0:01fa:3556:01:0: Calibration applied 163 + 164 + HDA 165 + --- 166 + A successful initialization will look like this (this will be repeated for 167 + each amplifier):: 168 + 169 + [ 6.306475] cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Cirrus Logic CS35L56 Rev B0 OTP3 fw:3.4.4 (patched=0) 170 + [ 6.613892] cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: DSP system name: 'xxxxxxxx', amp name: 'AMP1' 171 + [ 8.266660] snd_hda_codec_cs8409 ehdaudio0D0: bound i2c-CSC3556:00-cs35l56-hda.0 (ops cs35l56_hda_comp_ops [snd_hda_scodec_cs35l56]) 172 + [ 8.287525] cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx.wmfw: format 3 timestamp 0x66b2b872 173 + [ 8.287528] cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx.wmfw: Tue 05 Dec 2023 21:37:21 GMT Standard Time 174 + [ 9.984335] cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: DSP1: Firmware: 1a00d6 vendor: 0x2 v3.11.23, 41 algorithms 175 + [10.085797] cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx-amp1.bin: v3.11.23 176 + [10.655237] cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Calibration applied 177 + 178 + Important messages 179 + ~~~~~~~~~~~~~~~~~~ 180 + Cirrus Logic CS35L56 Rev B0 OTP3 fw:3.4.4 (patched=0) 181 + Shows that the driver has been able to read device ID registers from the 182 + amplifier. 183 + 184 + * The actual amplifier type and silicon revision (CS35L56 B0 in this 185 + example) is shown, as read from the amplifier identification registers. 186 + * (patched=0) is normal, and indicates that the amplifier has been hard 187 + reset and is running default ROM firmware. 188 + * (patched=1) means that something has previously downloaded firmware 189 + to the amplifier and the driver does not have control of the RESET 190 + signal to be able to replace this preloaded firmware. This is normal 191 + for systems where the BIOS downloads firmware to the amplifiers 192 + before OS boot. 193 + This status can also be seen if the cs35l56 kernel module is unloaded 194 + and reloaded on a system where the driver does not have control of 195 + RESET. SoundWire systems typically do not give the driver control of 196 + RESET and only a BIOS (re)boot can reset the amplifiers. 197 + 198 + DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx.wmfw 199 + Shows that a .wmfw firmware file was found and downloaded. 200 + 201 + DSP1: cirrus/cs35l56-b0-dsp1-misc-xxxxxxxx-amp1.bin 202 + Shows that a .bin firmware file was found and downloaded. 203 + 204 + Calibration applied 205 + Factory calibration data in EFI was written to the amplifier. 206 + 207 + Error messages 208 + ============== 209 + This section explains some of the error messages that the driver can log. 210 + 211 + Algorithm coefficient version %d.%d.%d but expected %d.%d.%d 212 + The version of the .bin file content does not match the loaded firmware. 213 + Caused by mismatched .wmfw and .bin file, or .bin file was found but 214 + .wmfw was not. 215 + 216 + No %s for algorithm %x 217 + The version of the .bin file content does not match the loaded firmware. 218 + Caused by mismatched .wmfw and .bin file, or .bin file was found but 219 + .wmfw was not. 220 + 221 + .bin file required but not found 222 + HDA driver did not find a .bin file that matches this hardware. 223 + 224 + Calibration disabled due to missing firmware controls 225 + Driver was not able to write EFI calibration data to firmware registers. 226 + This typically means that either: 227 + 228 + * The driver did not find a suitable wmfw for this hardware, or 229 + * The amplifier has already been patched with firmware by something 230 + previously, and the driver does not have control of a hard RESET line 231 + to be able to reset the amplifier and download the firmware files it 232 + found. This situation is indicated by the device identification 233 + string in the kernel log shows "(patched=1)" 234 + 235 + Failed to write calibration 236 + Same meaning and cause as "Calibration disabled due to missing firmware 237 + controls" 238 + 239 + Failed to read calibration data from EFI 240 + Factory calibration data in EFI is missing, empty or corrupt. 241 + This is most likely to be cause by accidentally deleting the file from 242 + the EFI filesystem. 243 + 244 + No calibration for silicon ID 245 + The factory calibration data in EFI does not match this hardware. 246 + The most likely cause is that an amplifier has been replaced on the 247 + motherboard without going through manufacturer calibration process to 248 + generate calibration data for the new amplifier. 249 + 250 + Did not find any buses for CSCxxxx 251 + Only on HDA systems. The HDA codec driver found an ACPI entry for 252 + Cirrus Logic companion amps, but could not enumerate the ACPI entries for 253 + the I2C/SPI buses. The most likely cause of this is that: 254 + 255 + * The relevant bus driver (I2C or SPI) is not part of the kernel. 256 + * The HDA codec driver was built-in to the kernel but the I2C/SPI 257 + bus driver is a module and so the HDA codec driver cannot call the 258 + bus driver functions. 259 + 260 + init_completion timed out 261 + The SoundWire bus controller (host end) did not enumerate the amplifier. 262 + In other words, the ACPI says there is an amplifier but for some reason 263 + it was not detected on the bus. 264 + 265 + No AF01 node 266 + Indicates an error in ACPI. A SoundWire system should have a Device() 267 + node named "AF01" but it was not found. 268 + 269 + Failed to get spk-id-gpios 270 + ACPI says that the driver should request a GPIO but the driver was not 271 + able to get that GPIO. The most likely cause is that the kernel does not 272 + include the correct GPIO or PINCTRL driver for this system. 273 + 274 + Failed to read spk-id 275 + ACPI says that the driver should request a GPIO but the driver was not 276 + able to read that GPIO. 277 + 278 + Unexpected spk-id element count 279 + AF01 contains more speaker ID GPIO entries than the driver supports 280 + 281 + Overtemp error 282 + Amplifier overheat protection was triggered and the amplifier shut down 283 + to protect itself. 284 + 285 + Amp short error 286 + Amplifier detected a short-circuit on the speaker output pins and shut 287 + down for protection. This would normally indicate a damaged speaker. 288 + 289 + Hibernate wake failed 290 + The driver tried to wake the amplifier from its power-saving state but 291 + did not see the expected responses from the amplifier. This can be caused 292 + by using firmware that does not match the hardware.
+9
Documentation/sound/codecs/index.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + Codec-Specific Information 4 + ========================== 5 + 6 + .. toctree:: 7 + :maxdepth: 2 8 + 9 + cs35l56
+1
Documentation/sound/index.rst
··· 13 13 alsa-configuration 14 14 hd-audio/index 15 15 cards/index 16 + codecs/index 16 17 utimers 17 18 18 19 .. only:: subproject and html
+2
MAINTAINERS
··· 5469 5469 L: patches@opensource.cirrus.com 5470 5470 S: Maintained 5471 5471 F: Documentation/devicetree/bindings/sound/cirrus,cs* 5472 + F: Documentation/sound/codecs/cs* 5472 5473 F: drivers/mfd/cs42l43* 5473 5474 F: drivers/pinctrl/cirrus/pinctrl-cs42l43* 5474 5475 F: drivers/spi/spi-cs42l43* ··· 21994 21993 F: sound/soc/sof/ 21995 21994 21996 21995 SOUND - GENERIC SOUND CARD (Simple-Audio-Card, Audio-Graph-Card) 21996 + M: Mark Brown <broonie@kernel.org> 21997 21997 M: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 21998 21998 S: Supported 21999 21999 L: linux-sound@vger.kernel.org
+7
include/sound/simple_card_utils.h
··· 89 89 #define simple_props_to_dai_codec(props, i) ((props)->codec_dai + i) 90 90 #define simple_props_to_codec_conf(props, i) ((props)->codec_conf + i) 91 91 92 + /* has the same effect as simple_priv_to_props(). Preferred over 93 + * simple_priv_to_props() when dealing with PCM runtime data as 94 + * the ID stored in rtd->id may not be a valid array index. 95 + */ 96 + #define runtime_simple_priv_to_props(priv, rtd) \ 97 + ((priv)->dai_props + ((rtd)->dai_link - (priv)->dai_link)) 98 + 92 99 #define for_each_prop_dlc_cpus(props, i, cpu) \ 93 100 for ((i) = 0; \ 94 101 ((i) < (props)->num.cpus) && \
+10 -4
sound/core/seq/seq_clientmgr.c
··· 1275 1275 if (client->type != client_info->type) 1276 1276 return -EINVAL; 1277 1277 1278 - /* check validity of midi_version field */ 1279 - if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3) && 1280 - client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0) 1281 - return -EINVAL; 1278 + if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3)) { 1279 + /* check validity of midi_version field */ 1280 + if (client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0) 1281 + return -EINVAL; 1282 + 1283 + /* check if UMP is supported in kernel */ 1284 + if (!IS_ENABLED(CONFIG_SND_SEQ_UMP) && 1285 + client_info->midi_version > 0) 1286 + return -EINVAL; 1287 + } 1282 1288 1283 1289 /* fill the info fields */ 1284 1290 if (client_info->name[0])
+7 -2
sound/pci/hda/patch_realtek.c
··· 10184 10184 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10185 10185 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), 10186 10186 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), 10187 + SND_PCI_QUIRK(0x1025, 0x1360, "Acer Aspire A115", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10187 10188 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10188 10189 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10189 10190 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), ··· 10670 10669 SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC), 10671 10670 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 10672 10671 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), 10672 + SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1), 10673 + SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1), 10673 10674 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), 10674 10675 SND_PCI_QUIRK(0x1043, 0x1eb3, "ASUS Ally RCLA72", ALC287_FIXUP_TAS2781_I2C), 10675 10676 SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2), ··· 10961 10958 SND_PCI_QUIRK(0x17aa, 0x38e0, "Yoga Y990 Intel VECO Dual", ALC287_FIXUP_TAS2781_I2C), 10962 10959 SND_PCI_QUIRK(0x17aa, 0x38f8, "Yoga Book 9i", ALC287_FIXUP_TAS2781_I2C), 10963 10960 SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C), 10964 - SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), 10965 - SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), 10961 + SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10962 + SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10966 10963 SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C), 10967 10964 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 10968 10965 SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC), ··· 10992 10989 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10993 10990 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 10994 10991 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 10992 + SND_PCI_QUIRK(0x1849, 0x0269, "Positivo Master C6400", ALC269VB_FIXUP_ASUS_ZENBOOK), 10995 10993 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), 10996 10994 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC), 10997 10995 SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL), ··· 11027 11023 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), 11028 11024 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), 11029 11025 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 11026 + SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2), 11030 11027 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 11031 11028 SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13), 11032 11029 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
+1
sound/soc/codecs/Kconfig
··· 2451 2451 2452 2452 config SND_SOC_WM8994 2453 2453 tristate 2454 + depends on MFD_WM8994 2454 2455 2455 2456 config SND_SOC_WM8995 2456 2457 tristate
+1
sound/soc/codecs/cs42l43.c
··· 2404 2404 2405 2405 static const struct dev_pm_ops cs42l43_codec_pm_ops = { 2406 2406 RUNTIME_PM_OPS(NULL, cs42l43_codec_runtime_resume, NULL) 2407 + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 2407 2408 }; 2408 2409 2409 2410 static const struct platform_device_id cs42l43_codec_id_table[] = {
+9 -1
sound/soc/codecs/es8316.c
··· 39 39 struct snd_soc_jack *jack; 40 40 int irq; 41 41 unsigned int sysclk; 42 - unsigned int allowed_rates[ARRAY_SIZE(supported_mclk_lrck_ratios)]; 42 + /* ES83xx supports halving the MCLK so it supports twice as many rates 43 + */ 44 + unsigned int allowed_rates[ARRAY_SIZE(supported_mclk_lrck_ratios) * 2]; 43 45 struct snd_pcm_hw_constraint_list sysclk_constraints; 44 46 bool jd_inverted; 45 47 }; ··· 388 386 389 387 if (freq % ratio == 0) 390 388 es8316->allowed_rates[count++] = freq / ratio; 389 + 390 + /* We also check if the halved MCLK produces a valid rate 391 + * since the codec supports halving the MCLK. 392 + */ 393 + if ((freq / ratio) % 2 == 0) 394 + es8316->allowed_rates[count++] = freq / ratio / 2; 391 395 } 392 396 393 397 if (count) {
+19 -4
sound/soc/codecs/es8326.c
··· 616 616 0x0F, 0x0F); 617 617 if (es8326->version > ES8326_VERSION_B) { 618 618 regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x40); 619 - regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x10); 619 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x30); 620 620 } 621 621 } 622 622 } else { ··· 631 631 regmap_write(es8326->regmap, ES8326_HPR_OFFSET_INI, offset_r); 632 632 es8326->calibrated = true; 633 633 } 634 + regmap_update_bits(es8326->regmap, ES8326_CLK_INV, 0xc0, 0x00); 635 + regmap_update_bits(es8326->regmap, ES8326_CLK_MUX, 0x80, 0x00); 634 636 if (direction == SNDRV_PCM_STREAM_PLAYBACK) { 635 637 regmap_update_bits(es8326->regmap, ES8326_DAC_DSM, 0x01, 0x01); 636 638 usleep_range(1000, 5000); ··· 647 645 } else { 648 646 msleep(300); 649 647 if (es8326->version > ES8326_VERSION_B) { 650 - regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x50); 648 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x70); 651 649 regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x00); 652 650 } 653 651 regmap_update_bits(es8326->regmap, ES8326_ADC_MUTE, ··· 678 676 regmap_write(es8326->regmap, ES8326_ANA_PDN, 0x00); 679 677 regmap_update_bits(es8326->regmap, ES8326_CLK_CTL, 0x20, 0x20); 680 678 regmap_update_bits(es8326->regmap, ES8326_RESET, 0x02, 0x00); 679 + if (es8326->version > ES8326_VERSION_B) { 680 + regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x40); 681 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x30); 682 + } 681 683 break; 682 684 case SND_SOC_BIAS_PREPARE: 683 685 break; ··· 689 683 regmap_write(es8326->regmap, ES8326_ANA_PDN, 0x3b); 690 684 regmap_update_bits(es8326->regmap, ES8326_CLK_CTL, 0x20, 0x00); 691 685 regmap_write(es8326->regmap, ES8326_SDINOUT1_IO, ES8326_IO_INPUT); 686 + if (es8326->version > ES8326_VERSION_B) { 687 + regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x40); 688 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x10); 689 + } 690 + regmap_update_bits(es8326->regmap, ES8326_CLK_INV, 0xc0, 0xc0); 691 + regmap_update_bits(es8326->regmap, ES8326_CLK_MUX, 0x80, 0x80); 692 692 break; 693 693 case SND_SOC_BIAS_OFF: 694 694 clk_disable_unprepare(es8326->mclk); ··· 785 773 case 0x6f: 786 774 case 0x4b: 787 775 /* button volume up */ 788 - cur_button = SND_JACK_BTN_1; 776 + if ((iface == 0x6f) && (es8326->version > ES8326_VERSION_B)) 777 + cur_button = SND_JACK_BTN_0; 778 + else 779 + cur_button = SND_JACK_BTN_1; 789 780 break; 790 781 case 0x27: 791 782 /* button volume down */ ··· 1097 1082 regmap_write(es8326->regmap, ES8326_ADC2_SRC, 0x66); 1098 1083 es8326_disable_micbias(es8326->component); 1099 1084 if (es8326->version > ES8326_VERSION_B) { 1100 - regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x73, 0x13); 1085 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x73, 0x10); 1101 1086 regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x40); 1102 1087 } 1103 1088
+4 -4
sound/soc/codecs/nau8824.c
··· 368 368 SOC_ENUM("DAC Oversampling Rate", nau8824_dac_oversampl_enum), 369 369 370 370 SOC_SINGLE_TLV("Speaker Right DACR Volume", 371 - NAU8824_REG_CLASSD_GAIN_1, 8, 0x1f, 0, spk_vol_tlv), 371 + NAU8824_REG_CLASSD_GAIN_1, 8, 0x19, 0, spk_vol_tlv), 372 372 SOC_SINGLE_TLV("Speaker Left DACL Volume", 373 - NAU8824_REG_CLASSD_GAIN_2, 0, 0x1f, 0, spk_vol_tlv), 373 + NAU8824_REG_CLASSD_GAIN_2, 0, 0x19, 0, spk_vol_tlv), 374 374 SOC_SINGLE_TLV("Speaker Left DACR Volume", 375 - NAU8824_REG_CLASSD_GAIN_1, 0, 0x1f, 0, spk_vol_tlv), 375 + NAU8824_REG_CLASSD_GAIN_1, 0, 0x19, 0, spk_vol_tlv), 376 376 SOC_SINGLE_TLV("Speaker Right DACL Volume", 377 - NAU8824_REG_CLASSD_GAIN_2, 8, 0x1f, 0, spk_vol_tlv), 377 + NAU8824_REG_CLASSD_GAIN_2, 8, 0x19, 0, spk_vol_tlv), 378 378 379 379 SOC_SINGLE_TLV("Headphone Right DACR Volume", 380 380 NAU8824_REG_ATT_PORT0, 8, 0x1f, 0, hp_vol_tlv),
+1 -1
sound/soc/codecs/tas2781-i2c.c
··· 78 78 X2781_CL_STT_VAL(TAS2781_PRM_INT_MASK_REG, 0xfe, false), 79 79 X2781_CL_STT_VAL(TAS2781_PRM_CLK_CFG_REG, 0xdd, false), 80 80 X2781_CL_STT_VAL(TAS2781_PRM_RSVD_REG, 0x20, false), 81 - X2781_CL_STT_VAL(TAS2781_PRM_TEST_57_REG, 0x14, false), 81 + X2781_CL_STT_VAL(TAS2781_PRM_TEST_57_REG, 0x14, true), 82 82 X2781_CL_STT_VAL(TAS2781_PRM_TEST_62_REG, 0x45, true), 83 83 X2781_CL_STT_VAL(TAS2781_PRM_PVDD_UVLO_REG, 0x03, false), 84 84 X2781_CL_STT_VAL(TAS2781_PRM_CHNL_0_REG, 0xa8, false),
+5 -5
sound/soc/generic/simple-card-utils.c
··· 296 296 { 297 297 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 298 298 struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card); 299 - struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id); 299 + struct simple_dai_props *props = runtime_simple_priv_to_props(priv, rtd); 300 300 struct simple_util_dai *dai; 301 301 unsigned int fixed_sysclk = 0; 302 302 int i1, i2, i; ··· 357 357 { 358 358 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 359 359 struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card); 360 - struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id); 360 + struct simple_dai_props *props = runtime_simple_priv_to_props(priv, rtd); 361 361 struct simple_util_dai *dai; 362 362 int i; 363 363 ··· 448 448 struct simple_util_dai *pdai; 449 449 struct snd_soc_dai *sdai; 450 450 struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card); 451 - struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id); 451 + struct simple_dai_props *props = runtime_simple_priv_to_props(priv, rtd); 452 452 unsigned int mclk, mclk_fs = 0; 453 453 int i, ret; 454 454 ··· 517 517 struct snd_pcm_hw_params *params) 518 518 { 519 519 struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card); 520 - struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->id); 520 + struct simple_dai_props *dai_props = runtime_simple_priv_to_props(priv, rtd); 521 521 struct simple_util_data *data = &dai_props->adata; 522 522 struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); 523 523 struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); ··· 628 628 int simple_util_dai_init(struct snd_soc_pcm_runtime *rtd) 629 629 { 630 630 struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card); 631 - struct simple_dai_props *props = simple_priv_to_props(priv, rtd->id); 631 + struct simple_dai_props *props = runtime_simple_priv_to_props(priv, rtd); 632 632 struct simple_util_dai *dai; 633 633 int i, ret; 634 634
+19 -4
sound/soc/intel/boards/sof_sdw.c
··· 608 608 .callback = sof_sdw_quirk_cb, 609 609 .matches = { 610 610 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 611 - DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "3838") 611 + DMI_MATCH(DMI_PRODUCT_NAME, "83JX") 612 612 }, 613 - .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS), 613 + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS | SOC_SDW_CODEC_MIC), 614 614 }, 615 615 { 616 616 .callback = sof_sdw_quirk_cb, 617 617 .matches = { 618 618 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 619 - DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "3832") 619 + DMI_MATCH(DMI_PRODUCT_NAME, "83LC") 620 620 }, 621 - .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS), 621 + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS | SOC_SDW_CODEC_MIC), 622 + }, 623 + { 624 + .callback = sof_sdw_quirk_cb, 625 + .matches = { 626 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 627 + DMI_MATCH(DMI_PRODUCT_NAME, "83MC") 628 + }, 629 + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS | SOC_SDW_CODEC_MIC), 630 + }, { 631 + .callback = sof_sdw_quirk_cb, 632 + .matches = { 633 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 634 + DMI_MATCH(DMI_PRODUCT_NAME, "83NM") 635 + }, 636 + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS | SOC_SDW_CODEC_MIC), 622 637 }, 623 638 { 624 639 .callback = sof_sdw_quirk_cb,
+23 -5
sound/soc/renesas/rcar/adg.c
··· 374 374 return 0; 375 375 } 376 376 377 - void rsnd_adg_clk_control(struct rsnd_priv *priv, int enable) 377 + int rsnd_adg_clk_control(struct rsnd_priv *priv, int enable) 378 378 { 379 379 struct rsnd_adg *adg = rsnd_priv_to_adg(priv); 380 380 struct rsnd_mod *adg_mod = rsnd_mod_get(adg); 381 381 struct clk *clk; 382 - int i; 382 + int ret = 0, i; 383 383 384 384 if (enable) { 385 385 rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr); ··· 389 389 390 390 for_each_rsnd_clkin(clk, adg, i) { 391 391 if (enable) { 392 - clk_prepare_enable(clk); 392 + ret = clk_prepare_enable(clk); 393 393 394 394 /* 395 395 * We shouldn't use clk_get_rate() under 396 396 * atomic context. Let's keep it when 397 397 * rsnd_adg_clk_enable() was called 398 398 */ 399 + if (ret < 0) 400 + break; 401 + 399 402 adg->clkin_rate[i] = clk_get_rate(clk); 400 403 } else { 401 - clk_disable_unprepare(clk); 404 + if (adg->clkin_rate[i]) 405 + clk_disable_unprepare(clk); 406 + 407 + adg->clkin_rate[i] = 0; 402 408 } 403 409 } 410 + 411 + /* 412 + * rsnd_adg_clk_enable() might return error (_disable() will not). 413 + * We need to rollback in such case 414 + */ 415 + if (ret < 0) 416 + rsnd_adg_clk_disable(priv); 417 + 418 + return ret; 404 419 } 405 420 406 421 static struct clk *rsnd_adg_create_null_clk(struct rsnd_priv *priv, ··· 768 753 if (ret) 769 754 return ret; 770 755 771 - rsnd_adg_clk_enable(priv); 756 + ret = rsnd_adg_clk_enable(priv); 757 + if (ret) 758 + return ret; 759 + 772 760 rsnd_adg_clk_dbg_info(priv, NULL); 773 761 774 762 return 0;
+1 -3
sound/soc/renesas/rcar/core.c
··· 2086 2086 { 2087 2087 struct rsnd_priv *priv = dev_get_drvdata(dev); 2088 2088 2089 - rsnd_adg_clk_enable(priv); 2090 - 2091 - return 0; 2089 + return rsnd_adg_clk_enable(priv); 2092 2090 } 2093 2091 2094 2092 static const struct dev_pm_ops rsnd_pm_ops = {
+1 -1
sound/soc/renesas/rcar/rsnd.h
··· 608 608 struct rsnd_dai_stream *io); 609 609 #define rsnd_adg_clk_enable(priv) rsnd_adg_clk_control(priv, 1) 610 610 #define rsnd_adg_clk_disable(priv) rsnd_adg_clk_control(priv, 0) 611 - void rsnd_adg_clk_control(struct rsnd_priv *priv, int enable); 611 + int rsnd_adg_clk_control(struct rsnd_priv *priv, int enable); 612 612 void rsnd_adg_clk_dbg_info(struct rsnd_priv *priv, struct seq_file *m); 613 613 614 614 /*
+4 -2
sound/soc/samsung/Kconfig
··· 127 127 128 128 config SND_SOC_SAMSUNG_ARIES_WM8994 129 129 tristate "SoC I2S Audio support for WM8994 on Aries" 130 - depends on SND_SOC_SAMSUNG && MFD_WM8994 && IIO && EXTCON 130 + depends on SND_SOC_SAMSUNG && I2C && IIO && EXTCON 131 131 select SND_SOC_BT_SCO 132 + select MFD_WM8994 132 133 select SND_SOC_WM8994 133 134 select SND_SAMSUNG_I2S 134 135 help ··· 141 140 142 141 config SND_SOC_SAMSUNG_MIDAS_WM1811 143 142 tristate "SoC I2S Audio support for Midas boards" 144 - depends on SND_SOC_SAMSUNG && IIO 143 + depends on SND_SOC_SAMSUNG && I2C && IIO 145 144 select SND_SAMSUNG_I2S 145 + select MFD_WM8994 146 146 select SND_SOC_WM8994 147 147 help 148 148 Say Y if you want to add support for SoC audio on the Midas boards.
+2
sound/usb/quirks.c
··· 2239 2239 QUIRK_FLAG_CTL_MSG_DELAY_1M), 2240 2240 DEVICE_FLG(0x0c45, 0x6340, /* Sonix HD USB Camera */ 2241 2241 QUIRK_FLAG_GET_SAMPLE_RATE), 2242 + DEVICE_FLG(0x0d8c, 0x0014, /* USB Audio Device */ 2243 + QUIRK_FLAG_CTL_MSG_DELAY_1M), 2242 2244 DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */ 2243 2245 QUIRK_FLAG_FIXED_RATE), 2244 2246 DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */