Skip to content

Commit 395f23e

Browse files
committed
ASoC: Intel: updates for 6.10 - part6
Merge series from Pierre-Louis Bossart <[email protected]>: Last batch of cleanups from Brent Lu, with Chromebooks now supported with fewer modular machine drivers.
2 parents a226d08 + 3d84e07 commit 395f23e

13 files changed

+461
-1016
lines changed

sound/soc/intel/boards/Kconfig

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -301,26 +301,21 @@ config SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
301301
tristate
302302
select SND_SOC_DA7219
303303
select SND_SOC_MAX98357A
304-
select SND_SOC_MAX98390
305304
select SND_SOC_DMIC
306305
select SND_SOC_HDAC_HDMI
307306
select SND_SOC_INTEL_HDA_DSP_COMMON
308307

309-
config SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
310-
tristate
311-
select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
312-
313308
if SND_SOC_INTEL_APL
314309

315310
config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH
316-
tristate "Broxton with DA7219 and MAX98357A/MAX98390 in I2S Mode"
311+
tristate "Broxton with DA7219 and MAX98357A in I2S Mode"
317312
depends on I2C && ACPI
318313
depends on MFD_INTEL_LPSS || COMPILE_TEST
319314
depends on SND_HDA_CODEC_HDMI
320-
select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
315+
select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
321316
help
322317
This adds support for ASoC machine driver for Broxton-P platforms
323-
with DA7219 + MAX98357A/MAX98390 I2S audio codec.
318+
with DA7219 + MAX98357A I2S audio codec.
324319
Say Y or m if you have such a device. This is a recommended option.
325320
If unsure select "N".
326321

@@ -433,30 +428,21 @@ if SND_SOC_SOF_GEMINILAKE
433428

434429
config SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH
435430
tristate "GLK with DA7219 and MAX98357A in I2S Mode"
436-
depends on I2C && ACPI
437-
depends on MFD_INTEL_LPSS || COMPILE_TEST
438-
depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC
439-
select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
431+
imply SND_SOC_INTEL_SOF_DA7219_MACH
440432
help
441433
This adds support for ASoC machine driver for Geminilake platforms
442-
with DA7219 + MAX98357A I2S audio codec.
434+
with DA7219 + MAX98357A I2S audio codec. This option is deprecated
435+
and please use SND_SOC_INTEL_SOF_DA7219_MACH instead.
443436
Say Y or m if you have such a device. This is a recommended option.
444437
If unsure select "N".
445438

446439
config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH
447440
tristate "GLK with RT5682 and MAX98357A in I2S Mode"
448-
depends on I2C && ACPI
449-
depends on MFD_INTEL_LPSS || COMPILE_TEST
450-
depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC
451-
select SND_SOC_RT5682_I2C
452-
select SND_SOC_RT5682S
453-
select SND_SOC_MAX98357A
454-
select SND_SOC_DMIC
455-
select SND_SOC_HDAC_HDMI
456-
select SND_SOC_INTEL_HDA_DSP_COMMON
441+
imply SND_SOC_INTEL_SOF_RT5682_MACH
457442
help
458443
This adds support for ASoC machine driver for Geminilake platforms
459-
with RT5682 + MAX98357A I2S audio codec.
444+
with RT5682 + MAX98357A I2S audio codec. This option is deprecated
445+
and please use SND_SOC_INTEL_SOF_RT5682_MACH instead.
460446
Say Y if you have such a device.
461447
If unsure select "N".
462448

@@ -487,6 +473,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH
487473
depends on ((SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC) &&\
488474
(MFD_INTEL_LPSS || COMPILE_TEST)) ||\
489475
(SND_SOC_SOF_BAYTRAIL && (X86_INTEL_LPSS || COMPILE_TEST))
476+
select SND_SOC_MAX98357A
490477
select SND_SOC_MAX98373_I2C
491478
select SND_SOC_MAX98390
492479
select SND_SOC_RT1011
@@ -584,12 +571,11 @@ if (SND_SOC_SOF_COMETLAKE && SND_SOC_SOF_HDA_LINK)
584571

