@@ -16,6 +16,7 @@ const struct snd_soc_dapm_route max_98373_dapm_routes[] = {
1616 /* speaker */
1717 { "Left Spk" , NULL , "Left BE_OUT" },
1818 { "Right Spk" , NULL , "Right BE_OUT" },
19+
1920};
2021EXPORT_SYMBOL_NS (max_98373_dapm_routes , SND_SOC_INTEL_SOF_MAXIM_COMMON );
2122
@@ -133,6 +134,91 @@ void max_98373_set_codec_conf(struct snd_soc_card *card)
133134}
134135EXPORT_SYMBOL_NS (max_98373_set_codec_conf , SND_SOC_INTEL_SOF_MAXIM_COMMON );
135136
137+ /*
138+ * Maxim MAX98390
139+ */
140+
141+ static struct snd_soc_codec_conf max_98390_codec_conf [] = {
142+ {
143+ .dlc = COMP_CODEC_CONF (MAX_98390_DEV0_NAME ),
144+ .name_prefix = "Woofer Right" ,
145+ },
146+ {
147+ .dlc = COMP_CODEC_CONF (MAX_98390_DEV1_NAME ),
148+ .name_prefix = "Woofer Left" ,
149+ },
150+ {
151+ .dlc = COMP_CODEC_CONF (MAX_98390_DEV2_NAME ),
152+ .name_prefix = "Tweeter Right" ,
153+ },
154+ {
155+ .dlc = COMP_CODEC_CONF (MAX_98390_DEV3_NAME ),
156+ .name_prefix = "Tweeter Left" ,
157+ },
158+ };
159+
160+ struct snd_soc_dai_link_component max_98390_components [] = {
161+ { /* For Woofer Right */
162+ .name = MAX_98390_DEV0_NAME ,
163+ .dai_name = MAX_98390_CODEC_DAI ,
164+ },
165+ { /* For Woofer Left */
166+ .name = MAX_98390_DEV1_NAME ,
167+ .dai_name = MAX_98390_CODEC_DAI ,
168+ },
169+ { /* For Tweeter Right */
170+ .name = MAX_98390_DEV2_NAME ,
171+ .dai_name = MAX_98390_CODEC_DAI ,
172+ },
173+ { /* For Tweeter Left */
174+ .name = MAX_98390_DEV3_NAME ,
175+ .dai_name = MAX_98390_CODEC_DAI ,
176+ },
177+
178+ };
179+ EXPORT_SYMBOL_NS (max_98390_components , SND_SOC_INTEL_SOF_MAXIM_COMMON );
180+
181+ static int max_98390_hw_params (struct snd_pcm_substream * substream ,
182+ struct snd_pcm_hw_params * params )
183+ {
184+ struct snd_soc_pcm_runtime * rtd = asoc_substream_to_rtd (substream );
185+ struct snd_soc_dai * codec_dai ;
186+ int j ;
187+
188+ for_each_rtd_codec_dais (rtd , j , codec_dai ) {
189+ if (!strcmp (codec_dai -> component -> name , MAX_98390_DEV0_NAME )) {
190+ /* DEV0 tdm slot configuration */
191+ snd_soc_dai_set_tdm_slot (codec_dai , 0x01 , 1 , 4 , 32 );
192+ }
193+ if (!strcmp (codec_dai -> component -> name , MAX_98390_DEV1_NAME )) {
194+ /* DEV1 tdm slot configuration */
195+ snd_soc_dai_set_tdm_slot (codec_dai , 0x02 , 2 , 4 , 32 );
196+ }
197+ if (!strcmp (codec_dai -> component -> name , MAX_98390_DEV2_NAME )) {
198+ /* DEVi2 tdm slot configuration */
199+ snd_soc_dai_set_tdm_slot (codec_dai , 0x04 , 4 , 4 , 32 );
200+ }
201+ if (!strcmp (codec_dai -> component -> name , MAX_98390_DEV3_NAME )) {
202+ /* DEV3 tdm slot configuration */
203+ snd_soc_dai_set_tdm_slot (codec_dai , 0x08 , 8 , 4 , 32 );
204+ }
205+ }
206+ return 0 ;
207+ }
208+
209+ struct snd_soc_ops max_98390_ops = {
210+ .hw_params = max_98390_hw_params ,
211+ .trigger = max_98373_trigger ,
212+ };
213+ EXPORT_SYMBOL_NS (max_98390_ops , SND_SOC_INTEL_SOF_MAXIM_COMMON );
214+
215+ void max_98390_set_codec_conf (struct snd_soc_card * card )
216+ {
217+ card -> codec_conf = max_98390_codec_conf ;
218+ card -> num_configs = ARRAY_SIZE (max_98390_codec_conf );
219+ }
220+ EXPORT_SYMBOL_NS (max_98390_set_codec_conf , SND_SOC_INTEL_SOF_MAXIM_COMMON );
221+
136222/*
137223 * Maxim MAX98357A/MAX98360A
138224 */
0 commit comments