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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"This became a bit bigger collection of patches, but almost all are
about device-specific fixes, and should be safe for 6.9:

- Lots of ASoC Intel SOF-related fixes/updates

- Locking fixes in SoundWire drivers

- ASoC AMD ACP/SOF updates

- ASoC ES8326 codec fixes

- HD-audio codec fixes and quirks

- A regression fix in emu10k1 synth code"

* tag 'sound-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (49 commits)
ASoC: SOF: Core: Add remove_late() to sof_init_environment failure path
ASoC: SOF: amd: fix for false dsp interrupts
ASoC: SOF: Intel: lnl: Disable DMIC/SSP offload on remove
ASoC: Intel: avs: boards: Add modules description
ASoC: codecs: ES8326: Removing the control of ADC_SCALE
ASoC: codecs: ES8326: Solve a headphone detection issue after suspend and resume
ASoC: codecs: ES8326: modify clock table
ASoC: codecs: ES8326: Solve error interruption issue
ALSA: line6: Zero-initialize message buffers
ALSA: hda/realtek: cs35l41: Support ASUS ROG G634JYR
ALSA: hda/realtek: Update Panasonic CF-SZ6 quirk to support headset with microphone
ALSA: hda/realtek: Add sound quirks for Lenovo Legion slim 7 16ARHA7 models
Revert "ALSA: emu10k1: fix synthesizer sample playback position and caching"
OSS: dmasound/paula: Mark driver struct with __refdata to prevent section mismatch
ALSA: hda/realtek: Add quirks for ASUS Laptops using CS35L56
ASoC: amd: acp: fix for acp_init function error handling
ASoC: tas2781: mark dvc_tlv with __maybe_unused
ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw
ASoC: rt-sdw*: add __func__ to all error logs
ASoC: rt722-sdca-sdw: fix locking sequence
...