585572
config SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH
586573
tristate "CML_LP with DA7219 and MAX98357A in I2S Mode"
587-
depends on I2C && ACPI
588-
depends on MFD_INTEL_LPSS || COMPILE_TEST
589-
select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
574+
imply SND_SOC_INTEL_SOF_DA7219_MACH
590575
help
591576
This adds support for ASoC machine driver for Cometlake platforms
592-
with DA7219 + MAX98357A I2S audio codec.
577+
with DA7219 + MAX98357A I2S audio codec. This option is deprecated
578+
and please use SND_SOC_INTEL_SOF_DA7219_MACH instead.
593579
Say Y or m if you have such a device. This is a recommended option.
594580
If unsure select "N".
595581

@@ -614,6 +600,7 @@ config SND_SOC_INTEL_SOF_DA7219_MACH
614600
select SND_SOC_DA7219
615601
select SND_SOC_MAX98357A
616602
select SND_SOC_MAX98373_I2C
603+
select SND_SOC_MAX98390
617604
select SND_SOC_DMIC
618605
select SND_SOC_INTEL_SOF_BOARD_HELPERS
619606
select SND_SOC_INTEL_SOF_MAXIM_COMMON

sound/soc/intel/boards/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o
77
snd-soc-sst-bxt-rt298-objs := bxt_rt298.o
88
snd-soc-sst-sof-pcm512x-objs := sof_pcm512x.o
99
snd-soc-sst-sof-wm8804-objs := sof_wm8804.o
10-
snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o
1110
snd-soc-sst-bytcr-rt5640-objs := bytcr_rt5640.o
1211
snd-soc-sst-bytcr-rt5651-objs := bytcr_rt5651.o
1312
snd-soc-sst-bytcr-wm5102-objs := bytcr_wm5102.o
@@ -52,11 +51,10 @@ obj-$(CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH) += snd-soc-sof_es8336.o
5251
obj-$(CONFIG_SND_SOC_INTEL_SOF_NAU8825_MACH) += snd-soc-sof_nau8825.o
5352
obj-$(CONFIG_SND_SOC_INTEL_SOF_DA7219_MACH) += snd-soc-sof_da7219.o
5453
obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-hsw-rt5640.o
55-
obj-$(CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON) += snd-soc-sst-bxt-da7219_max98357a.o
54+
obj-$(CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH) += snd-soc-sst-bxt-da7219_max98357a.o
5655
obj-$(CONFIG_SND_SOC_INTEL_BXT_RT298_MACH) += snd-soc-sst-bxt-rt298.o
5756
obj-$(CONFIG_SND_SOC_INTEL_SOF_PCM512x_MACH) += snd-soc-sst-sof-pcm512x.o
5857
obj-$(CONFIG_SND_SOC_INTEL_SOF_WM8804_MACH) += snd-soc-sst-sof-wm8804.o
59-
obj-$(CONFIG_SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH) += snd-soc-sst-glk-rt5682_max98357a.o
6058
obj-$(CONFIG_SND_SOC_INTEL_BROADWELL_MACH) += snd-soc-bdw-rt286.o
6159
obj-$(CONFIG_SND_SOC_INTEL_BDW_RT5650_MACH) += snd-soc-sst-bdw-rt5650-mach.o
6260
obj-$(CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH) += snd-soc-sst-bdw-rt5677-mach.o

sound/soc/intel/boards/bxt_da7219_max98357a.c

Lines changed: 2 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@
2424

2525
#define BXT_DIALOG_CODEC_DAI "da7219-hifi"
2626
#define BXT_MAXIM_CODEC_DAI "HiFi"
27-
#define MAX98390_DEV0_NAME "i2c-MX98390:00"
28-
#define MAX98390_DEV1_NAME "i2c-MX98390:01"
2927
#define DUAL_CHANNEL 2
3028
#define QUAD_CHANNEL 4
3129

32-
#define SPKAMP_MAX98357A 1
33-
#define SPKAMP_MAX98390 2
34-
3530
static struct snd_soc_jack broxton_headset;
3631
static struct snd_soc_jack broxton_hdmi[3];
3732

