Skip to content

Commit 27f5186

Browse files
committed
Merge tag 'sound-6.18-rc6' 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, and nothing stands out. - A regression fix for HD-audio HDMI probe - USB-audio hardening patches for issues spotted by fuzzers - ASoC fixes for TAS278x, SoundWire and Cirrus - Usual HD-audio and USB-audio quirks" * tag 'sound-6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Add native DSD quirks for PureAudio DAC series ASoC: rsnd: fix OF node reference leak in rsnd_ssiu_probe() ALSA: hda/tas2781: Correct the wrong project ID ALSA: usb-audio: Fix NULL pointer dereference in snd_usb_mixer_controls_badd ASoC: SDCA: bug fix while parsing mipi-sdca-control-cn-list ALSA: usb-audio: Fix potential overflow of PCM transfer buffer ALSA: hda/tas2781: Add new quirk for HP new projects ASoC: tas2781: fix getting the wrong device number ASoC: codecs: va-macro: fix resource leak in probe error path ASoC: tas2783A: Fix issues in firmware parsing ASoC: sdw_utils: fix device reference leak in is_sdca_endpoint_present() ASoC: cs4271: Fix regulator leak on probe failure ALSA: hda/hdmi: Fix breakage at probing nvhdmi-mcp driver ASoC: da7213: Use component driver suspend/resume ALSA: usb-audio: add min_mute quirk for SteelSeries Arctis ASoC: doc: cs35l56: Update firmware filename description for B0 silicon
2 parents d4f8ccc + 21a9ab5 commit 27f5186

File tree

15 files changed

+125
-49
lines changed

15 files changed

+125
-49
lines changed

Documentation/sound/codecs/cs35l56.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ In this example the SSID is 10280c63.
105105

106106
The format of the firmware file names is:
107107

108-
SoundWire (except CS35L56 Rev B0):
108+
SoundWire:
109109
cs35lxx-b0-dsp1-misc-SSID[-spkidX]-l?u?
110110

111-
SoundWire CS35L56 Rev B0:
111+
SoundWire CS35L56 Rev B0 firmware released before kernel version 6.16:
112112
cs35lxx-b0-dsp1-misc-SSID[-spkidX]-ampN
113113

114114
Non-SoundWire (HDA and I2S):
@@ -127,9 +127,8 @@ Where:
127127
* spkidX is an optional part, used for laptops that have firmware
128128
configurations for different makes and models of internal speakers.
129129

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.
130+
Early firmware for CS35L56 Rev B0 used the ALSA prefix (ampN) as the
131+
filename qualifier. Support for the l?u? qualifier was added in kernel 6.16.
133132

134133
Sound Open Firmware and ALSA topology files
135134
-------------------------------------------

sound/hda/codecs/hdmi/nvhdmi-mcp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ static int nvhdmi_mcp_probe(struct hda_codec *codec,
350350
static const struct hda_codec_ops nvhdmi_mcp_codec_ops = {
351351
.probe = nvhdmi_mcp_probe,
352352
.remove = snd_hda_hdmi_simple_remove,
353-
.build_controls = nvhdmi_mcp_build_pcms,
354-
.build_pcms = nvhdmi_mcp_build_controls,
353+
.build_pcms = nvhdmi_mcp_build_pcms,
354+
.build_controls = nvhdmi_mcp_build_controls,
355355
.init = nvhdmi_mcp_init,
356356
.unsol_event = snd_hda_hdmi_simple_unsol_event,
357357
};

sound/hda/codecs/realtek/alc269.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6694,6 +6694,15 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
66946694
SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
66956695
SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
66966696
SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
6697+
SND_PCI_QUIRK(0x103c, 0x8ed5, "HP Merino13X", ALC245_FIXUP_TAS2781_SPI_2),
6698+
SND_PCI_QUIRK(0x103c, 0x8ed6, "HP Merino13", ALC245_FIXUP_TAS2781_SPI_2),
6699+
SND_PCI_QUIRK(0x103c, 0x8ed7, "HP Merino14", ALC245_FIXUP_TAS2781_SPI_2),
6700+
SND_PCI_QUIRK(0x103c, 0x8ed8, "HP Merino16", ALC245_FIXUP_TAS2781_SPI_2),
6701+
SND_PCI_QUIRK(0x103c, 0x8ed9, "HP Merino14W", ALC245_FIXUP_TAS2781_SPI_2),
6702+
SND_PCI_QUIRK(0x103c, 0x8eda, "HP Merino16W", ALC245_FIXUP_TAS2781_SPI_2),
6703+
SND_PCI_QUIRK(0x103c, 0x8f40, "HP Lampas14", ALC287_FIXUP_TXNW2781_I2C),
6704+
SND_PCI_QUIRK(0x103c, 0x8f41, "HP Lampas16", ALC287_FIXUP_TXNW2781_I2C),
6705+
SND_PCI_QUIRK(0x103c, 0x8f42, "HP LampasW14", ALC287_FIXUP_TXNW2781_I2C),
66976706
SND_PCI_QUIRK(0x1043, 0x1032, "ASUS VivoBook X513EA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
66986707
SND_PCI_QUIRK(0x1043, 0x1034, "ASUS GU605C", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
66996708
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),

sound/soc/codecs/cs4271.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,17 +581,17 @@ static int cs4271_component_probe(struct snd_soc_component *component)
581581

582582
ret = regcache_sync(cs4271->regmap);
583583
if (ret < 0)
584-
return ret;
584+
goto err_disable_regulator;
585585

586586
ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2,
587587
CS4271_MODE2_PDN | CS4271_MODE2_CPEN,
588588
CS4271_MODE2_PDN | CS4271_MODE2_CPEN);
589589
if (ret < 0)
590-
return ret;
590+
goto err_disable_regulator;
591591
ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2,
592592
CS4271_MODE2_PDN, 0);
593593
if (ret < 0)
594-
return ret;
594+
goto err_disable_regulator;
595595
/* Power-up sequence requires 85 uS */
596596
udelay(85);
597597

