@@ -314,59 +314,21 @@ EXPORT_SYMBOL_NS(sof_rt1011_codec_conf, SND_SOC_INTEL_SOF_REALTEK_COMMON);
314314 *
315315 * For stereo output, there are always two amplifiers on the board.
316316 * 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.
320318 */
321- static const struct snd_soc_dapm_route rt1015p_1dev_dapm_routes [] = {
319+ static const struct snd_soc_dapm_route rt1015p_dapm_routes [] = {
322320 /* speaker */
323321 { "Left Spk" , NULL , "Speaker" },
324322 { "Right Spk" , NULL , "Speaker" },
325323};
326324
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-
344325static struct snd_soc_dai_link_component rt1015p_dai_link_components [] = {
345326 {
346327 .name = RT1015P_DEV0_NAME ,
347328 .dai_name = RT1015P_CODEC_DAI ,
348329 },
349- {
350- .name = RT1015P_DEV1_NAME ,
351- .dai_name = RT1015P_CODEC_DAI ,
352- },
353330};
354331
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-
370332static int rt1015p_hw_params (struct snd_pcm_substream * substream ,
371333 struct snd_pcm_hw_params * params )
372334{
@@ -398,12 +360,8 @@ static int rt1015p_init(struct snd_soc_pcm_runtime *rtd)
398360 return ret ;
399361 }
400362
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 ));
407365 if (ret )
408366 dev_err (rtd -> dev , "Speaker map addition failed: %d\n" , ret );
409367 return ret ;
@@ -412,19 +370,14 @@ static int rt1015p_init(struct snd_soc_pcm_runtime *rtd)
412370void sof_rt1015p_dai_link (struct snd_soc_dai_link * link )
413371{
414372 link -> codecs = rt1015p_dai_link_components ;
415- link -> num_codecs = rt1015p_get_num_codecs ( );
373+ link -> num_codecs = ARRAY_SIZE ( rt1015p_dai_link_components );
416374 link -> init = rt1015p_init ;
417375 link -> ops = & rt1015p_ops ;
418376}
419377EXPORT_SYMBOL_NS (sof_rt1015p_dai_link , SND_SOC_INTEL_SOF_REALTEK_COMMON );
420378
421379void sof_rt1015p_codec_conf (struct snd_soc_card * card )
422380{
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 );
428381}
429382EXPORT_SYMBOL_NS (sof_rt1015p_codec_conf , SND_SOC_INTEL_SOF_REALTEK_COMMON );
430383
0 commit comments