+695 -285
+3
include/sound/hdaudio_ext.h
··· 56 56 u32 pphcldpl; 57 57 u32 pphcldpu; 58 58 59 + u32 pplcllpl; 60 + u32 pplcllpu; 61 + 59 62 bool decoupled:1; 60 63 bool link_locked:1; 61 64 bool link_prepared;
+1 -1
include/sound/tas2781-tlv.h
··· 15 15 #ifndef __TAS2781_TLV_H__ 16 16 #define __TAS2781_TLV_H__ 17 17 18 - static const DECLARE_TLV_DB_SCALE(dvc_tlv, -10000, 100, 0); 18 + static const __maybe_unused DECLARE_TLV_DB_SCALE(dvc_tlv, -10000, 100, 0); 19 19 static const DECLARE_TLV_DB_SCALE(amp_vol_tlv, 1100, 50, 0); 20 20 21 21 #endif
+7 -1
sound/oss/dmasound/dmasound_paula.c
··· 725 725 dmasound_deinit(); 726 726 } 727 727 728 - static struct platform_driver amiga_audio_driver = { 728 + /* 729 + * amiga_audio_remove() lives in .exit.text. For drivers registered via 730 + * module_platform_driver_probe() this is ok because they cannot get unbound at 731 + * runtime. So mark the driver struct with __refdata to prevent modpost 732 + * triggering a section mismatch warning. 733 + */ 734 + static struct platform_driver amiga_audio_driver __refdata = { 729 735 .remove_new = __exit_p(amiga_audio_remove), 730 736 .driver = { 731 737 .name = "amiga-audio",
+2 -5
sound/pci/emu10k1/emu10k1_callback.c
··· 255 255 /* check if sample is finished playing (non-looping only) */ 256 256 if (bp != best + V_OFF && bp != best + V_FREE && 257 257 (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) { 258 - val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch) - 64; 258 + val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch); 259 259 if (val >= vp->reg.loopstart) 260 260 bp = best + V_OFF; 261 261 } ··· 362 362 363 363 map = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); 364 364 365 - addr = vp->reg.start + 64; 365 + addr = vp->reg.start; 366 366 temp = vp->reg.parm.filterQ; 367 367 ccca = (temp << 28) | addr; 368 368 if (vp->apitch < 0xe400) ··· 429 429 430 430 /* Q & current address (Q 4bit value, MSB) */ 431 431 CCCA, ccca, 432 - 433 - /* cache */ 434 - CCR, REG_VAL_PUT(CCR_CACHEINVALIDSIZE, 64), 435 432 436 433 /* reset volume */ 437 434 VTFT, vtarget | vp->ftarget,
+6
sound/pci/hda/cs35l41_hda_property.c
··· 108 108 { "10431F12", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 1000, 4500, 24 }, 109 109 { "10431F1F", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, -1, 0, 0, 0, 0 }, 110 110 { "10431F62", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 0, 0, 0 }, 111 + { "10433A60", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 1000, 4500, 24 }, 111 112 { "17AA386F", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, -1, -1, 0, 0, 0 }, 113 + { "17AA3877", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 }, 114 + { "17AA3878", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 }, 112 115 { "17AA38A9", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 2, -1, 0, 0, 0 }, 113 116 { "17AA38AB", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 2, -1, 0, 0, 0 }, 114 117 { "17AA38B4", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 }, ··· 499 496 { "CSC3551", "10431F12", generic_dsd_config }, 500 497 { "CSC3551", "10431F1F", generic_dsd_config }, 501 498 { "CSC3551", "10431F62", generic_dsd_config }, 499 + { "CSC3551", "10433A60", generic_dsd_config }, 502 500 { "CSC3551", "17AA386F", generic_dsd_config }, 501 + { "CSC3551", "17AA3877", generic_dsd_config }, 502 + { "CSC3551", "17AA3878", generic_dsd_config }, 503 503 { "CSC3551", "17AA38A9", generic_dsd_config }, 504 504 { "CSC3551", "17AA38AB", generic_dsd_config }, 505 505 { "CSC3551", "17AA38B4", generic_dsd_config },
+11 -2
sound/pci/hda/cs35l56_hda_i2c.c
··· 56 56 {} 57 57 }; 58 58 59 + static const struct acpi_device_id cs35l56_acpi_hda_match[] = { 60 + { "CSC3554", 0 }, 61 + { "CSC3556", 0 }, 62 + { "CSC3557", 0 }, 63 + {} 64 + }; 65 + MODULE_DEVICE_TABLE(acpi, cs35l56_acpi_hda_match); 66 + 59 67 static struct i2c_driver cs35l56_hda_i2c_driver = { 60 68 .driver = { 61 - .name = "cs35l56-hda", 62 - .pm = &cs35l56_hda_pm_ops, 69 + .name = "cs35l56-hda", 70 + .acpi_match_table = cs35l56_acpi_hda_match, 71 + .pm = &cs35l56_hda_pm_ops, 63 72 }, 64 73 .id_table = cs35l56_hda_i2c_id, 65 74 .probe = cs35l56_hda_i2c_probe,
+11 -2
sound/pci/hda/cs35l56_hda_spi.c
··· 56 56 {} 57 57 }; 58 58 59 + static const struct acpi_device_id cs35l56_acpi_hda_match[] = { 60 + { "CSC3554", 0 }, 61 + { "CSC3556", 0 }, 62 + { "CSC3557", 0 }, 63 + {} 64 + }; 65 + MODULE_DEVICE_TABLE(acpi, cs35l56_acpi_hda_match); 66 + 59 67 static struct spi_driver cs35l56_hda_spi_driver = { 60 68 .driver = { 61 - .name = "cs35l56-hda", 62 - .pm = &cs35l56_hda_pm_ops, 69 + .name = "cs35l56-hda", 70 + .acpi_match_table = cs35l56_acpi_hda_match, 71 + .pm = &cs35l56_hda_pm_ops, 63 72 }, 64 73 .id_table = cs35l56_hda_spi_id, 65 74 .probe = cs35l56_hda_spi_probe,
+57 -3
sound/pci/hda/patch_realtek.c
··· 6875 6875 comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2); 6876 6876 } 6877 6877 6878 + static void cs35l56_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 6879 + { 6880 + comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 2); 6881 + } 6882 + 6883 + static void cs35l56_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 6884 + { 6885 + comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 4); 6886 + } 6887 + 6888 + static void cs35l56_fixup_spi_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 6889 + { 6890 + comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 2); 6891 + } 6892 + 6878 6893 static void cs35l56_fixup_spi_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 6879 6894 { 6880 6895 comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 4); 6896 + } 6897 + 6898 + static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 6899 + { 6900 + /* 6901 + * The same SSID has been re-used in different hardware, they have 6902 + * different codecs and the newer GA403U has a ALC285. 6903 + */ 6904 + if (cdc->core.vendor_id == 0x10ec0285) 6905 + cs35l56_fixup_i2c_two(cdc, fix, action); 6906 + else 6907 + alc_fixup_inv_dmic(cdc, fix, action); 6881 6908 } 6882 6909 6883 6910 static void tas2781_fixup_i2c(struct hda_codec *cdc, ··· 7463 7436 ALC256_FIXUP_ACER_SFG16_MICMUTE_LED, 7464 7437 ALC256_FIXUP_HEADPHONE_AMP_VOL, 7465 7438 ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX, 7439 + ALC285_FIXUP_CS35L56_SPI_2, 7440 + ALC285_FIXUP_CS35L56_I2C_2, 7441 + ALC285_FIXUP_CS35L56_I2C_4, 7442 + ALC285_FIXUP_ASUS_GA403U, 7466 7443 }; 7467 7444 7468 7445 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 9674 9643 .type = HDA_FIXUP_FUNC, 9675 9644 .v.func = alc245_fixup_hp_spectre_x360_eu0xxx, 9676 9645 }, 9646 + [ALC285_FIXUP_CS35L56_SPI_2] = { 9647 + .type = HDA_FIXUP_FUNC, 9648 + .v.func = cs35l56_fixup_spi_two, 9649 + }, 9650 + [ALC285_FIXUP_CS35L56_I2C_2] = { 9651 + .type = HDA_FIXUP_FUNC, 9652 + .v.func = cs35l56_fixup_i2c_two, 9653 + }, 9654 + [ALC285_FIXUP_CS35L56_I2C_4] = { 9655 + .type = HDA_FIXUP_FUNC, 9656 + .v.func = cs35l56_fixup_i2c_four, 9657 + }, 9658 + [ALC285_FIXUP_ASUS_GA403U] = { 9659 + .type = HDA_FIXUP_FUNC, 9660 + .v.func = alc285_fixup_asus_ga403u, 9661 + }, 9677 9662 }; 9678 9663 9679 9664 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 10143 10096 SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2), 10144 10097 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), 10145 10098 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), 10146 - SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), 10099 + SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U), 10147 10100 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2), 10148 10101 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10149 10102 SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2), ··· 10151 10104 SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2), 10152 10105 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2), 10153 10106 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 10107 + SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_CS35L56_SPI_2), 10154 10108 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS), 10155 10109 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10156 10110 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), ··· 10163 10115 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), 10164 10116 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), 10165 10117 SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2), 10118 + SND_PCI_QUIRK(0x1043, 0x1df3, "ASUS UM5606", ALC285_FIXUP_CS35L56_I2C_4), 10166 10119 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2), 10167 10120 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 10168 10121 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), 10169 10122 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 10170 10123 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), 10124 + SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_CS35L56_I2C_2), 10125 + SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_CS35L56_I2C_2), 10171 10126 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), 10172 10127 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2), 10173 10128 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401), ··· 10184 10133 SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2), 10185 10134 SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC245_FIXUP_CS35L41_SPI_2), 10186 10135 SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2), 10187 - SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2), 10136 + SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10188 10137 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), 10189 10138 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), 10190 10139 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), ··· 10210 10159 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10211 10160 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10212 10161 SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10213 - SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), 10162 + SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10214 10163 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 10215 10164 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP), 10216 10165 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP), ··· 10384 10333 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10385 10334 SND_PCI_QUIRK(0x17aa, 0x386f, "Legion 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2), 10386 10335 SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C), 10336 + SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2), 10337 + SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2), 10387 10338 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C), 10388 10339 SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C), 10389 10340 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C), ··· 10456 10403 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10457 10404 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10458 10405 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP), 10406 + SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC), 10459 10407 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 10460 10408 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), 10461 10409 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
+7 -6
sound/soc/amd/acp/acp-pci.c
··· 115 115 goto unregister_dmic_dev; 116 116 } 117 117 118 - acp_init(chip); 118 + ret = acp_init(chip); 119 + if (ret) 120 + goto unregister_dmic_dev; 121 + 119 122 res = devm_kcalloc(&pci->dev, num_res, sizeof(struct resource), GFP_KERNEL); 120 123 if (!res) { 121 124 ret = -ENOMEM; ··· 136 133 } 137 134 } 138 135 139 - if (flag == FLAG_AMD_LEGACY_ONLY_DMIC) { 140 - ret = check_acp_pdm(pci, chip); 141 - if (ret < 0) 142 - goto skip_pdev_creation; 143 - } 136 + ret = check_acp_pdm(pci, chip); 137 + if (ret < 0) 138 + goto skip_pdev_creation; 144 139 145 140 chip->flag = flag; 146 141 memset(&pdevinfo, 0, sizeof(pdevinfo));
+5
sound/soc/codecs/cs-amp-lib.c
··· 56 56 dev_dbg(dsp->dev, "Calibration: Ambient=%#x, Status=%#x, CalR=%d\n", 57 57 data->calAmbient, data->calStatus, data->calR); 58 58 59 + if (list_empty(&dsp->ctl_list)) { 60 + dev_info(dsp->dev, "Calibration disabled due to missing firmware controls\n"); 61 + return -ENOENT; 62 + } 63 + 59 64 ret = cs_amp_write_cal_coeff(dsp, controls, controls->ambient, data->calAmbient); 60 65 if (ret) 61 66 return ret;
+8 -4
sound/soc/codecs/cs42l43.c
··· 2364 2364 2365 2365 static int cs42l43_codec_suspend(struct device *dev) 2366 2366 { 2367 - struct cs42l43 *cs42l43 = dev_get_drvdata(dev); 2367 + struct cs42l43_codec *priv = dev_get_drvdata(dev); 2368 + struct cs42l43 *cs42l43 = priv->core; 2368 2369 2369 2370 disable_irq(cs42l43->irq); 2370 2371 ··· 2374 2373 2375 2374 static int cs42l43_codec_suspend_noirq(struct device *dev) 2376 2375 { 2377 - struct cs42l43 *cs42l43 = dev_get_drvdata(dev); 2376 + struct cs42l43_codec *priv = dev_get_drvdata(dev); 2377 + struct cs42l43 *cs42l43 = priv->core; 2378 2378 2379 2379 enable_irq(cs42l43->irq); 2380 2380 ··· 2384 2382 2385 2383 static int cs42l43_codec_resume(struct device *dev) 2386 2384 { 2387 - struct cs42l43 *cs42l43 = dev_get_drvdata(dev); 2385 + struct cs42l43_codec *priv = dev_get_drvdata(dev); 2386 + struct cs42l43 *cs42l43 = priv->core; 2388 2387 2389 2388 enable_irq(cs42l43->irq); 2390 2389 ··· 2394 2391 2395 2392 static int cs42l43_codec_resume_noirq(struct device *dev) 2396 2393 { 2397 - struct cs42l43 *cs42l43 = dev_get_drvdata(dev); 2394 + struct cs42l43_codec *priv = dev_get_drvdata(dev); 2395 + struct cs42l43 *cs42l43 = priv->core; 2398 2396 2399 2397 disable_irq(cs42l43->irq); 2400 2398
+21 -16
sound/soc/codecs/es8326.c
··· 412 412 {125, 48000, 6000000, 0x04, 0x04, 0x1F, 0x2D, 0x8A, 0x0A, 0x27, 0x27}, 413 413 414 414 {128, 8000, 1024000, 0x60, 0x00, 0x05, 0x75, 0x8A, 0x1B, 0x1F, 0x7F}, 415 - {128, 16000, 2048000, 0x20, 0x00, 0x31, 0x35, 0x8A, 0x1B, 0x1F, 0x3F}, 416 - {128, 44100, 5644800, 0xE0, 0x00, 0x01, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, 417 - {128, 48000, 6144000, 0xE0, 0x00, 0x01, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, 415 + {128, 16000, 2048000, 0x20, 0x00, 0x31, 0x35, 0x08, 0x19, 0x1F, 0x3F}, 416 + {128, 44100, 5644800, 0xE0, 0x00, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F}, 417 + {128, 48000, 6144000, 0xE0, 0x00, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F}, 418 418 {144, 8000, 1152000, 0x20, 0x00, 0x03, 0x35, 0x8A, 0x1B, 0x23, 0x47}, 419 419 {144, 16000, 2304000, 0x20, 0x00, 0x11, 0x35, 0x8A, 0x1B, 0x23, 0x47}, 420 420 {192, 8000, 1536000, 0x60, 0x02, 0x0D, 0x75, 0x8A, 0x1B, 0x1F, 0x7F}, ··· 423 423 424 424 {200, 48000, 9600000, 0x04, 0x04, 0x0F, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, 425 425 {250, 48000, 12000000, 0x04, 0x04, 0x0F, 0x2D, 0xCA, 0x0A, 0x27, 0x27}, 426 - {256, 8000, 2048000, 0x60, 0x00, 0x31, 0x35, 0x8A, 0x1B, 0x1F, 0x7F}, 427 - {256, 16000, 4096000, 0x20, 0x00, 0x01, 0x35, 0x8A, 0x1B, 0x1F, 0x3F}, 428 - {256, 44100, 11289600, 0xE0, 0x00, 0x30, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, 429 - {256, 48000, 12288000, 0xE0, 0x00, 0x30, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, 426 + {256, 8000, 2048000, 0x60, 0x00, 0x31, 0x35, 0x08, 0x19, 0x1F, 0x7F}, 427 + {256, 16000, 4096000, 0x20, 0x00, 0x01, 0x35, 0x08, 0x19, 0x1F, 0x3F}, 428 + {256, 44100, 11289600, 0xE0, 0x01, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F}, 429 + {256, 48000, 12288000, 0xE0, 0x01, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F}, 430 430 {288, 8000, 2304000, 0x20, 0x00, 0x01, 0x35, 0x8A, 0x1B, 0x23, 0x47}, 431 431 {384, 8000, 3072000, 0x60, 0x02, 0x05, 0x75, 0x8A, 0x1B, 0x1F, 0x7F}, 432 432 {384, 16000, 6144000, 0x20, 0x02, 0x03, 0x35, 0x8A, 0x1B, 0x1F, 0x3F}, ··· 435 435 436 436 {400, 48000, 19200000, 0xE4, 0x04, 0x35, 0x6d, 0xCA, 0x0A, 0x1F, 0x1F}, 437 437 {500, 48000, 24000000, 0xF8, 0x04, 0x3F, 0x6D, 0xCA, 0x0A, 0x1F, 0x1F}, 438 - {512, 8000, 4096000, 0x60, 0x00, 0x01, 0x35, 0x8A, 0x1B, 0x1F, 0x7F}, 439 - {512, 16000, 8192000, 0x20, 0x00, 0x30, 0x35, 0x8A, 0x1B, 0x1F, 0x3F}, 440 - {512, 44100, 22579200, 0xE0, 0x00, 0x00, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, 441 - {512, 48000, 24576000, 0xE0, 0x00, 0x00, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, 438 + {512, 8000, 4096000, 0x60, 0x00, 0x01, 0x08, 0x19, 0x1B, 0x1F, 0x7F}, 439 + {512, 16000, 8192000, 0x20, 0x00, 0x30, 0x35, 0x08, 0x19, 0x1F, 0x3F}, 440 + {512, 44100, 22579200, 0xE0, 0x00, 0x00, 0x2D, 0x48, 0x08, 0x1F, 0x1F}, 441 + {512, 48000, 24576000, 0xE0, 0x00, 0x00, 0x2D, 0x48, 0x08, 0x1F, 0x1F}, 442 442 {768, 8000, 6144000, 0x60, 0x02, 0x11, 0x35, 0x8A, 0x1B, 0x1F, 0x7F}, 443 443 {768, 16000, 12288000, 0x20, 0x02, 0x01, 0x35, 0x8A, 0x1B, 0x1F, 0x3F}, 444 444 {768, 32000, 24576000, 0xE0, 0x02, 0x30, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F}, ··· 835 835 dev_dbg(comp->dev, "Report hp remove event\n"); 836 836 snd_soc_jack_report(es8326->jack, 0, SND_JACK_HEADSET); 837 837 /* mute adc when mic path switch */ 838 - regmap_write(es8326->regmap, ES8326_ADC_SCALE, 0x33); 839 838 regmap_write(es8326->regmap, ES8326_ADC1_SRC, 0x44); 840 839 regmap_write(es8326->regmap, ES8326_ADC2_SRC, 0x66); 841 840 es8326->hp = 0; ··· 842 843 regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01); 843 844 regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x0a); 844 845 regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x03); 846 + regmap_write(es8326->regmap, ES8326_INT_SOURCE, ES8326_INT_SRC_PIN9); 845 847 /* 846 848 * Inverted HPJACK_POL bit to trigger one IRQ to double check HP Removal event 847 849 */ ··· 865 865 * set auto-check mode, then restart jack_detect_work after 400ms. 866 866 * Don't report jack status. 867 867 */ 868 + regmap_write(es8326->regmap, ES8326_INT_SOURCE, 869 + (ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON)); 868 870 regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01); 869 871 es8326_enable_micbias(es8326->component); 870 872 usleep_range(50000, 70000); ··· 893 891 snd_soc_jack_report(es8326->jack, 894 892 SND_JACK_HEADSET, SND_JACK_HEADSET); 895 893 896 - regmap_write(es8326->regmap, ES8326_ADC_SCALE, 0x33); 897 894 regmap_update_bits(es8326->regmap, ES8326_PGA_PDN, 898 895 0x08, 0x08); 899 896 regmap_update_bits(es8326->regmap, ES8326_PGAGAIN, ··· 988 987 regmap_write(es8326->regmap, ES8326_VMIDSEL, 0x0E); 989 988 regmap_write(es8326->regmap, ES8326_ANA_LP, 0xf0); 990 989 usleep_range(10000, 15000); 991 - regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xe9); 990 + regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xd9); 992 991 regmap_write(es8326->regmap, ES8326_ANA_MICBIAS, 0xcb); 993 992 /* set headphone default type and detect pin */ 994 993 regmap_write(es8326->regmap, ES8326_HPDET_TYPE, 0x83); ··· 1039 1038 es8326_enable_micbias(es8326->component); 1040 1039 usleep_range(50000, 70000); 1041 1040 regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x00); 1042 - regmap_write(es8326->regmap, ES8326_INT_SOURCE, 1043 - (ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON)); 1041 + regmap_write(es8326->regmap, ES8326_INT_SOURCE, ES8326_INT_SRC_PIN9); 1044 1042 regmap_write(es8326->regmap, ES8326_INTOUT_IO, 1045 1043 es8326->interrupt_clk); 1046 1044 regmap_write(es8326->regmap, ES8326_SDINOUT1_IO, ··· 1060 1060 es8326->hp = 0; 1061 1061 es8326->hpl_vol = 0x03; 1062 1062 es8326->hpr_vol = 0x03; 1063 + 1064 + es8326_irq(es8326->irq, es8326); 1063 1065 return 0; 1064 1066 } 1065 1067 ··· 1072 1070 cancel_delayed_work_sync(&es8326->jack_detect_work); 1073 1071 es8326_disable_micbias(component); 1074 1072 es8326->calibrated = false; 1073 + regmap_write(es8326->regmap, ES8326_CLK_MUX, 0x2d); 1074 + regmap_write(es8326->regmap, ES8326_DAC2HPMIX, 0x00); 1075 + regmap_write(es8326->regmap, ES8326_ANA_PDN, 0x3b); 1075 1076 regmap_write(es8326->regmap, ES8326_CLK_CTL, ES8326_CLK_OFF); 1076 1077 regcache_cache_only(es8326->regmap, true); 1077 1078 regcache_mark_dirty(es8326->regmap);
+1 -1
sound/soc/codecs/es8326.h
··· 104 104 #define ES8326_MUTE (3 << 0) 105 105 106 106 /* ES8326_CLK_CTL */ 107 - #define ES8326_CLK_ON (0x7e << 0) 107 + #define ES8326_CLK_ON (0x7f << 0) 108 108 #define ES8326_CLK_OFF (0 << 0) 109 109 110 110 /* ES8326_CLK_INV */
+4 -4
sound/soc/codecs/rt1316-sdw.c
··· 537 537 retval = sdw_stream_add_slave(rt1316->sdw_slave, &stream_config, 538 538 &port_config, 1, sdw_stream); 539 539 if (retval) { 540 - dev_err(dai->dev, "Unable to configure port\n"); 540 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 541 541 return retval; 542 542 } 543 543 ··· 577 577 if (rt1316->bq_params_cnt) { 578 578 rt1316->bq_params = devm_kzalloc(dev, rt1316->bq_params_cnt, GFP_KERNEL); 579 579 if (!rt1316->bq_params) { 580 - dev_err(dev, "Could not allocate bq_params memory\n"); 580 + dev_err(dev, "%s: Could not allocate bq_params memory\n", __func__); 581 581 ret = -ENOMEM; 582 582 } else { 583 583 ret = device_property_read_u8_array(dev, "realtek,bq-params", rt1316->bq_params, rt1316->bq_params_cnt); 584 584 if (ret < 0) 585 - dev_err(dev, "Could not read list of realtek,bq-params\n"); 585 + dev_err(dev, "%s: Could not read list of realtek,bq-params\n", __func__); 586 586 } 587 587 } 588 588 ··· 759 759 time = wait_for_completion_timeout(&slave->initialization_complete, 760 760 msecs_to_jiffies(RT1316_PROBE_TIMEOUT)); 761 761 if (!time) { 762 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 762 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__); 763 763 sdw_show_ping_status(slave->bus, true); 764 764 765 765 return -ETIMEDOUT;
+4 -4
sound/soc/codecs/rt1318-sdw.c
··· 606 606 retval = sdw_stream_add_slave(rt1318->sdw_slave, &stream_config, 607 607 &port_config, 1, sdw_stream); 608 608 if (retval) { 609 - dev_err(dai->dev, "Unable to configure port\n"); 609 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 610 610 return retval; 611 611 } 612 612 ··· 631 631 sampling_rate = RT1318_SDCA_RATE_192000HZ; 632 632 break; 633 633 default: 634 - dev_err(component->dev, "Rate %d is not supported\n", 635 - params_rate(params)); 634 + dev_err(component->dev, "%s: Rate %d is not supported\n", 635 + __func__, params_rate(params)); 636 636 return -EINVAL; 637 637 } 638 638 ··· 835 835 time = wait_for_completion_timeout(&slave->initialization_complete, 836 836 msecs_to_jiffies(RT1318_PROBE_TIMEOUT)); 837 837 if (!time) { 838 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 838 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__); 839 839 return -ETIMEDOUT; 840 840 } 841 841
+8 -8
sound/soc/codecs/rt5682-sdw.c
··· 132 132 retval = sdw_stream_add_slave(rt5682->slave, &stream_config, 133 133 &port_config, 1, sdw_stream); 134 134 if (retval) { 135 - dev_err(dai->dev, "Unable to configure port\n"); 135 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 136 136 return retval; 137 137 } 138 138 ··· 315 315 &rt5682_sdw_indirect_regmap); 316 316 if (IS_ERR(rt5682->regmap)) { 317 317 ret = PTR_ERR(rt5682->regmap); 318 - dev_err(dev, "Failed to allocate register map: %d\n", 319 - ret); 318 + dev_err(dev, "%s: Failed to allocate register map: %d\n", 319 + __func__, ret); 320 320 return ret; 321 321 } 322 322 ··· 400 400 } 401 401 402 402 if (val != DEVICE_ID) { 403 - dev_err(dev, "Device with ID register %x is not rt5682\n", val); 403 + dev_err(dev, "%s: Device with ID register %x is not rt5682\n", __func__, val); 404 404 ret = -ENODEV; 405 405 goto err_nodev; 406 406 } ··· 648 648 649 649 ret = rt5682_clock_config(&slave->dev); 650 650 if (ret < 0) 651 - dev_err(&slave->dev, "Invalid clk config"); 651 + dev_err(&slave->dev, "%s: Invalid clk config", __func__); 652 652 653 653 return ret; 654 654 } ··· 763 763 return 0; 764 764 765 765 if (!slave->unattach_request) { 766 + mutex_lock(&rt5682->disable_irq_lock); 766 767 if (rt5682->disable_irq == true) { 767 - mutex_lock(&rt5682->disable_irq_lock); 768 768 sdw_write_no_pm(slave, SDW_SCP_INTMASK1, SDW_SCP_INT1_IMPL_DEF); 769 769 rt5682->disable_irq = false; 770 - mutex_unlock(&rt5682->disable_irq_lock); 771 770 } 771 + mutex_unlock(&rt5682->disable_irq_lock); 772 772 goto regmap_sync; 773 773 } 774 774 775 775 time = wait_for_completion_timeout(&slave->initialization_complete, 776 776 msecs_to_jiffies(RT5682_PROBE_TIMEOUT)); 777 777 if (!time) { 778 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 778 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__); 779 779 sdw_show_ping_status(slave->bus, true); 780 780 781 781 return -ETIMEDOUT;
+8 -8
sound/soc/codecs/rt700.c
··· 37 37 38 38 ret = regmap_write(regmap, addr, value); 39 39 if (ret < 0) 40 - pr_err("Failed to set private value: %06x <= %04x ret=%d\n", 41 - addr, value, ret); 40 + pr_err("%s: Failed to set private value: %06x <= %04x ret=%d\n", 41 + __func__, addr, value, ret); 42 42 43 43 return ret; 44 44 } ··· 52 52 *value = 0; 53 53 ret = regmap_read(regmap, addr, value); 54 54 if (ret < 0) 55 - pr_err("Failed to get private value: %06x => %04x ret=%d\n", 56 - addr, *value, ret); 55 + pr_err("%s: Failed to get private value: %06x => %04x ret=%d\n", 56 + __func__, addr, *value, ret); 57 57 58 58 return ret; 59 59 } ··· 930 930 port_config.num += 2; 931 931 break; 932 932 default: 933 - dev_err(component->dev, "Invalid DAI id %d\n", dai->id); 933 + dev_err(component->dev, "%s: Invalid DAI id %d\n", __func__, dai->id); 934 934 return -EINVAL; 935 935 } 936 936 937 937 retval = sdw_stream_add_slave(rt700->slave, &stream_config, 938 938 &port_config, 1, sdw_stream); 939 939 if (retval) { 940 - dev_err(dai->dev, "Unable to configure port\n"); 940 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 941 941 return retval; 942 942 } 943 943 ··· 945 945 /* bit 3:0 Number of Channel */ 946 946 val |= (params_channels(params) - 1); 947 947 } else { 948 - dev_err(component->dev, "Unsupported channels %d\n", 949 - params_channels(params)); 948 + dev_err(component->dev, "%s: Unsupported channels %d\n", 949 + __func__, params_channels(params)); 950 950 return -EINVAL; 951 951 } 952 952
+3 -3
sound/soc/codecs/rt711-sdca-sdw.c
··· 438 438 return 0; 439 439 440 440 if (!slave->unattach_request) { 441 + mutex_lock(&rt711->disable_irq_lock); 441 442 if (rt711->disable_irq == true) { 442 - mutex_lock(&rt711->disable_irq_lock); 443 443 sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_0); 444 444 sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8); 445 445 rt711->disable_irq = false; 446 - mutex_unlock(&rt711->disable_irq_lock); 447 446 } 447 + mutex_unlock(&rt711->disable_irq_lock); 448 448 goto regmap_sync; 449 449 } 450 450 451 451 time = wait_for_completion_timeout(&slave->initialization_complete, 452 452 msecs_to_jiffies(RT711_PROBE_TIMEOUT)); 453 453 if (!time) { 454 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 454 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__); 455 455 sdw_show_ping_status(slave->bus, true); 456 456 457 457 return -ETIMEDOUT;
+9 -9
sound/soc/codecs/rt711-sdca.c
··· 36 36 ret = regmap_write(regmap, addr, value); 37 37 if (ret < 0) 38 38 dev_err(&rt711->slave->dev, 39 - "Failed to set private value: %06x <= %04x ret=%d\n", 40 - addr, value, ret); 39 + "%s: Failed to set private value: %06x <= %04x ret=%d\n", 40 + __func__, addr, value, ret); 41 41 42 42 return ret; 43 43 } ··· 52 52 ret = regmap_read(regmap, addr, value); 53 53 if (ret < 0) 54 54 dev_err(&rt711->slave->dev, 55 - "Failed to get private value: %06x => %04x ret=%d\n", 56 - addr, *value, ret); 55 + "%s: Failed to get private value: %06x => %04x ret=%d\n", 56 + __func__, addr, *value, ret); 57 57 58 58 return ret; 59 59 } ··· 1293 1293 retval = sdw_stream_add_slave(rt711->slave, &stream_config, 1294 1294 &port_config, 1, sdw_stream); 1295 1295 if (retval) { 1296 - dev_err(dai->dev, "Unable to configure port\n"); 1296 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 1297 1297 return retval; 1298 1298 } 1299 1299 1300 1300 if (params_channels(params) > 16) { 1301 - dev_err(component->dev, "Unsupported channels %d\n", 1302 - params_channels(params)); 1301 + dev_err(component->dev, "%s: Unsupported channels %d\n", 1302 + __func__, params_channels(params)); 1303 1303 return -EINVAL; 1304 1304 } 1305 1305 ··· 1318 1318 sampling_rate = RT711_SDCA_RATE_192000HZ; 1319 1319 break; 1320 1320 default: 1321 - dev_err(component->dev, "Rate %d is not supported\n", 1322 - params_rate(params)); 1321 + dev_err(component->dev, "%s: Rate %d is not supported\n", 1322 + __func__, params_rate(params)); 1323 1323 return -EINVAL; 1324 1324 } 1325 1325
+4 -4
sound/soc/codecs/rt711-sdw.c
··· 408 408 409 409 ret = rt711_clock_config(&slave->dev); 410 410 if (ret < 0) 411 - dev_err(&slave->dev, "Invalid clk config"); 411 + dev_err(&slave->dev, "%s: Invalid clk config", __func__); 412 412 413 413 return ret; 414 414 } ··· 536 536 return 0; 537 537 538 538 if (!slave->unattach_request) { 539 + mutex_lock(&rt711->disable_irq_lock); 539 540 if (rt711->disable_irq == true) { 540 - mutex_lock(&rt711->disable_irq_lock); 541 541 sdw_write_no_pm(slave, SDW_SCP_INTMASK1, SDW_SCP_INT1_IMPL_DEF); 542 542 rt711->disable_irq = false; 543 - mutex_unlock(&rt711->disable_irq_lock); 544 543 } 544 + mutex_unlock(&rt711->disable_irq_lock); 545 545 goto regmap_sync; 546 546 } 547 547 548 548 time = wait_for_completion_timeout(&slave->initialization_complete, 549 549 msecs_to_jiffies(RT711_PROBE_TIMEOUT)); 550 550 if (!time) { 551 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 551 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__); 552 552 return -ETIMEDOUT; 553 553 } 554 554
+8 -8
sound/soc/codecs/rt711.c
··· 37 37 38 38 ret = regmap_write(regmap, addr, value); 39 39 if (ret < 0) 40 - pr_err("Failed to set private value: %06x <= %04x ret=%d\n", 41 - addr, value, ret); 40 + pr_err("%s: Failed to set private value: %06x <= %04x ret=%d\n", 41 + __func__, addr, value, ret); 42 42 43 43 return ret; 44 44 } ··· 52 52 *value = 0; 53 53 ret = regmap_read(regmap, addr, value); 54 54 if (ret < 0) 55 - pr_err("Failed to get private value: %06x => %04x ret=%d\n", 56 - addr, *value, ret); 55 + pr_err("%s: Failed to get private value: %06x => %04x ret=%d\n", 56 + __func__, addr, *value, ret); 57 57 58 58 return ret; 59 59 } ··· 428 428 RT711_HP_JD_FINAL_RESULT_CTL_JD12); 429 429 break; 430 430 default: 431 - dev_warn(rt711->component->dev, "Wrong JD source\n"); 431 + dev_warn(rt711->component->dev, "%s: Wrong JD source\n", __func__); 432 432 break; 433 433 } 434 434 ··· 1020 1020 retval = sdw_stream_add_slave(rt711->slave, &stream_config, 1021 1021 &port_config, 1, sdw_stream); 1022 1022 if (retval) { 1023 - dev_err(dai->dev, "Unable to configure port\n"); 1023 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 1024 1024 return retval; 1025 1025 } 1026 1026 ··· 1028 1028 /* bit 3:0 Number of Channel */ 1029 1029 val |= (params_channels(params) - 1); 1030 1030 } else { 1031 - dev_err(component->dev, "Unsupported channels %d\n", 1032 - params_channels(params)); 1031 + dev_err(component->dev, "%s: Unsupported channels %d\n", 1032 + __func__, params_channels(params)); 1033 1033 return -EINVAL; 1034 1034 } 1035 1035
+13 -11
sound/soc/codecs/rt712-sdca-dmic.c
··· 139 139 ret = regmap_write(regmap, addr, value); 140 140 if (ret < 0) 141 141 dev_err(&rt712->slave->dev, 142 - "Failed to set private value: %06x <= %04x ret=%d\n", 143 - addr, value, ret); 142 + "%s: Failed to set private value: %06x <= %04x ret=%d\n", 143 + __func__, addr, value, ret); 144 144 145 145 return ret; 146 146 } ··· 155 155 ret = regmap_read(regmap, addr, value); 156 156 if (ret < 0) 157 157 dev_err(&rt712->slave->dev, 158 - "Failed to get private value: %06x => %04x ret=%d\n", 159 - addr, *value, ret); 158 + "%s: Failed to get private value: %06x => %04x ret=%d\n", 159 + __func__, addr, *value, ret); 160 160 161 161 return ret; 162 162 } ··· 317 317 for (i = 0; i < p->count; i++) { 318 318 err = regmap_write(rt712->mbq_regmap, p->reg_base + i, gain_val[i]); 319 319 if (err < 0) 320 - dev_err(&rt712->slave->dev, "0x%08x can't be set\n", p->reg_base + i); 320 + dev_err(&rt712->slave->dev, "%s: 0x%08x can't be set\n", 321 + __func__, p->reg_base + i); 321 322 } 322 323 323 324 return changed; ··· 668 667 retval = sdw_stream_add_slave(rt712->slave, &stream_config, 669 668 &port_config, 1, sdw_stream); 670 669 if (retval) { 671 - dev_err(dai->dev, "Unable to configure port\n"); 670 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 672 671 return retval; 673 672 } 674 673 675 674 if (params_channels(params) > 4) { 676 - dev_err(component->dev, "Unsupported channels %d\n", 677 - params_channels(params)); 675 + dev_err(component->dev, "%s: Unsupported channels %d\n", 676 + __func__, params_channels(params)); 678 677 return -EINVAL; 679 678 } 680 679 ··· 699 698 sampling_rate = RT712_SDCA_RATE_192000HZ; 700 699 break; 701 700 default: 702 - dev_err(component->dev, "Rate %d is not supported\n", 703 - params_rate(params)); 701 + dev_err(component->dev, "%s: Rate %d is not supported\n", 702 + __func__, params_rate(params)); 704 703 return -EINVAL; 705 704 } 706 705 ··· 924 923 time = wait_for_completion_timeout(&slave->initialization_complete, 925 924 msecs_to_jiffies(RT712_PROBE_TIMEOUT)); 926 925 if (!time) { 927 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 926 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", 927 + __func__); 928 928 sdw_show_ping_status(slave->bus, true); 929 929 930 930 return -ETIMEDOUT;
+4 -3
sound/soc/codecs/rt712-sdca-sdw.c
··· 438 438 return 0; 439 439 440 440 if (!slave->unattach_request) { 441 + mutex_lock(&rt712->disable_irq_lock); 441 442 if (rt712->disable_irq == true) { 442 - mutex_lock(&rt712->disable_irq_lock); 443 + 443 444 sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_0); 444 445 sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8); 445 446 rt712->disable_irq = false; 446 - mutex_unlock(&rt712->disable_irq_lock); 447 447 } 448 + mutex_unlock(&rt712->disable_irq_lock); 448 449 goto regmap_sync; 449 450 } 450 451 451 452 time = wait_for_completion_timeout(&slave->initialization_complete, 452 453 msecs_to_jiffies(RT712_PROBE_TIMEOUT)); 453 454 if (!time) { 454 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 455 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__); 455 456 sdw_show_ping_status(slave->bus, true); 456 457 457 458 return -ETIMEDOUT;
+10 -10
sound/soc/codecs/rt712-sdca.c
··· 34 34 ret = regmap_write(regmap, addr, value); 35 35 if (ret < 0) 36 36 dev_err(&rt712->slave->dev, 37 - "Failed to set private value: %06x <= %04x ret=%d\n", 38 - addr, value, ret); 37 + "%s: Failed to set private value: %06x <= %04x ret=%d\n", 38 + __func__, addr, value, ret); 39 39 40 40 return ret; 41 41 } ··· 50 50 ret = regmap_read(regmap, addr, value); 51 51 if (ret < 0) 52 52 dev_err(&rt712->slave->dev, 53 - "Failed to get private value: %06x => %04x ret=%d\n", 54 - addr, *value, ret); 53 + "%s: Failed to get private value: %06x => %04x ret=%d\n", 54 + __func__, addr, *value, ret); 55 55 56 56 return ret; 57 57 } ··· 1060 1060 retval = sdw_stream_add_slave(rt712->slave, &stream_config, 1061 1061 &port_config, 1, sdw_stream); 1062 1062 if (retval) { 1063 - dev_err(dai->dev, "Unable to configure port\n"); 1063 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 1064 1064 return retval; 1065 1065 } 1066 1066 1067 1067 if (params_channels(params) > 16) { 1068 - dev_err(component->dev, "Unsupported channels %d\n", 1069 - params_channels(params)); 1068 + dev_err(component->dev, "%s: Unsupported channels %d\n", 1069 + __func__, params_channels(params)); 1070 1070 return -EINVAL; 1071 1071 } 1072 1072 ··· 1085 1085 sampling_rate = RT712_SDCA_RATE_192000HZ; 1086 1086 break; 1087 1087 default: 1088 - dev_err(component->dev, "Rate %d is not supported\n", 1089 - params_rate(params)); 1088 + dev_err(component->dev, "%s: Rate %d is not supported\n", 1089 + __func__, params_rate(params)); 1090 1090 return -EINVAL; 1091 1091 } 1092 1092 ··· 1106 1106 sampling_rate); 1107 1107 break; 1108 1108 default: 1109 - dev_err(component->dev, "Wrong DAI id\n"); 1109 + dev_err(component->dev, "%s: Wrong DAI id\n", __func__); 1110 1110 return -EINVAL; 1111 1111 } 1112 1112
+1 -1
sound/soc/codecs/rt715-sdca-sdw.c
··· 237 237 time = wait_for_completion_timeout(&slave->enumeration_complete, 238 238 msecs_to_jiffies(RT715_PROBE_TIMEOUT)); 239 239 if (!time) { 240 - dev_err(&slave->dev, "Enumeration not complete, timed out\n"); 240 + dev_err(&slave->dev, "%s: Enumeration not complete, timed out\n", __func__); 241 241 sdw_show_ping_status(slave->bus, true); 242 242 243 243 return -ETIMEDOUT;
+23 -23
sound/soc/codecs/rt715-sdca.c
··· 41 41 ret = regmap_write(regmap, addr, value); 42 42 if (ret < 0) 43 43 dev_err(&rt715->slave->dev, 44 - "Failed to set private value: %08x <= %04x %d\n", 45 - addr, value, ret); 44 + "%s: Failed to set private value: %08x <= %04x %d\n", 45 + __func__, addr, value, ret); 46 46 47 47 return ret; 48 48 } ··· 59 59 ret = regmap_read(regmap, addr, value); 60 60 if (ret < 0) 61 61 dev_err(&rt715->slave->dev, 62 - "Failed to get private value: %06x => %04x ret=%d\n", 63 - addr, *value, ret); 62 + "%s: Failed to get private value: %06x => %04x ret=%d\n", 63 + __func__, addr, *value, ret); 64 64 65 65 return ret; 66 66 } ··· 152 152 mc->shift); 153 153 ret = regmap_write(rt715->mbq_regmap, mc->reg + i, gain_val); 154 154 if (ret != 0) { 155 - dev_err(component->dev, "Failed to write 0x%x=0x%x\n", 156 - mc->reg + i, gain_val); 155 + dev_err(component->dev, "%s: Failed to write 0x%x=0x%x\n", 156 + __func__, mc->reg + i, gain_val); 157 157 return ret; 158 158 } 159 159 } ··· 188 188 ret = regmap_write(rt715->mbq_regmap, reg_base + i, 189 189 gain_val); 190 190 if (ret != 0) { 191 - dev_err(component->dev, "Failed to write 0x%x=0x%x\n", 192 - reg_base + i, gain_val); 191 + dev_err(component->dev, "%s: Failed to write 0x%x=0x%x\n", 192 + __func__, reg_base + i, gain_val); 193 193 return ret; 194 194 } 195 195 } ··· 224 224 reg = i < 7 ? reg_base + i : (reg_base - 1) | BIT(15); 225 225 ret = regmap_write(rt715->mbq_regmap, reg, gain_val); 226 226 if (ret != 0) { 227 - dev_err(component->dev, "Failed to write 0x%x=0x%x\n", 228 - reg, gain_val); 227 + dev_err(component->dev, "%s: Failed to write 0x%x=0x%x\n", 228 + __func__, reg, gain_val); 229 229 return ret; 230 230 } 231 231 } ··· 246 246 for (i = 0; i < 2; i++) { 247 247 ret = regmap_read(rt715->mbq_regmap, mc->reg + i, &val); 248 248 if (ret < 0) { 249 - dev_err(component->dev, "Failed to read 0x%x, ret=%d\n", 250 - mc->reg + i, ret); 249 + dev_err(component->dev, "%s: Failed to read 0x%x, ret=%d\n", 250 + __func__, mc->reg + i, ret); 251 251 return ret; 252 252 } 253 253 ucontrol->value.integer.value[i] = rt715_sdca_get_gain(val, mc->shift); ··· 271 271 for (i = 0; i < 4; i++) { 272 272 ret = regmap_read(rt715->mbq_regmap, reg_base + i, &val); 273 273 if (ret < 0) { 274 - dev_err(component->dev, "Failed to read 0x%x, ret=%d\n", 275 - reg_base + i, ret); 274 + dev_err(component->dev, "%s: Failed to read 0x%x, ret=%d\n", 275 + __func__, reg_base + i, ret); 276 276 return ret; 277 277 } 278 278 ucontrol->value.integer.value[i] = rt715_sdca_get_gain(val, gain_sft); ··· 297 297 for (i = 0; i < 8; i += 2) { 298 298 ret = regmap_read(rt715->mbq_regmap, reg_base + i, &val_l); 299 299 if (ret < 0) { 300 - dev_err(component->dev, "Failed to read 0x%x, ret=%d\n", 301 - reg_base + i, ret); 300 + dev_err(component->dev, "%s: Failed to read 0x%x, ret=%d\n", 301 + __func__, reg_base + i, ret); 302 302 return ret; 303 303 } 304 304 ucontrol->value.integer.value[i] = (val_l >> gain_sft) / 10; ··· 306 306 reg = (i == 6) ? (reg_base - 1) | BIT(15) : reg_base + 1 + i; 307 307 ret = regmap_read(rt715->mbq_regmap, reg, &val_r); 308 308 if (ret < 0) { 309 - dev_err(component->dev, "Failed to read 0x%x, ret=%d\n", 310 - reg, ret); 309 + dev_err(component->dev, "%s: Failed to read 0x%x, ret=%d\n", 310 + __func__, reg, ret); 311 311 return ret; 312 312 } 313 313 ucontrol->value.integer.value[i + 1] = (val_r >> gain_sft) / 10; ··· 834 834 0xaf00); 835 835 break; 836 836 default: 837 - dev_err(component->dev, "Invalid DAI id %d\n", dai->id); 837 + dev_err(component->dev, "%s: Invalid DAI id %d\n", __func__, dai->id); 838 838 return -EINVAL; 839 839 } 840 840 841 841 retval = sdw_stream_add_slave(rt715->slave, &stream_config, 842 842 &port_config, 1, sdw_stream); 843 843 if (retval) { 844 - dev_err(component->dev, "Unable to configure port, retval:%d\n", 845 - retval); 844 + dev_err(component->dev, "%s: Unable to configure port, retval:%d\n", 845 + __func__, retval); 846 846 return retval; 847 847 } 848 848 ··· 893 893 val = 0xf; 894 894 break; 895 895 default: 896 - dev_err(component->dev, "Unsupported sample rate %d\n", 897 - params_rate(params)); 896 + dev_err(component->dev, "%s: Unsupported sample rate %d\n", 897 + __func__, params_rate(params)); 898 898 return -EINVAL; 899 899 } 900 900
+2 -2
sound/soc/codecs/rt715-sdw.c
··· 482 482 483 483 ret = rt715_clock_config(&slave->dev); 484 484 if (ret < 0) 485 - dev_err(&slave->dev, "Invalid clk config"); 485 + dev_err(&slave->dev, "%s: Invalid clk config", __func__); 486 486 487 487 return 0; 488 488 } ··· 554 554 time = wait_for_completion_timeout(&slave->initialization_complete, 555 555 msecs_to_jiffies(RT715_PROBE_TIMEOUT)); 556 556 if (!time) { 557 - dev_err(&slave->dev, "Initialization not complete, timed out\n"); 557 + dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__); 558 558 sdw_show_ping_status(slave->bus, true); 559 559 560 560 return -ETIMEDOUT;
+12 -12
sound/soc/codecs/rt715.c
··· 40 40 41 41 ret = regmap_write(regmap, addr, value); 42 42 if (ret < 0) { 43 - pr_err("Failed to set private value: %08x <= %04x %d\n", 44 - addr, value, ret); 43 + pr_err("%s: Failed to set private value: %08x <= %04x %d\n", 44 + __func__, addr, value, ret); 45 45 } 46 46 47 47 return ret; ··· 55 55 56 56 ret = regmap_write(regmap, addr, value); 57 57 if (ret < 0) 58 - pr_err("Failed to set private value: %06x <= %04x ret=%d\n", 59 - addr, value, ret); 58 + pr_err("%s: Failed to set private value: %06x <= %04x ret=%d\n", 59 + __func__, addr, value, ret); 60 60 61 61 return ret; 62 62 } ··· 70 70 *value = 0; 71 71 ret = regmap_read(regmap, addr, value); 72 72 if (ret < 0) 73 - pr_err("Failed to get private value: %06x => %04x ret=%d\n", 74 - addr, *value, ret); 73 + pr_err("%s: Failed to get private value: %06x => %04x ret=%d\n", 74 + __func__, addr, *value, ret); 75 75 76 76 return ret; 77 77 } ··· 862 862 rt715_index_write(rt715->regmap, RT715_SDW_INPUT_SEL, 0xa000); 863 863 break; 864 864 default: 865 - dev_err(component->dev, "Invalid DAI id %d\n", dai->id); 865 + dev_err(component->dev, "%s: Invalid DAI id %d\n", __func__, dai->id); 866 866 return -EINVAL; 867 867 } 868 868 869 869 retval = sdw_stream_add_slave(rt715->slave, &stream_config, 870 870 &port_config, 1, sdw_stream); 871 871 if (retval) { 872 - dev_err(dai->dev, "Unable to configure port\n"); 872 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 873 873 return retval; 874 874 } 875 875 ··· 883 883 val |= 0x0 << 8; 884 884 break; 885 885 default: 886 - dev_err(component->dev, "Unsupported sample rate %d\n", 887 - params_rate(params)); 886 + dev_err(component->dev, "%s: Unsupported sample rate %d\n", 887 + __func__, params_rate(params)); 888 888 return -EINVAL; 889 889 } 890 890 ··· 892 892 /* bit 3:0 Number of Channel */ 893 893 val |= (params_channels(params) - 1); 894 894 } else { 895 - dev_err(component->dev, "Unsupported channels %d\n", 896 - params_channels(params)); 895 + dev_err(component->dev, "%s: Unsupported channels %d\n", 896 + __func__, params_channels(params)); 897 897 return -EINVAL; 898 898 } 899 899
+2 -2
sound/soc/codecs/rt722-sdca-sdw.c
··· 467 467 return 0; 468 468 469 469 if (!slave->unattach_request) { 470 + mutex_lock(&rt722->disable_irq_lock); 470 471 if (rt722->disable_irq == true) { 471 - mutex_lock(&rt722->disable_irq_lock); 472 472 sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_6); 473 473 sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8); 474 474 rt722->disable_irq = false; 475 - mutex_unlock(&rt722->disable_irq_lock); 476 475 } 476 + mutex_unlock(&rt722->disable_irq_lock); 477 477 goto regmap_sync; 478 478 } 479 479
+11 -10
sound/soc/codecs/rt722-sdca.c
··· 35 35 ret = regmap_write(regmap, addr, value); 36 36 if (ret < 0) 37 37 dev_err(&rt722->slave->dev, 38 - "Failed to set private value: %06x <= %04x ret=%d\n", 39 - addr, value, ret); 38 + "%s: Failed to set private value: %06x <= %04x ret=%d\n", 39 + __func__, addr, value, ret); 40 40 41 41 return ret; 42 42 } ··· 51 51 ret = regmap_read(regmap, addr, value); 52 52 if (ret < 0) 53 53 dev_err(&rt722->slave->dev, 54 - "Failed to get private value: %06x => %04x ret=%d\n", 55 - addr, *value, ret); 54 + "%s: Failed to get private value: %06x => %04x ret=%d\n", 55 + __func__, addr, *value, ret); 56 56 57 57 return ret; 58 58 } ··· 663 663 for (i = 0; i < p->count; i++) { 664 664 err = regmap_write(rt722->mbq_regmap, p->reg_base + i, gain_val[i]); 665 665 if (err < 0) 666 - dev_err(&rt722->slave->dev, "%#08x can't be set\n", p->reg_base + i); 666 + dev_err(&rt722->slave->dev, "%s: %#08x can't be set\n", 667 + __func__, p->reg_base + i); 667 668 } 668 669 669 670 return changed; ··· 1212 1211 retval = sdw_stream_add_slave(rt722->slave, &stream_config, 1213 1212 &port_config, 1, sdw_stream); 1214 1213 if (retval) { 1215 - dev_err(dai->dev, "Unable to configure port\n"); 1214 + dev_err(dai->dev, "%s: Unable to configure port\n", __func__); 1216 1215 return retval; 1217 1216 } 1218 1217 1219 1218 if (params_channels(params) > 16) { 1220 - dev_err(component->dev, "Unsupported channels %d\n", 1221 - params_channels(params)); 1219 + dev_err(component->dev, "%s: Unsupported channels %d\n", 1220 + __func__, params_channels(params)); 1222 1221 return -EINVAL; 1223 1222 } 1224 1223 ··· 1237 1236 sampling_rate = RT722_SDCA_RATE_192000HZ; 1238 1237 break; 1239 1238 default: 1240 - dev_err(component->dev, "Rate %d is not supported\n", 1241 - params_rate(params)); 1239 + dev_err(component->dev, "%s: Rate %d is not supported\n", 1240 + __func__, params_rate(params)); 1242 1241 return -EINVAL; 1243 1242 } 1244 1243
+2 -1
sound/soc/codecs/wm_adsp.c
··· 683 683 int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type, 684 684 unsigned int alg, void *buf, size_t len) 685 685 { 686 - struct cs_dsp_coeff_ctl *cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg); 686 + struct cs_dsp_coeff_ctl *cs_ctl; 687 687 struct wm_coeff_ctl *ctl; 688 688 int ret; 689 689 690 690 mutex_lock(&dsp->cs_dsp.pwr_lock); 691 + cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg); 691 692 ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, buf, len); 692 693 mutex_unlock(&dsp->cs_dsp.pwr_lock); 693 694
+1
sound/soc/intel/avs/boards/da7219.c
··· 296 296 297 297 module_platform_driver(avs_da7219_driver); 298 298 299 + MODULE_DESCRIPTION("Intel da7219 machine driver"); 299 300 MODULE_AUTHOR("Cezary Rojewski <cezary.rojewski@intel.com>"); 300 301 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/dmic.c
··· 96 96 97 97 module_platform_driver(avs_dmic_driver); 98 98 99 + MODULE_DESCRIPTION("Intel DMIC machine driver"); 99 100 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/es8336.c
··· 326 326 327 327 module_platform_driver(avs_es8336_driver); 328 328 329 + MODULE_DESCRIPTION("Intel es8336 machine driver"); 329 330 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/i2s_test.c
··· 204 204 205 205 module_platform_driver(avs_i2s_test_driver); 206 206 207 + MODULE_DESCRIPTION("Intel i2s test machine driver"); 207 208 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/max98357a.c
··· 154 154 155 155 module_platform_driver(avs_max98357a_driver) 156 156 157 + MODULE_DESCRIPTION("Intel max98357a machine driver"); 157 158 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/max98373.c
··· 211 211 212 212 module_platform_driver(avs_max98373_driver) 213 213 214 + MODULE_DESCRIPTION("Intel max98373 machine driver"); 214 215 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/max98927.c
··· 208 208 209 209 module_platform_driver(avs_max98927_driver) 210 210 211 + MODULE_DESCRIPTION("Intel max98927 machine driver"); 211 212 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/nau8825.c
··· 313 313 314 314 module_platform_driver(avs_nau8825_driver) 315 315 316 + MODULE_DESCRIPTION("Intel nau8825 machine driver"); 316 317 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/probe.c
··· 69 69 70 70 module_platform_driver(avs_probe_mb_driver); 71 71 72 + MODULE_DESCRIPTION("Intel probe machine driver"); 72 73 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/rt274.c
··· 276 276 277 277 module_platform_driver(avs_rt274_driver); 278 278 279 + MODULE_DESCRIPTION("Intel rt274 machine driver"); 279 280 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/rt286.c
··· 247 247 248 248 module_platform_driver(avs_rt286_driver); 249 249 250 + MODULE_DESCRIPTION("Intel rt286 machine driver"); 250 251 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/rt298.c
··· 266 266 267 267 module_platform_driver(avs_rt298_driver); 268 268 269 + MODULE_DESCRIPTION("Intel rt298 machine driver"); 269 270 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/rt5514.c
··· 192 192 193 193 module_platform_driver(avs_rt5514_driver); 194 194 195 + MODULE_DESCRIPTION("Intel rt5514 machine driver"); 195 196 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/rt5663.c
··· 265 265 266 266 module_platform_driver(avs_rt5663_driver); 267 267 268 + MODULE_DESCRIPTION("Intel rt5663 machine driver"); 268 269 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/rt5682.c
··· 341 341 342 342 module_platform_driver(avs_rt5682_driver) 343 343 344 + MODULE_DESCRIPTION("Intel rt5682 machine driver"); 344 345 MODULE_AUTHOR("Cezary Rojewski <cezary.rojewski@intel.com>"); 345 346 MODULE_LICENSE("GPL");
+1
sound/soc/intel/avs/boards/ssm4567.c
··· 200 200 201 201 module_platform_driver(avs_ssm4567_driver) 202 202 203 + MODULE_DESCRIPTION("Intel ssm4567 machine driver"); 203 204 MODULE_LICENSE("GPL");
+1 -1
sound/soc/soc-ops.c
··· 263 263 int max = mc->max; 264 264 int min = mc->min; 265 265 int sign_bit = mc->sign_bit; 266 - unsigned int mask = (1 << fls(max)) - 1; 266 + unsigned int mask = (1ULL << fls(max)) - 1; 267 267 unsigned int invert = mc->invert; 268 268 int val; 269 269 int ret;
+4 -4
sound/soc/sof/amd/acp.c
··· 704 704 goto unregister_dev; 705 705 } 706 706 707 + ret = acp_init(sdev); 708 + if (ret < 0) 709 + goto free_smn_dev; 710 + 707 711 sdev->ipc_irq = pci->irq; 708 712 ret = request_threaded_irq(sdev->ipc_irq, acp_irq_handler, acp_irq_thread, 709 713 IRQF_SHARED, "AudioDSP", sdev); ··· 716 712 sdev->ipc_irq); 717 713 goto free_smn_dev; 718 714 } 719 - 720 - ret = acp_init(sdev); 721 - if (ret < 0) 722 - goto free_ipc_irq; 723 715 724 716 /* scan SoundWire capabilities exposed by DSDT */ 725 717 ret = acp_sof_scan_sdw_devices(sdev, chip->sdw_acpi_dev_addr);
+8 -6
sound/soc/sof/core.c
··· 339 339 ret = snd_sof_probe(sdev); 340 340 if (ret < 0) { 341 341 dev_err(sdev->dev, "failed to probe DSP %d\n", ret); 342 - sof_ops_free(sdev); 343 - return ret; 342 + goto err_sof_probe; 344 343 } 345 344 346 345 /* check machine info */ ··· 357 358 ret = validate_sof_ops(sdev); 358 359 if (ret < 0) { 359 360 snd_sof_remove(sdev); 361 + snd_sof_remove_late(sdev); 360 362 return ret; 361 363 } 362 364 } 363 365 366 + return 0; 367 + 364 368 err_machine_check: 365 - if (ret) { 366 - snd_sof_remove(sdev); 367 - sof_ops_free(sdev); 368 - } 369 + snd_sof_remove(sdev); 370 + err_sof_probe: 371 + snd_sof_remove_late(sdev); 372 + sof_ops_free(sdev); 369 373 370 374 return ret; 371 375 }
+3
sound/soc/sof/intel/hda-common-ops.c
··· 57 57 .pcm_pointer = hda_dsp_pcm_pointer, 58 58 .pcm_ack = hda_dsp_pcm_ack, 59 59 60 + .get_dai_frame_counter = hda_dsp_get_stream_llp, 61 + .get_host_byte_counter = hda_dsp_get_stream_ldp, 62 + 60 63 /* firmware loading */ 61 64 .load_firmware = snd_sof_load_firmware_raw, 62 65
+11
sound/soc/sof/intel/hda-dai-ops.c
··· 7 7 8 8 #include <sound/pcm_params.h> 9 9 #include <sound/hdaudio_ext.h> 10 + #include <sound/hda_register.h> 10 11 #include <sound/hda-mlink.h> 11 12 #include <sound/sof/ipc4/header.h> 12 13 #include <uapi/sound/sof/header.h> ··· 363 362 case SNDRV_PCM_TRIGGER_STOP: 364 363 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 365 364 snd_hdac_ext_stream_clear(hext_stream); 365 + 366 + /* 367 + * Save the LLP registers in case the stream is 368 + * restarting due PAUSE_RELEASE, or START without a pcm 369 + * close/open since in this case the LLP register is not reset 370 + * to 0 and the delay calculation will return with invalid 371 + * results. 372 + */ 373 + hext_stream->pplcllpl = readl(hext_stream->pplc_addr + AZX_REG_PPLCLLPL); 374 + hext_stream->pplcllpu = readl(hext_stream->pplc_addr + AZX_REG_PPLCLLPU); 366 375 break; 367 376 default: 368 377 dev_err(sdev->dev, "unknown trigger command %d\n", cmd);
+15 -5
sound/soc/sof/intel/hda-dsp.c
··· 681 681 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; 682 682 const struct sof_intel_dsp_desc *chip = hda->desc; 683 683 struct hdac_bus *bus = sof_to_bus(sdev); 684 + bool imr_lost = false; 684 685 int ret, j; 685 686 686 687 /* 687 - * The memory used for IMR boot loses its content in deeper than S3 state 688 - * We must not try IMR boot on next power up (as it will fail). 689 - * 688 + * The memory used for IMR boot loses its content in deeper than S3 689 + * state on CAVS platforms. 690 + * On ACE platforms due to the system architecture the IMR content is 691 + * lost at S3 state already, they are tailored for s2idle use. 692 + * We must not try IMR boot on next power up in these cases as it will 693 + * fail. 694 + */ 695 + if (sdev->system_suspend_target > SOF_SUSPEND_S3 || 696 + (chip->hw_ip_version >= SOF_INTEL_ACE_1_0 && 697 + sdev->system_suspend_target == SOF_SUSPEND_S3)) 698 + imr_lost = true; 699 + 700 + /* 690 701 * In case of firmware crash or boot failure set the skip_imr_boot to true 691 702 * as well in order to try to re-load the firmware to do a 'cold' boot. 692 703 */ 693 - if (sdev->system_suspend_target > SOF_SUSPEND_S3 || 694 - sdev->fw_state == SOF_FW_CRASHED || 704 + if (imr_lost || sdev->fw_state == SOF_FW_CRASHED || 695 705 sdev->fw_state == SOF_FW_BOOT_FAILED) 696 706 hda->skip_imr_boot = true; 697 707
+29
sound/soc/sof/intel/hda-pcm.c
··· 259 259 snd_pcm_hw_constraint_mask64(substream->runtime, SNDRV_PCM_HW_PARAM_FORMAT, 260 260 SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_S32); 261 261 262 + /* 263 + * The dsp_max_burst_size_in_ms is the length of the maximum burst size 264 + * of the host DMA in the ALSA buffer. 265 + * 266 + * On playback start the DMA will transfer dsp_max_burst_size_in_ms 267 + * amount of data in one initial burst to fill up the host DMA buffer. 268 + * Consequent DMA burst sizes are shorter and their length can vary. 269 + * To make sure that userspace allocate large enough ALSA buffer we need 270 + * to place a constraint on the buffer time. 271 + * 272 + * On capture the DMA will transfer 1ms chunks. 273 + * 274 + * Exact dsp_max_burst_size_in_ms constraint is racy, so set the 275 + * constraint to a minimum of 2x dsp_max_burst_size_in_ms. 276 + */ 277 + if (spcm->stream[direction].dsp_max_burst_size_in_ms) 278 + snd_pcm_hw_constraint_minmax(substream->runtime, 279 + SNDRV_PCM_HW_PARAM_BUFFER_TIME, 280 + spcm->stream[direction].dsp_max_burst_size_in_ms * USEC_PER_MSEC * 2, 281 + UINT_MAX); 282 + 262 283 /* binding pcm substream to hda stream */ 263 284 substream->runtime->private_data = &dsp_stream->hstream; 285 + 286 + /* 287 + * Reset the llp cache values (they are used for LLP compensation in 288 + * case the counter is not reset) 289 + */ 290 + dsp_stream->pplcllpl = 0; 291 + dsp_stream->pplcllpu = 0; 292 + 264 293 return 0; 265 294 } 266 295
+70
sound/soc/sof/intel/hda-stream.c
··· 1063 1063 1064 1064 return pos; 1065 1065 } 1066 + 1067 + #define merge_u64(u32_u, u32_l) (((u64)(u32_u) << 32) | (u32_l)) 1068 + 1069 + /** 1070 + * hda_dsp_get_stream_llp - Retrieve the LLP (Linear Link Position) of the stream 1071 + * @sdev: SOF device 1072 + * @component: ASoC component 1073 + * @substream: PCM substream 1074 + * 1075 + * Returns the raw Linear Link Position value 1076 + */ 1077 + u64 hda_dsp_get_stream_llp(struct snd_sof_dev *sdev, 1078 + struct snd_soc_component *component, 1079 + struct snd_pcm_substream *substream) 1080 + { 1081 + struct hdac_stream *hstream = substream->runtime->private_data; 1082 + struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(hstream); 1083 + u32 llp_l, llp_u; 1084 + 1085 + /* 1086 + * The pplc_addr have been calculated during probe in 1087 + * hda_dsp_stream_init(): 1088 + * pplc_addr = sdev->bar[HDA_DSP_PP_BAR] + 1089 + * SOF_HDA_PPLC_BASE + 1090 + * SOF_HDA_PPLC_MULTI * total_stream + 1091 + * SOF_HDA_PPLC_INTERVAL * stream_index 1092 + * 1093 + * Use this pre-calculated address to avoid repeated re-calculation. 1094 + */ 1095 + llp_l = readl(hext_stream->pplc_addr + AZX_REG_PPLCLLPL); 1096 + llp_u = readl(hext_stream->pplc_addr + AZX_REG_PPLCLLPU); 1097 + 1098 + /* Compensate the LLP counter with the saved offset */ 1099 + if (hext_stream->pplcllpl || hext_stream->pplcllpu) 1100 + return merge_u64(llp_u, llp_l) - 1101 + merge_u64(hext_stream->pplcllpu, hext_stream->pplcllpl); 1102 + 1103 + return merge_u64(llp_u, llp_l); 1104 + } 1105 + 1106 + /** 1107 + * hda_dsp_get_stream_ldp - Retrieve the LDP (Linear DMA Position) of the stream 1108 + * @sdev: SOF device 1109 + * @component: ASoC component 1110 + * @substream: PCM substream 1111 + * 1112 + * Returns the raw Linear Link Position value 1113 + */ 1114 + u64 hda_dsp_get_stream_ldp(struct snd_sof_dev *sdev, 1115 + struct snd_soc_component *component, 1116 + struct snd_pcm_substream *substream) 1117 + { 1118 + struct hdac_stream *hstream = substream->runtime->private_data; 1119 + struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(hstream); 1120 + u32 ldp_l, ldp_u; 1121 + 1122 + /* 1123 + * The pphc_addr have been calculated during probe in 1124 + * hda_dsp_stream_init(): 1125 + * pphc_addr = sdev->bar[HDA_DSP_PP_BAR] + 1126 + * SOF_HDA_PPHC_BASE + 1127 + * SOF_HDA_PPHC_INTERVAL * stream_index 1128 + * 1129 + * Use this pre-calculated address to avoid repeated re-calculation. 1130 + */ 1131 + ldp_l = readl(hext_stream->pphc_addr + AZX_REG_PPHCLDPL); 1132 + ldp_u = readl(hext_stream->pphc_addr + AZX_REG_PPHCLDPU); 1133 + 1134 + return ((u64)ldp_u << 32) | ldp_l; 1135 + }
+6
sound/soc/sof/intel/hda.h
··· 662 662 663 663 snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream, 664 664 int direction, bool can_sleep); 665 + u64 hda_dsp_get_stream_llp(struct snd_sof_dev *sdev, 666 + struct snd_soc_component *component, 667 + struct snd_pcm_substream *substream); 668 + u64 hda_dsp_get_stream_ldp(struct snd_sof_dev *sdev, 669 + struct snd_soc_component *component, 670 + struct snd_pcm_substream *substream); 665 671 666 672 struct hdac_ext_stream * 667 673 hda_dsp_stream_get(struct snd_sof_dev *sdev, int direction, u32 flags);
+24 -10
sound/soc/sof/intel/lnl.c
··· 29 29 }; 30 30 31 31 /* this helps allows the DSP to setup DMIC/SSP */ 32 - static int hdac_bus_offload_dmic_ssp(struct hdac_bus *bus) 32 + static int hdac_bus_offload_dmic_ssp(struct hdac_bus *bus, bool enable) 33 33 { 34 34 int ret; 35 35 36 - ret = hdac_bus_eml_enable_offload(bus, true, AZX_REG_ML_LEPTR_ID_INTEL_SSP, true); 36 + ret = hdac_bus_eml_enable_offload(bus, true, 37 + AZX_REG_ML_LEPTR_ID_INTEL_SSP, enable); 37 38 if (ret < 0) 38 39 return ret; 39 40 40 - ret = hdac_bus_eml_enable_offload(bus, true, AZX_REG_ML_LEPTR_ID_INTEL_DMIC, true); 41 + ret = hdac_bus_eml_enable_offload(bus, true, 42 + AZX_REG_ML_LEPTR_ID_INTEL_DMIC, enable); 41 43 if (ret < 0) 42 44 return ret; 43 45 ··· 54 52 if (ret < 0) 55 53 return ret; 56 54 57 - return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev)); 55 + return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev), true); 56 + } 57 + 58 + static void lnl_hda_dsp_remove(struct snd_sof_dev *sdev) 59 + { 60 + int ret; 61 + 62 + ret = hdac_bus_offload_dmic_ssp(sof_to_bus(sdev), false); 63 + if (ret < 0) 64 + dev_warn(sdev->dev, 65 + "Failed to disable offload for DMIC/SSP: %d\n", ret); 66 + 67 + hda_dsp_remove(sdev); 58 68 } 59 69 60 70 static int lnl_hda_dsp_resume(struct snd_sof_dev *sdev) ··· 77 63 if (ret < 0) 78 64 return ret; 79 65 80 - return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev)); 66 + return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev), true); 81 67 } 82 68 83 69 static int lnl_hda_dsp_runtime_resume(struct snd_sof_dev *sdev) ··· 88 74 if (ret < 0) 89 75 return ret; 90 76 91 - return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev)); 77 + return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev), true); 92 78 } 93 79 94 80 static int lnl_dsp_post_fw_run(struct snd_sof_dev *sdev) ··· 111 97 /* common defaults */ 112 98 memcpy(&sof_lnl_ops, &sof_hda_common_ops, sizeof(struct snd_sof_dsp_ops)); 113 99 114 - /* probe */ 115 - if (!sdev->dspless_mode_selected) 100 + /* probe/remove */ 101 + if (!sdev->dspless_mode_selected) { 116 102 sof_lnl_ops.probe = lnl_hda_dsp_probe; 103 + sof_lnl_ops.remove = lnl_hda_dsp_remove; 104 + } 117 105 118 106 /* shutdown */ 119 107 sof_lnl_ops.shutdown = hda_dsp_shutdown; ··· 149 133 sof_lnl_ops.resume = lnl_hda_dsp_resume; 150 134 sof_lnl_ops.runtime_resume = lnl_hda_dsp_runtime_resume; 151 135 } 152 - 153 - sof_lnl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position; 154 136 155 137 /* dsp core get/put */ 156 138 sof_lnl_ops.core_get = mtl_dsp_core_get;
-14
sound/soc/sof/intel/mtl.c
··· 626 626 return mtl_enable_interrupts(sdev, false); 627 627 } 628 628 629 - u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev, 630 - struct snd_soc_component *component, 631 - struct snd_pcm_substream *substream) 632 - { 633 - struct hdac_stream *hstream = substream->runtime->private_data; 634 - u32 llp_l, llp_u; 635 - 636 - llp_l = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, MTL_PPLCLLPL(hstream->index)); 637 - llp_u = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, MTL_PPLCLLPU(hstream->index)); 638 - return ((u64)llp_u << 32) | llp_l; 639 - } 640 - 641 629 int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core) 642 630 { 643 631 const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; ··· 694 706 /* dsp core get/put */ 695 707 sof_mtl_ops.core_get = mtl_dsp_core_get; 696 708 sof_mtl_ops.core_put = mtl_dsp_core_put; 697 - 698 - sof_mtl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position; 699 709 700 710 sdev->private = kzalloc(sizeof(struct sof_ipc4_fw_data), GFP_KERNEL); 701 711 if (!sdev->private)
-10
sound/soc/sof/intel/mtl.h
··· 6 6 * Copyright(c) 2020-2022 Intel Corporation. All rights reserved. 7 7 */ 8 8 9 - /* HDA Registers */ 10 - #define MTL_PPLCLLPL_BASE 0x948 11 - #define MTL_PPLCLLPU_STRIDE 0x10 12 - #define MTL_PPLCLLPL(x) (MTL_PPLCLLPL_BASE + (x) * MTL_PPLCLLPU_STRIDE) 13 - #define MTL_PPLCLLPU(x) (MTL_PPLCLLPL_BASE + 0x4 + (x) * MTL_PPLCLLPU_STRIDE) 14 - 15 9 /* DSP Registers */ 16 10 #define MTL_HFDSSCS 0x1000 17 11 #define MTL_HFDSSCS_SPA_MASK BIT(16) ··· 96 102 int mtl_dsp_ipc_get_window_offset(struct snd_sof_dev *sdev, u32 id); 97 103 98 104 void mtl_ipc_dump(struct snd_sof_dev *sdev); 99 - 100 - u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev, 101 - struct snd_soc_component *component, 102 - struct snd_pcm_substream *substream); 103 105 104 106 int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core); 105 107 int mtl_dsp_core_put(struct snd_sof_dev *sdev, int core);
+7 -4
sound/soc/sof/ipc4-mtrace.c
··· 4 4 5 5 #include <linux/debugfs.h> 6 6 #include <linux/sched/signal.h> 7 + #include <linux/sched/clock.h> 7 8 #include <sound/sof/ipc4/header.h> 8 9 #include "sof-priv.h" 9 10 #include "ipc4-priv.h" ··· 413 412 const struct sof_ipc_ops *iops = sdev->ipc->ops; 414 413 struct sof_ipc4_msg msg; 415 414 u64 system_time; 416 - ktime_t kt; 417 415 int ret; 418 416 419 417 if (priv->mtrace_state != SOF_MTRACE_DISABLED) ··· 424 424 msg.primary |= SOF_IPC4_MOD_INSTANCE(SOF_IPC4_MOD_INIT_BASEFW_INSTANCE_ID); 425 425 msg.extension = SOF_IPC4_MOD_EXT_MSG_PARAM_ID(SOF_IPC4_FW_PARAM_SYSTEM_TIME); 426 426 427 - /* The system time is in usec, UTC, epoch is 1601-01-01 00:00:00 */ 428 - kt = ktime_add_us(ktime_get_real(), FW_EPOCH_DELTA * USEC_PER_SEC); 429 - system_time = ktime_to_us(kt); 427 + /* 428 + * local_clock() is used to align with dmesg, so both kernel and firmware logs have 429 + * the same base and a minor delta due to the IPC. system time is in us format but 430 + * local_clock() returns the time in ns, so convert to ns. 431 + */ 432 + system_time = div64_u64(local_clock(), NSEC_PER_USEC); 430 433 msg.data_size = sizeof(system_time); 431 434 msg.data_ptr = &system_time; 432 435 ret = iops->set_get_data(sdev, &msg, msg.data_size, true);
+156 -37
sound/soc/sof/ipc4-pcm.c
··· 15 15 #include "ipc4-topology.h" 16 16 #include "ipc4-fw-reg.h" 17 17 18 + /** 19 + * struct sof_ipc4_timestamp_info - IPC4 timestamp info 20 + * @host_copier: the host copier of the pcm stream 21 + * @dai_copier: the dai copier of the pcm stream 22 + * @stream_start_offset: reported by fw in memory window (converted to frames) 23 + * @stream_end_offset: reported by fw in memory window (converted to frames) 24 + * @llp_offset: llp offset in memory window 25 + * @boundary: wrap boundary should be used for the LLP frame counter 26 + * @delay: Calculated and stored in pointer callback. The stored value is 27 + * returned in the delay callback. 28 + */ 29 + struct sof_ipc4_timestamp_info { 30 + struct sof_ipc4_copier *host_copier; 31 + struct sof_ipc4_copier *dai_copier; 32 + u64 stream_start_offset; 33 + u64 stream_end_offset; 34 + u32 llp_offset; 35 + 36 + u64 boundary; 37 + snd_pcm_sframes_t delay; 38 + }; 39 + 18 40 static int sof_ipc4_set_multi_pipeline_state(struct snd_sof_dev *sdev, u32 state, 19 41 struct ipc4_pipeline_set_state_data *trigger_list) 20 42 { ··· 445 423 } 446 424 447 425 /* return if this is the final state */ 448 - if (state == SOF_IPC4_PIPE_PAUSED) 426 + if (state == SOF_IPC4_PIPE_PAUSED) { 427 + struct sof_ipc4_timestamp_info *time_info; 428 + 429 + /* 430 + * Invalidate the stream_start_offset to make sure that it is 431 + * going to be updated if the stream resumes 432 + */ 433 + time_info = spcm->stream[substream->stream].private; 434 + if (time_info) 435 + time_info->stream_start_offset = SOF_IPC4_INVALID_STREAM_POSITION; 436 + 449 437 goto free; 438 + } 450 439 skip_pause_transition: 451 440 /* else set the RUNNING/RESET state in the DSP */ 452 441 ret = sof_ipc4_set_multi_pipeline_state(sdev, state, trigger_list); ··· 497 464 498 465 /* determine the pipeline state */ 499 466 switch (cmd) { 500 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 501 - state = SOF_IPC4_PIPE_PAUSED; 502 - break; 503 467 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 504 468 case SNDRV_PCM_TRIGGER_RESUME: 505 469 case SNDRV_PCM_TRIGGER_START: 506 470 state = SOF_IPC4_PIPE_RUNNING; 507 471 break; 472 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 508 473 case SNDRV_PCM_TRIGGER_SUSPEND: 509 474 case SNDRV_PCM_TRIGGER_STOP: 510 475 state = SOF_IPC4_PIPE_PAUSED; ··· 734 703 if (abi_version < SOF_IPC4_FW_REGS_ABI_VER) 735 704 support_info = false; 736 705 706 + /* For delay reporting the get_host_byte_counter callback is needed */ 707 + if (!sof_ops(sdev) || !sof_ops(sdev)->get_host_byte_counter) 708 + support_info = false; 709 + 737 710 for_each_pcm_streams(stream) { 738 711 pipeline_list = &spcm->stream[stream].pipeline_list; 739 712 ··· 870 835 struct sof_ipc4_copier *host_copier = time_info->host_copier; 871 836 struct sof_ipc4_copier *dai_copier = time_info->dai_copier; 872 837 struct sof_ipc4_pipeline_registers ppl_reg; 873 - u64 stream_start_position; 874 838 u32 dai_sample_size; 875 839 u32 ch, node_index; 876 840 u32 offset; ··· 886 852 if (ppl_reg.stream_start_offset == SOF_IPC4_INVALID_STREAM_POSITION) 887 853 return -EINVAL; 888 854 889 - stream_start_position = ppl_reg.stream_start_offset; 890 855 ch = dai_copier->data.out_format.fmt_cfg; 891 856 ch = SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT(ch); 892 857 dai_sample_size = (dai_copier->data.out_format.bit_depth >> 3) * ch; 893 - /* convert offset to sample count */ 894 - do_div(stream_start_position, dai_sample_size); 895 - time_info->stream_start_offset = stream_start_position; 858 + 859 + /* convert offsets to frame count */ 860 + time_info->stream_start_offset = ppl_reg.stream_start_offset; 861 + do_div(time_info->stream_start_offset, dai_sample_size); 862 + time_info->stream_end_offset = ppl_reg.stream_end_offset; 863 + do_div(time_info->stream_end_offset, dai_sample_size); 864 + 865 + /* 866 + * Calculate the wrap boundary need to be used for delay calculation 867 + * The host counter is in bytes, it will wrap earlier than the frames 868 + * based link counter. 869 + */ 870 + time_info->boundary = div64_u64(~((u64)0), 871 + frames_to_bytes(substream->runtime, 1)); 872 + /* Initialize the delay value to 0 (no delay) */ 873 + time_info->delay = 0; 896 874 897 875 return 0; 898 876 } 899 877 900 - static snd_pcm_sframes_t sof_ipc4_pcm_delay(struct snd_soc_component *component, 901 - struct snd_pcm_substream *substream) 878 + static int sof_ipc4_pcm_pointer(struct snd_soc_component *component, 879 + struct snd_pcm_substream *substream, 880 + snd_pcm_uframes_t *pointer) 902 881 { 903 882 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); 904 883 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 905 884 struct sof_ipc4_timestamp_info *time_info; 906 885 struct sof_ipc4_llp_reading_slot llp; 907 - snd_pcm_uframes_t head_ptr, tail_ptr; 886 + snd_pcm_uframes_t head_cnt, tail_cnt; 908 887 struct snd_sof_pcm_stream *stream; 888 + u64 dai_cnt, host_cnt, host_ptr; 909 889 struct snd_sof_pcm *spcm; 910 - u64 tmp_ptr; 911 890 int ret; 912 891 913 892 spcm = snd_sof_find_spcm_dai(component, rtd); 914 893 if (!spcm) 915 - return 0; 894 + return -EOPNOTSUPP; 916 895 917 896 stream = &spcm->stream[substream->stream]; 918 897 time_info = stream->private; 919 898 if (!time_info) 920 - return 0; 899 + return -EOPNOTSUPP; 921 900 922 901 /* 923 902 * stream_start_offset is updated to memory window by FW based on ··· 940 893 if (time_info->stream_start_offset == SOF_IPC4_INVALID_STREAM_POSITION) { 941 894 ret = sof_ipc4_get_stream_start_offset(sdev, substream, stream, time_info); 942 895 if (ret < 0) 943 - return 0; 896 + return -EOPNOTSUPP; 944 897 } 898 + 899 + /* For delay calculation we need the host counter */ 900 + host_cnt = snd_sof_pcm_get_host_byte_counter(sdev, component, substream); 901 + host_ptr = host_cnt; 902 + 903 + /* convert the host_cnt to frames */ 904 + host_cnt = div64_u64(host_cnt, frames_to_bytes(substream->runtime, 1)); 945 905 946 906 /* 947 - * HDaudio links don't support the LLP counter reported by firmware 948 - * the link position is read directly from hardware registers. 907 + * If the LLP counter is not reported by firmware in the SRAM window 908 + * then read the dai (link) counter via host accessible means if 909 + * available. 949 910 */ 950 911 if (!time_info->llp_offset) { 951 - tmp_ptr = snd_sof_pcm_get_stream_position(sdev, component, substream); 952 - if (!tmp_ptr) 953 - return 0; 912 + dai_cnt = snd_sof_pcm_get_dai_frame_counter(sdev, component, substream); 913 + if (!dai_cnt) 914 + return -EOPNOTSUPP; 954 915 } else { 955 916 sof_mailbox_read(sdev, time_info->llp_offset, &llp, sizeof(llp)); 956 - tmp_ptr = ((u64)llp.reading.llp_u << 32) | llp.reading.llp_l; 917 + dai_cnt = ((u64)llp.reading.llp_u << 32) | llp.reading.llp_l; 957 918 } 919 + dai_cnt += time_info->stream_end_offset; 958 920 959 - /* In two cases dai dma position is not accurate 921 + /* In two cases dai dma counter is not accurate 960 922 * (1) dai pipeline is started before host pipeline 961 - * (2) multiple streams mixed into one. Each stream has the same dai dma position 923 + * (2) multiple streams mixed into one. Each stream has the same dai dma 924 + * counter 962 925 * 963 - * Firmware calculates correct stream_start_offset for all cases including above two. 964 - * Driver subtracts stream_start_offset from dai dma position to get accurate one 926 + * Firmware calculates correct stream_start_offset for all cases 927 + * including above two. 928 + * Driver subtracts stream_start_offset from dai dma counter to get 929 + * accurate one 965 930 */ 966 - tmp_ptr -= time_info->stream_start_offset; 967 931 968 - /* Calculate the delay taking into account that both pointer can wrap */ 969 - div64_u64_rem(tmp_ptr, substream->runtime->boundary, &tmp_ptr); 970 - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 971 - head_ptr = substream->runtime->status->hw_ptr; 972 - tail_ptr = tmp_ptr; 932 + /* 933 + * On stream start the dai counter might not yet have reached the 934 + * stream_start_offset value which means that no frames have left the 935 + * DSP yet from the audio stream (on playback, capture streams have 936 + * offset of 0 as we start capturing right away). 937 + * In this case we need to adjust the distance between the counters by 938 + * increasing the host counter by (offset - dai_counter). 939 + * Otherwise the dai_counter needs to be adjusted to reflect the number 940 + * of valid frames passed on the DAI side. 941 + * 942 + * The delay is the difference between the counters on the two 943 + * sides of the DSP. 944 + */ 945 + if (dai_cnt < time_info->stream_start_offset) { 946 + host_cnt += time_info->stream_start_offset - dai_cnt; 947 + dai_cnt = 0; 973 948 } else { 974 - head_ptr = tmp_ptr; 975 - tail_ptr = substream->runtime->status->hw_ptr; 949 + dai_cnt -= time_info->stream_start_offset; 976 950 } 977 951 978 - if (head_ptr < tail_ptr) 979 - return substream->runtime->boundary - tail_ptr + head_ptr; 952 + /* Wrap the dai counter at the boundary where the host counter wraps */ 953 + div64_u64_rem(dai_cnt, time_info->boundary, &dai_cnt); 980 954 981 - return head_ptr - tail_ptr; 955 + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 956 + head_cnt = host_cnt; 957 + tail_cnt = dai_cnt; 958 + } else { 959 + head_cnt = dai_cnt; 960 + tail_cnt = host_cnt; 961 + } 962 + 963 + if (head_cnt < tail_cnt) { 964 + time_info->delay = time_info->boundary - tail_cnt + head_cnt; 965 + goto out; 966 + } 967 + 968 + time_info->delay = head_cnt - tail_cnt; 969 + 970 + out: 971 + /* 972 + * Convert the host byte counter to PCM pointer which wraps in buffer 973 + * and it is in frames 974 + */ 975 + div64_u64_rem(host_ptr, snd_pcm_lib_buffer_bytes(substream), &host_ptr); 976 + *pointer = bytes_to_frames(substream->runtime, host_ptr); 977 + 978 + return 0; 979 + } 980 + 981 + static snd_pcm_sframes_t sof_ipc4_pcm_delay(struct snd_soc_component *component, 982 + struct snd_pcm_substream *substream) 983 + { 984 + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 985 + struct sof_ipc4_timestamp_info *time_info; 986 + struct snd_sof_pcm_stream *stream; 987 + struct snd_sof_pcm *spcm; 988 + 989 + spcm = snd_sof_find_spcm_dai(component, rtd); 990 + if (!spcm) 991 + return 0; 992 + 993 + stream = &spcm->stream[substream->stream]; 994 + time_info = stream->private; 995 + /* 996 + * Report the stored delay value calculated in the pointer callback. 997 + * In the unlikely event that the calculation was skipped/aborted, the 998 + * default 0 delay returned. 999 + */ 1000 + if (time_info) 1001 + return time_info->delay; 1002 + 1003 + /* No delay information available, report 0 as delay */ 1004 + return 0; 1005 + 982 1006 } 983 1007 984 1008 const struct sof_ipc_pcm_ops ipc4_pcm_ops = { ··· 1059 941 .dai_link_fixup = sof_ipc4_pcm_dai_link_fixup, 1060 942 .pcm_setup = sof_ipc4_pcm_setup, 1061 943 .pcm_free = sof_ipc4_pcm_free, 944 + .pointer = sof_ipc4_pcm_pointer, 1062 945 .delay = sof_ipc4_pcm_delay, 1063 946 .ipc_first_on_start = true, 1064 947 .platform_stop_during_hw_free = true,
-14
sound/soc/sof/ipc4-priv.h
··· 92 92 struct mutex pipeline_state_mutex; /* protect pipeline triggers, ref counts and states */ 93 93 }; 94 94 95 - /** 96 - * struct sof_ipc4_timestamp_info - IPC4 timestamp info 97 - * @host_copier: the host copier of the pcm stream 98 - * @dai_copier: the dai copier of the pcm stream 99 - * @stream_start_offset: reported by fw in memory window 100 - * @llp_offset: llp offset in memory window 101 - */ 102 - struct sof_ipc4_timestamp_info { 103 - struct sof_ipc4_copier *host_copier; 104 - struct sof_ipc4_copier *dai_copier; 105 - u64 stream_start_offset; 106 - u32 llp_offset; 107 - }; 108 - 109 95 extern const struct sof_ipc_fw_loader_ops ipc4_loader_ops; 110 96 extern const struct sof_ipc_tplg_ops ipc4_tplg_ops; 111 97 extern const struct sof_ipc_tplg_control_ops tplg_ipc4_control_ops;
+21 -1
sound/soc/sof/ipc4-topology.c
··· 412 412 struct sof_ipc4_available_audio_format *available_fmt; 413 413 struct snd_soc_component *scomp = swidget->scomp; 414 414 struct sof_ipc4_copier *ipc4_copier; 415 + struct snd_sof_pcm *spcm; 415 416 int node_type = 0; 416 - int ret; 417 + int ret, dir; 417 418 418 419 ipc4_copier = kzalloc(sizeof(*ipc4_copier), GFP_KERNEL); 419 420 if (!ipc4_copier) ··· 447 446 goto free_available_fmt; 448 447 } 449 448 dev_dbg(scomp->dev, "host copier '%s' node_type %u\n", swidget->widget->name, node_type); 449 + 450 + spcm = snd_sof_find_spcm_comp(scomp, swidget->comp_id, &dir); 451 + if (!spcm) 452 + goto skip_gtw_cfg; 453 + 454 + if (dir == SNDRV_PCM_STREAM_PLAYBACK) { 455 + struct snd_sof_pcm_stream *sps = &spcm->stream[dir]; 456 + 457 + sof_update_ipc_object(scomp, &sps->dsp_max_burst_size_in_ms, 458 + SOF_COPIER_DEEP_BUFFER_TOKENS, 459 + swidget->tuples, 460 + swidget->num_tuples, sizeof(u32), 1); 461 + /* Set default DMA buffer size if it is not specified in topology */ 462 + if (!sps->dsp_max_burst_size_in_ms) 463 + sps->dsp_max_burst_size_in_ms = SOF_IPC4_MIN_DMA_BUFFER_SIZE; 464 + } else { 465 + /* Capture data is copied from DSP to host in 1ms bursts */ 466 + spcm->stream[dir].dsp_max_burst_size_in_ms = 1; 467 + } 450 468 451 469 skip_gtw_cfg: 452 470 ipc4_copier->gtw_attr = kzalloc(sizeof(*ipc4_copier->gtw_attr), GFP_KERNEL);
+19 -5
sound/soc/sof/ops.h
··· 523 523 return 0; 524 524 } 525 525 526 - static inline u64 snd_sof_pcm_get_stream_position(struct snd_sof_dev *sdev, 527 - struct snd_soc_component *component, 528 - struct snd_pcm_substream *substream) 526 + static inline u64 527 + snd_sof_pcm_get_dai_frame_counter(struct snd_sof_dev *sdev, 528 + struct snd_soc_component *component, 529 + struct snd_pcm_substream *substream) 529 530 { 530 - if (sof_ops(sdev) && sof_ops(sdev)->get_stream_position) 531 - return sof_ops(sdev)->get_stream_position(sdev, component, substream); 531 + if (sof_ops(sdev) && sof_ops(sdev)->get_dai_frame_counter) 532 + return sof_ops(sdev)->get_dai_frame_counter(sdev, component, 533 + substream); 534 + 535 + return 0; 536 + } 537 + 538 + static inline u64 539 + snd_sof_pcm_get_host_byte_counter(struct snd_sof_dev *sdev, 540 + struct snd_soc_component *component, 541 + struct snd_pcm_substream *substream) 542 + { 543 + if (sof_ops(sdev) && sof_ops(sdev)->get_host_byte_counter) 544 + return sof_ops(sdev)->get_host_byte_counter(sdev, component, 545 + substream); 532 546 533 547 return 0; 534 548 }
+8
sound/soc/sof/pcm.c
··· 388 388 { 389 389 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 390 390 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); 391 + const struct sof_ipc_pcm_ops *pcm_ops = sof_ipc_get_ops(sdev, pcm); 391 392 struct snd_sof_pcm *spcm; 392 393 snd_pcm_uframes_t host, dai; 394 + int ret = -EOPNOTSUPP; 393 395 394 396 /* nothing to do for BE */ 395 397 if (rtd->dai_link->no_pcm) 396 398 return 0; 399 + 400 + if (pcm_ops && pcm_ops->pointer) 401 + ret = pcm_ops->pointer(component, substream, &host); 402 + 403 + if (ret != -EOPNOTSUPP) 404 + return ret ? ret : host; 397 405 398 406 /* use dsp ops pointer callback directly if set */ 399 407 if (sof_ops(sdev)->pcm_pointer)
+8 -1
sound/soc/sof/sof-audio.h
··· 103 103 * additional memory in the SOF PCM stream structure 104 104 * @pcm_free: Function pointer for PCM free that can be used for freeing any 105 105 * additional memory in the SOF PCM stream structure 106 - * @delay: Function pointer for pcm delay calculation 106 + * @pointer: Function pointer for pcm pointer 107 + * Note: the @pointer callback may return -EOPNOTSUPP which should be 108 + * handled in a same way as if the callback is not provided 109 + * @delay: Function pointer for pcm delay reporting 107 110 * @reset_hw_params_during_stop: Flag indicating whether the hw_params should be reset during the 108 111 * STOP pcm trigger 109 112 * @ipc_first_on_start: Send IPC before invoking platform trigger during ··· 127 124 int (*dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); 128 125 int (*pcm_setup)(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm); 129 126 void (*pcm_free)(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm); 127 + int (*pointer)(struct snd_soc_component *component, 128 + struct snd_pcm_substream *substream, 129 + snd_pcm_uframes_t *pointer); 130 130 snd_pcm_sframes_t (*delay)(struct snd_soc_component *component, 131 131 struct snd_pcm_substream *substream); 132 132 bool reset_hw_params_during_stop; ··· 328 322 struct work_struct period_elapsed_work; 329 323 struct snd_soc_dapm_widget_list *list; /* list of connected DAPM widgets */ 330 324 bool d0i3_compatible; /* DSP can be in D0I3 when this pcm is opened */ 325 + unsigned int dsp_max_burst_size_in_ms; /* The maximum size of the host DMA burst in ms */ 331 326 /* 332 327 * flag to indicate that the DSP pipelines should be kept 333 328 * active or not while suspending the stream
+18 -6
sound/soc/sof/sof-priv.h
··· 262 262 int (*pcm_ack)(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream); /* optional */ 263 263 264 264 /* 265 - * optional callback to retrieve the link DMA position for the substream 266 - * when the position is not reported in the shared SRAM windows but 267 - * instead from a host-accessible hardware counter. 265 + * optional callback to retrieve the number of frames left/arrived from/to 266 + * the DSP on the DAI side (link/codec/DMIC/etc). 267 + * 268 + * The callback is used when the firmware does not provide this information 269 + * via the shared SRAM window and it can be retrieved by host. 268 270 */ 269 - u64 (*get_stream_position)(struct snd_sof_dev *sdev, 270 - struct snd_soc_component *component, 271 - struct snd_pcm_substream *substream); /* optional */ 271 + u64 (*get_dai_frame_counter)(struct snd_sof_dev *sdev, 272 + struct snd_soc_component *component, 273 + struct snd_pcm_substream *substream); /* optional */ 274 + 275 + /* 276 + * Optional callback to retrieve the number of bytes left/arrived from/to 277 + * the DSP on the host side (bytes between host ALSA buffer and DSP). 278 + * 279 + * The callback is needed for ALSA delay reporting. 280 + */ 281 + u64 (*get_host_byte_counter)(struct snd_sof_dev *sdev, 282 + struct snd_soc_component *component, 283 + struct snd_pcm_substream *substream); /* optional */ 272 284 273 285 /* host read DSP stream data */ 274 286 int (*ipc_msg_data)(struct snd_sof_dev *sdev,
+3 -3
sound/usb/line6/driver.c
··· 202 202 struct urb *urb; 203 203 204 204 /* create message: */ 205 - msg = kmalloc(sizeof(struct message), GFP_ATOMIC); 205 + msg = kzalloc(sizeof(struct message), GFP_ATOMIC); 206 206 if (msg == NULL) 207 207 return -ENOMEM; 208 208 ··· 688 688 int ret; 689 689 690 690 /* initialize USB buffers: */ 691 - line6->buffer_listen = kmalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL); 691 + line6->buffer_listen = kzalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL); 692 692 if (!line6->buffer_listen) 693 693 return -ENOMEM; 694 694 ··· 697 697 return -ENOMEM; 698 698 699 699 if (line6->properties->capabilities & LINE6_CAP_CONTROL_MIDI) { 700 - line6->buffer_message = kmalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL); 700 + line6->buffer_message = kzalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL); 701 701 if (!line6->buffer_message) 702 702 return -ENOMEM; 703 703