Skip to content

Commit 0eb0e27

Browse files
committed
Merge tag 'asoc-fix-v6.6-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.6 Quite a large collection of fixes, with numbers boosted by multiple vendors sending multi-patch serieses. Nothing super major, and also one device quirk.
2 parents 41b0747 + 31bb7bd commit 0eb0e27

File tree

26 files changed

+192
-113
lines changed

26 files changed

+192
-113
lines changed

drivers/firmware/cirrus/cs_dsp.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,15 +1863,15 @@ static int cs_dsp_adsp2_setup_algs(struct cs_dsp *dsp)
18631863
return PTR_ERR(adsp2_alg);
18641864

18651865
for (i = 0; i < n_algs; i++) {
1866-
cs_dsp_info(dsp,
1867-
"%d: ID %x v%d.%d.%d XM@%x YM@%x ZM@%x\n",
1868-
i, be32_to_cpu(adsp2_alg[i].alg.id),
1869-
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff0000) >> 16,
1870-
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff00) >> 8,
1871-
be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff,
1872-
be32_to_cpu(adsp2_alg[i].xm),
1873-
be32_to_cpu(adsp2_alg[i].ym),
1874-
be32_to_cpu(adsp2_alg[i].zm));
1866+
cs_dsp_dbg(dsp,
1867+
"%d: ID %x v%d.%d.%d XM@%x YM@%x ZM@%x\n",
1868+
i, be32_to_cpu(adsp2_alg[i].alg.id),
1869+
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff0000) >> 16,
1870+
(be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff00) >> 8,
1871+
be32_to_cpu(adsp2_alg[i].alg.ver) & 0xff,
1872+
be32_to_cpu(adsp2_alg[i].xm),
1873+
be32_to_cpu(adsp2_alg[i].ym),
1874+
be32_to_cpu(adsp2_alg[i].zm));
18751875

18761876
alg_region = cs_dsp_create_region(dsp, WMFW_ADSP2_XM,
18771877
adsp2_alg[i].alg.id,
@@ -1996,14 +1996,14 @@ static int cs_dsp_halo_setup_algs(struct cs_dsp *dsp)
19961996
return PTR_ERR(halo_alg);
19971997

19981998
for (i = 0; i < n_algs; i++) {
1999-
cs_dsp_info(dsp,
2000-
"%d: ID %x v%d.%d.%d XM@%x YM@%x\n",
2001-
i, be32_to_cpu(halo_alg[i].alg.id),
2002-
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff0000) >> 16,
2003-
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff00) >> 8,
2004-
be32_to_cpu(halo_alg[i].alg.ver) & 0xff,
2005-
be32_to_cpu(halo_alg[i].xm_base),
2006-
be32_to_cpu(halo_alg[i].ym_base));
1999+
cs_dsp_dbg(dsp,
2000+
"%d: ID %x v%d.%d.%d XM@%x YM@%x\n",
2001+
i, be32_to_cpu(halo_alg[i].alg.id),
2002+
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff0000) >> 16,
2003+
(be32_to_cpu(halo_alg[i].alg.ver) & 0xff00) >> 8,
2004+
be32_to_cpu(halo_alg[i].alg.ver) & 0xff,
2005+
be32_to_cpu(halo_alg[i].xm_base),
2006+
be32_to_cpu(halo_alg[i].ym_base));
20072007

