@@ -314,59 +314,21 @@ EXPORT_SYMBOL_NS(sof_rt1011_codec_conf, SND_SOC_INTEL_SOF_REALTEK_COMMON);
314
314
*
315
315
* For stereo output, there are always two amplifiers on the board.
316
316
* However, the ACPI implements only one device instance (UID=0) if they
317
- * are sharing the same enable pin. The code will detect the number of
318
- * device instance and use corresponding DAPM structures for
319
- * initialization.
317
+ * are sharing the same enable pin. This is the case of rt1015p.
320
318
*/
321
- static const struct snd_soc_dapm_route rt1015p_1dev_dapm_routes [] = {
319
+ static const struct snd_soc_dapm_route rt1015p_dapm_routes [] = {
322
320
/* speaker */
323
321
{ "Left Spk" , NULL , "Speaker" },
324
322
{ "Right Spk" , NULL , "Speaker" },
325
323
};
326
324
327
- static const struct snd_soc_dapm_route rt1015p_2dev_dapm_routes [] = {
328
- /* speaker */
329
- { "Left Spk" , NULL , "Left Speaker" },
330
- { "Right Spk" , NULL , "Right Speaker" },
331
- };
332
-
333
- static struct snd_soc_codec_conf rt1015p_codec_confs [] = {
334
- {
335
- .dlc = COMP_CODEC_CONF (RT1015P_DEV0_NAME ),
336
- .name_prefix = "Left" ,
337
- },
338
- {
339
- .dlc = COMP_CODEC_CONF (RT1015P_DEV1_NAME ),
340
- .name_prefix = "Right" ,
341
- },
342
- };
343
-
344
325
static struct snd_soc_dai_link_component rt1015p_dai_link_components [] = {
345
326
{
346
327
.name = RT1015P_DEV0_NAME ,
347
328
.dai_name = RT1015P_CODEC_DAI ,
348
329
},
349
- {
350
- .name = RT1015P_DEV1_NAME ,
351
- .dai_name = RT1015P_CODEC_DAI ,
352
- },
353
330
};
354
331
355
- static int rt1015p_get_num_codecs (void )
356
- {
357
- static int dev_num ;
358
-
359
- if (dev_num )
360
- return dev_num ;
361
-
362
- if (!acpi_dev_present ("RTL1015" , "1" , -1 ))
363
- dev_num = 1 ;
364
- else
365
- dev_num = 2 ;
366
-
367
- return dev_num ;
368
- }
369
-
370
332
static int rt1015p_hw_params (struct snd_pcm_substream * substream ,
371
333
struct snd_pcm_hw_params * params )
372
334
{
@@ -398,12 +360,8 @@ static int rt1015p_init(struct snd_soc_pcm_runtime *rtd)
398
360
return ret ;
399
361
}
400
362
401
- if (rt1015p_get_num_codecs () == 1 )
402
- ret = snd_soc_dapm_add_routes (& card -> dapm , rt1015p_1dev_dapm_routes ,
403
- ARRAY_SIZE (rt1015p_1dev_dapm_routes ));
404
- else
405
- ret = snd_soc_dapm_add_routes (& card -> dapm , rt1015p_2dev_dapm_routes ,
406
- ARRAY_SIZE (rt1015p_2dev_dapm_routes ));
363
+ ret = snd_soc_dapm_add_routes (& card -> dapm , rt1015p_dapm_routes ,
364
+ ARRAY_SIZE (rt1015p_dapm_routes ));
407
365
if (ret )
408
366
dev_err (rtd -> dev , "Speaker map addition failed: %d\n" , ret );
409
367
return ret ;
@@ -412,19 +370,14 @@ static int rt1015p_init(struct snd_soc_pcm_runtime *rtd)
412
370
void sof_rt1015p_dai_link (struct snd_soc_dai_link * link )
413
371
{
414
372
link -> codecs = rt1015p_dai_link_components ;
415
- link -> num_codecs = rt1015p_get_num_codecs ( );
373
+ link -> num_codecs = ARRAY_SIZE ( rt1015p_dai_link_components );
416
374
link -> init = rt1015p_init ;
417
375
link -> ops = & rt1015p_ops ;
418
376
}
419
377
EXPORT_SYMBOL_NS (sof_rt1015p_dai_link , SND_SOC_INTEL_SOF_REALTEK_COMMON );
420
378
421
379
void sof_rt1015p_codec_conf (struct snd_soc_card * card )
422
380
{
423
- if (rt1015p_get_num_codecs () == 1 )
424
- return ;
425
-
426
- card -> codec_conf = rt1015p_codec_confs ;
427
- card -> num_configs = ARRAY_SIZE (rt1015p_codec_confs );
428
381
}
429
382
EXPORT_SYMBOL_NS (sof_rt1015p_codec_conf , SND_SOC_INTEL_SOF_REALTEK_COMMON );
430
383
0 commit comments