summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2017-01-14 16:13:02 +0800
committerMark Brown <broonie@kernel.org>2017-01-17 17:57:14 +0000
commit345233d7c6be80d4124140f2a0993880c7ae2453 (patch)
tree1d5075485875e217101a145534a513b8a3fdd1fb /include/sound
parent2914266975fcb09a688cefe98874625366e67c65 (diff)
downloadlinux-345233d7c6be80d4124140f2a0993880c7ae2453.tar.gz
linux-345233d7c6be80d4124140f2a0993880c7ae2453.tar.xz
ASoC: core: Add API to use DMI name in sound card long name
Intel DSP platform drivers are used by many different devices but are difficult for userspace to differentiate. This patch adds an API to allow the DMI name to be used in the sound card long name, thereby helping userspace load the correct UCM configuration. Usually machine drivers uses their own name as the sound card name (short name), and leave the long name and driver name blank. This API will use the DMI info like vendor, product and board to make up the card long name. If the machine driver has already explicitly set the long name, this API will do nothing. This patch also allows for further differentiation as many devices that share the same DMI name i.e. Minnowboards, UP boards may be configured with different codecs or firmwares. The API supports flavoring the DMI name into the card longname to provide the extra differentiation required for these devices. For Use Case Manager (UCM) in the user space, changing card long name by this API is backward compatible, since the card name does not change. For a given sound card, even if there is no device-specific UCM configuration file that uses the card long name, UCM will fall back to load the default configuration file that uses the card name. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2b502f6cc6d0..8cad99dfb78c 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -497,6 +497,8 @@ 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);
+int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour);
+
/* Utility functions to get clock rates from various things */
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
@@ -1098,6 +1100,8 @@ struct snd_soc_card {
const char *name;
const char *long_name;
const char *driver_name;
+ char dmi_longname[80];
+
struct device *dev;
struct snd_card *snd_card;
struct module *owner;