Skip to content

Commit 12e5fe6

Browse files
brentlubroonie
authored andcommitted
ASoC: Intel: bxt_da7219_max98357a: remove MAX98390 support
Remove MAX98390 support and use sof_da7219 machine driver instead for existing cml boards with MAX98390 speaker amplifier. Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5a2bc76 commit 12e5fe6

File tree

3 files changed

+6
-111
lines changed

3 files changed

+6
-111
lines changed

sound/soc/intel/boards/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ 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
@@ -313,14 +312,14 @@ config SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
313312
if SND_SOC_INTEL_APL
314313

315314
config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH
316-
tristate "Broxton with DA7219 and MAX98357A/MAX98390 in I2S Mode"
315+
tristate "Broxton with DA7219 and MAX98357A in I2S Mode"
317316
depends on I2C && ACPI
318317
depends on MFD_INTEL_LPSS || COMPILE_TEST
319318
depends on SND_HDA_CODEC_HDMI
320319
select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
321320
help
322321
This adds support for ASoC machine driver for Broxton-P platforms
323-
with DA7219 + MAX98357A/MAX98390 I2S audio codec.
322+
with DA7219 + MAX98357A I2S audio codec.
324323
Say Y or m if you have such a device. This is a recommended option.
325324
If unsure select "N".
326325

@@ -587,6 +586,7 @@ config SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH
587586
depends on I2C && ACPI
588587
depends on MFD_INTEL_LPSS || COMPILE_TEST
589588
select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
589+
imply SND_SOC_INTEL_SOF_DA7219_MACH
590590
help
591591
This adds support for ASoC machine driver for Cometlake platforms
592592
with DA7219 + MAX98357A I2S audio codec.

sound/soc/intel/boards/bxt_da7219_max98357a.c

Lines changed: 2 additions & 107 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,19 +131,11 @@ 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"},
161137
};
162138

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-
};
168-
169139
static const struct snd_soc_dapm_route broxton_map[] = {
170140
{"HiFi Playback", NULL, "ssp5 Tx"},
171141
{"ssp5 Tx", NULL, "codec0_out"},
@@ -453,10 +423,6 @@ SND_SOC_DAILINK_DEF(ssp5_pin,
453423
SND_SOC_DAILINK_DEF(ssp5_codec,
454424
DAILINK_COMP_ARRAY(COMP_CODEC("MX98357A:00",
455425
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")));
460426

461427
SND_SOC_DAILINK_DEF(ssp1_pin,
462428
DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin")));
@@ -654,69 +620,15 @@ static struct snd_soc_dai_link broxton_dais[] = {
654620
},
655621
};
656622

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-
668623
#define NAME_SIZE 32
669624
static int bxt_card_late_probe(struct snd_soc_card *card)
670625
{
671626
struct bxt_card_private *ctx = snd_soc_card_get_drvdata(card);
672627
struct bxt_hdmi_pcm *pcm;
673628
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;
629+
int err, i = 0;
678630
char jack_name[NAME_SIZE];
679631

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-
720632
if (soc_intel_is_glk())
721633
snd_soc_dapm_add_routes(&card->dapm, gemini_map,
722634
ARRAY_SIZE(gemini_map));
@@ -785,11 +697,6 @@ static int broxton_audio_probe(struct platform_device *pdev)
785697

786698
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
787699

788-
if (acpi_dev_present("MX98390", NULL, -1))
789-
ctx->spkamp = SPKAMP_MAX98390;
790-
else
791-
ctx->spkamp = SPKAMP_MAX98357A;
792-
793700
broxton_audio_card.dev = &pdev->dev;
794701
snd_soc_card_set_drvdata(&broxton_audio_card, ctx);
795702
if (soc_intel_is_glk()) {
@@ -817,13 +724,7 @@ static int broxton_audio_probe(struct platform_device *pdev)
817724
} else if (soc_intel_is_cml()) {
818725
unsigned int i;
819726

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";
727+
broxton_audio_card.name = "cmlda7219max";
827728

828729
for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
829730
if (!broxton_dais[i].codecs->dai_name)
@@ -834,12 +735,6 @@ static int broxton_audio_probe(struct platform_device *pdev)
834735
BXT_MAXIM_CODEC_DAI)) {
835736
broxton_dais[i].name = "SSP1-Codec";
836737
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-
}
843738
}
844739
/* DIALOG_CODEC is connected to SSP0 */
845740
else if (!strcmp(broxton_dais[i].codecs->dai_name,

sound/soc/intel/common/soc-acpi-intel-cml-match.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
7575
},
7676
{
7777
.id = "DLGS7219",
78-
.drv_name = "cml_da7219_mx98357a",
78+
.drv_name = "cml_da7219_def",
7979
.machine_quirk = snd_soc_acpi_codec_list,
8080
.quirk_data = &max98390_spk_codecs,
8181
.sof_tplg_filename = "sof-cml-da7219-max98390.tplg",

0 commit comments

Comments
 (0)