All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ASoC: Give prettier longname based on DMI
@ 2017-04-24  6:54 Takashi Iwai
  2017-04-24  6:54 ` [PATCH v2 1/2] ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name() Takashi Iwai
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Takashi Iwai @ 2017-04-24  6:54 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Vinod Koul, alsa-devel, Jie Yang,
	Pierre-Louis Bossart

Hi,

this is the revised patchset to set the card longname based on DMI
so that a unique UCM profile can be picked up.

v1->v2: Fix the missnig NULL argument in the function call


Takashi

===

Takashi Iwai (2):
  ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()
  ASoC: Call snd_soc_set_dmi_name() unconditionally

 include/sound/soc.h                | 8 ++++++++
 sound/soc/intel/boards/broadwell.c | 3 ---
 sound/soc/soc-core.c               | 5 +++++
 3 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.11.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()
  2017-04-24  6:54 [PATCH v2 0/2] ASoC: Give prettier longname based on DMI Takashi Iwai
@ 2017-04-24  6:54 ` Takashi Iwai
  2017-04-24  6:54 ` [PATCH v2 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally Takashi Iwai
  2017-04-24  6:58 ` [PATCH v2 0/2] ASoC: Give prettier longname based on DMI Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2017-04-24  6:54 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Vinod Koul, alsa-devel, Jie Yang,
	Pierre-Louis Bossart

For systems without DMI, it makes no sense to have the code.

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 include/sound/soc.h  | 8 ++++++++
 sound/soc/soc-core.c | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index cdfb55f7aede..915c06cb2b32 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -497,7 +497,15 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);
 int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
 	unsigned int dai_fmt);
 
+#ifdef CONFIG_DMI
 int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour);
+#else
+static inline int snd_soc_set_dmi_name(struct snd_soc_card *card,
+				       const char *flavour)
+{
+	return 0;
+}
+#endif
 
 /* Utility functions to get clock rates from various things */
 int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2722bb0c5573..aac73ff8a92a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1918,6 +1918,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
 EXPORT_SYMBOL_GPL(snd_soc_runtime_set_dai_fmt);
 
 
+#ifdef CONFIG_DMI
 /* Trim special characters, and replace '-' with '_' since '-' is used to
  * separate different DMI fields in the card long name. Only number and
  * alphabet characters and a few separator characters are kept.
@@ -2049,6 +2050,7 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(snd_soc_set_dmi_name);
+#endif /* CONFIG_DMI */
 
 static int snd_soc_instantiate_card(struct snd_soc_card *card)
 {
-- 
2.11.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally
  2017-04-24  6:54 [PATCH v2 0/2] ASoC: Give prettier longname based on DMI Takashi Iwai
  2017-04-24  6:54 ` [PATCH v2 1/2] ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name() Takashi Iwai
@ 2017-04-24  6:54 ` Takashi Iwai
  2017-04-24 18:20   ` Applied "ASoC: Call snd_soc_set_dmi_name() unconditionally" to the asoc tree Mark Brown
  2017-04-24  6:58 ` [PATCH v2 0/2] ASoC: Give prettier longname based on DMI Vinod Koul
  2 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2017-04-24  6:54 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Vinod Koul, alsa-devel, Jie Yang,
	Pierre-Louis Bossart

Since recently UCM can pick up a configuration specific to the board
via card longname field, and we introduced a helper function
snd_soc_set_dmi_name() for that.  So far, it was used only in one
place (sound/soc/intel/boards/broadwell.c), but it should be more
widely applied.

This patch puts a big hammer for that: it lets snd_soc_register_card()
calling snd_soc_set_dmi_name() unconditionally, so that all x86
devices get the better longname string.  This would have no impact for
other systems without DMI support, as snd_soc_set_dmi_name() is no-op
on them.

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
v1->v2: Fix the missnig NULL argument in the function call

 sound/soc/intel/boards/broadwell.c | 3 ---
 sound/soc/soc-core.c               | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/boards/broadwell.c b/sound/soc/intel/boards/broadwell.c
index faf865bb1765..6dcbbcefc25b 100644
--- a/sound/soc/intel/boards/broadwell.c
+++ b/sound/soc/intel/boards/broadwell.c
@@ -269,9 +269,6 @@ static struct snd_soc_card broadwell_rt286 = {
 static int broadwell_audio_probe(struct platform_device *pdev)
 {
 	broadwell_rt286.dev = &pdev->dev;
-
-	snd_soc_set_dmi_name(&broadwell_rt286, NULL);
-
 	return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286);
 }
 
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index aac73ff8a92a..e1952be5394b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2192,6 +2192,9 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 		snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
 					card->num_of_dapm_routes);
 
