@@ -33,6 +33,12 @@ static struct clk *rt5682_dai_bclk;
33
33
static struct gpio_desc * dmic_sel ;
34
34
void * soc_is_rltk_max (struct device * dev );
35
35
36
+ enum {
37
+ RT5682 = 0 ,
38
+ MAX ,
39
+ EC ,
40
+ };
41
+
36
42
static int acp3x_5682_init (struct snd_soc_pcm_runtime * rtd )
37
43
{
38
44
int ret ;
@@ -242,6 +248,9 @@ SND_SOC_DAILINK_DEF(rt5682,
242
248
DAILINK_COMP_ARRAY (COMP_CODEC ("i2c-10EC5682:00" , "rt5682-aif1" )));
243
249
SND_SOC_DAILINK_DEF (max ,
244
250
DAILINK_COMP_ARRAY (COMP_CODEC ("MX98357A:00" , "HiFi" )));
251
+ SND_SOC_DAILINK_DEF (rt1015 ,
252
+ DAILINK_COMP_ARRAY (COMP_CODEC ("i2c-10EC1015:00" , "rt1015-aif" ),
253
+ COMP_CODEC ("i2c-10EC1015:01" , "rt1015-aif" )));
245
254
SND_SOC_DAILINK_DEF (cros_ec ,
246
255
DAILINK_COMP_ARRAY (COMP_CODEC ("GOOG0013:00" , "EC Codec I2S RX" )));
247
256
@@ -260,7 +269,7 @@ static struct snd_soc_codec_conf rt1015_conf[] = {
260
269
};
261
270
262
271
static struct snd_soc_dai_link acp3x_dai [] = {
263
- {
272
+ [ RT5682 ] = {
264
273
.name = "acp3x-5682-play" ,
265
274
.stream_name = "Playback" ,
266
275
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
@@ -271,16 +280,19 @@ static struct snd_soc_dai_link acp3x_dai[] = {
271
280
.ops = & acp3x_5682_ops ,
272
281
SND_SOC_DAILINK_REG (acp3x_i2s , rt5682 , platform ),
273
282
},
274
- {
283
+ [ MAX ] = {
275
284
.name = "acp3x-max98357-play" ,
276
285
.stream_name = "HiFi Playback" ,
277
286
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
278
- | SND_SOC_DAIFMT_CBM_CFM ,
287
+ | SND_SOC_DAIFMT_CBS_CFS ,
279
288
.dpcm_playback = 1 ,
280
289
.ops = & acp3x_max_play_ops ,
281
- SND_SOC_DAILINK_REG (acp3x_bt , max , platform ),
290
+ .cpus = acp3x_bt ,
291
+ .num_cpus = ARRAY_SIZE (acp3x_bt ),
292
+ .platforms = platform ,
293
+ .num_platforms = ARRAY_SIZE (platform ),
282
294
},
283
- {
295
+ [ EC ] = {
284
296
.name = "acp3x-ec-dmic0-capture" ,
285
297
.stream_name = "Capture DMIC0" ,
286
298
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
@@ -390,6 +402,18 @@ void *soc_is_rltk_max(struct device *dev)
390
402
return (void * )match -> driver_data ;
391
403
}
392
404
405
+ static void card_spk_dai_link_present (struct snd_soc_dai_link * links ,
406
+ const char * card_name )
407
+ {
408
+ if (!strcmp (card_name , "acp3xalc56821015" )) {
409
+ links [1 ].codecs = rt1015 ;
410
+ links [1 ].num_codecs = ARRAY_SIZE (rt1015 );
411
+ } else {
412
+ links [1 ].codecs = max ;
413
+ links [1 ].num_codecs = ARRAY_SIZE (max );
414
+ }
415
+ }
416
+
393
417
static int acp3x_probe (struct platform_device * pdev )
394
418
{
395
419
int ret ;
@@ -405,6 +429,7 @@ static int acp3x_probe(struct platform_device *pdev)
405
429
if (!machine )
406
430
return - ENOMEM ;
407
431
432
+ card_spk_dai_link_present (card -> dai_link , card -> name );
408
433
card -> dev = & pdev -> dev ;
409
434
platform_set_drvdata (pdev , card );
410
435
snd_soc_card_set_drvdata (card , machine );
0 commit comments