@@ -601,6 +601,10 @@ static int cs4271_component_probe(struct snd_soc_component *component)
601601
CS4271_MODE2_MUTECAEQUB);
602602

603603
return 0;
604+
605+
err_disable_regulator:
606+
regulator_bulk_disable(ARRAY_SIZE(cs4271->supplies), cs4271->supplies);
607+
return ret;
604608
}
605609

606610
static void cs4271_component_remove(struct snd_soc_component *component)

sound/soc/codecs/da7213.c

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,11 +2124,50 @@ static int da7213_probe(struct snd_soc_component *component)
21242124
return 0;
21252125
}
21262126

2127+
static int da7213_runtime_suspend(struct device *dev)
2128+
{
2129+
struct da7213_priv *da7213 = dev_get_drvdata(dev);
2130+
2131+
regcache_cache_only(da7213->regmap, true);
2132+
regcache_mark_dirty(da7213->regmap);
2133+
regulator_bulk_disable(DA7213_NUM_SUPPLIES, da7213->supplies);
2134+
2135+
return 0;
2136+
}
2137+
2138+
static int da7213_runtime_resume(struct device *dev)
2139+
{
2140+
struct da7213_priv *da7213 = dev_get_drvdata(dev);
2141+
int ret;
2142+
2143+
ret = regulator_bulk_enable(DA7213_NUM_SUPPLIES, da7213->supplies);
2144+
if (ret < 0)
2145+
return ret;
2146+
regcache_cache_only(da7213->regmap, false);
2147+
return regcache_sync(da7213->regmap);
2148+
}
2149+
2150+
static int da7213_suspend(struct snd_soc_component *component)
2151+
{
2152+
struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component);
2153+
2154+
return da7213_runtime_suspend(da7213->dev);
2155+
}
2156+
2157+
static int da7213_resume(struct snd_soc_component *component)
2158+
{
2159+
struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component);
2160+
2161+
return da7213_runtime_resume(da7213->dev);
2162+
}
2163+
21272164
static const struct snd_soc_component_driver soc_component_dev_da7213 = {
21282165
.probe = da7213_probe,
21292166
.set_bias_level = da7213_set_bias_level,
21302167
.controls = da7213_snd_controls,
21312168
.num_controls = ARRAY_SIZE(da7213_snd_controls),
2169+
.suspend = da7213_suspend,
2170+
.resume = da7213_resume,
21322171
.dapm_widgets = da7213_dapm_widgets,
21332172
.num_dapm_widgets = ARRAY_SIZE(da7213_dapm_widgets),
21342173
.dapm_routes = da7213_audio_map,
@@ -2175,6 +2214,8 @@ static int da7213_i2c_probe(struct i2c_client *i2c)
21752214
if (!da7213->fin_min_rate)
21762215
return -EINVAL;
21772216

2217+
da7213->dev = &i2c->dev;
2218+
21782219
i2c_set_clientdata(i2c, da7213);
21792220

21802221
/* Get required supplies */
@@ -2224,31 +2265,9 @@ static void da7213_i2c_remove(struct i2c_client *i2c)
22242265
pm_runtime_disable(&i2c->dev);
22252266
}
22262267

2227-
static int da7213_runtime_suspend(struct device *dev)
2228-
{
2229-
struct da7213_priv *da7213 = dev_get_drvdata(dev);
2230-
2231-
regcache_cache_only(da7213->regmap, true);
2232-
regcache_mark_dirty(da7213->regmap);
2233-
regulator_bulk_disable(DA7213_NUM_SUPPLIES, da7213->supplies);
2234-
2235-
return 0;
2236-
}
2237-
2238-
static int da7213_runtime_resume(struct device *dev)
2239-
{
2240-
struct da7213_priv *da7213 = dev_get_drvdata(dev);
2241-
int ret;
2242-
2243-
ret = regulator_bulk_enable(DA7213_NUM_SUPPLIES, da7213->supplies);
2244-
if (ret < 0)
2245-
return ret;
2246-
regcache_cache_only(da7213->regmap, false);
2247-
return regcache_sync(da7213->regmap);
2248-
}
2249-
2250-
static DEFINE_RUNTIME_DEV_PM_OPS(da7213_pm, da7213_runtime_suspend,
2251-
da7213_runtime_resume, NULL);
2268+
static const struct dev_pm_ops da7213_pm = {
2269+
RUNTIME_PM_OPS(da7213_runtime_suspend, da7213_runtime_resume, NULL)
2270+
};
22522271

