Commit 8643e85a authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
parent 803e5913
...@@ -262,14 +262,12 @@ static struct snd_soc_dai_link bdw_rt5650_dais[] = { ...@@ -262,14 +262,12 @@ static struct snd_soc_dai_link bdw_rt5650_dais[] = {
}, },
}; };
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
/* use space before codec name to simplify card ID, and simplify driver name */ /* use space before codec name to simplify card ID, and simplify driver name */
#define CARD_NAME "bdw rt5650" /* card name will be 'sof-bdw rt5650' */ #define SOF_CARD_NAME "bdw rt5650" /* card name will be 'sof-bdw rt5650' */
#define DRIVER_NAME "SOF" #define SOF_DRIVER_NAME "SOF"
#else
#define CARD_NAME "bdw-rt5650" #define CARD_NAME "bdw-rt5650"
#define DRIVER_NAME NULL /* card name will be used for driver name */ #define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
/* ASoC machine driver for Broadwell DSP + RT5650 */ /* ASoC machine driver for Broadwell DSP + RT5650 */
static struct snd_soc_card bdw_rt5650_card = { static struct snd_soc_card bdw_rt5650_card = {
...@@ -309,6 +307,15 @@ static int bdw_rt5650_probe(struct platform_device *pdev) ...@@ -309,6 +307,15 @@ static int bdw_rt5650_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
/* set card and driver name */
if (snd_soc_acpi_sof_parent(&pdev->dev)) {
bdw_rt5650_card.name = SOF_CARD_NAME;
bdw_rt5650_card.driver_name = SOF_DRIVER_NAME;
} else {
bdw_rt5650_card.name = CARD_NAME;
bdw_rt5650_card.driver_name = DRIVER_NAME;
}
snd_soc_card_set_drvdata(&bdw_rt5650_card, bdw_rt5650); snd_soc_card_set_drvdata(&bdw_rt5650_card, bdw_rt5650);
return devm_snd_soc_register_card(&pdev->dev, &bdw_rt5650_card); return devm_snd_soc_register_card(&pdev->dev, &bdw_rt5650_card);
......
...@@ -387,14 +387,12 @@ static int bdw_rt5677_resume_post(struct snd_soc_card *card) ...@@ -387,14 +387,12 @@ static int bdw_rt5677_resume_post(struct snd_soc_card *card)
return 0; return 0;
} }
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
/* use space before codec name to simplify card ID, and simplify driver name */ /* use space before codec name to simplify card ID, and simplify driver name */
#define CARD_NAME "bdw rt5677" /* card name will be 'sof-bdw rt5677' */ #define SOF_CARD_NAME "bdw rt5677" /* card name will be 'sof-bdw rt5677' */
#define DRIVER_NAME "SOF" #define SOF_DRIVER_NAME "SOF"
#else
#define CARD_NAME "bdw-rt5677" #define CARD_NAME "bdw-rt5677"
#define DRIVER_NAME NULL /* card name will be used for driver name */ #define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
/* ASoC machine driver for Broadwell DSP + RT5677 */ /* ASoC machine driver for Broadwell DSP + RT5677 */
static struct snd_soc_card bdw_rt5677_card = { static struct snd_soc_card bdw_rt5677_card = {
...@@ -437,6 +435,15 @@ static int bdw_rt5677_probe(struct platform_device *pdev) ...@@ -437,6 +435,15 @@ static int bdw_rt5677_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
/* set card and driver name */
if (snd_soc_acpi_sof_parent(&pdev->dev)) {
bdw_rt5677_card.name = SOF_CARD_NAME;
bdw_rt5677_card.driver_name = SOF_DRIVER_NAME;
} else {
bdw_rt5677_card.name = CARD_NAME;
bdw_rt5677_card.driver_name = DRIVER_NAME;
}
snd_soc_card_set_drvdata(&bdw_rt5677_card, bdw_rt5677); snd_soc_card_set_drvdata(&bdw_rt5677_card, bdw_rt5677);
return devm_snd_soc_register_card(&pdev->dev, &bdw_rt5677_card); return devm_snd_soc_register_card(&pdev->dev, &bdw_rt5677_card);
......
...@@ -262,19 +262,15 @@ static int broadwell_resume(struct snd_soc_card *card){ ...@@ -262,19 +262,15 @@ static int broadwell_resume(struct snd_soc_card *card){
return 0; return 0;
} }
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
/* use space before codec name to simplify card ID, and simplify driver name */ /* use space before codec name to simplify card ID, and simplify driver name */
#define CARD_NAME "bdw rt286" /* card name will be 'sof-bdw rt286' */ #define SOF_CARD_NAME "bdw rt286" /* card name will be 'sof-bdw rt286' */
#define DRIVER_NAME "SOF" #define SOF_DRIVER_NAME "SOF"
#else
#define CARD_NAME "broadwell-rt286" #define CARD_NAME "broadwell-rt286"
#define DRIVER_NAME NULL /* card name will be used for driver name */ #define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
/* broadwell audio machine driver for WPT + RT286S */ /* broadwell audio machine driver for WPT + RT286S */
static struct snd_soc_card broadwell_rt286 = { static struct snd_soc_card broadwell_rt286 = {
.name = CARD_NAME,
.driver_name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dai_link = broadwell_rt286_dais, .dai_link = broadwell_rt286_dais,
.num_links = ARRAY_SIZE(broadwell_rt286_dais), .num_links = ARRAY_SIZE(broadwell_rt286_dais),
...@@ -303,6 +299,15 @@ static int broadwell_audio_probe(struct platform_device *pdev) ...@@ -303,6 +299,15 @@ static int broadwell_audio_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
/* set card and driver name */
if (snd_soc_acpi_sof_parent(&pdev->dev)) {
broadwell_rt286.name = SOF_CARD_NAME;
broadwell_rt286.driver_name = SOF_DRIVER_NAME;
} else {
broadwell_rt286.name = CARD_NAME;
broadwell_rt286.driver_name = DRIVER_NAME;
}
return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286); return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment