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.

ASoC: Merge up fixes

There is some overlap with the cs4271 driver.

+82 -38
+4 -5
Documentation/sound/codecs/cs35l56.rst
··· 105 105 106 106 The format of the firmware file names is: 107 107 108 - SoundWire (except CS35L56 Rev B0): 108 + SoundWire: 109 109 cs35lxx-b0-dsp1-misc-SSID[-spkidX]-l?u? 110 110 111 - SoundWire CS35L56 Rev B0: 111 + SoundWire CS35L56 Rev B0 firmware released before kernel version 6.16: 112 112 cs35lxx-b0-dsp1-misc-SSID[-spkidX]-ampN 113 113 114 114 Non-SoundWire (HDA and I2S): ··· 127 127 * spkidX is an optional part, used for laptops that have firmware 128 128 configurations for different makes and models of internal speakers. 129 129 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. 133 132 134 133 Sound Open Firmware and ALSA topology files 135 134 -------------------------------------------
+1
sound/soc/codecs/cs4271.c
··· 603 603 CS4271_MODE2_PDN | CS4271_MODE2_CPEN); 604 604 if (ret < 0) 605 605 goto err_disable_clk; 606 + 606 607 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, 607 608 CS4271_MODE2_PDN, 0); 608 609 if (ret < 0)
+44 -25
sound/soc/codecs/da7213.c
··· 2124 2124 return 0; 2125 2125 } 2126 2126 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 + 2127 2164 static const struct snd_soc_component_driver soc_component_dev_da7213 = { 2128 2165 .probe = da7213_probe, 2129 2166 .set_bias_level = da7213_set_bias_level, 2130 2167 .controls = da7213_snd_controls, 2131 2168 .num_controls = ARRAY_SIZE(da7213_snd_controls), 2169 + .suspend = da7213_suspend, 2170 + .resume = da7213_resume, 2132 2171 .dapm_widgets = da7213_dapm_widgets, 2133 2172 .num_dapm_widgets = ARRAY_SIZE(da7213_dapm_widgets), 2134 2173 .dapm_routes = da7213_audio_map, ··· 2213 2174 da7213->fin_min_rate = (uintptr_t)i2c_get_match_data(i2c); 2214 2175 if (!da7213->fin_min_rate) 2215 2176 return -EINVAL; 2177 + 2178 + da7213->dev = &i2c->dev; 2216 2179 2217 2180 i2c_set_clientdata(i2c, da7213); 2218 2181 ··· 2265 2224 pm_runtime_disable(&i2c->dev); 2266 2225 } 2267 2226 2268 - static int da7213_runtime_suspend(struct device *dev) 2269 - { 2270 - struct da7213_priv *da7213 = dev_get_drvdata(dev); 2271 - 2272 - regcache_cache_only(da7213->regmap, true); 2273 - regcache_mark_dirty(da7213->regmap); 2274 - regulator_bulk_disable(DA7213_NUM_SUPPLIES, da7213->supplies); 2275 - 2276 - return 0; 2277 - } 2278 - 2279 - static int da7213_runtime_resume(struct device *dev) 2280 - { 2281 - struct da7213_priv *da7213 = dev_get_drvdata(dev); 2282 - int ret; 2283 - 2284 - ret = regulator_bulk_enable(DA7213_NUM_SUPPLIES, da7213->supplies); 2285 - if (ret < 0) 2286 - return ret; 2287 - regcache_cache_only(da7213->regmap, false); 2288 - return regcache_sync(da7213->regmap); 2289 - } 2290 - 2291 - static DEFINE_RUNTIME_DEV_PM_OPS(da7213_pm, da7213_runtime_suspend, 2292 - da7213_runtime_resume, NULL); 2227 + static const struct dev_pm_ops da7213_pm = { 2228 + RUNTIME_PM_OPS(da7213_runtime_suspend, da7213_runtime_resume, NULL) 2229 + }; 2293 2230 2294 2231 static const struct i2c_device_id da7213_i2c_id[] = { 2295 2232 { "da7213" },
+1
sound/soc/codecs/da7213.h
··· 595 595 /* Codec private data */ 596 596 struct da7213_priv { 597 597 struct regmap *regmap; 598 + struct device *dev; 598 599 struct mutex ctrl_lock; 599 600 struct regulator_bulk_data supplies[DA7213_NUM_SUPPLIES]; 600 601 struct clk *mclk;
+18 -2
sound/soc/codecs/tas2783-sdw.c
··· 761 761 goto out; 762 762 } 763 763 764 - mutex_lock(&tas_dev->pde_lock); 765 764 img_sz = fmw->size; 766 765 buf = fmw->data; 767 766 offset += FW_DL_OFFSET; 767 + if (offset >= (img_sz - FW_FL_HDR)) { 768 + dev_err(tas_dev->dev, 769 + "firmware is too small"); 770 + ret = -EINVAL; 771 + goto out; 772 + } 773 + 774 + mutex_lock(&tas_dev->pde_lock); 768 775 while (offset < (img_sz - FW_FL_HDR)) { 769 776 memset(&hdr, 0, sizeof(hdr)); 770 777 offset += read_header(&buf[offset], &hdr); ··· 781 774 hdr.length, offset); 782 775 /* size also includes the header */ 783 776 file_blk_size = hdr.length - FW_FL_HDR; 777 + 778 + /* make sure that enough data is there */ 779 + if (offset + file_blk_size > img_sz) { 780 + ret = -EINVAL; 781 + dev_err(tas_dev->dev, 782 + "corrupt firmware file"); 783 + break; 784 + } 784 785 785 786 switch (hdr.file_id) { 786 787 case 0: ··· 822 807 break; 823 808 } 824 809 mutex_unlock(&tas_dev->pde_lock); 825 - tas2783_update_calibdata(tas_dev); 810 + if (!ret) 811 + tas2783_update_calibdata(tas_dev); 826 812 827 813 out: 828 814 if (!ret)
+14 -6
sound/soc/sdw_utils/soc_sdw_utils.c
··· 1335 1335 struct sdw_slave *slave; 1336 1336 struct device *sdw_dev; 1337 1337 const char *sdw_codec_name; 1338 - int i; 1338 + int ret, i; 1339 1339 1340 1340 dlc = kzalloc(sizeof(*dlc), GFP_KERNEL); 1341 1341 if (!dlc) ··· 1365 1365 } 1366 1366 1367 1367 slave = dev_to_sdw_dev(sdw_dev); 1368 - if (!slave) 1369 - return -EINVAL; 1368 + if (!slave) { 1369 + ret = -EINVAL; 1370 + goto put_device; 1371 + } 1370 1372 1371 1373 /* Make sure BIOS provides SDCA properties */ 1372 1374 if (!slave->sdca_data.interface_revision) { 1373 1375 dev_warn(&slave->dev, "SDCA properties not found in the BIOS\n"); 1374 - return 1; 1376 + ret = 1; 1377 + goto put_device; 1375 1378 } 1376 1379 1377 1380 for (i = 0; i < slave->sdca_data.num_functions; i++) { ··· 1383 1380 if (dai_type == dai_info->dai_type) { 1384 1381 dev_dbg(&slave->dev, "DAI type %d sdca function %s found\n", 1385 1382 dai_type, slave->sdca_data.function[i].name); 1386 - return 1; 1383 + ret = 1; 1384 + goto put_device; 1387 1385 } 1388 1386 } 1389 1387 ··· 1392 1388 "SDCA device function for DAI type %d not supported, skip endpoint\n", 1393 1389 dai_info->dai_type); 1394 1390 1395 - return 0; 1391 + ret = 0; 1392 + 1393 + put_device: 1394 + put_device(sdw_dev); 1395 + return ret; 1396 1396 } 1397 1397 1398 1398 int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,