22532272
static const struct i2c_device_id da7213_i2c_id[] = {
22542273
{ "da7213" },

sound/soc/codecs/da7213.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ enum da7213_supplies {
595595
/* Codec private data */
596596
struct da7213_priv {
597597
struct regmap *regmap;
598+
struct device *dev;
598599
struct mutex ctrl_lock;
599600
struct regulator_bulk_data supplies[DA7213_NUM_SUPPLIES];
600601
struct clk *mclk;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ static int va_macro_probe(struct platform_device *pdev)
16381638
if (ret)
16391639
goto err_clkout;
16401640

1641-
va->fsgen = clk_hw_get_clk(&va->hw, "fsgen");
1641+
va->fsgen = devm_clk_hw_get_clk(dev, &va->hw, "fsgen");
16421642
if (IS_ERR(va->fsgen)) {
16431643
ret = PTR_ERR(va->fsgen);
16441644
goto err_clkout;

sound/soc/codecs/tas2781-i2c.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,8 @@ static void tasdevice_parse_dt(struct tasdevice_priv *tas_priv)
19571957
{
19581958
struct i2c_client *client = (struct i2c_client *)tas_priv->client;
19591959
unsigned int dev_addrs[TASDEVICE_MAX_CHANNELS];
1960-
int i, ndev = 0;
1960+
int ndev = 0;
1961+
int i, rc;
19611962

19621963
if (tas_priv->isacpi) {
19631964
ndev = device_property_read_u32_array(&client->dev,
@@ -1968,8 +1969,12 @@ static void tasdevice_parse_dt(struct tasdevice_priv *tas_priv)
19681969
} else {
19691970
ndev = (ndev < ARRAY_SIZE(dev_addrs))
19701971
? ndev : ARRAY_SIZE(dev_addrs);
1971-
ndev = device_property_read_u32_array(&client->dev,
1972+
rc = device_property_read_u32_array(&client->dev,
19721973
"ti,audio-slots", dev_addrs, ndev);
1974+
if (rc != 0) {
1975+
ndev = 1;
1976+
dev_addrs[0] = client->addr;
1977+
}
19731978
}
19741979

19751980
tas_priv->irq =

sound/soc/codecs/tas2783-sdw.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,10 +762,17 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context)
762762
goto out;
763763
}
764764

765-
mutex_lock(&tas_dev->pde_lock);
766765
img_sz = fmw->size;
767766
buf = fmw->data;
768767
offset += FW_DL_OFFSET;
768+
if (offset >= (img_sz - FW_FL_HDR)) {
769+
dev_err(tas_dev->dev,
770+
"firmware is too small");
771+
ret = -EINVAL;
772+
goto out;
773+
}
774+
775+
mutex_lock(&tas_dev->pde_lock);
769776
while (offset < (img_sz - FW_FL_HDR)) {
770777
memset(&hdr, 0, sizeof(hdr));
771778
offset += read_header(&buf[offset], &hdr);
@@ -776,6 +783,14 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context)
776783
/* size also includes the header */
777784
file_blk_size = hdr.length - FW_FL_HDR;
778785

786+
/* make sure that enough data is there */
787+
if (offset + file_blk_size > img_sz) {
788+
ret = -EINVAL;
789+
dev_err(tas_dev->dev,
790+
"corrupt firmware file");
791+
break;
792+
}
793+
779794
switch (hdr.file_id) {
780795
case 0:
781796
ret = sdw_nwrite_no_pm(tas_dev->sdw_peripheral,
@@ -808,7 +823,8 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context)
808823
break;
809824
}
810825
mutex_unlock(&tas_dev->pde_lock);
811-
tas2783_update_calibdata(tas_dev);
826+
if (!ret)
827+
tas2783_update_calibdata(tas_dev);
812828

813829
out:
814830
if (!ret)

sound/soc/renesas/rcar/ssiu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ void rsnd_parse_connect_ssiu(struct rsnd_dai *rdai,
509509
int rsnd_ssiu_probe(struct rsnd_priv *priv)
510510
{
511511
struct device *dev = rsnd_priv_to_dev(priv);
512-
struct device_node *node;
512+
struct device_node *node __free(device_node) = rsnd_ssiu_of_node(priv);
513513
struct rsnd_ssiu *ssiu;
514514
struct rsnd_mod_ops *ops;
515515
const int *list = NULL;
@@ -522,7 +522,6 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv)
522522
* see
523523
* rsnd_ssiu_bufsif_to_id()
524524
*/
525-
node = rsnd_ssiu_of_node(priv);
526525
if (node)
527526
nr = rsnd_node_count(priv, node, SSIU_NAME);
528527
else

0 commit comments

Comments
 (0)