Skip to content

Commit 91ef3d9

Browse files
committed
Merge tag 'asoc-fix-v5.8-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.8 This is a collection of mostly small fixes, mostly fixing fallout from some of the DPCM changes that went in last time around which shook out some issues on i.MX and Qualcomm platforms. The addition of a managed version of snd_soc_register_dai() is to fix resource leaks. There's also a few new device IDs for x86 systems.
2 parents d50313a + f141a42 commit 91ef3d9

26 files changed

+295
-151
lines changed

include/sound/dmaengine_pcm.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,15 @@ int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,
161161

162162
#define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm"
163163

164+
struct dmaengine_pcm {
165+
struct dma_chan *chan[SNDRV_PCM_STREAM_LAST + 1];
166+
const struct snd_dmaengine_pcm_config *config;
167+
struct snd_soc_component component;
168+
unsigned int flags;
169+
};
170+
171+
static inline struct dmaengine_pcm *soc_component_to_pcm(struct snd_soc_component *p)
172+
{
173+
return container_of(p, struct dmaengine_pcm, component);
174+
}
164175
#endif

include/sound/soc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ int devm_snd_soc_register_component(struct device *dev,
444444
const struct snd_soc_component_driver *component_driver,
445445
struct snd_soc_dai_driver *dai_drv, int num_dai);
446446
void snd_soc_unregister_component(struct device *dev);
447+
struct snd_soc_component *snd_soc_lookup_component_nolocked(struct device *dev,
448+
const char *driver_name);
447449
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
448450
const char *driver_name);
449451

@@ -1361,6 +1363,10 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
13611363
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
13621364
struct snd_soc_dai_driver *dai_drv,
13631365
bool legacy_dai_naming);
1366+
struct snd_soc_dai *devm_snd_soc_register_dai(struct device *dev,
1367+
struct snd_soc_component *component,
1368+
struct snd_soc_dai_driver *dai_drv,
1369+
bool legacy_dai_naming);
13641370
void snd_soc_unregister_dai(struct snd_soc_dai *dai);
13651371

13661372
struct snd_soc_dai *snd_soc_find_dai(

sound/hda/intel-dsp-config.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ static const struct config_entry config_table[] = {
208208
},
209209
#endif
210210

211+
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE)
211212
/* Cometlake-LP */
212-
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_LP)
213213
{
214214
.flags = FLAG_SOF,
215215
.device = 0x02c8,
@@ -240,9 +240,7 @@ static const struct config_entry config_table[] = {
240240
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
241241
.device = 0x02c8,
242242
},
243-
#endif
244243
/* Cometlake-H */
245-
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_H)
246244
{
247245
.flags = FLAG_SOF,
248246
.device = 0x06c8,

sound/soc/amd/raven/acp3x-pcm-dma.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,25 +342,41 @@ static int acp3x_dma_close(struct snd_soc_component *component,
342342
{
343343
struct snd_soc_pcm_runtime *prtd;
344344
struct i2s_dev_data *adata;
345+
struct i2s_stream_instance *ins;
345346

346347
prtd = substream->private_data;
347348
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
348349
adata = dev_get_drvdata(component->dev);
350+
ins = substream->runtime->private_data;
351+
if (!ins)
352+
return -EINVAL;
349353

354+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
355+
switch (ins->i2s_instance) {
356+
case I2S_BT_INSTANCE:
357+
adata->play_stream = NULL;
358+
break;
359+
case I2S_SP_INSTANCE:
360+
default:
361+
adata->i2ssp_play_stream = NULL;
362+
}
363+
} else {
364+
switch (ins->i2s_instance) {
365+
case I2S_BT_INSTANCE:
366+
adata->capture_stream = NULL;
367+
break;
368+
case I2S_SP_INSTANCE:
369+
default:
370+
adata->i2ssp_capture_stream = NULL;
371+
}
372+
}
350373

351374
/* Disable ACP irq, when the current stream is being closed and
352375
* another stream is also not active.
353376
*/
354377
if (!adata->play_stream && !adata->capture_stream &&
355378
!adata->i2ssp_play_stream && !adata->i2ssp_capture_stream)
356379
rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
357-
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
358-
adata->play_stream = NULL;
359-
adata->i2ssp_play_stream = NULL;
360-
} else {
361-
adata->capture_stream = NULL;
362-
adata->i2ssp_capture_stream = NULL;
363-
}
364380
return 0;
365381
}
366382

sound/soc/codecs/hdac_hda.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -441,21 +441,21 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
441441
ret = snd_hda_codec_set_name(hcodec, hcodec->preset->name);
442442
if (ret < 0) {
443443
dev_err(&hdev->dev, "name failed %s\n", hcodec->preset->name);
444-
goto error;
444+
goto error_pm;
445445
}
446446