+	/* try to set some sane longname if DMI is available */
+	snd_soc_set_dmi_name(card, NULL);
+
 	snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname),
 		 "%s", card->name);
 	snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
-- 
2.11.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] ASoC: Give prettier longname based on DMI
  2017-04-24  6:54 [PATCH v2 0/2] ASoC: Give prettier longname based on DMI Takashi Iwai
  2017-04-24  6:54 ` [PATCH v2 1/2] ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name() Takashi Iwai
  2017-04-24  6:54 ` [PATCH v2 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally Takashi Iwai
@ 2017-04-24  6:58 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2017-04-24  6:58 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Liam Girdwood, alsa-devel, Mark Brown, Jie Yang,
	Pierre-Louis Bossart

On Mon, Apr 24, 2017 at 08:54:40AM +0200, Takashi Iwai wrote:
> Hi,
> 
> this is the revised patchset to set the card longname based on DMI
> so that a unique UCM profile can be picked up.

Acked-by: Vinod Koul <vinod.koul@intel.com>

-- 
~Vinod

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Applied "ASoC: Call snd_soc_set_dmi_name() unconditionally" to the asoc tree
  2017-04-24  6:54 ` [PATCH v2 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally Takashi Iwai
@ 2017-04-24 18:20   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2017-04-24 18:20 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: alsa-devel, Vinod Koul, Jie Yang, Pierre-Louis Bossart,
	Liam Girdwood, Mark Brown

The patch

   ASoC: Call snd_soc_set_dmi_name() unconditionally

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 861886d338f7dd802be972e770a695bba62f397a Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 24 Apr 2017 08:54:42 +0200
Subject: [PATCH] ASoC: Call snd_soc_set_dmi_name() unconditionally

Since recently UCM can pick up a configuration specific to the board
via card longname field, and we introduced a helper function
snd_soc_set_dmi_name() for that.  So far, it was used only in one
place (sound/soc/intel/boards/broadwell.c), but it should be more
widely applied.

This patch puts a big hammer for that: it lets snd_soc_register_card()
calling snd_soc_set_dmi_name() unconditionally, so that all x86
devices get the better longname string.  This would have no impact for
other systems without DMI support, as snd_soc_set_dmi_name() is no-op
on them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/broadwell.c | 3 ---
 sound/soc/soc-core.c               | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/boards/broadwell.c b/sound/soc/intel/boards/broadwell.c
index faf865bb1765..6dcbbcefc25b 100644
--- a/sound/soc/intel/boards/broadwell.c
+++ b/sound/soc/intel/boards/broadwell.c
@@ -269,9 +269,6 @@ static struct snd_soc_card broadwell_rt286 = {
 static int broadwell_audio_probe(struct platform_device *pdev)
 {
 	broadwell_rt286.dev = &pdev->dev;
-
-	snd_soc_set_dmi_name(&broadwell_rt286, NULL);
-
 	return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286);
 }
 
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 52f6d9c28df9..05c4d9564b0b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2192,6 +2192,9 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 		snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
 					card->num_of_dapm_routes);
 
+	/* try to set some sane longname if DMI is available */
+	snd_soc_set_dmi_name(card, NULL);
+
 	snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname),
 		 "%s", card->name);
 	snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-24 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-24  6:54 [PATCH v2 0/2] ASoC: Give prettier longname based on DMI Takashi Iwai
2017-04-24  6:54 ` [PATCH v2 1/2] ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name() Takashi Iwai
2017-04-24  6:54 ` [PATCH v2 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally Takashi Iwai
2017-04-24 18:20   ` Applied "ASoC: Call snd_soc_set_dmi_name() unconditionally" to the asoc tree Mark Brown
2017-04-24  6:58 ` [PATCH v2 0/2] ASoC: Give prettier longname based on DMI Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.