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-
3530static struct snd_soc_jack broxton_headset ;
3631static struct snd_soc_jack broxton_hdmi [3 ];
3732
@@ -44,7 +39,6 @@ struct bxt_hdmi_pcm {
4439struct bxt_card_private {
4540 struct list_head hdmi_pcm_list ;
4641 bool common_hdmi_codec_drv ;
47- int spkamp ;
4842};
4943
5044enum {
@@ -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-
10591static 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-
126104static 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-
169139static 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,
453423SND_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
461427SND_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
669624static 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 ,
0 commit comments