Skip to content

Commit 2d23096

Browse files
committed
Merge tag 'sound-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "At this time, the majority of changes are for pending ASoC fixes while a few usual HD-audio and USB-audio quirks are found. Almost all patches are small device-specific fixes, and nothing worrisome stands out, so far" * tag 'sound-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (37 commits) ALSA: hda/realtek: Add quirk for Clevo NP70PNP ALSA: hda: intel-dsp-config: Add RaptorLake PCI IDs ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook 845/865 G9 ALSA: usb-audio: Clear MIDI port active flag after draining ALSA: usb-audio: add mapping for MSI MAG X570S Torpedo MAX. ALSA: hda/i915: Fix one too many pci_dev_put() ALSA: hda/hdmi: add HDMI codec VID for Raptorlake-P ALSA: hda/hdmi: fix warning about PCM count when used with SOF sound/oss/dmasound: fix 'dmasound_setup' defined but not used firmware: cs_dsp: Fix overrun of unterminated control name string ASoC: codecs: Fix an error handling path in (rx|tx|va)_macro_probe() ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15 ASoC: Intel: sof_es8336: add a quirk for headset at mic1 port ASoC: Intel: sof_es8336: support a separate gpio to control headphone ASoC: Intel: sof_es8336: simplify speaker gpio naming ASoC: wm8731: Disable the regulator when probing fails ASoC: Intel: soc-acpi: correct device endpoints for max98373 ASoC: codecs: wcd934x: do not switch off SIDO Buck when codec is in use ASoC: SOF: topology: Fix memory leak in sof_control_load() ASoC: SOF: topology: cleanup dailinks on widget unload ...
2 parents 281b9d9 + 86222af commit 2d23096

35 files changed

+300
-177
lines changed

drivers/firmware/cirrus/cs_dsp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,7 @@ static int cs_dsp_create_control(struct cs_dsp *dsp,
955955
ctl->alg_region = *alg_region;
956956
if (subname && dsp->fw_ver >= 2) {
957957
ctl->subname_len = subname_len;
958-
ctl->subname = kmemdup(subname,
959-
strlen(subname) + 1, GFP_KERNEL);
958+
ctl->subname = kasprintf(GFP_KERNEL, "%.*s", subname_len, subname);
960959
if (!ctl->subname) {
961960
ret = -ENOMEM;
962961
goto err_ctl;

include/sound/soc-component.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ struct snd_soc_component_driver {
179179
struct snd_pcm_hw_params *params);
180180
bool use_dai_pcm_id; /* use DAI link PCM ID as PCM device number */
181181
int be_pcm_base; /* base device ID for all BE PCMs */
182+
183+
#ifdef CONFIG_DEBUG_FS
184+
const char *debugfs_prefix;
185+
#endif
182186
};
183187

184188
struct snd_soc_component {

sound/hda/hdac_i915.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,10 @@ static int i915_gfx_present(struct pci_dev *hdac_pci)
127127
display_dev = pci_get_class(class, display_dev);
128128

129129
if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL &&
130-
connectivity_check(display_dev, hdac_pci))
130+
connectivity_check(display_dev, hdac_pci)) {
131+
pci_dev_put(display_dev);
131132
match = true;
132-
133-
pci_dev_put(display_dev);
134-
133+
}
135134
} while (!match && display_dev);
136135

137136
return match;

sound/hda/intel-dsp-config.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,15 @@ static const struct config_entry config_table[] = {
424424
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
425425
.device = 0x54c8,
426426
},
427+
/* RaptorLake-P */
428+
{
429+
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
430+
.device = 0x51ca,
431+
},
432+
{
433+
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
434+
.device = 0x51cb,
435+
},
427436
#endif
428437

429438
};

sound/oss/dmasound/dmasound_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ void dmasound_deinit(void)
14281428
unregister_sound_dsp(sq_unit);
14291429
}
14301430

