Skip to content

Commit eed8673

Browse files
brentlubroonie
authored andcommitted
ASoC: Intel: realtek-common: remove 2-spk rt1015p config
The original code for rt1015p could support 1 or 2 rt1015p device instances in ACPI. However, all designs implement only 1 instance in ACPI table so we remove the code segment which is for 2 instances. Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f1a5cb6 commit eed8673

File tree

2 files changed

+5
-53
lines changed

2 files changed

+5
-53
lines changed

sound/soc/intel/boards/sof_realtek_common.c

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
344325
static 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-
370332
static 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)
412370
void 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
}
419377
EXPORT_SYMBOL_NS(sof_rt1015p_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON);
420378

421379
void 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
}
429382
EXPORT_SYMBOL_NS(sof_rt1015p_codec_conf, SND_SOC_INTEL_SOF_REALTEK_COMMON);
430383

sound/soc/intel/boards/sof_realtek_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ void sof_rt1011_codec_conf(struct device *dev, struct snd_soc_card *card);
3131
*/
3232
#define RT1015P_CODEC_DAI "HiFi"
3333
#define RT1015P_DEV0_NAME RT1015P_ACPI_HID ":00"
34-
#define RT1015P_DEV1_NAME RT1015P_ACPI_HID ":01"
3534

3635
void sof_rt1015p_dai_link(struct snd_soc_dai_link *link);
3736
void sof_rt1015p_codec_conf(struct snd_soc_card *card);

0 commit comments

Comments
 (0)