Skip to content

Commit c3c5ac4

Browse files
committed
ASoC: Intel: updates for 6.10 - part7
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: This patchset should be the last batch for this kernel cycle! Brent Lu continued his cleanups to refactor and use fewer machine drivers on Chrmebooks. Bard Liao updated the sof-sdw machine driver to deal with UCM support of the RT712 configuration. Note that this sof-sdw driver will be refactored in the next kernel cycle to allow AMD and others to reuse common SoundWire parts that are not Intel-specific. Initial changes are described here: thesofproject#4967
2 parents c8bdf9e + 4c11132 commit c3c5ac4

24 files changed

+300
-427
lines changed

sound/soc/intel/boards/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
681681
select SND_SOC_CS35L56_SDW
682682
select SND_SOC_DMIC
683683
select SND_SOC_INTEL_HDA_DSP_COMMON
684-
select SND_SOC_INTEL_SOF_MAXIM_COMMON
685684
imply SND_SOC_SDW_MOCKUP
686685
help
687686
Add support for Intel SoundWire-based platforms connected to

sound/soc/intel/boards/sof_da7219.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,8 @@ sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
275275
max_98360a_dai_link(ctx->amp_link);
276276
break;
277277
case CODEC_MAX98373:
278-
ctx->amp_link->codecs = max_98373_components;
279-
ctx->amp_link->num_codecs = ARRAY_SIZE(max_98373_components);
280-
ctx->amp_link->init = max_98373_spk_codec_init;
278+
max_98373_dai_link(dev, ctx->amp_link);
279+
281280
if (ctx->da7219.is_jsl_board) {
282281
ctx->amp_link->ops = &max98373_ops; /* use local ops */
283282
} else {

sound/soc/intel/boards/sof_maxim_common.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ static unsigned int get_num_codecs(const char *hid)
3939
return dev_num;
4040
}
4141

42+
/*
43+
* Maxim MAX98373
44+
*/
4245
#define MAX_98373_PIN_NAME 16
4346