1431-
static int dmasound_setup(char *str)
1431+
static int __maybe_unused dmasound_setup(char *str)
14321432
{
14331433
int ints[6], size;
14341434

sound/pci/hda/patch_hdmi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ static int hdmi_find_pcm_slot(struct hdmi_spec *spec,
13951395

13961396
last_try:
13971397
/* the last try; check the empty slots in pins */
1398-
for (i = 0; i < spec->num_nids; i++) {
1398+
for (i = 0; i < spec->pcm_used; i++) {
13991399
if (!test_bit(i, &spec->pcm_bitmap))
14001400
return i;
14011401
}
@@ -2325,7 +2325,9 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
23252325
* dev_num is the device entry number in a pin
23262326
*/
23272327

2328-
if (codec->mst_no_extra_pcms)
2328+
if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms)
2329+
pcm_num = spec->num_cvts;
2330+
else if (codec->mst_no_extra_pcms)
23292331
pcm_num = spec->num_nids;
23302332
else
23312333
pcm_num = spec->num_nids + spec->dev_num - 1;
@@ -4551,6 +4553,7 @@ HDA_CODEC_ENTRY(0x80862819, "DG2 HDMI", patch_i915_adlp_hdmi),
45514553
HDA_CODEC_ENTRY(0x8086281a, "Jasperlake HDMI", patch_i915_icl_hdmi),
45524554
HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI", patch_i915_icl_hdmi),
45534555
HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_adlp_hdmi),
4556+
HDA_CODEC_ENTRY(0x8086281f, "Raptorlake-P HDMI", patch_i915_adlp_hdmi),
45544557
HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi),
45554558
HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi),
45564559
HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi),

sound/pci/hda/patch_realtek.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7006,6 +7006,7 @@ enum {
70067006
ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
70077007
ALC287_FIXUP_LEGION_16ACHG6,
70087008
ALC287_FIXUP_CS35L41_I2C_2,
7009+
ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
70097010
ALC245_FIXUP_CS35L41_SPI_2,
70107011
ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
70117012
ALC245_FIXUP_CS35L41_SPI_4,
@@ -8769,6 +8770,12 @@ static const struct hda_fixup alc269_fixups[] = {
87698770
.type = HDA_FIXUP_FUNC,
87708771
.v.func = cs35l41_fixup_i2c_two,
87718772
},
8773+
[ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
8774+
.type = HDA_FIXUP_FUNC,
8775+
.v.func = cs35l41_fixup_i2c_two,
8776+
.chained = true,
8777+
.chain_id = ALC285_FIXUP_HP_MUTE_LED,
8778+
},
87728779
[ALC245_FIXUP_CS35L41_SPI_2] = {
87738780
.type = HDA_FIXUP_FUNC,
87748781
.v.func = cs35l41_fixup_spi_two,
@@ -9025,9 +9032,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
90259032
SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
90269033
SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
90279034
SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9028-
SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
9035+
SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
90299036
SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
9030-
SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
9037+
SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
90319038
SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
90329039
SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
90339040
SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
@@ -9163,6 +9170,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
91639170
SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
91649171
SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91659172
SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9173+
SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91669174
SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91679175
SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91689176
SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),

sound/soc/atmel/sam9g20_wm8731.c

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,6 @@
4646
*/
4747
#undef ENABLE_MIC_INPUT
4848

49-
static struct clk *mclk;
50-
51-
static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card,
52-
struct snd_soc_dapm_context *dapm,
53-
enum snd_soc_bias_level level)
54-
{
55-
static int mclk_on;
56-
int ret = 0;
57-
58-
switch (level) {
59-
case SND_SOC_BIAS_ON:
60-
case SND_SOC_BIAS_PREPARE:
61-
if (!mclk_on)
62-
ret = clk_enable(mclk);
63-
if (ret == 0)
64-
mclk_on = 1;
65-
break;
66-
67-
case SND_SOC_BIAS_OFF:
68-
case SND_SOC_BIAS_STANDBY:
69-
if (mclk_on)
70-
clk_disable(mclk);
71-
mclk_on = 0;
72-
break;
73-
}
74-
75-
return ret;
76-
}
77-
7849
static const struct snd_soc_dapm_widget at91sam9g20ek_dapm_widgets[] = {
7950
SND_SOC_DAPM_MIC("Int Mic", NULL),
8051
SND_SOC_DAPM_SPK("Ext Spk", NULL),
@@ -135,7 +106,6 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
135106
.owner = THIS_MODULE,
136107
.dai_link = &at91sam9g20ek_dai,
137108
.num_links = 1,
138-
.set_bias_level = at91sam9g20ek_set_bias_level,
139109

140110
.dapm_widgets = at91sam9g20ek_dapm_widgets,
141111
.num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets),
@@ -148,7 +118,6 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
148118
{
149119
struct device_node *np = pdev->dev.of_node;
150120
struct device_node *codec_np, *cpu_np;
151-
struct clk *pllb;
152121
struct snd_soc_card *card = &snd_soc_at91sam9g20ek;
153122
int ret;
154123

@@ -162,31 +131,6 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
162131
return -EINVAL;
163132
}
164133

