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

For applying HD-audio EPROBE_DEFER series cleanly.

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

+572 -232
+1 -1
Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml
··· 82 82 description: 83 83 Current at which the headset micbias sense clamp will engage, 0 to 84 84 disable. 85 - enum: [ 0, 14, 23, 41, 50, 60, 68, 86, 95 ] 85 + enum: [ 0, 14, 24, 43, 52, 61, 71, 90, 99 ] 86 86 default: 0 87 87 88 88 cirrus,bias-ramp-ms:
+3
Documentation/devicetree/bindings/sound/fsl,micfil.yaml
··· 56 56 - const: clkext3 57 57 minItems: 2 58 58 59 + "#sound-dai-cells": 60 + const: 0 61 + 59 62 required: 60 63 - compatible 61 64 - reg
+1
Documentation/devicetree/bindings/sound/rockchip-spdif.yaml
··· 26 26 - const: rockchip,rk3568-spdif 27 27 - items: 28 28 - enum: 29 + - rockchip,rk3128-spdif 29 30 - rockchip,rk3188-spdif 30 31 - rockchip,rk3288-spdif 31 32 - rockchip,rk3308-spdif
+17 -17
drivers/firmware/cirrus/cs_dsp.c
··· 1863 1863 return PTR_ERR(adsp2_alg); 1864 1864 1865 1865 for (i = 0; i < n_algs; i++) { 1866 - cs_dsp_info(dsp, 1867 - "%d: ID %x v%d.%d.%d XM@%x YM@%x ZM@%x\n", 1868 - i, be32_to_cpu(adsp2_alg[i].alg.id), 1869 - (be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff0000) >> 16, 1870 - (be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff00) >> 8, 1871 - be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff, 1872 - be32_to_cpu(adsp2_alg[i].xm), 1873 - be32_to_cpu(adsp2_alg[i].ym), 1874 - be32_to_cpu(adsp2_alg[i].zm)); 1866 + cs_dsp_dbg(dsp, 1867 + "%d: ID %x v%d.%d.%d XM@%x YM@%x ZM@%x\n", 1868 + i, be32_to_cpu(adsp2_alg[i].alg.id), 1869 + (be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff0000) >> 16, 1870 + (be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff00) >> 8, 1871 + be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff, 1872 + be32_to_cpu(adsp2_alg[i].xm), 1873 + be32_to_cpu(adsp2_alg[i].ym), 1874 + be32_to_cpu(adsp2_alg[i].zm)); 1875 1875 1876 1876 alg_region = cs_dsp_create_region(dsp, WMFW_ADSP2_XM, 1877 1877 adsp2_alg[i].alg.id, ··· 1996 1996 return PTR_ERR(halo_alg); 1997 1997 1998 1998 for (i = 0; i < n_algs; i++) { 1999 - cs_dsp_info(dsp, 2000 - "%d: ID %x v%d.%d.%d XM@%x YM@%x\n", 2001 - i, be32_to_cpu(halo_alg[i].alg.id), 2002 - (be32_to_cpu(halo_alg[i].alg.ver) & 0xff0000) >> 16, 2003 - (be32_to_cpu(halo_alg[i].alg.ver) & 0xff00) >> 8, 2004 - be32_to_cpu(halo_alg[i].alg.ver) & 0xff, 2005 - be32_to_cpu(halo_alg[i].xm_base), 2006 - be32_to_cpu(halo_alg[i].ym_base)); 1999 + cs_dsp_dbg(dsp, 2000 + "%d: ID %x v%d.%d.%d XM@%x YM@%x\n", 2001 + i, be32_to_cpu(halo_alg[i].alg.id), 2002 + (be32_to_cpu(halo_alg[i].alg.ver) & 0xff0000) >> 16, 2003 + (be32_to_cpu(halo_alg[i].alg.ver) & 0xff00) >> 8, 2004 + be32_to_cpu(halo_alg[i].alg.ver) & 0xff, 2005 + be32_to_cpu(halo_alg[i].xm_base), 2006 + be32_to_cpu(halo_alg[i].ym_base)); 2007 2007 2008 2008 ret = cs_dsp_halo_create_regions(dsp, halo_alg[i].alg.id, 2009 2009 halo_alg[i].alg.ver,
+1
include/sound/soc-dapm.h
··· 469 469 470 470 int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream, 471 471 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai); 472 + int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s); 472 473 473 474 /* dapm path setup */ 474 475 int snd_soc_dapm_new_widgets(struct snd_soc_card *card);
+2
include/sound/soc.h
··· 1126 1126 unsigned int pop_wait:1; 1127 1127 unsigned int fe_compr:1; /* for Dynamic PCM */ 1128 1128 1129 + bool initialized; 1130 + 1129 1131 int num_components; 1130 1132 struct snd_soc_component *components[]; /* CPU/Codec/Platform */ 1131 1133 };
+79 -36
sound/pci/hda/cs35l41_hda.c
··· 188 188 cs35l41->speaker_id, "wmfw"); 189 189 if (!ret) { 190 190 /* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */ 191 - return cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, 192 - CS35L41_FIRMWARE_ROOT, 193 - cs35l41->acpi_subsystem_id, cs35l41->amp_name, 194 - cs35l41->speaker_id, "bin"); 191 + ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, 192 + CS35L41_FIRMWARE_ROOT, 193 + cs35l41->acpi_subsystem_id, cs35l41->amp_name, 194 + cs35l41->speaker_id, "bin"); 195 + if (ret) 196 + goto coeff_err; 197 + 198 + return 0; 195 199 } 196 200 197 201 /* try cirrus/part-dspN-fwtype-sub<-ampname>.wmfw */ ··· 204 200 cs35l41->amp_name, -1, "wmfw"); 205 201 if (!ret) { 206 202 /* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */ 207 - return cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, 208 - CS35L41_FIRMWARE_ROOT, 209 - cs35l41->acpi_subsystem_id, cs35l41->amp_name, 210 - cs35l41->speaker_id, "bin"); 203 + ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, 204 + CS35L41_FIRMWARE_ROOT, 205 + cs35l41->acpi_subsystem_id, cs35l41->amp_name, 206 + cs35l41->speaker_id, "bin"); 207 + if (ret) 208 + goto coeff_err; 209 + 210 + return 0; 211 211 } 212 212 213 213 /* try cirrus/part-dspN-fwtype-sub<-spkidN>.wmfw */ ··· 226 218 cs35l41->amp_name, cs35l41->speaker_id, "bin"); 227 219 if (ret) 228 220 /* try cirrus/part-dspN-fwtype-sub<-spkidN>.bin */ 229 - return cs35l41_request_firmware_file(cs35l41, coeff_firmware, 230 - coeff_filename, CS35L41_FIRMWARE_ROOT, 231 - cs35l41->acpi_subsystem_id, NULL, 232 - cs35l41->speaker_id, "bin"); 221 + ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, 222 + coeff_filename, CS35L41_FIRMWARE_ROOT, 223 + cs35l41->acpi_subsystem_id, NULL, 224 + cs35l41->speaker_id, "bin"); 225 + if (ret) 226 + goto coeff_err; 227 + 228 + return 0; 233 229 } 234 230 235 231 /* try cirrus/part-dspN-fwtype-sub.wmfw */ ··· 248 236 cs35l41->speaker_id, "bin"); 249 237 if (ret) 250 238 /* try cirrus/part-dspN-fwtype-sub<-spkidN>.bin */ 251 - return cs35l41_request_firmware_file(cs35l41, coeff_firmware, 252 - coeff_filename, CS35L41_FIRMWARE_ROOT, 253 - cs35l41->acpi_subsystem_id, NULL, 254 - cs35l41->speaker_id, "bin"); 239 + ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, 240 + coeff_filename, CS35L41_FIRMWARE_ROOT, 241 + cs35l41->acpi_subsystem_id, NULL, 242 + cs35l41->speaker_id, "bin"); 243 + if (ret) 244 + goto coeff_err; 255 245 } 256 246 247 + return ret; 248 + coeff_err: 249 + release_firmware(*wmfw_firmware); 250 + kfree(*wmfw_filename); 251 + return ret; 252 + } 253 + 254 + static int cs35l41_fallback_firmware_file(struct cs35l41_hda *cs35l41, 255 + const struct firmware **wmfw_firmware, 256 + char **wmfw_filename, 257 + const struct firmware **coeff_firmware, 258 + char **coeff_filename) 259 + { 260 + int ret; 261 + 262 + /* Handle fallback */ 263 + dev_warn(cs35l41->dev, "Falling back to default firmware.\n"); 264 + 265 + /* fallback try cirrus/part-dspN-fwtype.wmfw */ 266 + ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, 267 + CS35L41_FIRMWARE_ROOT, NULL, NULL, -1, "wmfw"); 268 + if (ret) 269 + goto err; 270 + 271 + /* fallback try cirrus/part-dspN-fwtype.bin */ 272 + ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, 273 + CS35L41_FIRMWARE_ROOT, NULL, NULL, -1, "bin"); 274 + if (ret) { 275 + release_firmware(*wmfw_firmware); 276 + kfree(*wmfw_filename); 277 + goto err; 278 + } 279 + return 0; 280 + 281 + err: 282 + dev_warn(cs35l41->dev, "Unable to find firmware and tuning\n"); 257 283 return ret; 258 284 } 259 285 ··· 307 257 ret = cs35l41_request_firmware_files_spkid(cs35l41, wmfw_firmware, wmfw_filename, 308 258 coeff_firmware, coeff_filename); 309 259 goto out; 310 - 311 260 } 312 261 313 262 /* try cirrus/part-dspN-fwtype-sub<-ampname>.wmfw */ ··· 319 270 CS35L41_FIRMWARE_ROOT, 320 271 cs35l41->acpi_subsystem_id, cs35l41->amp_name, 321 272 -1, "bin"); 273 + if (ret) 274 + goto coeff_err; 275 + 322 276 goto out; 323 277 } 324 278 ··· 341 289 CS35L41_FIRMWARE_ROOT, 342 290 cs35l41->acpi_subsystem_id, NULL, -1, 343 291 "bin"); 292 + if (ret) 293 + goto coeff_err; 344 294 } 345 295 346 296 out: 347 - if (!ret) 348 - return 0; 297 + if (ret) 298 + /* if all attempts at finding firmware fail, try fallback */ 299 + goto fallback; 349 300 350 - /* Handle fallback */ 351 - dev_warn(cs35l41->dev, "Falling back to default firmware.\n"); 301 + return 0; 352 302 303 + coeff_err: 353 304 release_firmware(*wmfw_firmware); 354 305 kfree(*wmfw_filename); 355 - 356 - /* fallback try cirrus/part-dspN-fwtype.wmfw */ 357 - ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, 358 - CS35L41_FIRMWARE_ROOT, NULL, NULL, -1, "wmfw"); 359 - if (!ret) 360 - /* fallback try cirrus/part-dspN-fwtype.bin */ 361 - ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, 362 - CS35L41_FIRMWARE_ROOT, NULL, NULL, -1, "bin"); 363 - 364 - if (ret) { 365 - release_firmware(*wmfw_firmware); 366 - kfree(*wmfw_filename); 367 - dev_warn(cs35l41->dev, "Unable to find firmware and tuning\n"); 368 - } 369 - return ret; 306 + fallback: 307 + return cs35l41_fallback_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, 308 + coeff_firmware, coeff_filename); 370 309 } 371 310 372 311 #if IS_ENABLED(CONFIG_EFI)
+3 -3
sound/pci/hda/cs35l56_hda.c
··· 106 106 } 107 107 } 108 108 109 - static int __maybe_unused cs35l56_hda_runtime_suspend(struct device *dev) 109 + static int cs35l56_hda_runtime_suspend(struct device *dev) 110 110 { 111 111 struct cs35l56_hda *cs35l56 = dev_get_drvdata(dev); 112 112 ··· 116 116 return cs35l56_runtime_suspend_common(&cs35l56->base); 117 117 } 118 118 119 - static int __maybe_unused cs35l56_hda_runtime_resume(struct device *dev) 119 + static int cs35l56_hda_runtime_resume(struct device *dev) 120 120 { 121 121 struct cs35l56_hda *cs35l56 = dev_get_drvdata(dev); 122 122 int ret; ··· 1026 1026 EXPORT_SYMBOL_NS_GPL(cs35l56_hda_remove, SND_HDA_SCODEC_CS35L56); 1027 1027 1028 1028 const struct dev_pm_ops cs35l56_hda_pm_ops = { 1029 - SET_RUNTIME_PM_OPS(cs35l56_hda_runtime_suspend, cs35l56_hda_runtime_resume, NULL) 1029 + RUNTIME_PM_OPS(cs35l56_hda_runtime_suspend, cs35l56_hda_runtime_resume, NULL) 1030 1030 SYSTEM_SLEEP_PM_OPS(cs35l56_hda_system_suspend, cs35l56_hda_system_resume) 1031 1031 LATE_SYSTEM_SLEEP_PM_OPS(cs35l56_hda_system_suspend_late, 1032 1032 cs35l56_hda_system_resume_early)
+48 -10
sound/pci/hda/patch_realtek.c
··· 7159 7159 0x0); /* Make sure 0x14 was disable */ 7160 7160 } 7161 7161 } 7162 + /* Fix none verb table of Headset Mic pin */ 7163 + static void alc_fixup_headset_mic(struct hda_codec *codec, 7164 + const struct hda_fixup *fix, int action) 7165 + { 7166 + struct alc_spec *spec = codec->spec; 7167 + static const struct hda_pintbl pincfgs[] = { 7168 + { 0x19, 0x03a1103c }, 7169 + { } 7170 + }; 7171 + 7172 + switch (action) { 7173 + case HDA_FIXUP_ACT_PRE_PROBE: 7174 + snd_hda_apply_pincfgs(codec, pincfgs); 7175 + alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 7176 + spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 7177 + break; 7178 + } 7179 + } 7162 7180 7163 7181 7164 7182 enum { ··· 7442 7424 ALC245_FIXUP_HP_MUTE_LED_COEFBIT, 7443 7425 ALC245_FIXUP_HP_X360_MUTE_LEDS, 7444 7426 ALC287_FIXUP_THINKPAD_I2S_SPK, 7427 + ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD, 7428 + ALC2XX_FIXUP_HEADSET_MIC, 7445 7429 }; 7446 7430 7447 7431 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 9542 9522 .type = HDA_FIXUP_FUNC, 9543 9523 .v.func = alc287_fixup_bind_dacs, 9544 9524 }, 9525 + [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = { 9526 + .type = HDA_FIXUP_FUNC, 9527 + .v.func = alc287_fixup_bind_dacs, 9528 + .chained = true, 9529 + .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, 9530 + }, 9531 + [ALC2XX_FIXUP_HEADSET_MIC] = { 9532 + .type = HDA_FIXUP_FUNC, 9533 + .v.func = alc_fixup_headset_mic, 9534 + }, 9545 9535 }; 9546 9536 9547 9537 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 9826 9796 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9827 9797 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9828 9798 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9799 + SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 9829 9800 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 9830 9801 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9831 9802 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), ··· 9896 9865 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), 9897 9866 SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301V", ALC285_FIXUP_ASUS_HEADSET_MIC), 9898 9867 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), 9868 + SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZV", ALC285_FIXUP_ASUS_HEADSET_MIC), 9899 9869 SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2), 9900 9870 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 9901 9871 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), ··· 9967 9935 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 9968 9936 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 9969 9937 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 9970 - SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC225_FIXUP_HEADSET_JACK), 9938 + SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 9971 9939 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), 9972 9940 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 9973 9941 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP), ··· 10101 10069 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 10102 10070 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), 10103 10071 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), 10104 - SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10105 - SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10106 - SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10107 - SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10108 - SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10109 - SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10110 - SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10111 - SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI), 10072 + SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10073 + SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10074 + SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10075 + SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10076 + SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10077 + SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10078 + SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10079 + SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10112 10080 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 10113 10081 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 10114 10082 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), ··· 10204 10172 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), 10205 10173 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), 10206 10174 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), 10207 - SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC225_FIXUP_HEADSET_JACK), 10175 + SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK), 10208 10176 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 10209 10177 10210 10178 #if 0 ··· 10690 10658 {0x17, 0x90170110}, 10691 10659 {0x19, 0x03a11030}, 10692 10660 {0x21, 0x03211020}), 10661 + SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK, 10662 + {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */ 10663 + {0x19, 0x04a11040}, 10664 + {0x21, 0x04211020}), 10693 10665 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, 10694 10666 {0x12, 0x90a60130}, 10695 10667 {0x17, 0x90170110}, ··· 10856 10820 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, 10857 10821 {0x19, 0x40000000}, 10858 10822 {0x1a, 0x40000000}), 10823 + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC, 10824 + {0x19, 0x40000000}), 10859 10825 {} 10860 10826 }; 10861 10827
+28
sound/soc/amd/yc/acp6x-mach.c
··· 217 217 .driver_data = &acp6x_card, 218 218 .matches = { 219 219 DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 220 + DMI_MATCH(DMI_PRODUCT_NAME, "82QF"), 221 + } 222 + }, 223 + { 224 + .driver_data = &acp6x_card, 225 + .matches = { 226 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 220 227 DMI_MATCH(DMI_PRODUCT_NAME, "82TL"), 221 228 } 222 229 }, ··· 231 224 .driver_data = &acp6x_card, 232 225 .matches = { 233 226 DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 227 + DMI_MATCH(DMI_PRODUCT_NAME, "82UG"), 228 + } 229 + }, 230 + { 231 + .driver_data = &acp6x_card, 232 + .matches = { 233 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 234 234 DMI_MATCH(DMI_PRODUCT_NAME, "82V2"), 235 + } 236 + }, 237 + { 238 + .driver_data = &acp6x_card, 239 + .matches = { 240 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 241 + DMI_MATCH(DMI_PRODUCT_NAME, "82YM"), 235 242 } 236 243 }, 237 244 { ··· 281 260 .matches = { 282 261 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), 283 262 DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"), 263 + } 264 + }, 265 + { 266 + .driver_data = &acp6x_card, 267 + .matches = { 268 + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), 269 + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 B7ED"), 284 270 } 285 271 }, 286 272 {
+2
sound/soc/codecs/aw88395/aw88395_lib.c
··· 452 452 if ((aw_bin->all_bin_parse_num != 1) || 453 453 (aw_bin->header_info[0].bin_data_type != DATA_TYPE_REGISTER)) { 454 454 dev_err(aw_dev->dev, "bin num or type error"); 455 + ret = -EINVAL; 455 456 goto parse_bin_failed; 456 457 } 457 458 458 459 if (aw_bin->header_info[0].valid_data_len % 4) { 459 460 dev_err(aw_dev->dev, "bin data len get error!"); 461 + ret = -EINVAL; 460 462 goto parse_bin_failed; 461 463 } 462 464
-1
sound/soc/codecs/cs35l56-i2c.c
··· 27 27 return -ENOMEM; 28 28 29 29 cs35l56->base.dev = dev; 30 - cs35l56->base.can_hibernate = true; 31 30 32 31 i2c_set_clientdata(client, cs35l56); 33 32 cs35l56->base.regmap = devm_regmap_init_i2c(client, regmap_config);
+8 -1
sound/soc/codecs/cs35l56.c
··· 706 706 707 707 mutex_lock(&cs35l56->base.irq_lock); 708 708 709 - init_completion(&cs35l56->init_completion); 709 + reinit_completion(&cs35l56->init_completion); 710 710 711 711 cs35l56->soft_resetting = true; 712 712 cs35l56_system_reset(&cs35l56->base, !!cs35l56->sdw_peripheral); ··· 1186 1186 /* Registers could be dirty after soft reset or SoundWire enumeration */ 1187 1187 regcache_sync(cs35l56->base.regmap); 1188 1188 1189 + /* Set ASP1 DOUT to high-impedance when it is not transmitting audio data. */ 1190 + ret = regmap_set_bits(cs35l56->base.regmap, CS35L56_ASP1_CONTROL3, 1191 + CS35L56_ASP1_DOUT_HIZ_CTRL_MASK); 1192 + if (ret) 1193 + return dev_err_probe(cs35l56->base.dev, ret, "Failed to write ASP1_CONTROL3\n"); 1194 + 1189 1195 cs35l56->base.init_done = true; 1190 1196 complete(&cs35l56->init_completion); 1191 1197 ··· 1213 1207 flush_workqueue(cs35l56->dsp_wq); 1214 1208 destroy_workqueue(cs35l56->dsp_wq); 1215 1209 1210 + pm_runtime_dont_use_autosuspend(cs35l56->base.dev); 1216 1211 pm_runtime_suspend(cs35l56->base.dev); 1217 1212 pm_runtime_disable(cs35l56->base.dev); 1218 1213
+21
sound/soc/codecs/cs42l42-sdw.c
··· 6 6 7 7 #include <linux/acpi.h> 8 8 #include <linux/device.h> 9 + #include <linux/gpio/consumer.h> 9 10 #include <linux/iopoll.h> 10 11 #include <linux/module.h> 11 12 #include <linux/mod_devicetable.h> ··· 345 344 switch (status) { 346 345 case SDW_SLAVE_ATTACHED: 347 346 dev_dbg(cs42l42->dev, "ATTACHED\n"); 347 + 348 + /* 349 + * The SoundWire core can report stale ATTACH notifications 350 + * if we hard-reset CS42L42 in probe() but it had already been 351 + * enumerated. Reject the ATTACH if we haven't yet seen an 352 + * UNATTACH report for the device being in reset. 353 + */ 354 + if (cs42l42->sdw_waiting_first_unattach) 355 + break; 356 + 348 357 /* 349 358 * Initialise codec, this only needs to be done once. 350 359 * When resuming from suspend, resume callback will handle re-init of codec, ··· 365 354 break; 366 355 case SDW_SLAVE_UNATTACHED: 367 356 dev_dbg(cs42l42->dev, "UNATTACHED\n"); 357 + 358 + if (cs42l42->sdw_waiting_first_unattach) { 359 + /* 360 + * SoundWire core has seen that CS42L42 is not on 361 + * the bus so release RESET and wait for ATTACH. 362 + */ 363 + cs42l42->sdw_waiting_first_unattach = false; 364 + gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); 365 + } 366 + 368 367 break; 369 368 default: 370 369 break;
+20 -1
sound/soc/codecs/cs42l42.c
··· 2320 2320 2321 2321 if (cs42l42->reset_gpio) { 2322 2322 dev_dbg(cs42l42->dev, "Found reset GPIO\n"); 2323 - gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); 2323 + 2324 + /* 2325 + * ACPI can override the default GPIO state we requested 2326 + * so ensure that we start with RESET low. 2327 + */ 2328 + gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); 2329 + 2330 + /* Ensure minimum reset pulse width */ 2331 + usleep_range(10, 500); 2332 + 2333 + /* 2334 + * On SoundWire keep the chip in reset until we get an UNATTACH 2335 + * notification from the SoundWire core. This acts as a 2336 + * synchronization point to reject stale ATTACH notifications 2337 + * if the chip was already enumerated before we reset it. 2338 + */ 2339 + if (cs42l42->sdw_peripheral) 2340 + cs42l42->sdw_waiting_first_unattach = true; 2341 + else 2342 + gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); 2324 2343 } 2325 2344 usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2); 2326 2345
+1
sound/soc/codecs/cs42l42.h
··· 53 53 u8 stream_use; 54 54 bool hp_adc_up_pending; 55 55 bool suspended; 56 + bool sdw_waiting_first_unattach; 56 57 bool init_done; 57 58 }; 58 59
+1 -1
sound/soc/codecs/cs42l43-jack.c
··· 34 34 static const unsigned int cs42l43_accdet_ramp_ms[] = { 10, 40, 90, 170 }; 35 35 36 36 static const unsigned int cs42l43_accdet_bias_sense[] = { 37 - 14, 23, 41, 50, 60, 68, 86, 95, 0, 37 + 14, 24, 43, 52, 61, 71, 90, 99, 0, 38 38 }; 39 39 40 40 static int cs42l43_find_index(struct cs42l43_codec *priv, const char * const prop,
+8 -6
sound/soc/codecs/cs42l43.c
··· 2077 2077 2078 2078 static int cs42l43_request_irq(struct cs42l43_codec *priv, 2079 2079 struct irq_domain *dom, const char * const name, 2080 - unsigned int irq, irq_handler_t handler) 2080 + unsigned int irq, irq_handler_t handler, 2081 + unsigned long flags) 2081 2082 { 2082 2083 int ret; 2083 2084 ··· 2088 2087 2089 2088 dev_dbg(priv->dev, "Request IRQ %d for %s\n", ret, name); 2090 2089 2091 - ret = devm_request_threaded_irq(priv->dev, ret, NULL, handler, IRQF_ONESHOT, 2092 - name, priv); 2090 + ret = devm_request_threaded_irq(priv->dev, ret, NULL, handler, 2091 + IRQF_ONESHOT | flags, name, priv); 2093 2092 if (ret) 2094 2093 return dev_err_probe(priv->dev, ret, "Failed to request IRQ %s\n", name); 2095 2094 ··· 2125 2124 return 0; 2126 2125 } 2127 2126 2128 - ret = cs42l43_request_irq(priv, dom, close_name, close_irq, handler); 2127 + ret = cs42l43_request_irq(priv, dom, close_name, close_irq, handler, IRQF_SHARED); 2129 2128 if (ret) 2130 2129 return ret; 2131 2130 2132 - return cs42l43_request_irq(priv, dom, open_name, open_irq, handler); 2131 + return cs42l43_request_irq(priv, dom, open_name, open_irq, handler, IRQF_SHARED); 2133 2132 } 2134 2133 2135 2134 static int cs42l43_codec_probe(struct platform_device *pdev) ··· 2179 2178 2180 2179 for (i = 0; i < ARRAY_SIZE(cs42l43_irqs); i++) { 2181 2180 ret = cs42l43_request_irq(priv, dom, cs42l43_irqs[i].name, 2182 - cs42l43_irqs[i].irq, cs42l43_irqs[i].handler); 2181 + cs42l43_irqs[i].irq, 2182 + cs42l43_irqs[i].handler, 0); 2183 2183 if (ret) 2184 2184 goto err_pm; 2185 2185 }
+5 -6
sound/soc/codecs/da7219-aad.c
··· 59 59 bool micbias_up = false; 60 60 int retries = 0; 61 61 62 - /* Disable ground switch */ 63 - snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); 64 - 65 62 /* Drive headphones/lineout */ 66 63 snd_soc_component_update_bits(component, DA7219_HP_L_CTRL, 67 64 DA7219_HP_L_AMP_OE_MASK, ··· 151 154 } else { 152 155 tonegen_freq_hptest = cpu_to_le16(DA7219_AAD_HPTEST_RAMP_FREQ_INT_OSC); 153 156 } 154 - 155 - /* Disable ground switch */ 156 - snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); 157 157 158 158 /* Ensure gain ramping at fastest rate */ 159 159 gain_ramp_ctrl = snd_soc_component_read(component, DA7219_GAIN_RAMP_CTRL); ··· 415 421 * handle a removal, and we can check at the end of 416 422 * hptest if we have a valid result or not. 417 423 */ 424 + 425 + cancel_delayed_work_sync(&da7219_aad->jack_det_work); 426 + /* Disable ground switch */ 427 + snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); 428 + 418 429 if (statusa & DA7219_JACK_TYPE_STS_MASK) { 419 430 report |= SND_JACK_HEADSET; 420 431 mask |= SND_JACK_HEADSET | SND_JACK_LINEOUT;
+4 -1
sound/soc/codecs/hdmi-codec.c
··· 531 531 hp->sample_rate = sample_rate; 532 532 hp->channels = channels; 533 533 534 - hcp->chmap_idx = idx; 534 + if (pcm_audio) 535 + hcp->chmap_idx = ca_id; 536 + else 537 + hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; 535 538 536 539 return 0; 537 540 }
+2 -2
sound/soc/codecs/lpass-wsa-macro.c
··· 1675 1675 u16 boost_path_ctl, boost_path_cfg1; 1676 1676 u16 reg, reg_mix; 1677 1677 1678 - if (!strcmp(w->name, "WSA_RX INT0 CHAIN")) { 1678 + if (!snd_soc_dapm_widget_name_cmp(w, "WSA_RX INT0 CHAIN")) { 1679 1679 boost_path_ctl = CDC_WSA_BOOST0_BOOST_PATH_CTL; 1680 1680 boost_path_cfg1 = CDC_WSA_RX0_RX_PATH_CFG1; 1681 1681 reg = CDC_WSA_RX0_RX_PATH_CTL; 1682 1682 reg_mix = CDC_WSA_RX0_RX_PATH_MIX_CTL; 1683 - } else if (!strcmp(w->name, "WSA_RX INT1 CHAIN")) { 1683 + } else if (!snd_soc_dapm_widget_name_cmp(w, "WSA_RX INT1 CHAIN")) { 1684 1684 boost_path_ctl = CDC_WSA_BOOST1_BOOST_PATH_CTL; 1685 1685 boost_path_cfg1 = CDC_WSA_RX1_RX_PATH_CFG1; 1686 1686 reg = CDC_WSA_RX1_RX_PATH_CTL;
+12 -17
sound/soc/codecs/rt5640.c
··· 2403 2403 struct rt5640_priv *rt5640 = data; 2404 2404 int delay = 0; 2405 2405 2406 - if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) { 2407 - cancel_delayed_work_sync(&rt5640->jack_work); 2406 + if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) 2408 2407 delay = 100; 2409 - } 2410 2408 2411 2409 if (rt5640->jack) 2412 - queue_delayed_work(system_long_wq, &rt5640->jack_work, delay); 2410 + mod_delayed_work(system_long_wq, &rt5640->jack_work, delay); 2413 2411 2414 2412 return IRQ_HANDLED; 2415 2413 } ··· 2563 2565 if (jack_data && jack_data->use_platform_clock) 2564 2566 rt5640->use_platform_clock = jack_data->use_platform_clock; 2565 2567 2566 - ret = devm_request_threaded_irq(component->dev, rt5640->irq, 2567 - NULL, rt5640_irq, 2568 - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 2569 - "rt5640", rt5640); 2568 + ret = request_irq(rt5640->irq, rt5640_irq, 2569 + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 2570 + "rt5640", rt5640); 2570 2571 if (ret) { 2571 2572 dev_warn(component->dev, "Failed to request IRQ %d: %d\n", rt5640->irq, ret); 2572 2573 rt5640_disable_jack_detect(component); ··· 2618 2621 2619 2622 rt5640->jack = jack; 2620 2623 2621 - ret = devm_request_threaded_irq(component->dev, rt5640->irq, 2622 - NULL, rt5640_irq, IRQF_TRIGGER_RISING | IRQF_ONESHOT, 2623 - "rt5640", rt5640); 2624 + ret = request_irq(rt5640->irq, rt5640_irq, 2625 + IRQF_TRIGGER_RISING | IRQF_ONESHOT, "rt5640", rt5640); 2624 2626 if (ret) { 2625 2627 dev_warn(component->dev, "Failed to request IRQ %d: %d\n", rt5640->irq, ret); 2626 - rt5640->irq = -ENXIO; 2628 + rt5640->jack = NULL; 2627 2629 return; 2628 2630 } 2631 + rt5640->irq_requested = true; 2629 2632 2630 2633 /* sync initial jack state */ 2631 2634 queue_delayed_work(system_long_wq, &rt5640->jack_work, 0); ··· 2798 2801 { 2799 2802 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2800 2803 2801 - if (rt5640->irq) { 2804 + if (rt5640->jack) { 2802 2805 /* disable jack interrupts during system suspend */ 2803 2806 disable_irq(rt5640->irq); 2807 + rt5640_cancel_work(rt5640); 2804 2808 } 2805 2809 2806 - rt5640_cancel_work(rt5640); 2807 2810 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2808 2811 rt5640_reset(component); 2809 2812 regcache_cache_only(rt5640->regmap, true); ··· 2825 2828 2826 2829 regcache_cache_only(rt5640->regmap, false); 2827 2830 regcache_sync(rt5640->regmap); 2828 - 2829 - if (rt5640->irq) 2830 - enable_irq(rt5640->irq); 2831 2831 2832 2832 if (rt5640->jack) { 2833 2833 if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) { ··· 2853 2859 } 2854 2860 } 2855 2861 2862 + enable_irq(rt5640->irq); 2856 2863 queue_delayed_work(system_long_wq, &rt5640->jack_work, 0); 2857 2864 } 2858 2865
+2
sound/soc/codecs/rt5645.c
··· 3257 3257 RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ); 3258 3258 regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1, 3259 3259 RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL); 3260 + regmap_update_bits(rt5645->regmap, RT5645_DEPOP_M1, 3261 + RT5645_HP_CB_MASK, RT5645_HP_CB_PU); 3260 3262 } 3261 3263 rt5645_irq(0, rt5645); 3262 3264
+5 -5
sound/soc/codecs/rt5682-i2c.c
··· 157 157 return ret; 158 158 } 159 159 160 - ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators, 161 - rt5682); 162 - if (ret) 163 - return ret; 164 - 165 160 ret = regulator_bulk_enable(ARRAY_SIZE(rt5682->supplies), 166 161 rt5682->supplies); 167 162 if (ret) { 168 163 dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); 169 164 return ret; 170 165 } 166 + 167 + ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators, 168 + rt5682); 169 + if (ret) 170 + return ret; 171 171 172 172 ret = rt5682_get_ldo1(rt5682, &i2c->dev); 173 173 if (ret)
+1 -1
sound/soc/codecs/tas2780.c
··· 39 39 usleep_range(2000, 2050); 40 40 } 41 41 42 - snd_soc_component_write(tas2780->component, TAS2780_SW_RST, 42 + ret = snd_soc_component_write(tas2780->component, TAS2780_SW_RST, 43 43 TAS2780_RST); 44 44 if (ret) 45 45 dev_err(tas2780->dev, "%s:errCode:0x%x Reset error!\n",
+2 -2
sound/soc/codecs/tlv320adc3xxx.c
··· 293 293 #define ADC3XXX_BYPASS_RPGA 0x80 294 294 295 295 /* MICBIAS control bits */ 296 - #define ADC3XXX_MICBIAS_MASK 0x2 296 + #define ADC3XXX_MICBIAS_MASK 0x3 297 297 #define ADC3XXX_MICBIAS1_SHIFT 5 298 298 #define ADC3XXX_MICBIAS2_SHIFT 3 299 299 ··· 1099 1099 unsigned int val; 1100 1100 1101 1101 if (!of_property_read_u32(np, propname, &val)) { 1102 - if (val >= ADC3XXX_MICBIAS_AVDD) { 1102 + if (val > ADC3XXX_MICBIAS_AVDD) { 1103 1103 dev_err(dev, "Invalid property value for '%s'\n", propname); 1104 1104 return -EINVAL; 1105 1105 }
+26 -1
sound/soc/codecs/wcd938x-sdw.c
··· 1278 1278 pm_runtime_set_active(dev); 1279 1279 pm_runtime_enable(dev); 1280 1280 1281 - return component_add(dev, &wcd938x_sdw_component_ops); 1281 + ret = component_add(dev, &wcd938x_sdw_component_ops); 1282 + if (ret) 1283 + goto err_disable_rpm; 1284 + 1285 + return 0; 1286 + 1287 + err_disable_rpm: 1288 + pm_runtime_disable(dev); 1289 + pm_runtime_set_suspended(dev); 1290 + pm_runtime_dont_use_autosuspend(dev); 1291 + 1292 + return ret; 1293 + } 1294 + 1295 + static int wcd9380_remove(struct sdw_slave *pdev) 1296 + { 1297 + struct device *dev = &pdev->dev; 1298 + 1299 + component_del(dev, &wcd938x_sdw_component_ops); 1300 + 1301 + pm_runtime_disable(dev); 1302 + pm_runtime_set_suspended(dev); 1303 + pm_runtime_dont_use_autosuspend(dev); 1304 + 1305 + return 0; 1282 1306 } 1283 1307 1284 1308 static const struct sdw_device_id wcd9380_slave_id[] = { ··· 1344 1320 1345 1321 static struct sdw_driver wcd9380_codec_driver = { 1346 1322 .probe = wcd9380_probe, 1323 + .remove = wcd9380_remove, 1347 1324 .ops = &wcd9380_slave_ops, 1348 1325 .id_table = wcd9380_slave_id, 1349 1326 .driver = {
+57 -19
sound/soc/codecs/wcd938x.c
··· 3325 3325 return dev_err_probe(dev, ret, "Failed to get supplies\n"); 3326 3326 3327 3327 ret = regulator_bulk_enable(WCD938X_MAX_SUPPLY, wcd938x->supplies); 3328 - if (ret) 3328 + if (ret) { 3329 + regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); 3329 3330 return dev_err_probe(dev, ret, "Failed to enable supplies\n"); 3331 + } 3330 3332 3331 3333 wcd938x_dt_parse_micbias_info(dev, wcd938x); 3332 3334 ··· 3437 3435 wcd938x->rxdev = wcd938x_sdw_device_get(wcd938x->rxnode); 3438 3436 if (!wcd938x->rxdev) { 3439 3437 dev_err(dev, "could not find slave with matching of node\n"); 3440 - return -EINVAL; 3438 + ret = -EINVAL; 3439 + goto err_unbind; 3441 3440 } 3442 3441 wcd938x->sdw_priv[AIF1_PB] = dev_get_drvdata(wcd938x->rxdev); 3443 3442 wcd938x->sdw_priv[AIF1_PB]->wcd938x = wcd938x; ··· 3446 3443 wcd938x->txdev = wcd938x_sdw_device_get(wcd938x->txnode); 3447 3444 if (!wcd938x->txdev) { 3448 3445 dev_err(dev, "could not find txslave with matching of node\n"); 3449 - return -EINVAL; 3446 + ret = -EINVAL; 3447 + goto err_put_rxdev; 3450 3448 } 3451 3449 wcd938x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd938x->txdev); 3452 3450 wcd938x->sdw_priv[AIF1_CAP]->wcd938x = wcd938x; 3453 3451 wcd938x->tx_sdw_dev = dev_to_sdw_dev(wcd938x->txdev); 3454 - if (!wcd938x->tx_sdw_dev) { 3455 - dev_err(dev, "could not get txslave with matching of dev\n"); 3456 - return -EINVAL; 3457 - } 3458 3452 3459 3453 /* As TX is main CSR reg interface, which should not be suspended first. 3460 3454 * expicilty add the dependency link */ 3461 3455 if (!device_link_add(wcd938x->rxdev, wcd938x->txdev, DL_FLAG_STATELESS | 3462 3456 DL_FLAG_PM_RUNTIME)) { 3463 3457 dev_err(dev, "could not devlink tx and rx\n"); 3464 - return -EINVAL; 3458 + ret = -EINVAL; 3459 + goto err_put_txdev; 3465 3460 } 3466 3461 3467 3462 if (!device_link_add(dev, wcd938x->txdev, DL_FLAG_STATELESS | 3468 3463 DL_FLAG_PM_RUNTIME)) { 3469 3464 dev_err(dev, "could not devlink wcd and tx\n"); 3470 - return -EINVAL; 3465 + ret = -EINVAL; 3466 + goto err_remove_rxtx_link; 3471 3467 } 3472 3468 3473 3469 if (!device_link_add(dev, wcd938x->rxdev, DL_FLAG_STATELESS | 3474 3470 DL_FLAG_PM_RUNTIME)) { 3475 3471 dev_err(dev, "could not devlink wcd and rx\n"); 3476 - return -EINVAL; 3472 + ret = -EINVAL; 3473 + goto err_remove_tx_link; 3477 3474 } 3478 3475 3479 3476 wcd938x->regmap = dev_get_regmap(&wcd938x->tx_sdw_dev->dev, NULL); 3480 3477 if (!wcd938x->regmap) { 3481 3478 dev_err(dev, "could not get TX device regmap\n"); 3482 - return -EINVAL; 3479 + ret = -EINVAL; 3480 + goto err_remove_rx_link; 3483 3481 } 3484 3482 3485 3483 ret = wcd938x_irq_init(wcd938x, dev); 3486 3484 if (ret) { 3487 3485 dev_err(dev, "%s: IRQ init failed: %d\n", __func__, ret); 3488 - return ret; 3486 + goto err_remove_rx_link; 3489 3487 } 3490 3488 3491 3489 wcd938x->sdw_priv[AIF1_PB]->slave_irq = wcd938x->virq; ··· 3495 3491 ret = wcd938x_set_micbias_data(wcd938x); 3496 3492 if (ret < 0) { 3497 3493 dev_err(dev, "%s: bad micbias pdata\n", __func__); 3498 - return ret; 3494 + goto err_remove_rx_link; 3499 3495 } 3500 3496 3501 3497 ret = snd_soc_register_component(dev, &soc_codec_dev_wcd938x, 3502 3498 wcd938x_dais, ARRAY_SIZE(wcd938x_dais)); 3503 - if (ret) 3499 + if (ret) { 3504 3500 dev_err(dev, "%s: Codec registration failed\n", 3505 3501 __func__); 3502 + goto err_remove_rx_link; 3503 + } 3504 + 3505 + return 0; 3506 + 3507 + err_remove_rx_link: 3508 + device_link_remove(dev, wcd938x->rxdev); 3509 + err_remove_tx_link: 3510 + device_link_remove(dev, wcd938x->txdev); 3511 + err_remove_rxtx_link: 3512 + device_link_remove(wcd938x->rxdev, wcd938x->txdev); 3513 + err_put_txdev: 3514 + put_device(wcd938x->txdev); 3515 + err_put_rxdev: 3516 + put_device(wcd938x->rxdev); 3517 + err_unbind: 3518 + component_unbind_all(dev, wcd938x); 3506 3519 3507 3520 return ret; 3508 - 3509 3521 } 3510 3522 3511 3523 static void wcd938x_unbind(struct device *dev) 3512 3524 { 3513 3525 struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); 3514 3526 3527 + snd_soc_unregister_component(dev); 3515 3528 device_link_remove(dev, wcd938x->txdev); 3516 3529 device_link_remove(dev, wcd938x->rxdev); 3517 3530 device_link_remove(wcd938x->rxdev, wcd938x->txdev); 3518 - snd_soc_unregister_component(dev); 3531 + put_device(wcd938x->txdev); 3532 + put_device(wcd938x->rxdev); 3519 3533 component_unbind_all(dev, wcd938x); 3520 3534 } 3521 3535 ··· 3594 3572 3595 3573 ret = wcd938x_add_slave_components(wcd938x, dev, &match); 3596 3574 if (ret) 3597 - return ret; 3575 + goto err_disable_regulators; 3598 3576 3599 3577 wcd938x_reset(wcd938x); 3600 3578 3601 3579 ret = component_master_add_with_match(dev, &wcd938x_comp_ops, match); 3602 3580 if (ret) 3603 - return ret; 3581 + goto err_disable_regulators; 3604 3582 3605 3583 pm_runtime_set_autosuspend_delay(dev, 1000); 3606 3584 pm_runtime_use_autosuspend(dev); ··· 3610 3588 pm_runtime_idle(dev); 3611 3589 3612 3590 return 0; 3591 + 3592 + err_disable_regulators: 3593 + regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); 3594 + regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); 3595 + 3596 + return ret; 3613 3597 } 3614 3598 3615 3599 static void wcd938x_remove(struct platform_device *pdev) 3616 3600 { 3617 - component_master_del(&pdev->dev, &wcd938x_comp_ops); 3601 + struct device *dev = &pdev->dev; 3602 + struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); 3603 + 3604 + component_master_del(dev, &wcd938x_comp_ops); 3605 + 3606 + pm_runtime_disable(dev); 3607 + pm_runtime_set_suspended(dev); 3608 + pm_runtime_dont_use_autosuspend(dev); 3609 + 3610 + regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); 3611 + regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); 3618 3612 } 3619 3613 3620 3614 #if defined(CONFIG_OF)
+14 -5
sound/soc/codecs/wm8960.c
··· 1468 1468 } 1469 1469 1470 1470 wm8960->regmap = devm_regmap_init_i2c(i2c, &wm8960_regmap); 1471 - if (IS_ERR(wm8960->regmap)) 1472 - return PTR_ERR(wm8960->regmap); 1471 + if (IS_ERR(wm8960->regmap)) { 1472 + ret = PTR_ERR(wm8960->regmap); 1473 + goto bulk_disable; 1474 + } 1473 1475 1474 1476 if (pdata) 1475 1477 memcpy(&wm8960->pdata, pdata, sizeof(struct wm8960_data)); ··· 1481 1479 ret = i2c_master_recv(i2c, &val, sizeof(val)); 1482 1480 if (ret >= 0) { 1483 1481 dev_err(&i2c->dev, "Not wm8960, wm8960 reg can not read by i2c\n"); 1484 - return -EINVAL; 1482 + ret = -EINVAL; 1483 + goto bulk_disable; 1485 1484 } 1486 1485 1487 1486 ret = wm8960_reset(wm8960->regmap); 1488 1487 if (ret != 0) { 1489 1488 dev_err(&i2c->dev, "Failed to issue reset\n"); 1490 - return ret; 1489 + goto bulk_disable; 1491 1490 } 1492 1491 1493 1492 if (wm8960->pdata.shared_lrclk) { ··· 1497 1494 if (ret != 0) { 1498 1495 dev_err(&i2c->dev, "Failed to enable LRCM: %d\n", 1499 1496 ret); 1500 - return ret; 1497 + goto bulk_disable; 1501 1498 } 1502 1499 } 1503 1500 ··· 1531 1528 1532 1529 ret = devm_snd_soc_register_component(&i2c->dev, 1533 1530 &soc_component_dev_wm8960, &wm8960_dai, 1); 1531 + if (ret) 1532 + goto bulk_disable; 1534 1533 1534 + return 0; 1535 + 1536 + bulk_disable: 1537 + regulator_bulk_disable(ARRAY_SIZE(wm8960->supplies), wm8960->supplies); 1535 1538 return ret; 1536 1539 } 1537 1540
+11 -2
sound/soc/codecs/wm_adsp.c
··· 687 687 struct wm_coeff_ctl *ctl; 688 688 int ret; 689 689 690 + mutex_lock(&dsp->cs_dsp.pwr_lock); 690 691 ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, buf, len); 692 + mutex_unlock(&dsp->cs_dsp.pwr_lock); 693 + 691 694 if (ret < 0) 692 695 return ret; 693 696 ··· 706 703 int wm_adsp_read_ctl(struct wm_adsp *dsp, const char *name, int type, 707 704 unsigned int alg, void *buf, size_t len) 708 705 { 709 - return cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg), 710 - 0, buf, len); 706 + int ret; 707 + 708 + mutex_lock(&dsp->cs_dsp.pwr_lock); 709 + ret = cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg), 710 + 0, buf, len); 711 + mutex_unlock(&dsp->cs_dsp.pwr_lock); 712 + 713 + return ret; 711 714 } 712 715 EXPORT_SYMBOL_GPL(wm_adsp_read_ctl); 713 716
+1 -1
sound/soc/dwc/dwc-i2s.c
··· 917 917 918 918 static int dw_i2s_probe(struct platform_device *pdev) 919 919 { 920 - const struct i2s_platform_data *pdata = of_device_get_match_data(&pdev->dev); 920 + const struct i2s_platform_data *pdata = pdev->dev.platform_data; 921 921 struct dw_i2s_dev *dev; 922 922 struct resource *res; 923 923 int ret, irq;
+8 -4
sound/soc/fsl/fsl-asoc-card.c
··· 52 52 unsigned long mclk_freq; 53 53 unsigned long free_freq; 54 54 u32 mclk_id; 55 - u32 fll_id; 56 - u32 pll_id; 55 + int fll_id; 56 + int pll_id; 57 57 }; 58 58 59 59 /** ··· 206 206 } 207 207 208 208 /* Specific configuration for PLL */ 209 - if (codec_priv->pll_id && codec_priv->fll_id) { 209 + if (codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) { 210 210 if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE) 211 211 pll_out = priv->sample_rate * 384; 212 212 else ··· 248 248 249 249 priv->streams &= ~BIT(substream->stream); 250 250 251 - if (!priv->streams && codec_priv->pll_id && codec_priv->fll_id) { 251 + if (!priv->streams && codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) { 252 252 /* Force freq to be free_freq to avoid error message in codec */ 253 253 ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0), 254 254 codec_priv->mclk_id, ··· 621 621 priv->card.dapm_routes = audio_map; 622 622 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map); 623 623 priv->card.driver_name = DRIVER_NAME; 624 + 625 + priv->codec_priv.fll_id = -1; 626 + priv->codec_priv.pll_id = -1; 627 + 624 628 /* Diversify the card configurations */ 625 629 if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) { 626 630 codec_dai_name = "cs42888";
+7 -2
sound/soc/fsl/fsl_sai.c
··· 710 710 { 711 711 unsigned int ofs = sai->soc_data->reg_offset; 712 712 bool tx = dir == TX; 713 - u32 xcsr, count = 100; 713 + u32 xcsr, count = 100, mask; 714 + 715 + if (sai->soc_data->mclk_with_tere && sai->mclk_direction_output) 716 + mask = FSL_SAI_CSR_TERE; 717 + else 718 + mask = FSL_SAI_CSR_TERE | FSL_SAI_CSR_BCE; 714 719 715 720 regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), 716 - FSL_SAI_CSR_TERE | FSL_SAI_CSR_BCE, 0); 721 + mask, 0); 717 722 718 723 /* TERE will remain set till the end of current frame */ 719 724 do {
+1 -1
sound/soc/fsl/imx-audmix.c
··· 315 315 if (IS_ERR(priv->cpu_mclk)) { 316 316 ret = PTR_ERR(priv->cpu_mclk); 317 317 dev_err(&cpu_pdev->dev, "failed to get DAI mclk1: %d\n", ret); 318 - return -EINVAL; 318 + return ret; 319 319 } 320 320 321 321 priv->audmix_pdev = audmix_pdev;
+1
sound/soc/fsl/imx-pcm-rpmsg.c
··· 19 19 static struct snd_pcm_hardware imx_rpmsg_pcm_hardware = { 20 20 .info = SNDRV_PCM_INFO_INTERLEAVED | 21 21 SNDRV_PCM_INFO_BLOCK_TRANSFER | 22 + SNDRV_PCM_INFO_BATCH | 22 23 SNDRV_PCM_INFO_MMAP | 23 24 SNDRV_PCM_INFO_MMAP_VALID | 24 25 SNDRV_PCM_INFO_NO_PERIOD_WAKEUP |
+8
sound/soc/fsl/imx-rpmsg.c
··· 89 89 SND_SOC_DAIFMT_NB_NF | 90 90 SND_SOC_DAIFMT_CBC_CFC; 91 91 92 + /* 93 + * i.MX rpmsg sound cards work on codec slave mode. MCLK will be 94 + * disabled by CPU DAI driver in hw_free(). Some codec requires MCLK 95 + * present at power up/down sequence. So need to set ignore_pmdown_time 96 + * to power down codec immediately before MCLK is turned off. 97 + */ 98 + data->dai.ignore_pmdown_time = 1; 99 + 92 100 /* Optional codec node */ 93 101 ret = of_parse_phandle_with_fixed_args(np, "audio-codec", 0, 0, &args); 94 102 if (ret) {
+2 -1
sound/soc/generic/simple-card-utils.c
··· 310 310 if (fixed_sysclk % props->mclk_fs) { 311 311 dev_err(rtd->dev, "fixed sysclk %u not divisible by mclk_fs %u\n", 312 312 fixed_sysclk, props->mclk_fs); 313 - return -EINVAL; 313 + ret = -EINVAL; 314 + goto codec_err; 314 315 } 315 316 ret = snd_pcm_hw_constraint_minmax(substream->runtime, SNDRV_PCM_HW_PARAM_RATE, 316 317 fixed_rate, fixed_rate);
+4 -2
sound/soc/generic/simple-card.c
··· 759 759 struct snd_soc_dai_link *dai_link = priv->dai_link; 760 760 struct simple_dai_props *dai_props = priv->dai_props; 761 761 762 + ret = -EINVAL; 763 + 762 764 cinfo = dev->platform_data; 763 765 if (!cinfo) { 764 766 dev_err(dev, "no info for asoc-simple-card\n"); 765 - return -EINVAL; 767 + goto err; 766 768 } 767 769 768 770 if (!cinfo->name || ··· 773 771 !cinfo->platform || 774 772 !cinfo->cpu_dai.name) { 775 773 dev_err(dev, "insufficient asoc_simple_card_info settings\n"); 776 - return -EINVAL; 774 + goto err; 777 775 } 778 776 779 777 cpus = dai_link->cpus;
+3
sound/soc/intel/avs/boards/hdaudio.c
··· 55 55 return -ENOMEM; 56 56 57 57 dl[i].codecs->name = devm_kstrdup(dev, cname, GFP_KERNEL); 58 + if (!dl[i].codecs->name) 59 + return -ENOMEM; 60 + 58 61 dl[i].codecs->dai_name = pcm->name; 59 62 dl[i].num_codecs = 1; 60 63 dl[i].num_cpus = 1;
+10
sound/soc/intel/boards/sof_es8336.c
··· 808 808 SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK | 809 809 SOF_ES8336_JD_INVERTED), 810 810 }, 811 + { 812 + .name = "mtl_es83x6_c1_h02", 813 + .driver_data = (kernel_ulong_t)(SOF_ES8336_SSP_CODEC(1) | 814 + SOF_NO_OF_HDMI_CAPTURE_SSP(2) | 815 + SOF_HDMI_CAPTURE_1_SSP(0) | 816 + SOF_HDMI_CAPTURE_2_SSP(2) | 817 + SOF_SSP_HDMI_CAPTURE_PRESENT | 818 + SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK | 819 + SOF_ES8336_JD_INVERTED), 820 + }, 811 821 { } 812 822 }; 813 823 MODULE_DEVICE_TABLE(platform, board_ids);
+10
sound/soc/intel/boards/sof_sdw.c
··· 380 380 .callback = sof_sdw_quirk_cb, 381 381 .matches = { 382 382 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), 383 + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B14"), 384 + }, 385 + /* No Jack */ 386 + .driver_data = (void *)SOF_SDW_TGL_HDMI, 387 + }, 388 + 389 + { 390 + .callback = sof_sdw_quirk_cb, 391 + .matches = { 392 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), 383 393 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B29"), 384 394 }, 385 395 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
+6 -6
sound/soc/intel/common/soc-acpi-intel-adl-match.c
··· 656 656 .sof_tplg_filename = "sof-adl-rt1316-l2-mono-rt714-l3.tplg", 657 657 }, 658 658 { 659 - .link_mask = 0x3, /* rt1316 on link1 & rt714 on link0 */ 660 - .links = adl_sdw_rt1316_link1_rt714_link0, 661 - .drv_name = "sof_sdw", 662 - .sof_tplg_filename = "sof-adl-rt1316-l1-mono-rt714-l0.tplg", 663 - }, 664 - { 665 659 .link_mask = 0x7, /* rt714 on link0 & two rt1316s on link1 and link2 */ 666 660 .links = adl_sdw_rt1316_link12_rt714_link0, 667 661 .drv_name = "sof_sdw", 668 662 .sof_tplg_filename = "sof-adl-rt1316-l12-rt714-l0.tplg", 663 + }, 664 + { 665 + .link_mask = 0x3, /* rt1316 on link1 & rt714 on link0 */ 666 + .links = adl_sdw_rt1316_link1_rt714_link0, 667 + .drv_name = "sof_sdw", 668 + .sof_tplg_filename = "sof-adl-rt1316-l1-mono-rt714-l0.tplg", 669 669 }, 670 670 { 671 671 .link_mask = 0x5, /* 2 active links required */
+25
sound/soc/intel/common/soc-acpi-intel-mtl-match.c
··· 30 30 .codecs = {"10EC5682", "RTL5682"}, 31 31 }; 32 32 33 + static const struct snd_soc_acpi_codecs mtl_essx_83x6 = { 34 + .num_codecs = 3, 35 + .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"}, 36 + }; 37 + 38 + static const struct snd_soc_acpi_codecs mtl_lt6911_hdmi = { 39 + .num_codecs = 1, 40 + .codecs = {"INTC10B0"} 41 + }; 42 + 33 43 struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[] = { 34 44 { 35 45 .comp_ids = &mtl_rt5682_rt5682s_hp, ··· 61 51 .machine_quirk = snd_soc_acpi_codec_list, 62 52 .quirk_data = &mtl_rt1019p_amp, 63 53 .sof_tplg_filename = "sof-mtl-rt1019-rt5682.tplg", 54 + }, 55 + { 56 + .comp_ids = &mtl_essx_83x6, 57 + .drv_name = "mtl_es83x6_c1_h02", 58 + .machine_quirk = snd_soc_acpi_codec_list, 59 + .quirk_data = &mtl_lt6911_hdmi, 60 + .sof_tplg_filename = "sof-mtl-es83x6-ssp1-hdmi-ssp02.tplg", 61 + }, 62 + { 63 + .comp_ids = &mtl_essx_83x6, 64 + .drv_name = "sof-essx8336", 65 + .sof_tplg_filename = "sof-mtl-es8336", /* the tplg suffix is added at run time */ 66 + .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER | 67 + SND_SOC_ACPI_TPLG_INTEL_SSP_MSB | 68 + SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, 64 69 }, 65 70 {}, 66 71 };
+17 -32
sound/soc/meson/axg-spdifin.c
··· 112 112 return 0; 113 113 } 114 114 115 - static int axg_spdifin_startup(struct snd_pcm_substream *substream, 116 - struct snd_soc_dai *dai) 117 - { 118 - struct axg_spdifin *priv = snd_soc_dai_get_drvdata(dai); 119 - int ret; 120 - 121 - ret = clk_prepare_enable(priv->refclk); 122 - if (ret) { 123 - dev_err(dai->dev, 124 - "failed to enable spdifin reference clock\n"); 125 - return ret; 126 - } 127 - 128 - regmap_update_bits(priv->map, SPDIFIN_CTRL0, SPDIFIN_CTRL0_EN, 129 - SPDIFIN_CTRL0_EN); 130 - 131 - return 0; 132 - } 133 - 134 - static void axg_spdifin_shutdown(struct snd_pcm_substream *substream, 135 - struct snd_soc_dai *dai) 136 - { 137 - struct axg_spdifin *priv = snd_soc_dai_get_drvdata(dai); 138 - 139 - regmap_update_bits(priv->map, SPDIFIN_CTRL0, SPDIFIN_CTRL0_EN, 0); 140 - clk_disable_unprepare(priv->refclk); 141 - } 142 - 143 115 static void axg_spdifin_write_mode_param(struct regmap *map, int mode, 144 116 unsigned int val, 145 117 unsigned int num_per_reg, ··· 223 251 ret = axg_spdifin_sample_mode_config(dai, priv); 224 252 if (ret) { 225 253 dev_err(dai->dev, "mode configuration failed\n"); 226 - clk_disable_unprepare(priv->pclk); 227 - return ret; 254 + goto pclk_err; 228 255 } 229 256 257 + ret = clk_prepare_enable(priv->refclk); 258 + if (ret) { 259 + dev_err(dai->dev, 260 + "failed to enable spdifin reference clock\n"); 261 + goto pclk_err; 262 + } 263 + 264 + regmap_update_bits(priv->map, SPDIFIN_CTRL0, SPDIFIN_CTRL0_EN, 265 + SPDIFIN_CTRL0_EN); 266 + 230 267 return 0; 268 + 269 + pclk_err: 270 + clk_disable_unprepare(priv->pclk); 271 + return ret; 231 272 } 232 273 233 274 static int axg_spdifin_dai_remove(struct snd_soc_dai *dai) 234 275 { 235 276 struct axg_spdifin *priv = snd_soc_dai_get_drvdata(dai); 236 277 278 + regmap_update_bits(priv->map, SPDIFIN_CTRL0, SPDIFIN_CTRL0_EN, 0); 279 + clk_disable_unprepare(priv->refclk); 237 280 clk_disable_unprepare(priv->pclk); 238 281 return 0; 239 282 } ··· 257 270 .probe = axg_spdifin_dai_probe, 258 271 .remove = axg_spdifin_dai_remove, 259 272 .prepare = axg_spdifin_prepare, 260 - .startup = axg_spdifin_startup, 261 - .shutdown = axg_spdifin_shutdown, 262 273 }; 263 274 264 275 static int axg_spdifin_iec958_info(struct snd_kcontrol *kcontrol,
+1 -1
sound/soc/pxa/pxa-ssp.c
··· 773 773 if (IS_ERR(priv->extclk)) { 774 774 ret = PTR_ERR(priv->extclk); 775 775 if (ret == -EPROBE_DEFER) 776 - return ret; 776 + goto err_priv; 777 777 778 778 priv->extclk = NULL; 779 779 }
+1
sound/soc/sh/rcar/core.c
··· 1303 1303 if (i >= RSND_MAX_COMPONENT) { 1304 1304 dev_info(dev, "reach to max component\n"); 1305 1305 of_node_put(node); 1306 + of_node_put(ports); 1306 1307 break; 1307 1308 } 1308 1309 }
+1
sound/soc/soc-component.c
··· 242 242 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 243 243 struct snd_kcontrol *kctl; 244 244 245 + /* When updating, change also snd_soc_dapm_widget_name_cmp() */ 245 246 if (component->name_prefix) 246 247 snprintf(name, ARRAY_SIZE(name), "%s %s", component->name_prefix, ctl); 247 248 else
+17 -7
sound/soc/soc-core.c
··· 1347 1347 snd_soc_runtime_get_dai_fmt(rtd); 1348 1348 ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); 1349 1349 if (ret) 1350 - return ret; 1350 + goto err; 1351 1351 1352 1352 /* add DPCM sysfs entries */ 1353 1353 soc_dpcm_debugfs_add(rtd); ··· 1372 1372 /* create compress_device if possible */ 1373 1373 ret = snd_soc_dai_compress_new(cpu_dai, rtd, num); 1374 1374 if (ret != -ENOTSUPP) 1375 - return ret; 1375 + goto err; 1376 1376 1377 1377 /* create the pcm */ 1378 1378 ret = soc_new_pcm(rtd, num); 1379 1379 if (ret < 0) { 1380 1380 dev_err(card->dev, "ASoC: can't create pcm %s :%d\n", 1381 1381 dai_link->stream_name, ret); 1382 - return ret; 1382 + goto err; 1383 1383 } 1384 1384 1385 - return snd_soc_pcm_dai_new(rtd); 1385 + ret = snd_soc_pcm_dai_new(rtd); 1386 + if (ret < 0) 1387 + goto err; 1388 + 1389 + rtd->initialized = true; 1390 + 1391 + return 0; 1392 + err: 1393 + snd_soc_link_exit(rtd); 1394 + return ret; 1386 1395 } 1387 1396 1388 1397 static void soc_set_name_prefix(struct snd_soc_card *card, ··· 1454 1445 if (component->card) { 1455 1446 if (component->card != card) { 1456 1447 dev_err(component->dev, 1457 - "Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n", 1458 - card->name, component->card->name); 1448 + "Trying to bind component \"%s\" to card \"%s\" but is already bound to card \"%s\"\n", 1449 + component->name, card->name, component->card->name); 1459 1450 return -ENODEV; 1460 1451 } 1461 1452 return 0; ··· 1989 1980 1990 1981 /* release machine specific resources */ 1991 1982 for_each_card_rtds(card, rtd) 1992 - snd_soc_link_exit(rtd); 1983 + if (rtd->initialized) 1984 + snd_soc_link_exit(rtd); 1993 1985 /* remove and free each DAI */ 1994 1986 soc_remove_link_dais(card); 1995 1987 soc_remove_link_components(card);
+12
sound/soc/soc-dapm.c
··· 2728 2728 } 2729 2729 EXPORT_SYMBOL_GPL(snd_soc_dapm_update_dai); 2730 2730 2731 + int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s) 2732 + { 2733 + struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 2734 + const char *wname = widget->name; 2735 + 2736 + if (component->name_prefix) 2737 + wname += strlen(component->name_prefix) + 1; /* plus space */ 2738 + 2739 + return strcmp(wname, s); 2740 + } 2741 + EXPORT_SYMBOL_GPL(snd_soc_dapm_widget_name_cmp); 2742 + 2731 2743 /* 2732 2744 * dapm_update_widget_flags() - Re-compute widget sink and source flags 2733 2745 * @w: The widget for which to update the flags
+2 -2
sound/soc/soc-generic-dmaengine-pcm.c
··· 44 44 * platforms which make use of the snd_dmaengine_dai_dma_data struct for their 45 45 * DAI DMA data. Internally the function will first call 46 46 * snd_hwparams_to_dma_slave_config to fill in the slave config based on the 47 - * hw_params, followed by snd_dmaengine_set_config_from_dai_data to fill in the 48 - * remaining fields based on the DAI DMA data. 47 + * hw_params, followed by snd_dmaengine_pcm_set_config_from_dai_data to fill in 48 + * the remaining fields based on the DAI DMA data. 49 49 */ 50 50 int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, 51 51 struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config)
+11 -12
sound/soc/soc-pcm.c
··· 985 985 { 986 986 struct snd_soc_dai *cpu_dai; 987 987 struct snd_soc_dai *codec_dai; 988 + struct snd_pcm_hw_params tmp_params; 988 989 int i, ret = 0; 989 990 990 991 snd_soc_dpcm_mutex_assert_held(rtd); ··· 999 998 goto out; 1000 999 1001 1000 for_each_rtd_codec_dais(rtd, i, codec_dai) { 1002 - struct snd_pcm_hw_params codec_params; 1003 1001 unsigned int tdm_mask = snd_soc_dai_tdm_mask_get(codec_dai, substream->stream); 1004 1002 1005 1003 /* ··· 1019 1019 continue; 1020 1020 1021 1021 /* copy params for each codec */ 1022 - codec_params = *params; 1022 + tmp_params = *params; 1023 1023 1024 1024 /* fixup params based on TDM slot masks */ 1025 1025 if (tdm_mask) 1026 - soc_pcm_codec_params_fixup(&codec_params, tdm_mask); 1026 + soc_pcm_codec_params_fixup(&tmp_params, tdm_mask); 1027 1027 1028 1028 ret = snd_soc_dai_hw_params(codec_dai, substream, 1029 - &codec_params); 1029 + &tmp_params); 1030 1030 if(ret < 0) 1031 1031 goto out; 1032 1032 1033 - soc_pcm_set_dai_params(codec_dai, &codec_params); 1034 - snd_soc_dapm_update_dai(substream, &codec_params, codec_dai); 1033 + soc_pcm_set_dai_params(codec_dai, &tmp_params); 1034 + snd_soc_dapm_update_dai(substream, &tmp_params, codec_dai); 1035 1035 } 1036 1036 1037 1037 for_each_rtd_cpu_dais(rtd, i, cpu_dai) { 1038 - struct snd_pcm_hw_params cpu_params; 1039 1038 unsigned int ch_mask = 0; 1040 1039 int j; 1041 1040 ··· 1046 1047 continue; 1047 1048 1048 1049 /* copy params for each cpu */ 1049 - cpu_params = *params; 1050 + tmp_params = *params; 1050 1051 1051 1052 if (!rtd->dai_link->codec_ch_maps) 1052 1053 goto hw_params; ··· 1061 1062 1062 1063 /* fixup cpu channel number */ 1063 1064 if (ch_mask) 1064 - soc_pcm_codec_params_fixup(&cpu_params, ch_mask); 1065 + soc_pcm_codec_params_fixup(&tmp_params, ch_mask); 1065 1066 1066 1067 hw_params: 1067 - ret = snd_soc_dai_hw_params(cpu_dai, substream, &cpu_params); 1068 + ret = snd_soc_dai_hw_params(cpu_dai, substream, &tmp_params); 1068 1069 if (ret < 0) 1069 1070 goto out; 1070 1071 1071 1072 /* store the parameters for each DAI */ 1072 - soc_pcm_set_dai_params(cpu_dai, &cpu_params); 1073 - snd_soc_dapm_update_dai(substream, &cpu_params, cpu_dai); 1073 + soc_pcm_set_dai_params(cpu_dai, &tmp_params); 1074 + snd_soc_dapm_update_dai(substream, &tmp_params, cpu_dai); 1074 1075 } 1075 1076 1076 1077 ret = snd_soc_pcm_component_hw_params(substream, params);
+1
sound/soc/soc-utils.c
··· 217 217 return 1; 218 218 return 0; 219 219 } 220 + EXPORT_SYMBOL_GPL(snd_soc_dai_is_dummy); 220 221 221 222 int snd_soc_component_is_dummy(struct snd_soc_component *component) 222 223 {
-1
sound/soc/sof/amd/pci-rmb.c
··· 35 35 .dsp_intr_base = ACP6X_DSP_SW_INTR_BASE, 36 36 .sram_pte_offset = ACP6X_SRAM_PTE_OFFSET, 37 37 .hw_semaphore_offset = ACP6X_AXI2DAGB_SEM_0, 38 - .acp_clkmux_sel = ACP6X_CLKMUX_SEL, 39 38 .fusion_dsp_offset = ACP6X_DSP_FUSION_RUNSTALL, 40 39 .probe_reg_offset = ACP6X_FUTURE_REG_ACLK_0, 41 40 };
+1 -2
sound/soc/sof/core.c
··· 486 486 snd_sof_ipc_free(sdev); 487 487 snd_sof_free_debug(sdev); 488 488 snd_sof_remove(sdev); 489 + sof_ops_free(sdev); 489 490 } 490 - 491 - sof_ops_free(sdev); 492 491 493 492 /* release firmware */ 494 493 snd_sof_fw_unload(sdev);
+1 -1
sound/soc/sof/intel/mtl.c
··· 460 460 /* step 3: wait for IPC DONE bit from ROM */ 461 461 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, chip->ipc_ack, status, 462 462 ((status & chip->ipc_ack_mask) == chip->ipc_ack_mask), 463 - HDA_DSP_REG_POLL_INTERVAL_US, MTL_DSP_PURGE_TIMEOUT_US); 463 + HDA_DSP_REG_POLL_INTERVAL_US, HDA_DSP_INIT_TIMEOUT_US); 464 464 if (ret < 0) { 465 465 if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS) 466 466 dev_err(sdev->dev, "timeout waiting for purge IPC done\n");
-1
sound/soc/sof/intel/mtl.h
··· 62 62 #define MTL_DSP_IRQSTS_IPC BIT(0) 63 63 #define MTL_DSP_IRQSTS_SDW BIT(6) 64 64 65 - #define MTL_DSP_PURGE_TIMEOUT_US 20000000 /* 20s */ 66 65 #define MTL_DSP_REG_POLL_INTERVAL_US 10 /* 10 us */ 67 66 68 67 /* Memory windows */
+1 -1
sound/soc/sof/ipc4-topology.c
··· 231 231 232 232 ret = sof_update_ipc_object(scomp, available_fmt, 233 233 SOF_AUDIO_FMT_NUM_TOKENS, swidget->tuples, 234 - swidget->num_tuples, sizeof(available_fmt), 1); 234 + swidget->num_tuples, sizeof(*available_fmt), 1); 235 235 if (ret) { 236 236 dev_err(scomp->dev, "Failed to parse audio format token count\n"); 237 237 return ret;
+2 -1
sound/soc/sof/sof-audio.c
··· 212 212 sof_widget_free_unlocked(sdev, swidget); 213 213 use_count_decremented = true; 214 214 core_put: 215 - snd_sof_dsp_core_put(sdev, swidget->core); 215 + if (!use_count_decremented) 216 + snd_sof_dsp_core_put(sdev, swidget->core); 216 217 pipe_widget_free: 217 218 if (swidget->id != snd_soc_dapm_scheduler) 218 219 sof_widget_free_unlocked(sdev, swidget->spipe->pipe_widget);
+17 -13
sound/soc/tegra/tegra_audio_graph_card.c
··· 10 10 #include <linux/platform_device.h> 11 11 #include <sound/graph_card.h> 12 12 #include <sound/pcm_params.h> 13 + #include <sound/soc-dai.h> 13 14 14 15 #define MAX_PLLA_OUT0_DIV 128 15 16 ··· 44 43 unsigned int plla_rates[NUM_RATE_TYPE]; 45 44 unsigned int plla_out0_rates[NUM_RATE_TYPE]; 46 45 }; 46 + 47 + static bool need_clk_update(struct snd_soc_dai *dai) 48 + { 49 + if (snd_soc_dai_is_dummy(dai) || 50 + !dai->driver->ops || 51 + !dai->driver->name) 52 + return false; 53 + 54 + if (strstr(dai->driver->name, "I2S") || 55 + strstr(dai->driver->name, "DMIC") || 56 + strstr(dai->driver->name, "DSPK")) 57 + return true; 58 + 59 + return false; 60 + } 47 61 48 62 /* Setup PLL clock as per the given sample rate */ 49 63 static int tegra_audio_graph_update_pll(struct snd_pcm_substream *substream, ··· 156 140 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 157 141 int err; 158 142 159 - /* 160 - * This gets called for each DAI link (FE or BE) when DPCM is used. 161 - * We may not want to update PLLA rate for each call. So PLLA update 162 - * must be restricted to external I/O links (I2S, DMIC or DSPK) since 163 - * they actually depend on it. I/O modules update their clocks in 164 - * hw_param() of their respective component driver and PLLA rate 165 - * update here helps them to derive appropriate rates. 166 - * 167 - * TODO: When more HW accelerators get added (like sample rate 168 - * converter, volume gain controller etc., which don't really 169 - * depend on PLLA) we need a better way to filter here. 170 - */ 171 - if (cpu_dai->driver->ops && rtd->dai_link->no_pcm) { 143 + if (need_clk_update(cpu_dai)) { 172 144 err = tegra_audio_graph_update_pll(substream, params); 173 145 if (err) 174 146 return err;
+7
sound/usb/mixer.c
··· 1204 1204 cval->res = 16; 1205 1205 } 1206 1206 break; 1207 + case USB_ID(0x1bcf, 0x2283): /* NexiGo N930AF FHD Webcam */ 1208 + if (!strcmp(kctl->id.name, "Mic Capture Volume")) { 1209 + usb_audio_info(chip, 1210 + "set resolution quirk: cval->res = 16\n"); 1211 + cval->res = 16; 1212 + } 1213 + break; 1207 1214 } 1208 1215 } 1209 1216
+2 -2
sound/usb/mixer_scarlett_gen2.c
··· 3294 3294 /* Add input phantom controls */ 3295 3295 if (info->inputs_per_phantom == 1) { 3296 3296 for (i = 0; i < info->phantom_count; i++) { 3297 - snprintf(s, sizeof(s), fmt, i + 1, 3298 - "Phantom Power", "Switch"); 3297 + scnprintf(s, sizeof(s), fmt, i + 1, 3298 + "Phantom Power", "Switch"); 3299 3299 err = scarlett2_add_new_ctl( 3300 3300 mixer, &scarlett2_phantom_ctl, 3301 3301 i, 1, s, &private->phantom_ctls[i]);
+7 -1
sound/usb/quirks.c
··· 1994 1994 /* mic works only when ep packet size is set to wMaxPacketSize */ 1995 1995 fp->attributes |= UAC_EP_CS_ATTR_FILL_MAX; 1996 1996 break; 1997 - 1997 + case USB_ID(0x3511, 0x2b1e): /* Opencomm2 UC USB Bluetooth dongle */ 1998 + /* mic works only when ep pitch control is not set */ 1999 + if (stream == SNDRV_PCM_STREAM_CAPTURE) 2000 + fp->attributes &= ~UAC_EP_CS_ATTR_PITCH_CONTROL; 2001 + break; 1998 2002 } 1999 2003 } 2000 2004 ··· 2177 2173 QUIRK_FLAG_FIXED_RATE), 2178 2174 DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ 2179 2175 QUIRK_FLAG_FIXED_RATE), 2176 + DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */ 2177 + QUIRK_FLAG_GET_SAMPLE_RATE), 2180 2178 2181 2179 /* Vendor matches */ 2182 2180 VENDOR_FLG(0x045e, /* MS Lifecam */