From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
tiwai@suse.de,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
broonie@kernel.org, Rander Wang <rander.wang@linux.intel.com>
Subject: [PATCH 11/14] ASoC: Intel: broadwell: set card and driver name dynamically
Date: Thu, 12 Nov 2020 16:38:22 -0600 [thread overview]
Message-ID: <20201112223825.39765-12-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20201112223825.39765-1-pierre-louis.bossart@linux.intel.com>
Remove last hard-coded build-time dependency
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
---
sound/soc/intel/boards/bdw-rt5650.c | 17 ++++++++++++-----
sound/soc/intel/boards/bdw-rt5677.c | 17 ++++++++++++-----
sound/soc/intel/boards/broadwell.c | 19 ++++++++++++-------
3 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/sound/soc/intel/boards/bdw-rt5650.c b/sound/soc/intel/boards/bdw-rt5650.c
index aa420b201848..c5122d3b0e6c 100644
--- a/sound/soc/intel/boards/bdw-rt5650.c
+++ b/sound/soc/intel/boards/bdw-rt5650.c
@@ -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 */
-#define CARD_NAME "bdw rt5650" /* card name will be 'sof-bdw rt5650' */
-#define DRIVER_NAME "SOF"
-#else
+#define SOF_CARD_NAME "bdw rt5650" /* card name will be 'sof-bdw rt5650' */
+#define SOF_DRIVER_NAME "SOF"
+
#define CARD_NAME "bdw-rt5650"
#define DRIVER_NAME NULL /* card name will be used for driver name */
-#endif
/* ASoC machine driver for Broadwell DSP + RT5650 */
static struct snd_soc_card bdw_rt5650_card = {
@@ -309,6 +307,15 @@ static int bdw_rt5650_probe(struct platform_device *pdev)
if (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);
return devm_snd_soc_register_card(&pdev->dev, &bdw_rt5650_card);
diff --git a/sound/soc/intel/boards/bdw-rt5677.c b/sound/soc/intel/boards/bdw-rt5677.c
index 9cdd4164e1fb..021bc59aac80 100644
--- a/sound/soc/intel/boards/bdw-rt5677.c
+++ b/sound/soc/intel/boards/bdw-rt5677.c
@@ -387,14 +387,12 @@ static int bdw_rt5677_resume_post(struct snd_soc_card *card)
return 0;
}
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
/* 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 DRIVER_NAME "SOF"
-#else
+#define SOF_CARD_NAME "bdw rt5677" /* card name will be 'sof-bdw rt5677' */
+#define SOF_DRIVER_NAME "SOF"
+
#define CARD_NAME "bdw-rt5677"
#define DRIVER_NAME NULL /* card name will be used for driver name */
-#endif
/* ASoC machine driver for Broadwell DSP + RT5677 */
static struct snd_soc_card bdw_rt5677_card = {
@@ -437,6 +435,15 @@ static int bdw_rt5677_probe(struct platform_device *pdev)
if (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);
return devm_snd_soc_register_card(&pdev->dev, &bdw_rt5677_card);
diff --git a/sound/soc/intel/boards/broadwell.c b/sound/soc/intel/boards/broadwell.c
index 69e0b13b47f4..3c3aff9c61cc 100644
--- a/sound/soc/intel/boards/broadwell.c
+++ b/sound/soc/intel/boards/broadwell.c
@@ -262,19 +262,15 @@ static int broadwell_resume(struct snd_soc_card *card){
return 0;
}
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
/* 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 DRIVER_NAME "SOF"
-#else
+#define SOF_CARD_NAME "bdw rt286" /* card name will be 'sof-bdw rt286' */
+#define SOF_DRIVER_NAME "SOF"
+
#define CARD_NAME "broadwell-rt286"
#define DRIVER_NAME NULL /* card name will be used for driver name */
-#endif
/* broadwell audio machine driver for WPT + RT286S */
static struct snd_soc_card broadwell_rt286 = {
- .name = CARD_NAME,
- .driver_name = DRIVER_NAME,
.owner = THIS_MODULE,
.dai_link = broadwell_rt286_dais,
.num_links = ARRAY_SIZE(broadwell_rt286_dais),
@@ -303,6 +299,15 @@ static int broadwell_audio_probe(struct platform_device *pdev)
if (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);
}
--
2.25.1
next prev parent reply other threads:[~2020-11-12 22:44 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 22:38 [PATCH 00/14] ASoC: Intel/SOF: extend run-time driver selection to ACPI devices Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 01/14] ASoC: Intel: broadwell: add missing pm_ops Pierre-Louis Bossart
2020-11-13 11:17 ` Rojewski, Cezary
2020-11-12 22:38 ` [PATCH 02/14] ASoC: Intel: bdw-rt5677: " Pierre-Louis Bossart
2020-11-13 11:19 ` Rojewski, Cezary
2020-11-12 22:38 ` [PATCH 03/14] ALSA: hda: intel-dsp-config: add helper for ACPI DSP driver selection Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 04/14] ASoC: soc-acpi: add helper to identify parent driver Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 05/14] ASoC: Intel: boards: byt/cht: set card and driver name at run time Pierre-Louis Bossart
2021-04-25 18:13 ` youling257
2021-04-26 15:12 ` Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 06/14] ASoC: Intel: byt/cht: set pm ops dynamically Pierre-Louis Bossart
2020-11-17 17:18 ` Mark Brown
2020-11-17 17:39 ` Pierre-Louis Bossart
2020-11-18 13:31 ` Mark Brown
2020-11-12 22:38 ` [PATCH 07/14] ASoC: SOF: acpi: add dynamic selection of DSP driver Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 08/14] ASoC: Intel: Atom: " Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 09/14] ASoC: SOF: Intel: allow for coexistence between SOF and Atom/SST drivers Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 10/14] ALSA: hda: intel-dsp-config: add Broadwell ACPI DSP driver selection Pierre-Louis Bossart
2020-11-12 22:38 ` Pierre-Louis Bossart [this message]
2020-11-12 22:38 ` [PATCH 12/14] ASoC: Intel: catpt: add dynamic selection of DSP driver Pierre-Louis Bossart
2020-11-12 22:38 ` [PATCH 13/14] ASoC: SOF: Intel: allow for coexistence between SOF and catpt drivers Pierre-Louis Bossart
2020-11-19 14:06 ` Mark Brown
2020-11-19 17:52 ` Pierre-Louis Bossart
2020-11-19 18:25 ` Mark Brown
2020-11-12 22:38 ` [PATCH 14/14] ALSA: hda: intel-dsp-config: ignore dsp_driver parameter for PCI legacy devices Pierre-Louis Bossart
2020-11-12 23:04 ` [PATCH 00/14] ASoC: Intel/SOF: extend run-time driver selection to ACPI devices Rojewski, Cezary
2020-11-13 13:06 ` Rojewski, Cezary
2020-11-13 14:40 ` Pierre-Louis Bossart
2020-11-13 16:49 ` Mark Brown
2020-11-13 17:06 ` Hans de Goede
2020-11-16 15:39 ` Rojewski, Cezary
2020-11-16 17:47 ` Pierre-Louis Bossart
2020-11-17 14:04 ` Takashi Iwai
2020-11-17 17:31 ` Mark Brown
2020-11-17 17:46 ` Takashi Iwai
2020-11-17 22:13 ` Rojewski, Cezary
2020-11-17 22:53 ` Pierre-Louis Bossart
2020-11-18 20:15 ` Rojewski, Cezary
2020-11-18 20:25 ` Pierre-Louis Bossart
2020-11-20 15:40 ` Rojewski, Cezary
2020-11-20 16:48 ` Mark Brown
2020-11-20 17:10 ` Rojewski, Cezary
2020-11-20 18:06 ` Mark Brown
2020-11-20 21:02 ` Rojewski, Cezary
2020-11-23 17:35 ` Mark Brown
2020-11-24 11:56 ` Rojewski, Cezary
2020-11-24 14:01 ` Mark Brown
2020-11-24 14:15 ` Takashi Iwai
2020-11-24 16:07 ` Rojewski, Cezary
2020-11-24 16:14 ` Mark Brown
2020-11-24 16:14 ` Takashi Iwai
2020-11-24 16:12 ` Mark Brown
2020-11-18 7:49 ` Takashi Iwai
2020-11-18 20:59 ` Rojewski, Cezary
2020-11-20 21:29 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201112223825.39765-12-pierre-louis.bossart@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=guennadi.liakhovetski@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=rander.wang@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).