165-
/*
166-
* Codec MCLK is supplied by PCK0 - set it up.
167-
*/
168-
mclk = clk_get(NULL, "pck0");
169-
if (IS_ERR(mclk)) {
170-
dev_err(&pdev->dev, "Failed to get MCLK\n");
171-
ret = PTR_ERR(mclk);
172-
goto err;
173-
}
174-
175-
pllb = clk_get(NULL, "pllb");
176-
if (IS_ERR(pllb)) {
177-
dev_err(&pdev->dev, "Failed to get PLLB\n");
178-
ret = PTR_ERR(pllb);
179-
goto err_mclk;
180-
}
181-
ret = clk_set_parent(mclk, pllb);
182-
clk_put(pllb);
183-
if (ret != 0) {
184-
dev_err(&pdev->dev, "Failed to set MCLK parent\n");
185-
goto err_mclk;
186-
}
187-
188-
clk_set_rate(mclk, MCLK_RATE);
189-
190134
card->dev = &pdev->dev;
191135

192136
/* Parse device node info */
@@ -230,9 +174,6 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
230174

231175
return ret;
232176

233-
err_mclk:
234-
clk_put(mclk);
235-
mclk = NULL;
236177
err:
237178
atmel_ssc_put_audio(0);
238179
return ret;
@@ -242,8 +183,6 @@ static int at91sam9g20ek_audio_remove(struct platform_device *pdev)
242183
{
243184
struct snd_soc_card *card = platform_get_drvdata(pdev);
244185

245-
clk_disable(mclk);
246-
mclk = NULL;
247186
snd_soc_unregister_card(card);
248187
atmel_ssc_put_audio(0);
249188

sound/soc/codecs/cs35l41-lib.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,21 +822,23 @@ int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
822822
word_offset = otp_map_match->word_offset;
823823

824824
for (i = 0; i < otp_map_match->num_elements; i++) {
825-
dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d\n",
826-
bit_offset, word_offset, bit_sum % 32);
825+
dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d otp_map[i].size = %d\n",
826+
bit_offset, word_offset, bit_sum % 32, otp_map[i].size);
827827
if (bit_offset + otp_map[i].size - 1 >= 32) {
828828
otp_val = (otp_mem[word_offset] &
829829
GENMASK(31, bit_offset)) >> bit_offset;
830830
otp_val |= (otp_mem[++word_offset] &
831831
GENMASK(bit_offset + otp_map[i].size - 33, 0)) <<
832832
(32 - bit_offset);
833833
bit_offset += otp_map[i].size - 32;
834-
} else {
834+
} else if (bit_offset + otp_map[i].size - 1 >= 0) {
835835
otp_val = (otp_mem[word_offset] &
836836
GENMASK(bit_offset + otp_map[i].size - 1, bit_offset)
837837
) >> bit_offset;
838838
bit_offset += otp_map[i].size;
839-
}
839+
} else /* both bit_offset and otp_map[i].size are 0 */
840+
otp_val = 0;
841+
840842
bit_sum += otp_map[i].size;
841843

842844
if (bit_offset == 32) {

sound/soc/codecs/lpass-rx-macro.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,12 +3566,16 @@ static int rx_macro_probe(struct platform_device *pdev)
35663566
return PTR_ERR(rx->pds);
35673567

35683568
base = devm_platform_ioremap_resource(pdev, 0);
3569-
if (IS_ERR(base))
3570-
return PTR_ERR(base);
3569+
if (IS_ERR(base)) {
3570+
ret = PTR_ERR(base);
3571+
goto err;
3572+
}
35713573

35723574
rx->regmap = devm_regmap_init_mmio(dev, base, &rx_regmap_config);
3573-
if (IS_ERR(rx->regmap))
3574-
return PTR_ERR(rx->regmap);
3575+
if (IS_ERR(rx->regmap)) {
3576+
ret = PTR_ERR(rx->regmap);
3577+
goto err;
3578+
}
35753579

35763580
dev_set_drvdata(dev, rx);
35773581

@@ -3632,6 +3636,8 @@ static int rx_macro_probe(struct platform_device *pdev)
36323636
err_dcodec:
36333637
clk_disable_unprepare(rx->macro);
36343638
err:
3639+
lpass_macro_pds_exit(rx->pds);
3640+
36353641
return ret;
36363642
}
36373643

0 commit comments

Comments
 (0)