447447
ret = snd_hdac_regmap_init(&hcodec->core);
448448
if (ret < 0) {
449449
dev_err(&hdev->dev, "regmap init failed\n");
450-
goto error;
450+
goto error_pm;
451451
}
452452

453453
patch = (hda_codec_patch_t)hcodec->preset->driver_data;
454454
if (patch) {
455455
ret = patch(hcodec);
456456
if (ret < 0) {
457457
dev_err(&hdev->dev, "patch failed %d\n", ret);
458-
goto error;
458+
goto error_regmap;
459459
}
460460
} else {
461461
dev_dbg(&hdev->dev, "no patch file found\n");
@@ -467,7 +467,7 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
467467
ret = snd_hda_codec_parse_pcms(hcodec);
468468
if (ret < 0) {
469469
dev_err(&hdev->dev, "unable to map pcms to dai %d\n", ret);
470-
goto error;
470+
goto error_regmap;
471471
}
472472

473473
/* HDMI controls need to be created in machine drivers */
@@ -476,7 +476,7 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
476476
if (ret < 0) {
477477
dev_err(&hdev->dev, "unable to create controls %d\n",
478478
ret);
479-
goto error;
479+
goto error_regmap;
480480
}
481481
}
482482

@@ -496,7 +496,9 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
496496

497497
return 0;
498498

499-
error:
499+
error_regmap:
500+
snd_hdac_regmap_exit(hdev);
501+
error_pm:
500502
pm_runtime_put(&hdev->dev);
501503
error_no_pm:
502504
snd_hdac_ext_bus_link_put(hdev->bus, hlink);
@@ -518,6 +520,8 @@ static void hdac_hda_codec_remove(struct snd_soc_component *component)
518520

519521
pm_runtime_disable(&hdev->dev);
520522
snd_hdac_ext_bus_link_put(hdev->bus, hlink);
523+
524+
snd_hdac_regmap_exit(hdev);
521525
}
522526

523527
static const struct snd_soc_dapm_route hdac_hda_dapm_routes[] = {

sound/soc/codecs/max98390.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,8 @@ static bool max98390_readable_register(struct device *dev, unsigned int reg)
700700
case MAX98390_IRQ_CTRL ... MAX98390_WDOG_CTRL:
701701
case MAX98390_MEAS_ADC_THERM_WARN_THRESH
702702
... MAX98390_BROWNOUT_INFINITE_HOLD:
703-
case MAX98390_BROWNOUT_LVL_HOLD ... THERMAL_COILTEMP_RD_BACK_BYTE0:
704-
case DSMIG_DEBUZZER_THRESHOLD ... MAX98390_R24FF_REV_ID:
703+
case MAX98390_BROWNOUT_LVL_HOLD ... DSMIG_DEBUZZER_THRESHOLD:
704+
case DSM_VOL_ENA ... MAX98390_R24FF_REV_ID:
705705
return true;
706706
default:
707707
return false;
@@ -717,7 +717,7 @@ static bool max98390_volatile_reg(struct device *dev, unsigned int reg)
717717
case MAX98390_BROWNOUT_LOWEST_STATUS:
718718
case MAX98390_ENV_TRACK_BOOST_VOUT_READ:
719719
case DSM_STBASS_HPF_B0_BYTE0 ... DSM_DEBUZZER_ATTACK_TIME_BYTE2:
720-
case THERMAL_RDC_RD_BACK_BYTE1 ... THERMAL_COILTEMP_RD_BACK_BYTE0:
720+
case THERMAL_RDC_RD_BACK_BYTE1 ... DSMIG_DEBUZZER_THRESHOLD:
721721
case DSM_THERMAL_GAIN ... DSM_WBDRC_GAIN:
722722
return true;
723723
default:

sound/soc/codecs/rt1015.c

Lines changed: 75 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -34,69 +34,79 @@ static const struct reg_default rt1015_reg[] = {
3434
{ 0x0000, 0x0000 },
3535
{ 0x0004, 0xa000 },
3636
{ 0x0006, 0x0003 },
37-
{ 0x000a, 0x0802 },
38-
{ 0x000c, 0x0020 },
37+
{ 0x000a, 0x081e },
38+
{ 0x000c, 0x0006 },
3939
{ 0x000e, 0x0000 },
4040
{ 0x0010, 0x0000 },
4141
{ 0x0012, 0x0000 },
42+
{ 0x0014, 0x0000 },
43+
{ 0x0016, 0x0000 },
44+
{ 0x0018, 0x0000 },
4245
{ 0x0020, 0x8000 },
43-
{ 0x0022, 0x471b },
44-
{ 0x006a, 0x0000 },
45-
{ 0x006c, 0x4020 },
46+
{ 0x0022, 0x8043 },
4647
{ 0x0076, 0x0000 },
4748
{ 0x0078, 0x0000 },
48-
{ 0x007a, 0x0000 },
49+
{ 0x007a, 0x0002 },
4950
{ 0x007c, 0x10ec },
5051
{ 0x007d, 0x1015 },
5152
{ 0x00f0, 0x5000 },
52-
{ 0x00f2, 0x0774 },
53-
{ 0x00f3, 0x8400 },
53+
{ 0x00f2, 0x004c },
54+
{ 0x00f3, 0xecfe },
5455
{ 0x00f4, 0x0000 },
56+
{ 0x00f6, 0x0400 },
5557
{ 0x0100, 0x0028 },
5658
{ 0x0102, 0xff02 },
57-
{ 0x0104, 0x8232 },
59+
{ 0x0104, 0xa213 },
5860
{ 0x0106, 0x200c },
59-
{ 0x010c, 0x002f },
60-
{ 0x010e, 0xc000 },
61+
{ 0x010c, 0x0000 },
62+
{ 0x010e, 0x0058 },
6163
{ 0x0111, 0x0200 },
6264
{ 0x0112, 0x0400 },
6365
{ 0x0114, 0x0022 },
6466
{ 0x0116, 0x0000 },
6567
{ 0x0118, 0x0000 },
6668
{ 0x011a, 0x0123 },
6769
{ 0x011c, 0x4567 },
68-
{ 0x0300, 0xdddd },
69-
{ 0x0302, 0x0000 },
70-
{ 0x0311, 0x9330 },
71-
{ 0x0313, 0x0000 },
72-
{ 0x0314, 0x0000 },
70+
{ 0x0300, 0x203d },
71+
{ 0x0302, 0x001e },
72+
{ 0x0311, 0x0000 },
73+
{ 0x0313, 0x6014 },
74+
{ 0x0314, 0x00a2 },
7375
{ 0x031a, 0x00a0 },
7476
{ 0x031c, 0x001f },
7577
{ 0x031d, 0xffff },
7678
{ 0x031e, 0x0000 },
7779
{ 0x031f, 0x0000 },
80+
{ 0x0320, 0x0000 },
7881
{ 0x0321, 0x0000 },
79-
{ 0x0322, 0x0000 },
80-
{ 0x0328, 0x0000 },
81-
{ 0x0329, 0x0000 },
82-
{ 0x032a, 0x0000 },
83-
{ 0x032b, 0x0000 },
84-
{ 0x032c, 0x0000 },
85-
{ 0x032d, 0x0000 },
86-
{ 0x032e, 0x030e },
87-
{ 0x0330, 0x0080 },
82+
{ 0x0322, 0xd7df },
83+
{ 0x0328, 0x10b2 },
84+
{ 0x0329, 0x0175 },
85+
{ 0x032a, 0x36ad },
86+
{ 0x032b, 0x7e55 },
87+
{ 0x032c, 0x0520 },
88+
{ 0x032d, 0xaa00 },
89+
{ 0x032e, 0x570e },
90+
{ 0x0330, 0xe180 },
8891
{ 0x0332, 0x0034 },
89-
{ 0x0334, 0x0000 },
90-
{ 0x0336, 0x0000 },
92+
{ 0x0334, 0x0001 },
93+
{ 0x0336, 0x0010 },
94+
{ 0x0338, 0x0000 },
95+
{ 0x04fa, 0x0030 },
96+
{ 0x04fc, 0x35c8 },
97+
{ 0x04fe, 0x0800 },
98+
{ 0x0500, 0x0400 },
99+
{ 0x0502, 0x1000 },
100+
{ 0x0504, 0x0000 },
91101
{ 0x0506, 0x04ff },
92-
{ 0x0508, 0x0030 },
93-
{ 0x050a, 0x0018 },
94-
{ 0x0519, 0x307f },
95-
{ 0x051a, 0xffff },
96-
{ 0x051b, 0x4000 },
102+
{ 0x0508, 0x0010 },
103+
{ 0x050a, 0x001a },
104+
{ 0x0519, 0x1c68 },
105+
{ 0x051a, 0x0ccc },
106+
{ 0x051b, 0x0666 },
97107
{ 0x051d, 0x0000 },
98108
{ 0x051f, 0x0000 },
99-
{ 0x0536, 0x1000 },
109+
{ 0x0536, 0x061c },
100110
{ 0x0538, 0x0000 },
101111
{ 0x053a, 0x0000 },
102112
{ 0x053c, 0x0000 },
@@ -110,36 +120,35 @@ static const struct reg_default rt1015_reg[] = {
110120
{ 0x0544, 0x0000 },
111121
{ 0x0568, 0x0000 },
112122
{ 0x056a, 0x0000 },
113-
{ 0x1000, 0x0000 },
114-
{ 0x1002, 0x6505 },
123+
{ 0x1000, 0x0040 },
124+
{ 0x1002, 0x5405 },
115125
{ 0x1006, 0x5515 },
116-
{ 0x1007, 0x003f },
117-
{ 0x1009, 0x770f },
118-
{ 0x100a, 0x01ff },
119-
{ 0x100c, 0x0000 },
126+
{ 0x1007, 0x05f7 },
127+
{ 0x1009, 0x0b0a },
128+
{ 0x100a, 0x00ef },
120129
{ 0x100d, 0x0003 },
121130
{ 0x1010, 0xa433 },
122131
{ 0x1020, 0x0000 },
123-
{ 0x1200, 0x3d02 },
124-
{ 0x1202, 0x0813 },
125-
{ 0x1204, 0x0211 },
132+
{ 0x1200, 0x5a01 },
133+
{ 0x1202, 0x6524 },
134+
{ 0x1204, 0x1f00 },
126135
{ 0x1206, 0x0000 },
127136
{ 0x1208, 0x0000 },
128137
{ 0x120a, 0x0000 },
129138
{ 0x120c, 0x0000 },
130139
{ 0x120e, 0x0000 },
131140
{ 0x1210, 0x0000 },
132141
{ 0x1212, 0x0000 },
133-
{ 0x1300, 0x0701 },
134-
{ 0x1302, 0x12f9 },
135-
{ 0x1304, 0x3405 },
142+
{ 0x1300, 0x10a1 },
143+
{ 0x1302, 0x12ff },
144+
{ 0x1304, 0x0400 },
136145
{ 0x1305, 0x0844 },
137-
{ 0x1306, 0x1611 },
146+
{ 0x1306, 0x4611 },
138147
{ 0x1308, 0x555e },
139148
{ 0x130a, 0x0000 },
140-
{ 0x130c, 0x2400},
141-
{ 0x130e, 0x7700 },
142-
{ 0x130f, 0x0000 },
149+
{ 0x130c, 0x2000 },
150+
{ 0x130e, 0x0100 },
151+
{ 0x130f, 0x0001 },
143152
{ 0x1310, 0x0000 },
144153
{ 0x1312, 0x0000 },
145154
{ 0x1314, 0x0000 },
@@ -209,6 +218,9 @@ static bool rt1015_volatile_register(struct device *dev, unsigned int reg)
209218
case RT1015_DC_CALIB_CLSD7:
210219
case RT1015_DC_CALIB_CLSD8:
211220
case RT1015_S_BST_TIMING_INTER1:
221+
case RT1015_OSCK_STA:
222+
case RT1015_MONO_DYNA_CTRL1:
223+
case RT1015_MONO_DYNA_CTRL5:
212224
return true;
213225

214226
default:
@@ -224,6 +236,12 @@ static bool rt1015_readable_register(struct device *dev, unsigned int reg)
224236
case RT1015_CLK3:
225237
case RT1015_PLL1:
226238
case RT1015_PLL2:
239+
case RT1015_DUM_RW1:
240+
case RT1015_DUM_RW2:
241+
case RT1015_DUM_RW3:
242+
case RT1015_DUM_RW4:
243+
case RT1015_DUM_RW5:
244+
case RT1015_DUM_RW6:
227245
case RT1015_CLK_DET:
228246
case RT1015_SIL_DET:
229247
case RT1015_CUSTOMER_ID:
@@ -235,6 +253,7 @@ static bool rt1015_readable_register(struct device *dev, unsigned int reg)
235253
case RT1015_PAD_DRV2:
236254
case RT1015_GAT_BOOST:
237255
case RT1015_PRO_ALT:
256+
case RT1015_OSCK_STA:
238257
case RT1015_MAN_I2C:
239258
case RT1015_DAC1:
240259
case RT1015_DAC2:
@@ -272,6 +291,13 @@ static bool rt1015_readable_register(struct device *dev, unsigned int reg)
272291
case RT1015_SMART_BST_CTRL2:
273292
case RT1015_ANA_CTRL1:
274293
case RT1015_ANA_CTRL2:
294+
case RT1015_PWR_STATE_CTRL:
295+
case RT1015_MONO_DYNA_CTRL:
296+
case RT1015_MONO_DYNA_CTRL1:
297+
case RT1015_MONO_DYNA_CTRL2:
298+
case RT1015_MONO_DYNA_CTRL3:
299+
case RT1015_MONO_DYNA_CTRL4:
300+
case RT1015_MONO_DYNA_CTRL5:
275301
case RT1015_SPK_VOL:
276302
case RT1015_SHORT_DETTOP1:
277303
case RT1015_SHORT_DETTOP2:

0 commit comments

Comments
 (0)