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,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-
191148static 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,
453407SND_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
461411SND_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
669608static 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
867694static 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};
873698MODULE_DEVICE_TABLE (platform , bxt_board_ids );
0 commit comments