44-
const struct snd_soc_dapm_route max_98373_dapm_routes[] = {
47+
static const struct snd_soc_dapm_route max_98373_dapm_routes[] = {
4548
/* speaker */
4649
{ "Left Spk", NULL, "Left BE_OUT" },
4750
{ "Right Spk", NULL, "Right BE_OUT" },
4851
};
49-
EXPORT_SYMBOL_NS(max_98373_dapm_routes, SND_SOC_INTEL_SOF_MAXIM_COMMON);
5052

5153
static struct snd_soc_codec_conf max_98373_codec_conf[] = {
5254
{
@@ -59,7 +61,7 @@ static struct snd_soc_codec_conf max_98373_codec_conf[] = {
5961
},
6062
};
6163

62-
struct snd_soc_dai_link_component max_98373_components[] = {
64+
static struct snd_soc_dai_link_component max_98373_components[] = {
6365
{ /* For Right */
6466
.name = MAX_98373_DEV0_NAME,
6567
.dai_name = MAX_98373_CODEC_DAI,
@@ -69,7 +71,6 @@ struct snd_soc_dai_link_component max_98373_components[] = {
6971
.dai_name = MAX_98373_CODEC_DAI,
7072
},
7173
};
72-
EXPORT_SYMBOL_NS(max_98373_components, SND_SOC_INTEL_SOF_MAXIM_COMMON);
7374

7475
static int max_98373_hw_params(struct snd_pcm_substream *substream,
7576
struct snd_pcm_hw_params *params)
@@ -96,7 +97,7 @@ static int max_98373_hw_params(struct snd_pcm_substream *substream,
9697
return 0;
9798
}
9899

99-
int max_98373_trigger(struct snd_pcm_substream *substream, int cmd)
100+
static int max_98373_trigger(struct snd_pcm_substream *substream, int cmd)
100101
{
101102
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
102103
struct snd_soc_dai *codec_dai;
@@ -139,15 +140,13 @@ int max_98373_trigger(struct snd_pcm_substream *substream, int cmd)
139140

140141
return ret;
141142
}
142-
EXPORT_SYMBOL_NS(max_98373_trigger, SND_SOC_INTEL_SOF_MAXIM_COMMON);
143143

144-
struct snd_soc_ops max_98373_ops = {
144+
static const struct snd_soc_ops max_98373_ops = {
145145
.hw_params = max_98373_hw_params,
146146
.trigger = max_98373_trigger,
147147
};
148-
EXPORT_SYMBOL_NS(max_98373_ops, SND_SOC_INTEL_SOF_MAXIM_COMMON);
149148

150-
int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
149+
static int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
151150
{
152151
struct snd_soc_card *card = rtd->card;
153152
unsigned int num_codecs = get_num_codecs(MAX_98373_ACPI_HID);
@@ -186,7 +185,15 @@ int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
186185

187186
return ret;
188187
}
189-
EXPORT_SYMBOL_NS(max_98373_spk_codec_init, SND_SOC_INTEL_SOF_MAXIM_COMMON);
188+
189+
void max_98373_dai_link(struct device *dev, struct snd_soc_dai_link *link)
190+
{
191+
link->codecs = max_98373_components;
192+
link->num_codecs = ARRAY_SIZE(max_98373_components);
193+
link->init = max_98373_spk_codec_init;
194+
link->ops = &max_98373_ops;
195+
}
196+
EXPORT_SYMBOL_NS(max_98373_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
190197

191198
void max_98373_set_codec_conf(struct snd_soc_card *card)
192199
{

sound/soc/intel/boards/sof_maxim_common.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@
2020
#define MAX_98373_DEV0_NAME "i2c-" MAX_98373_ACPI_HID ":00"
2121
#define MAX_98373_DEV1_NAME "i2c-" MAX_98373_ACPI_HID ":01"
2222

23-
extern struct snd_soc_dai_link_component max_98373_components[2];
24-
extern struct snd_soc_ops max_98373_ops;
25-
extern const struct snd_soc_dapm_route max_98373_dapm_routes[];
26-
27-
int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd);
23+
void max_98373_dai_link(struct device *dev, struct snd_soc_dai_link *link);
2824
void max_98373_set_codec_conf(struct snd_soc_card *card);
29-
int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);
3025

3126
/*
3227
* Maxim MAX98390

sound/soc/intel/boards/sof_nau8825.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,7 @@ sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
213213
max_98360a_dai_link(ctx->amp_link);
214214
break;
215215
case CODEC_MAX98373:
216-
ctx->amp_link->codecs = max_98373_components;
217-
ctx->amp_link->num_codecs = ARRAY_SIZE(max_98373_components);
218-
ctx->amp_link->init = max_98373_spk_codec_init;
219-
ctx->amp_link->ops = &max_98373_ops;
216+
max_98373_dai_link(dev, ctx->amp_link);
220217
break;
221218
case CODEC_NAU8318:
222219
nau8318_set_dai_link(ctx->amp_link);

sound/soc/intel/boards/sof_realtek_common.c

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -314,59 +314,21 @@ EXPORT_SYMBOL_NS(sof_rt1011_codec_conf, SND_SOC_INTEL_SOF_REALTEK_COMMON);
314314
*
315315
* For stereo output, there are always two amplifiers on the board.
316316
* However, the ACPI implements only one device instance (UID=0) if they
317-
* are sharing the same enable pin. The code will detect the number of
318-
* device instance and use corresponding DAPM structures for
319-
* initialization.
317+
* are sharing the same enable pin. This is the case of rt1015p.
320318
*/
321-
static const struct snd_soc_dapm_route rt1015p_1dev_dapm_routes[] = {
319+
static const struct snd_soc_dapm_route rt1015p_dapm_routes[] = {
322320
/* speaker */
323321
{ "Left Spk", NULL, "Speaker" },
324322
{ "Right Spk", NULL, "Speaker" },
325323
};
326324

327-
static const struct snd_soc_dapm_route rt1015p_2dev_dapm_routes[] = {
328-
/* speaker */
329-
{ "Left Spk", NULL, "Left Speaker" },
330-
{ "Right Spk", NULL, "Right Speaker" },
331-
};
332-
333-
static struct snd_soc_codec_conf rt1015p_codec_confs[] = {
334-
{
335-
.dlc = COMP_CODEC_CONF(RT1015P_DEV0_NAME),
336-
.name_prefix = "Left",
337-
},
338-
{
339-
.dlc = COMP_CODEC_CONF(RT1015P_DEV1_NAME),
340-
.name_prefix = "Right",
341-
},
342-
};
343-
344325
static struct snd_soc_dai_link_component rt1015p_dai_link_components[] = {
345326
{
346327
.name = RT1015P_DEV0_NAME,
347328
.dai_name = RT1015P_CODEC_DAI,
348329
},
349-
{
350-
.name = RT1015P_DEV1_NAME,
351-
.dai_name = RT1015P_CODEC_DAI,
352-
},
353330
};
354331

355-
static int rt1015p_get_num_codecs(void)
356-
{
357-
static int dev_num;
358-
359-
if (dev_num)
360-
return dev_num;
361-
362-
if (!acpi_dev_present("RTL1015", "1", -1))
363-
dev_num = 1;
364-
else
365-
dev_num = 2;
366-
367-
return dev_num;
368-
}
369-
370332
static int rt1015p_hw_params(struct snd_pcm_substream *substream,
371333
struct snd_pcm_hw_params *params)
372334
{
@@ -398,12 +360,8 @@ static int rt1015p_init(struct snd_soc_pcm_runtime *rtd)
398360
return ret;
399361
}
400362

401-
if (rt1015p_get_num_codecs() == 1)
402-
ret = snd_soc_dapm_add_routes(&card->dapm, rt1015p_1dev_dapm_routes,
403-
ARRAY_SIZE(rt1015p_1dev_dapm_routes));
404-
else
405-
ret = snd_soc_dapm_add_routes(&card->dapm, rt1015p_2dev_dapm_routes,
406-
ARRAY_SIZE(rt1015p_2dev_dapm_routes));
363+
ret = snd_soc_dapm_add_routes(&card->dapm, rt1015p_dapm_routes,
364+
ARRAY_SIZE(rt1015p_dapm_routes));
407365
if (ret)
408366
dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret);
409367
return ret;
@@ -412,19 +370,14 @@ static int rt1015p_init(struct snd_soc_pcm_runtime *rtd)
412370
void sof_rt1015p_dai_link(struct snd_soc_dai_link *link)
413371
{
414372
link->codecs = rt1015p_dai_link_components;
415-
link->num_codecs = rt1015p_get_num_codecs();
373+
link->num_codecs = ARRAY_SIZE(rt1015p_dai_link_components);
416374
link->init = rt1015p_init;
417375
link->ops = &rt1015p_ops;
418376
}
419377
EXPORT_SYMBOL_NS(sof_rt1015p_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON);
420378

421379
void sof_rt1015p_codec_conf(struct snd_soc_card *card)
422380
{
423-
if (rt1015p_get_num_codecs() == 1)
424-
return;
425-
426-
card->codec_conf = rt1015p_codec_confs;
427-
card->num_configs = ARRAY_SIZE(rt1015p_codec_confs);
428381
}
429382
EXPORT_SYMBOL_NS(sof_rt1015p_codec_conf, SND_SOC_INTEL_SOF_REALTEK_COMMON);
430383

sound/soc/intel/boards/sof_realtek_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ void sof_rt1011_codec_conf(struct device *dev, struct snd_soc_card *card);
3131
*/
3232
#define RT1015P_CODEC_DAI "HiFi"
3333
#define RT1015P_DEV0_NAME RT1015P_ACPI_HID ":00"
34-
#define RT1015P_DEV1_NAME RT1015P_ACPI_HID ":01"
3534

3635
void sof_rt1015p_dai_link(struct snd_soc_dai_link *link);
3736
void sof_rt1015p_codec_conf(struct snd_soc_card *card);

sound/soc/intel/boards/sof_rt5682.c

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ static const struct dmi_system_id sof_rt5682_quirk_table[] = {
6767
.driver_data = (void *)(SOF_RT5682_MCLK_EN |
6868
SOF_SSP_PORT_CODEC(1)),
6969
},
70-
{
71-
.callback = sof_rt5682_quirk_cb,
72-
.matches = {
73-
DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Hatch"),
74-
},
75-
.driver_data = (void *)(SOF_RT5682_MCLK_EN |
76-
SOF_SSP_PORT_CODEC(0) |
77-
SOF_SSP_PORT_AMP(1)),
78-
},
7970
{
8071
.callback = sof_rt5682_quirk_cb,
8172
.matches = {
@@ -600,10 +591,7 @@ sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
600591
max_98360a_dai_link(ctx->amp_link);
601592
break;
602593
case CODEC_MAX98373:
603-
ctx->amp_link->codecs = max_98373_components;
604-
ctx->amp_link->num_codecs = ARRAY_SIZE(max_98373_components);
605-
ctx->amp_link->init = max_98373_spk_codec_init;
606-
ctx->amp_link->ops = &max_98373_ops;
594+
max_98373_dai_link(dev, ctx->amp_link);
607595
break;
608596
case CODEC_MAX98390:
609597
max_98390_dai_link(dev, ctx->amp_link);
@@ -875,27 +863,13 @@ static const struct platform_device_id board_ids[] = {
875863
SOF_SSP_MASK_HDMI_CAPTURE(0x5)),
876864
},
877865
{
878-
.name = "mtl_mx98357_rt5682",
866+
.name = "mtl_rt5682_def",
879867
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
880868
SOF_SSP_PORT_CODEC(0) |
881869
SOF_SSP_PORT_AMP(1) |
882870
SOF_SSP_PORT_BT_OFFLOAD(2) |
883871
SOF_BT_OFFLOAD_PRESENT),
884872
},
885-
{
886-
.name = "mtl_mx98360_rt5682",
887-
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
888-
SOF_SSP_PORT_CODEC(0) |
889-
SOF_SSP_PORT_AMP(1)),
890-
},
891-
{
892-
.name = "mtl_rt5682_def",
893-
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
894-
SOF_SSP_PORT_CODEC(2) |
895-
SOF_SSP_PORT_AMP(0) |
896-
SOF_SSP_PORT_BT_OFFLOAD(1) |
897-
SOF_BT_OFFLOAD_PRESENT),
898-
},
899873
{ }
900874
};
901875
MODULE_DEVICE_TABLE(platform, board_ids);

0 commit comments

Comments
 (0)