24
24
25
25
#define BXT_DIALOG_CODEC_DAI "da7219-hifi"
26
26
#define BXT_MAXIM_CODEC_DAI "HiFi"
27
- #define MAX98390_DEV0_NAME "i2c-MX98390:00"
28
- #define MAX98390_DEV1_NAME "i2c-MX98390:01"
29
27
#define DUAL_CHANNEL 2
30
28
#define QUAD_CHANNEL 4
31
29
32
- #define SPKAMP_MAX98357A 1
33
- #define SPKAMP_MAX98390 2
34
-
35
30
static struct snd_soc_jack broxton_headset ;
36
31
static struct snd_soc_jack broxton_hdmi [3 ];
37
32
@@ -44,7 +39,6 @@ struct bxt_hdmi_pcm {
44
39
struct bxt_card_private {
45
40
struct list_head hdmi_pcm_list ;
46
41
bool common_hdmi_codec_drv ;
47
- int spkamp ;
48
42
};
49
43
50
44
enum {
@@ -91,17 +85,9 @@ static const struct snd_kcontrol_new broxton_controls[] = {
91
85
SOC_DAPM_PIN_SWITCH ("Headphone Jack" ),
92
86
SOC_DAPM_PIN_SWITCH ("Headset Mic" ),
93
87
SOC_DAPM_PIN_SWITCH ("Line Out" ),
94
- };
95
-
96
- static const struct snd_kcontrol_new max98357a_controls [] = {
97
88
SOC_DAPM_PIN_SWITCH ("Spk" ),
98
89
};
99
90
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
-
105
91
static const struct snd_soc_dapm_widget broxton_widgets [] = {
106
92
SND_SOC_DAPM_HP ("Headphone Jack" , NULL ),
107
93
SND_SOC_DAPM_MIC ("Headset Mic" , NULL ),
@@ -112,17 +98,9 @@ static const struct snd_soc_dapm_widget broxton_widgets[] = {
112
98
SND_SOC_DAPM_SPK ("HDMI3" , NULL ),
113
99
SND_SOC_DAPM_SUPPLY ("Platform Clock" , SND_SOC_NOPM , 0 , 0 ,
114
100
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 [] = {
118
101
SND_SOC_DAPM_SPK ("Spk" , NULL ),
119
102
};
120
103
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
-
126
104
static const struct snd_soc_dapm_route audio_map [] = {
127
105
/* HP jack connectors - unknown if we have jack detection */
128
106
{"Headphone Jack" , NULL , "HPL" },
@@ -153,20 +131,10 @@ static const struct snd_soc_dapm_route audio_map[] = {
153
131
{ "Headphone Jack" , NULL , "Platform Clock" },
154
132
{ "Headset Mic" , NULL , "Platform Clock" },
155
133
{ "Line Out" , NULL , "Platform Clock" },
156
- };
157
134
158
- static const struct snd_soc_dapm_route max98357a_routes [] = {
159
135
/* speaker */
160
136
{"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
- };
168
137
169
- static const struct snd_soc_dapm_route broxton_map [] = {
170
138
{"HiFi Playback" , NULL , "ssp5 Tx" },
171
139
{"ssp5 Tx" , NULL , "codec0_out" },
172
140
@@ -177,17 +145,6 @@ static const struct snd_soc_dapm_route broxton_map[] = {
177
145
{"ssp1 Rx" , NULL , "Capture" },
178
146
};
179
147
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
-
191
148
static struct snd_soc_jack_pin jack_pins [] = {
192
149
{
193
150
.pin = "Headphone Jack" ,
@@ -231,10 +188,7 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
231
188
int clk_freq ;
232
189
233
190
/* Configure sysclk for codec */
234
- if (soc_intel_is_cml ())
235
- clk_freq = 24000000 ;
236
- else
237
- clk_freq = 19200000 ;
191
+ clk_freq = 19200000 ;
238
192
239
193
ret = snd_soc_dai_set_sysclk (codec_dai , DA7219_CLKSRC_MCLK , clk_freq ,
240
194
SND_SOC_CLOCK_IN );
@@ -453,10 +407,6 @@ SND_SOC_DAILINK_DEF(ssp5_pin,
453
407
SND_SOC_DAILINK_DEF (ssp5_codec ,
454
408
DAILINK_COMP_ARRAY (COMP_CODEC ("MX98357A:00" ,
455
409
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" )));
460
410
461
411
SND_SOC_DAILINK_DEF (ssp1_pin ,
462
412
DAILINK_COMP_ARRAY (COMP_CPU ("SSP1 Pin" )));
@@ -654,76 +604,15 @@ static struct snd_soc_dai_link broxton_dais[] = {
654
604
},
655
605
};
656
606
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
-
668
607
#define NAME_SIZE 32
669
608
static int bxt_card_late_probe (struct snd_soc_card * card )
670
609
{
671
610
struct bxt_card_private * ctx = snd_soc_card_get_drvdata (card );
672
611
struct bxt_hdmi_pcm * pcm ;
673
612
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 ;
678
614
char jack_name [NAME_SIZE ];
679
615
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
-
727
616
if (list_empty (& ctx -> hdmi_pcm_list ))
728
617
return - EINVAL ;
729
618
@@ -785,70 +674,8 @@ static int broxton_audio_probe(struct platform_device *pdev)
785
674
786
675
INIT_LIST_HEAD (& ctx -> hdmi_pcm_list );
787
676
788
- if (acpi_dev_present ("MX98390" , NULL , -1 ))
789
- ctx -> spkamp = SPKAMP_MAX98390 ;
790
- else
791
- ctx -> spkamp = SPKAMP_MAX98357A ;
792
-
793
677
broxton_audio_card .dev = & pdev -> dev ;
794
678
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
- }
852
679
853
680
/* override platform name, if required */
854
681
mach = pdev -> dev .platform_data ;
@@ -866,8 +693,6 @@ static int broxton_audio_probe(struct platform_device *pdev)
866
693
867
694
static const struct platform_device_id bxt_board_ids [] = {
868
695
{ .name = "bxt_da7219_mx98357a" },
869
- { .name = "glk_da7219_mx98357a" },
870
- { .name = "cml_da7219_mx98357a" },
871
696
{ }
872
697
};
873
698
MODULE_DEVICE_TABLE (platform , bxt_board_ids );
0 commit comments