Skip to content

Commit 299f489

Browse files
committed
Merge tag 'sound-6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes. All changes are device-specific at this time: - Fixes for Cirrus codecs with SoundWire, including firmware name updates - Fix for i.MX8 SoC DSP - Usual HD-audio, USB-audio, and ASoC AMD quirks - Fixes for legendary SoundBlaster AWE32 ISA device (a real one, we still got a bug report after 25 years) - Minor build fixes" * tag 'sound-6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits) ALSA: hda/realtek: Enable headset Mic on Positivo P15X ASoC: Intel: sof-function-topology-lib: Print out the unsupported dmic count ASoC: doc: cs35l56: Add CS35L63 to the list of supported devices ASoC: SOF: imx8: add core shutdown operation for imx8/imx8x ALSA: hda/realtek: Add quirk for Asus GA605K ALSA: hda/realtek: enable headset mic on Latitude 5420 Rugged ASoC: amd: yc: update quirk data for HP Victus ASoC: apple: mca: Drop default ARCH_APPLE in Kconfig ALSA: usb-audio: Rename ALSA kcontrol PCM and PCM1 for the KTMicro sound card ASoC: amd: yc: Add quirk for MSI Bravo 17 D7VF internal mic ASoC: doc: cs35l56: Update to add new SoundWire firmware filename suffix ASoC: cs35l56: Use SoundWire address as alternate firmware suffix on L56 B0 ASoC: cs35l56: Use SoundWire address as firmware name suffix for new silicon ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present() ALSA: sb: Force to disable DMAs once when DMA mode is changed ALSA: sb: Don't allow changing the DMA mode during operations ALSA: hda/realtek: Add quirk for Asus GU605C ALSA: hda/realtek: Fix built-in mic on ASUS VivoBook X513EA ALSA: hda/realtek - Add mute LED support for HP Victus 16-s1xxx and HP Victus 15-fa1xxx ALSA: ctxfi: Replace deprecated strcpy() with strscpy() ...
2 parents d41fef1 + 33bdee1 commit 299f489

File tree

19 files changed

+207
-37
lines changed

19 files changed

+207
-37
lines changed

Documentation/sound/codecs/cs35l56.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. SPDX-License-Identifier: GPL-2.0-only
22
3-
=====================================================================
4-
Audio drivers for Cirrus Logic CS35L54/56/57 Boosted Smart Amplifiers
5-
=====================================================================
3+
========================================================================
4+
Audio drivers for Cirrus Logic CS35L54/56/57/63 Boosted Smart Amplifiers
5+
========================================================================
66
:Copyright: 2025 Cirrus Logic, Inc. and
77
Cirrus Logic International Semiconductor Ltd.
88

@@ -13,11 +13,11 @@ Summary
1313

1414
The high-level summary of this document is:
1515

16-
**If you have a laptop that uses CS35L54/56/57 amplifiers but audio is not
16+
**If you have a laptop that uses CS35L54/56/57/63 amplifiers but audio is not
1717
working, DO NOT ATTEMPT TO USE FIRMWARE AND SETTINGS FROM ANOTHER LAPTOP,
1818
EVEN IF THAT LAPTOP SEEMS SIMILAR.**
1919

20-
The CS35L54/56/57 amplifiers must be correctly configured for the power
20+
The CS35L54/56/57/63 amplifiers must be correctly configured for the power
2121
supply voltage, speaker impedance, maximum speaker voltage/current, and
2222
other external hardware connections.
2323

@@ -34,6 +34,7 @@ The cs35l56 drivers support:
3434
* CS35L54
3535
* CS35L56
3636
* CS35L57
37+
* CS35L63
3738

3839
There are two drivers in the kernel
3940

@@ -104,19 +105,32 @@ In this example the SSID is 10280c63.
104105

105106
The format of the firmware file names is:
106107

108+
SoundWire (except CS35L56 Rev B0):
109+
cs35lxx-b0-dsp1-misc-SSID[-spkidX]-l?u?
110+
111+
SoundWire CS35L56 Rev B0:
112+
cs35lxx-b0-dsp1-misc-SSID[-spkidX]-ampN
113+
114+
Non-SoundWire (HDA and I2S):
107115
cs35lxx-b0-dsp1-misc-SSID[-spkidX]-ampN
108116

109117
Where:
110118

111119
* cs35lxx-b0 is the amplifier model and silicon revision. This information
112120
is logged by the driver during initialization.
113121
* SSID is the 8-digit hexadecimal SSID value.
122+
* l?u? is the physical address on the SoundWire bus of the amp this
123+
file applies to.
114124
* ampN is the amplifier number (for example amp1). This is the same as
115125
the prefix on the ALSA control names except that it is always lower-case
116126
in the file name.
117127
* spkidX is an optional part, used for laptops that have firmware
118128
configurations for different makes and models of internal speakers.
119129

130+
The CS35L56 Rev B0 continues to use the old filename scheme because a
131+
large number of firmware files have already been published with these
132+
names.
133+
120134
Sound Open Firmware and ALSA topology files
121135
-------------------------------------------
122136

sound/isa/sb/sb16_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ static int snd_sb16_dma_control_put(struct snd_kcontrol *kcontrol, struct snd_ct
703703
unsigned char nval, oval;
704704
int change;
705705

706+
if (chip->mode & (SB_MODE_PLAYBACK | SB_MODE_CAPTURE))
707+
return -EBUSY;
708+
706709
nval = ucontrol->value.enumerated.item[0];
707710
if (nval > 2)
708711
return -EINVAL;
@@ -711,6 +714,10 @@ static int snd_sb16_dma_control_put(struct snd_kcontrol *kcontrol, struct snd_ct
711714
change = nval != oval;
712715
snd_sb16_set_dma_mode(chip, nval);
713716
spin_unlock_irqrestore(&chip->reg_lock, flags);
717+
if (change) {
718+
snd_dma_disable(chip->dma8);
719+
snd_dma_disable(chip->dma16);
720+
}
714721
return change;
715722
}
716723

sound/pci/ctxfi/xfi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
9898
if (err < 0)
9999
goto error;
100100

101-
strcpy(card->driver, "SB-XFi");
102-
strcpy(card->shortname, "Creative X-Fi");
101+
strscpy(card->driver, "SB-XFi");
102+
strscpy(card->shortname, "Creative X-Fi");
103103
snprintf(card->longname, sizeof(card->longname), "%s %s %s",
104104
card->shortname, atc->chip_name, atc->model_name);
105105

sound/pci/hda/hda_intel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,6 +2283,8 @@ static const struct snd_pci_quirk power_save_denylist[] = {
22832283
SND_PCI_QUIRK(0x1734, 0x1232, "KONTRON SinglePC", 0),
22842284
/* Dell ALC3271 */
22852285
SND_PCI_QUIRK(0x1028, 0x0962, "Dell ALC3271", 0),
2286+
/* https://bugzilla.kernel.org/show_bug.cgi?id=220210 */
2287+
SND_PCI_QUIRK(0x17aa, 0x5079, "Lenovo Thinkpad E15", 0),
22862288
{}
22872289
};
22882290

sound/pci/hda/patch_realtek.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8030,6 +8030,9 @@ enum {
80308030
ALC294_FIXUP_ASUS_CS35L41_SPI_2,
80318031
ALC274_FIXUP_HP_AIO_BIND_DACS,
80328032
ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2,
8033+
ALC285_FIXUP_ASUS_GA605K_HEADSET_MIC,
8034+
ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1,
8035+
ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC,
80338036
};
80348037

80358038
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -10414,6 +10417,26 @@ static const struct hda_fixup alc269_fixups[] = {
1041410417
.type = HDA_FIXUP_FUNC,
1041510418
.v.func = alc274_fixup_hp_aio_bind_dacs,
1041610419
},
10420+
[ALC285_FIXUP_ASUS_GA605K_HEADSET_MIC] = {
10421+
.type = HDA_FIXUP_PINS,
10422+
.v.pins = (const struct hda_pintbl[]) {
10423+
{ 0x19, 0x03a11050 },
10424+
{ 0x1b, 0x03a11c30 },
10425+
{ }
10426+
},
10427+
.chained = true,
10428+
.chain_id = ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1
10429+
},
10430+
[ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1] = {
10431+
.type = HDA_FIXUP_FUNC,
10432+
.v.func = alc285_fixup_speaker2_to_dac1,
10433+
},
10434+
[ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC] = {
10435+
.type = HDA_FIXUP_FUNC,
10436+
.v.func = alc269_fixup_limit_int_mic_boost,
10437+
.chained = true,
10438+
.chain_id = ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
10439+
},
1041710440
};
1041810441

1041910442
static const struct hda_quirk alc269_fixup_tbl[] = {
@@ -10509,6 +10532,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1050910532
SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
1051010533
SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
1051110534
SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
10535+
SND_PCI_QUIRK(0x1028, 0x0879, "Dell Latitude 5420 Rugged", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
1051210536
SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
1051310537
SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
1051410538
SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
@@ -10787,6 +10811,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1078710811
SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1078810812
SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
1078910813
SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10814+
SND_PCI_QUIRK(0x103c, 0x8bc8, "HP Victus 15-fa1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
1079010815
SND_PCI_QUIRK(0x103c, 0x8bcd, "HP Omen 16-xd0xxx", ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT),
1079110816
SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
1079210817
SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
@@ -10840,6 +10865,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1084010865
SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
1084110866
SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1084210867
SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10868+
SND_PCI_QUIRK(0x103c, 0x8c9c, "HP Victus 16-s1xxx (MB 8C9C)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
1084310869
SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
1084410870
SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
1084510871
SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
@@ -10904,6 +10930,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1090410930
SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
1090510931
SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
1090610932
SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
10933+
SND_PCI_QUIRK(0x1043, 0x1032, "ASUS VivoBook X513EA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10934+
SND_PCI_QUIRK(0x1043, 0x1034, "ASUS GU605C", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
1090710935
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
1090810936
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
1090910937
SND_PCI_QUIRK(0x1043, 0x1054, "ASUS G614FH/FM/FP", ALC287_FIXUP_CS35L41_I2C_2),
@@ -10932,6 +10960,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1093210960
SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
1093310961
SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
1093410962
SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
10963+
SND_PCI_QUIRK(0x1043, 0x1314, "ASUS GA605K", ALC285_FIXUP_ASUS_GA605K_HEADSET_MIC),
1093510964
SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
1093610965
SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
1093710966
SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
@@ -11384,6 +11413,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1138411413
SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1138511414
SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13),
1138611415
SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
11416+
SND_PCI_QUIRK(0x2782, 0x1407, "Positivo P15X", ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC),
1138711417
SND_PCI_QUIRK(0x2782, 0x1701, "Infinix Y4 Max", ALC269VC_FIXUP_INFINIX_Y4_MAX),
1138811418
SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX),
1138911419
SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
451451
DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VEK"),
452452
}
453453
},
454+
{
455+
.driver_data = &acp6x_card,
456+
.matches = {
457+
DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."),
458+
DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VF"),
459+
}
460+
},
454461
{
455462
.driver_data = &acp6x_card,
456463
.matches = {
@@ -514,6 +521,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
514521
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"),
515522
}
516523
},
524+
{
525+
.driver_data = &acp6x_card,
526+
.matches = {
527+
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
528+
DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb2xxx"),
529+
}
530+
},
517531
{
518532
.driver_data = &acp6x_card,
519533
.matches = {

sound/soc/apple/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ config SND_SOC_APPLE_MCA
22
tristate "Apple Silicon MCA driver"
33
depends on ARCH_APPLE || COMPILE_TEST
44
select SND_DMAENGINE_PCM
5-
default ARCH_APPLE
65
help
76
This option enables an ASoC platform driver for MCA peripherals found
87
on Apple Silicon SoCs.

sound/soc/codecs/cs35l56-sdw.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,15 @@ static const struct regmap_bus cs35l56_regmap_bus_sdw = {
238238
.val_format_endian_default = REGMAP_ENDIAN_BIG,
239239
};
240240

241-
static int cs35l56_sdw_set_cal_index(struct cs35l56_private *cs35l56)
241+
static int cs35l56_sdw_get_unique_id(struct cs35l56_private *cs35l56)
242242
{
243243
int ret;
244244

245-
/* SoundWire UniqueId is used to index the calibration array */
246245
ret = sdw_read_no_pm(cs35l56->sdw_peripheral, SDW_SCP_DEVID_0);
247246
if (ret < 0)
248247
return ret;
249248

250-
cs35l56->base.cal_index = ret & 0xf;
249+
cs35l56->sdw_unique_id = ret & 0xf;
251250

252251
return 0;
253252
}
@@ -259,11 +258,13 @@ static void cs35l56_sdw_init(struct sdw_slave *peripheral)
259258

260259
pm_runtime_get_noresume(cs35l56->base.dev);
261260

262-
if (cs35l56->base.cal_index < 0) {
263-
ret = cs35l56_sdw_set_cal_index(cs35l56);
264-
if (ret < 0)
265-
goto out;
266-
}
261+
ret = cs35l56_sdw_get_unique_id(cs35l56);
262+
if (ret)
263+
goto out;
264+
265+
/* SoundWire UniqueId is used to index the calibration array */
266+
if (cs35l56->base.cal_index < 0)
267+
cs35l56->base.cal_index = cs35l56->sdw_unique_id;
267268

268269
ret = cs35l56_init(cs35l56);
269270
if (ret < 0) {
@@ -587,6 +588,7 @@ static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_devi
587588

588589
cs35l56->base.dev = dev;
589590
cs35l56->sdw_peripheral = peripheral;
591+
cs35l56->sdw_link_num = peripheral->bus->link_id;
590592
INIT_WORK(&cs35l56->sdw_irq_work, cs35l56_sdw_irq_work);
591593

592594
dev_set_drvdata(dev, cs35l56);

sound/soc/codecs/cs35l56.c

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -706,17 +706,41 @@ static int cs35l56_write_cal(struct cs35l56_private *cs35l56)
706706
return ret;
707707
}
708708

709-
static void cs35l56_reinit_patch(struct cs35l56_private *cs35l56)
709+
static int cs35l56_dsp_download_and_power_up(struct cs35l56_private *cs35l56,
710+
bool load_firmware)
710711
{
711712
int ret;
712713

713-
/* Use wm_adsp to load and apply the firmware patch and coefficient files */
714-
ret = wm_adsp_power_up(&cs35l56->dsp, true);
714+
/*
715+
* Abort the first load if it didn't find the suffixed bins and
716+
* we have an alternate fallback suffix.
717+
*/
718+
cs35l56->dsp.bin_mandatory = (load_firmware && cs35l56->fallback_fw_suffix);
719+
720+
ret = wm_adsp_power_up(&cs35l56->dsp, load_firmware);
721+
if ((ret == -ENOENT) && cs35l56->dsp.bin_mandatory) {
722+
cs35l56->dsp.fwf_suffix = cs35l56->fallback_fw_suffix;
723+
cs35l56->fallback_fw_suffix = NULL;
724+
cs35l56->dsp.bin_mandatory = false;
725+
ret = wm_adsp_power_up(&cs35l56->dsp, load_firmware);
726+
}
727+
715728
if (ret) {
716-
dev_dbg(cs35l56->base.dev, "%s: wm_adsp_power_up ret %d\n", __func__, ret);
717-
return;
729+
dev_dbg(cs35l56->base.dev, "wm_adsp_power_up ret %d\n", ret);
730+
return ret;
718731
}
719732

733+
return 0;
734+
}
735+
736+
static void cs35l56_reinit_patch(struct cs35l56_private *cs35l56)
737+
{
738+
int ret;
739+
740+
ret = cs35l56_dsp_download_and_power_up(cs35l56, true);
741+
if (ret)
742+
return;
743+
720744
cs35l56_write_cal(cs35l56);
721745

722746
/* Always REINIT after applying patch or coefficients */
@@ -750,11 +774,9 @@ static void cs35l56_patch(struct cs35l56_private *cs35l56, bool firmware_missing
750774
* but only if firmware is missing. If firmware is already patched just
751775
* power-up wm_adsp without downloading firmware.
752776
*/
753-
ret = wm_adsp_power_up(&cs35l56->dsp, !!firmware_missing);
754-
if (ret) {
755-
dev_dbg(cs35l56->base.dev, "%s: wm_adsp_power_up ret %d\n", __func__, ret);
777+
ret = cs35l56_dsp_download_and_power_up(cs35l56, firmware_missing);
778+
if (ret)
756779
goto err;
757-
}
758780

759781
mutex_lock(&cs35l56->base.irq_lock);
760782

@@ -853,6 +875,34 @@ static void cs35l56_dsp_work(struct work_struct *work)
853875
pm_runtime_put_autosuspend(cs35l56->base.dev);
854876
}
855877

878+
static int cs35l56_set_fw_suffix(struct cs35l56_private *cs35l56)
879+
{
880+
if (cs35l56->dsp.fwf_suffix)
881+
return 0;
882+
883+
if (!cs35l56->sdw_peripheral)
884+
return 0;
885+
886+
cs35l56->dsp.fwf_suffix = devm_kasprintf(cs35l56->base.dev, GFP_KERNEL,
887+
"l%uu%u",
888+
cs35l56->sdw_link_num,
889+
cs35l56->sdw_unique_id);
890+
if (!cs35l56->dsp.fwf_suffix)
891+
return -ENOMEM;
892+
893+
/*
894+
* There are published firmware files for L56 B0 silicon using
895+
* the ALSA prefix as the filename suffix. Default to trying these
896+
* first, with the new name as an alternate.
897+
*/
898+
if ((cs35l56->base.type == 0x56) && (cs35l56->base.rev == 0xb0)) {
899+
cs35l56->fallback_fw_suffix = cs35l56->dsp.fwf_suffix;
900+
cs35l56->dsp.fwf_suffix = cs35l56->component->name_prefix;
901+
}
902+
903+
return 0;
904+
}
905+
856906
static int cs35l56_component_probe(struct snd_soc_component *component)
857907
{
858908
struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component);
@@ -892,6 +942,10 @@ static int cs35l56_component_probe(struct snd_soc_component *component)
892942
return -ENOMEM;
893943

894944
cs35l56->component = component;
945+
ret = cs35l56_set_fw_suffix(cs35l56);
946+
if (ret)
947+
return ret;
948+
895949
wm_adsp2_component_probe(&cs35l56->dsp, component);
896950

897951
debugfs_create_bool("init_done", 0444, debugfs_root, &cs35l56->base.init_done);

sound/soc/codecs/cs35l56.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct cs35l56_private {
3838
struct snd_soc_component *component;
3939
struct regulator_bulk_data supplies[CS35L56_NUM_BULK_SUPPLIES];
4040
struct sdw_slave *sdw_peripheral;
41+
const char *fallback_fw_suffix;
4142
struct work_struct sdw_irq_work;
4243
bool sdw_irq_no_unmask;
4344
bool soft_resetting;
@@ -52,6 +53,8 @@ struct cs35l56_private {
5253
bool tdm_mode;
5354
bool sysclk_set;
5455
u8 old_sdw_clock_scale;
56+
u8 sdw_link_num;
57+
u8 sdw_unique_id;
5558
};
5659

5760
extern const struct dev_pm_ops cs35l56_pm_ops_i2c_spi;

0 commit comments

Comments
 (0)