Skip to content

Commit 17c6a0c

Browse files
committed
Merge tag 'asoc-fix-v6.8-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.8 A few small fixes, some driver specific and one slightly larger one from Richard which adds a new core helper and updates a small clutch of drivers to deal with the fact that they were using a helper which requires that the lock for the list of controls without holding that lock. We also have some quirks for new AMD based Lenovo systems.
2 parents b34bf65 + ed00a69 commit 17c6a0c

File tree

9 files changed

+54
-6
lines changed

9 files changed

+54
-6
lines changed

include/sound/soc-card.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ static inline void snd_soc_card_mutex_unlock(struct snd_soc_card *card)
3030

3131
struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
3232
const char *name);
33+
struct snd_kcontrol *snd_soc_card_get_kcontrol_locked(struct snd_soc_card *soc_card,
34+
const char *name);
3335
int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
3436
struct snd_soc_jack *jack);
3537
int snd_soc_card_jack_new_pins(struct snd_soc_card *card, const char *id,

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,20 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
199199
DMI_MATCH(DMI_PRODUCT_NAME, "21HY"),
200200
}
201201
},
202+
{
203+
.driver_data = &acp6x_card,
204+
.matches = {
205+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
206+
DMI_MATCH(DMI_PRODUCT_NAME, "21J2"),
207+
}
208+
},
209+
{
210+
.driver_data = &acp6x_card,
211+
.matches = {
212+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
213+
DMI_MATCH(DMI_PRODUCT_NAME, "21J0"),
214+
}
215+
},
202216
{
203217
.driver_data = &acp6x_card,
204218
.matches = {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ static int snd_acp6x_probe(struct pci_dev *pci,
162162
/* Yellow Carp device check */
163163
switch (pci->revision) {
164164
case 0x60:
165+
case 0x63:
165166
case 0x6f:
166167
break;
167168
default:

sound/soc/codecs/cs35l45.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static int cs35l45_activate_ctl(struct snd_soc_component *component,
184184
else
185185
snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s", ctl_name);
186186

187-
kcontrol = snd_soc_card_get_kcontrol(component->card, name);
187+
kcontrol = snd_soc_card_get_kcontrol_locked(component->card, name);
188188
if (!kcontrol) {
189189
dev_err(component->dev, "Can't find kcontrol %s\n", name);
190190
return -EINVAL;

sound/soc/codecs/cs35l56-shared.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ void cs35l56_wait_min_reset_pulse(void)
335335
EXPORT_SYMBOL_NS_GPL(cs35l56_wait_min_reset_pulse, SND_SOC_CS35L56_SHARED);
336336

337337
static const struct reg_sequence cs35l56_system_reset_seq[] = {
338+
REG_SEQ0(CS35L56_DSP1_HALO_STATE, 0),
338339
REG_SEQ0(CS35L56_DSP_VIRTUAL1_MBOX_1, CS35L56_MBOX_CMD_SYSTEM_RESET),
339340
};
340341

sound/soc/codecs/cs35l56.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int cs35l56_sync_asp1_mixer_widgets_with_firmware(struct cs35l56_private
114114
name = full_name;
115115
}
116116

117-
kcontrol = snd_soc_card_get_kcontrol(dapm->card, name);
117+
kcontrol = snd_soc_card_get_kcontrol_locked(dapm->card, name);
118118
if (!kcontrol) {
119119
dev_warn(cs35l56->base.dev, "Could not find control %s\n", name);
120120
continue;

sound/soc/fsl/fsl_xcvr.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ static int fsl_xcvr_activate_ctl(struct snd_soc_dai *dai, const char *name,
174174
struct snd_kcontrol *kctl;
175175
bool enabled;
176176

177-
kctl = snd_soc_card_get_kcontrol(card, name);
177+
lockdep_assert_held(&card->snd_card->controls_rwsem);
178+
179+
kctl = snd_soc_card_get_kcontrol_locked(card, name);
178180
if (kctl == NULL)
179181
return -ENOENT;
180182

@@ -576,10 +578,14 @@ static int fsl_xcvr_startup(struct snd_pcm_substream *substream,
576578
xcvr->streams |= BIT(substream->stream);
577579

578580
if (!xcvr->soc_data->spdif_only) {
581+
struct snd_soc_card *card = dai->component->card;
582+
579583
/* Disable XCVR controls if there is stream started */
584+
down_read(&card->snd_card->controls_rwsem);
580585
fsl_xcvr_activate_ctl(dai, fsl_xcvr_mode_kctl.name, false);
581586
fsl_xcvr_activate_ctl(dai, fsl_xcvr_arc_mode_kctl.name, false);
582587
fsl_xcvr_activate_ctl(dai, fsl_xcvr_earc_capds_kctl.name, false);
588+
up_read(&card->snd_card->controls_rwsem);
583589
}
584590

585591
return 0;
@@ -598,11 +604,15 @@ static void fsl_xcvr_shutdown(struct snd_pcm_substream *substream,
598604
/* Enable XCVR controls if there is no stream started */
599605
if (!xcvr->streams) {
600606
if (!xcvr->soc_data->spdif_only) {
607+
struct snd_soc_card *card = dai->component->card;
608+
609+
down_read(&card->snd_card->controls_rwsem);
601610
fsl_xcvr_activate_ctl(dai, fsl_xcvr_mode_kctl.name, true);
602611
fsl_xcvr_activate_ctl(dai, fsl_xcvr_arc_mode_kctl.name,
603612
(xcvr->mode == FSL_XCVR_MODE_ARC));
604613
fsl_xcvr_activate_ctl(dai, fsl_xcvr_earc_capds_kctl.name,
605614
(xcvr->mode == FSL_XCVR_MODE_EARC));
615+
up_read(&card->snd_card->controls_rwsem);
606616
}
607617
ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_IER0,
608618
FSL_XCVR_IRQ_EARC_ALL, 0);

sound/soc/qcom/lpass-cdc-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static int lpass_cdc_dma_daiops_trigger(struct snd_pcm_substream *substream,
259259
int cmd, struct snd_soc_dai *dai)
260260
{
261261
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
262-
struct lpaif_dmactl *dmactl;
262+
struct lpaif_dmactl *dmactl = NULL;
263263
int ret = 0, id;
264264

265265
switch (cmd) {

sound/soc/soc-card.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// Copyright (C) 2019 Renesas Electronics Corp.
66
// Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
77
//
8+
9+
#include <linux/lockdep.h>
10+
#include <linux/rwsem.h>
811
#include <sound/soc.h>
912
#include <sound/jack.h>
1013

@@ -26,12 +29,15 @@ static inline int _soc_card_ret(struct snd_soc_card *card,
2629
return ret;
2730
}
2831

29-
struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
30-
const char *name)
32+
struct snd_kcontrol *snd_soc_card_get_kcontrol_locked(struct snd_soc_card *soc_card,
33+
const char *name)
3134
{
3235
struct snd_card *card = soc_card->snd_card;
3336
struct snd_kcontrol *kctl;
3437

38+
/* must be held read or write */
39+
lockdep_assert_held(&card->controls_rwsem);
40+
3541
if (unlikely(!name))
3642
return NULL;
3743

@@ -40,6 +46,20 @@ struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
4046
return kctl;
4147
return NULL;
4248
}
49+
EXPORT_SYMBOL_GPL(snd_soc_card_get_kcontrol_locked);
50+
51+
struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
52+
const char *name)
53+
{
54+
struct snd_card *card = soc_card->snd_card;
55+
struct snd_kcontrol *kctl;
56+
57+
down_read(&card->controls_rwsem);
58+
kctl = snd_soc_card_get_kcontrol_locked(soc_card, name);
59+
up_read(&card->controls_rwsem);
60+
61+
return kctl;
62+
}
4363
EXPORT_SYMBOL_GPL(snd_soc_card_get_kcontrol);
4464

4565
static int jack_new(struct snd_soc_card *card, const char *id, int type,

0 commit comments

Comments
 (0)