@@ -44,7 +39,6 @@ struct bxt_hdmi_pcm {
4439
struct bxt_card_private {
4540
struct list_head hdmi_pcm_list;
4641
bool common_hdmi_codec_drv;
47-
int spkamp;
4842
};
4943

5044
enum {
@@ -91,17 +85,9 @@ static const struct snd_kcontrol_new broxton_controls[] = {
9185
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
9286
SOC_DAPM_PIN_SWITCH("Headset Mic"),
9387
SOC_DAPM_PIN_SWITCH("Line Out"),
94-
};
95-
96-
static const struct snd_kcontrol_new max98357a_controls[] = {
9788
SOC_DAPM_PIN_SWITCH("Spk"),
9889
};
9990

100-
static const struct snd_kcontrol_new max98390_controls[] = {
101-
SOC_DAPM_PIN_SWITCH("Left Spk"),
102-
SOC_DAPM_PIN_SWITCH("Right Spk"),
103-
};
104-
10591
static const struct snd_soc_dapm_widget broxton_widgets[] = {
10692
SND_SOC_DAPM_HP("Headphone Jack", NULL),
10793
SND_SOC_DAPM_MIC("Headset Mic", NULL),
@@ -112,17 +98,9 @@ static const struct snd_soc_dapm_widget broxton_widgets[] = {
11298
SND_SOC_DAPM_SPK("HDMI3", NULL),
11399
SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
114100
platform_clock_control, SND_SOC_DAPM_POST_PMD|SND_SOC_DAPM_PRE_PMU),
115-
};
116-
117-
static const struct snd_soc_dapm_widget max98357a_widgets[] = {
118101
SND_SOC_DAPM_SPK("Spk", NULL),
119102
};
120103

121-
static const struct snd_soc_dapm_widget max98390_widgets[] = {
122-
SND_SOC_DAPM_SPK("Left Spk", NULL),
123-
SND_SOC_DAPM_SPK("Right Spk", NULL),
124-
};
125-
126104
static const struct snd_soc_dapm_route audio_map[] = {
127105
/* HP jack connectors - unknown if we have jack detection */
128106
{"Headphone Jack", NULL, "HPL"},
@@ -153,20 +131,10 @@ static const struct snd_soc_dapm_route audio_map[] = {
153131
{ "Headphone Jack", NULL, "Platform Clock" },
154132
{ "Headset Mic", NULL, "Platform Clock" },
155133
{ "Line Out", NULL, "Platform Clock" },
156-
};
157134

158-
static const struct snd_soc_dapm_route max98357a_routes[] = {
159135
/* speaker */
160136
{"Spk", NULL, "Speaker"},
161-
};
162-
163-
static const struct snd_soc_dapm_route max98390_routes[] = {
164-
/* Speaker */
165-
{"Left Spk", NULL, "Left BE_OUT"},
166-
{"Right Spk", NULL, "Right BE_OUT"},
167-
};
168137

169-
static const struct snd_soc_dapm_route broxton_map[] = {
170138
{"HiFi Playback", NULL, "ssp5 Tx"},
171139
{"ssp5 Tx", NULL, "codec0_out"},
172140

@@ -177,17 +145,6 @@ static const struct snd_soc_dapm_route broxton_map[] = {
177145
{"ssp1 Rx", NULL, "Capture"},
178146
};
179147

180-
static const struct snd_soc_dapm_route gemini_map[] = {
181-
{"HiFi Playback", NULL, "ssp1 Tx"},
182-
{"ssp1 Tx", NULL, "codec0_out"},
183-
184-
{"Playback", NULL, "ssp2 Tx"},
185-
{"ssp2 Tx", NULL, "codec1_out"},
186-
187-
{"codec0_in", NULL, "ssp2 Rx"},
188-
{"ssp2 Rx", NULL, "Capture"},
189-
};
190-
191148
static struct snd_soc_jack_pin jack_pins[] = {
192149
{
193150
.pin = "Headphone Jack",
@@ -231,10 +188,7 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
231188
int clk_freq;
232189

233190
/* Configure sysclk for codec */
234-
if (soc_intel_is_cml())
235-
clk_freq = 24000000;
236-
else
237-
clk_freq = 19200000;
191+
clk_freq = 19200000;
238192

239193
ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, clk_freq,
240194
SND_SOC_CLOCK_IN);
@@ -453,10 +407,6 @@ SND_SOC_DAILINK_DEF(ssp5_pin,
453407
SND_SOC_DAILINK_DEF(ssp5_codec,
454408
DAILINK_COMP_ARRAY(COMP_CODEC("MX98357A:00",
455409
BXT_MAXIM_CODEC_DAI)));
456-
SND_SOC_DAILINK_DEF(max98390_codec,
457-
DAILINK_COMP_ARRAY(
458-
/* Left */ COMP_CODEC(MAX98390_DEV0_NAME, "max98390-aif1"),
459-
/* Right */ COMP_CODEC(MAX98390_DEV1_NAME, "max98390-aif1")));
460410

461411
SND_SOC_DAILINK_DEF(ssp1_pin,
462412
DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin")));
@@ -654,76 +604,15 @@ static struct snd_soc_dai_link broxton_dais[] = {
654604
},
655605
};
656606

657-
static struct snd_soc_codec_conf max98390_codec_confs[] = {
658-
{
659-
.dlc = COMP_CODEC_CONF(MAX98390_DEV0_NAME),
660-
.name_prefix = "Left",
661-
},
662-
{
663-
.dlc = COMP_CODEC_CONF(MAX98390_DEV1_NAME),
664-
.name_prefix = "Right",
665-
},
666-
};
667-
668607
#define NAME_SIZE 32
669608
static int bxt_card_late_probe(struct snd_soc_card *card)
670609
{
671610
struct bxt_card_private *ctx = snd_soc_card_get_drvdata(card);
672611
struct bxt_hdmi_pcm *pcm;
673612
struct snd_soc_component *component = NULL;
674-
const struct snd_kcontrol_new *controls;
675-
const struct snd_soc_dapm_widget *widgets;
676-
const struct snd_soc_dapm_route *routes;
677-
int num_controls, num_widgets, num_routes, err, i = 0;
613+
int err, i = 0;
678614
char jack_name[NAME_SIZE];
679615

680-
switch (ctx->spkamp) {
681-
case SPKAMP_MAX98357A:
682-
controls = max98357a_controls;
683-
num_controls = ARRAY_SIZE(max98357a_controls);
684-
widgets = max98357a_widgets;
685-
num_widgets = ARRAY_SIZE(max98357a_widgets);
686-
routes = max98357a_routes;
687-
num_routes = ARRAY_SIZE(max98357a_routes);
688-
break;
689-
case SPKAMP_MAX98390:
690-
controls = max98390_controls;
691-
num_controls = ARRAY_SIZE(max98390_controls);
692-
widgets = max98390_widgets;
693-
num_widgets = ARRAY_SIZE(max98390_widgets);
694-
routes = max98390_routes;
695-
num_routes = ARRAY_SIZE(max98390_routes);
696-
break;
697-
default:
698-
dev_err(card->dev, "Invalid speaker amplifier %d\n", ctx->spkamp);
699-
return -EINVAL;
700-
}
701-
702-
err = snd_soc_dapm_new_controls(&card->dapm, widgets, num_widgets);
703-
if (err) {
704-
dev_err(card->dev, "Fail to new widgets\n");
705-
return err;
706-
}
707-
708-
err = snd_soc_add_card_controls(card, controls, num_controls);
709-
if (err) {
710-
dev_err(card->dev, "Fail to add controls\n");
711-
return err;
712-
}
713-
714-
err = snd_soc_dapm_add_routes(&card->dapm, routes, num_routes);
715-
if (err) {
716-
dev_err(card->dev, "Fail to add routes\n");
717-
return err;
718-
}
719-
720-
if (soc_intel_is_glk())
721-
snd_soc_dapm_add_routes(&card->dapm, gemini_map,
722-
ARRAY_SIZE(gemini_map));
723-
else
724-
snd_soc_dapm_add_routes(&card->dapm, broxton_map,
725-
ARRAY_SIZE(broxton_map));
726-
727616
if (list_empty(&ctx->hdmi_pcm_list))
728617
return -EINVAL;
729618

@@ -785,70 +674,8 @@ static int broxton_audio_probe(struct platform_device *pdev)
785674

786675
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
787676

788-
if (acpi_dev_present("MX98390", NULL, -1))
789-
ctx->spkamp = SPKAMP_MAX98390;
790-
else
791-
ctx->spkamp = SPKAMP_MAX98357A;
792-
793677
broxton_audio_card.dev = &pdev->dev;
794678
snd_soc_card_set_drvdata(&broxton_audio_card, ctx);
795-
if (soc_intel_is_glk()) {
796-
unsigned int i;
797-
798-
broxton_audio_card.name = "glkda7219max";
799-
/* Fixup the SSP entries for geminilake */
800-
for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
801-
if (!broxton_dais[i].codecs->dai_name)
802-
continue;
803-
804-
/* MAXIM_CODEC is connected to SSP1. */
805-
if (!strcmp(broxton_dais[i].codecs->dai_name,
806-
BXT_MAXIM_CODEC_DAI)) {
807-
broxton_dais[i].name = "SSP1-Codec";
808-
broxton_dais[i].cpus->dai_name = "SSP1 Pin";
809-
}
810-
/* DIALOG_CODE is connected to SSP2 */
811-
else if (!strcmp(broxton_dais[i].codecs->dai_name,
812-
BXT_DIALOG_CODEC_DAI)) {
813-
broxton_dais[i].name = "SSP2-Codec";
814-
broxton_dais[i].cpus->dai_name = "SSP2 Pin";
815-
}
816-
}
817-
} else if (soc_intel_is_cml()) {
818-
unsigned int i;
819-
820-
if (ctx->spkamp == SPKAMP_MAX98390) {
821-
broxton_audio_card.name = "cml_max98390_da7219";
822-
823-
broxton_audio_card.codec_conf = max98390_codec_confs;
824-
broxton_audio_card.num_configs = ARRAY_SIZE(max98390_codec_confs);
825-
} else
826-
broxton_audio_card.name = "cmlda7219max";
827-
828-
for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
829-
if (!broxton_dais[i].codecs->dai_name)
830-
continue;
831-
832-
/* MAXIM_CODEC is connected to SSP1. */
833-
if (!strcmp(broxton_dais[i].codecs->dai_name,
834-
BXT_MAXIM_CODEC_DAI)) {
835-
broxton_dais[i].name = "SSP1-Codec";
836-
broxton_dais[i].cpus->dai_name = "SSP1 Pin";
837-
838-
if (ctx->spkamp == SPKAMP_MAX98390) {
839-
broxton_dais[i].codecs = max98390_codec;
840-
broxton_dais[i].num_codecs = ARRAY_SIZE(max98390_codec);
841-
broxton_dais[i].dpcm_capture = 1;
842-
}
843-
}
844-
/* DIALOG_CODEC is connected to SSP0 */
845-
else if (!strcmp(broxton_dais[i].codecs->dai_name,
846-
BXT_DIALOG_CODEC_DAI)) {
847-
broxton_dais[i].name = "SSP0-Codec";
848-
broxton_dais[i].cpus->dai_name = "SSP0 Pin";
849-
}
850-
}
851-
}
852679

853680
/* override platform name, if required */
854681
mach = pdev->dev.platform_data;
@@ -866,8 +693,6 @@ static int broxton_audio_probe(struct platform_device *pdev)
866693

867694
static const struct platform_device_id bxt_board_ids[] = {
868695
{ .name = "bxt_da7219_mx98357a" },
869-
{ .name = "glk_da7219_mx98357a" },
870-
{ .name = "cml_da7219_mx98357a" },
871696
{ }
872697
};
873698
MODULE_DEVICE_TABLE(platform, bxt_board_ids);

0 commit comments

Comments
 (0)