20082008
ret = cs_dsp_halo_create_regions(dsp, halo_alg[i].alg.id,
20092009
halo_alg[i].alg.ver,

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,27 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
213213
DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
214214
}
215215
},
216+
{
217+
.driver_data = &acp6x_card,
218+
.matches = {
219+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
220+
DMI_MATCH(DMI_PRODUCT_NAME, "82QF"),
221+
}
222+
},
216223
{
217224
.driver_data = &acp6x_card,
218225
.matches = {
219226
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
220227
DMI_MATCH(DMI_PRODUCT_NAME, "82TL"),
221228
}
222229
},
230+
{
231+
.driver_data = &acp6x_card,
232+
.matches = {
233+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
234+
DMI_MATCH(DMI_PRODUCT_NAME, "82UG"),
235+
}
236+
},
223237
{
224238
.driver_data = &acp6x_card,
225239
.matches = {
@@ -262,6 +276,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
262276
DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"),
263277
}
264278
},
279+
{
280+
.driver_data = &acp6x_card,
281+
.matches = {
282+
DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."),
283+
DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 B7ED"),
284+
}
285+
},
265286
{
266287
.driver_data = &acp6x_card,
267288
.matches = {

sound/soc/codecs/aw88395/aw88395_lib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,13 @@ static int aw_dev_parse_reg_bin_with_hdr(struct aw_device *aw_dev,
452452
if ((aw_bin->all_bin_parse_num != 1) ||
453453
(aw_bin->header_info[0].bin_data_type != DATA_TYPE_REGISTER)) {
454454
dev_err(aw_dev->dev, "bin num or type error");
455+
ret = -EINVAL;
455456
goto parse_bin_failed;
456457
}
457458

458459
if (aw_bin->header_info[0].valid_data_len % 4) {
459460
dev_err(aw_dev->dev, "bin data len get error!");
461+
ret = -EINVAL;
460462
goto parse_bin_failed;
461463
}
462464

sound/soc/codecs/cs35l56-i2c.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ static int cs35l56_i2c_probe(struct i2c_client *client)
2727
return -ENOMEM;
2828

2929
cs35l56->base.dev = dev;
30-
cs35l56->base.can_hibernate = true;
3130

3231
i2c_set_clientdata(client, cs35l56);
3332
cs35l56->base.regmap = devm_regmap_init_i2c(client, regmap_config);

sound/soc/codecs/cs35l56.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,7 @@ void cs35l56_remove(struct cs35l56_private *cs35l56)
12071207
flush_workqueue(cs35l56->dsp_wq);
12081208
destroy_workqueue(cs35l56->dsp_wq);
12091209

1210+
pm_runtime_dont_use_autosuspend(cs35l56->base.dev);
12101211
pm_runtime_suspend(cs35l56->base.dev);
12111212
pm_runtime_disable(cs35l56->base.dev);
12121213

sound/soc/codecs/cs42l42-sdw.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,16 @@ static int cs42l42_sdw_update_status(struct sdw_slave *peripheral,
344344
switch (status) {
345345
case SDW_SLAVE_ATTACHED:
346346
dev_dbg(cs42l42->dev, "ATTACHED\n");
347+
348+
/*
349+
* The SoundWire core can report stale ATTACH notifications
350+
* if we hard-reset CS42L42 in probe() but it had already been
351+
* enumerated. Reject the ATTACH if we haven't yet seen an
352+
* UNATTACH report for the device being in reset.
353+
*/
354+
if (cs42l42->sdw_waiting_first_unattach)
355+
break;
356+
347357
/*
348358
* Initialise codec, this only needs to be done once.
349359
* When resuming from suspend, resume callback will handle re-init of codec,
@@ -354,6 +364,16 @@ static int cs42l42_sdw_update_status(struct sdw_slave *peripheral,
354364
break;
355365
case SDW_SLAVE_UNATTACHED:
356366
dev_dbg(cs42l42->dev, "UNATTACHED\n");
367+
368+
if (cs42l42->sdw_waiting_first_unattach) {
369+
/*
370+
* SoundWire core has seen that CS42L42 is not on
371+
* the bus so release RESET and wait for ATTACH.
372+
*/
373+
cs42l42->sdw_waiting_first_unattach = false;
374+
gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
375+
}
376+
357377
break;
358378
default:
359379
break;

sound/soc/codecs/cs42l42.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,26 @@ int cs42l42_common_probe(struct cs42l42_private *cs42l42,
23202320

23212321
if (cs42l42->reset_gpio) {
23222322
dev_dbg(cs42l42->dev, "Found reset GPIO\n");
2323-
gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
2323+
2324+
/*
2325+
* ACPI can override the default GPIO state we requested
2326+
* so ensure that we start with RESET low.
2327+
*/
2328+
gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
2329+
2330+
/* Ensure minimum reset pulse width */
2331+
usleep_range(10, 500);
2332+
2333+
/*
2334+
* On SoundWire keep the chip in reset until we get an UNATTACH
2335+
* notification from the SoundWire core. This acts as a
2336+
* synchronization point to reject stale ATTACH notifications
2337+
* if the chip was already enumerated before we reset it.
2338+
*/
2339+
if (cs42l42->sdw_peripheral)
2340+
cs42l42->sdw_waiting_first_unattach = true;
2341+
else
2342+
gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
23242343
}
23252344
usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);
23262345

sound/soc/codecs/cs42l42.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct cs42l42_private {
5353
u8 stream_use;
5454
bool hp_adc_up_pending;
5555
bool suspended;
56+
bool sdw_waiting_first_unattach;
5657
bool init_done;
5758
};
5859

sound/soc/codecs/cs42l43.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,8 @@ static const struct cs42l43_irq cs42l43_irqs[] = {
20772077

20782078
static int cs42l43_request_irq(struct cs42l43_codec *priv,
20792079
struct irq_domain *dom, const char * const name,
2080-
unsigned int irq, irq_handler_t handler)
2080+
unsigned int irq, irq_handler_t handler,
2081+
unsigned long flags)
20812082
{
20822083
int ret;
20832084

@@ -2087,8 +2088,8 @@ static int cs42l43_request_irq(struct cs42l43_codec *priv,
20872088

20882089
dev_dbg(priv->dev, "Request IRQ %d for %s\n", ret, name);
20892090

2090-
ret = devm_request_threaded_irq(priv->dev, ret, NULL, handler, IRQF_ONESHOT,
2091-
name, priv);
2091+
ret = devm_request_threaded_irq(priv->dev, ret, NULL, handler,
2092+
IRQF_ONESHOT | flags, name, priv);
20922093
if (ret)
20932094
return dev_err_probe(priv->dev, ret, "Failed to request IRQ %s\n", name);
20942095

@@ -2124,11 +2125,11 @@ static int cs42l43_shutter_irq(struct cs42l43_codec *priv,
21242125
return 0;
21252126
}
21262127

2127-
ret = cs42l43_request_irq(priv, dom, close_name, close_irq, handler);
2128+
ret = cs42l43_request_irq(priv, dom, close_name, close_irq, handler, IRQF_SHARED);
21282129
if (ret)
21292130
return ret;
21302131

2131-
return cs42l43_request_irq(priv, dom, open_name, open_irq, handler);
2132+
return cs42l43_request_irq(priv, dom, open_name, open_irq, handler, IRQF_SHARED);
21322133
}
21332134

21342135
static int cs42l43_codec_probe(struct platform_device *pdev)
@@ -2178,7 +2179,8 @@ static int cs42l43_codec_probe(struct platform_device *pdev)
21782179

21792180
for (i = 0; i < ARRAY_SIZE(cs42l43_irqs); i++) {
21802181
ret = cs42l43_request_irq(priv, dom, cs42l43_irqs[i].name,
2181-
cs42l43_irqs[i].irq, cs42l43_irqs[i].handler);
2182+
cs42l43_irqs[i].irq,
2183+
cs42l43_irqs[i].handler, 0);
21822184
if (ret)
21832185
goto err_pm;
21842186
}

sound/soc/codecs/rt5640.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,13 +2403,11 @@ static irqreturn_t rt5640_irq(int irq, void *data)
24032403
struct rt5640_priv *rt5640 = data;
24042404
int delay = 0;
24052405

2406-
if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) {
2407-
cancel_delayed_work_sync(&rt5640->jack_work);
2406+
if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER)
24082407
delay = 100;
2409-
}
24102408

24112409
if (rt5640->jack)
2412-
queue_delayed_work(system_long_wq, &rt5640->jack_work, delay);
2410+
mod_delayed_work(system_long_wq, &rt5640->jack_work, delay);
24132411

24142412
return IRQ_HANDLED;
24152413
}
@@ -2565,10 +2563,9 @@ static void rt5640_enable_jack_detect(struct snd_soc_component *component,
25652563
if (jack_data && jack_data->use_platform_clock)
25662564
rt5640->use_platform_clock = jack_data->use_platform_clock;
25672565

2568-
ret = devm_request_threaded_irq(component->dev, rt5640->irq,
2569-
NULL, rt5640_irq,
2570-
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
2571-
"rt5640", rt5640);
2566+
ret = request_irq(rt5640->irq, rt5640_irq,
2567+
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
2568+
"rt5640", rt5640);
25722569
if (ret) {
25732570
dev_warn(component->dev, "Failed to request IRQ %d: %d\n", rt5640->irq, ret);
25742571
rt5640_disable_jack_detect(component);
@@ -2621,14 +2618,14 @@ static void rt5640_enable_hda_jack_detect(
26212618

26222619
rt5640->jack = jack;
26232620

2624-
ret = devm_request_threaded_irq(component->dev, rt5640->irq,
2625-
NULL, rt5640_irq, IRQF_TRIGGER_RISING | IRQF_ONESHOT,
2626-
"rt5640", rt5640);
2621+
ret = request_irq(rt5640->irq, rt5640_irq,
2622+
IRQF_TRIGGER_RISING | IRQF_ONESHOT, "rt5640", rt5640);
26272623
if (ret) {
26282624
dev_warn(component->dev, "Failed to request IRQ %d: %d\n", rt5640->irq, ret);
2629-
rt5640->irq = -ENXIO;
2625+
rt5640->jack = NULL;
26302626
return;
26312627
}
2628+
rt5640->irq_requested = true;
26322629

26332630
/* sync initial jack state */
26342631
queue_delayed_work(system_long_wq, &rt5640->jack_work, 0);
@@ -2801,12 +2798,12 @@ static int rt5640_suspend(struct snd_soc_component *component)
28012798
{
28022799
struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
28032800

2804-
if (rt5640->irq) {
2801+
if (rt5640->jack) {
28052802
/* disable jack interrupts during system suspend */
28062803
disable_irq(rt5640->irq);
2804+
rt5640_cancel_work(rt5640);
28072805
}
28082806

2809-
rt5640_cancel_work(rt5640);
28102807
snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
28112808
rt5640_reset(component);
28122809
regcache_cache_only(rt5640->regmap, true);
@@ -2829,9 +2826,6 @@ static int rt5640_resume(struct snd_soc_component *component)
28292826
regcache_cache_only(rt5640->regmap, false);
28302827
regcache_sync(rt5640->regmap);
28312828

2832-
if (rt5640->irq)
2833-
enable_irq(rt5640->irq);
2834-
28352829
if (rt5640->jack) {
28362830
if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) {
28372831
snd_soc_component_update_bits(component,
@@ -2859,6 +2853,7 @@ static int rt5640_resume(struct snd_soc_component *component)
28592853
}
28602854
}
28612855

2856+
enable_irq(rt5640->irq);
28622857
queue_delayed_work(system_long_wq, &rt5640->jack_work, 0);
28632858
}
28642859

0 commit comments

Comments
 (0)