ASoC: Intel: cht*: simplify card names for SOF uses
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 17 Jun 2020 16:56:15 +0000 (11:56 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 17 Jun 2020 19:58:31 +0000 (20:58 +0100)
Blindly adding an sof- prefix to the card name is not user friendly
and causes UCM issues with a driver name truncated to 16 characters.

Simplify to use "sof-bytcht <codec_name>" pattern for all cht* machine
drivers. The sof- prefix is added by the core. A generic "SOF" driver
name is used, and UCMv2 will detect the configuration for this driver
by testing the card name.

Legacy uses are unmodified.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/cht_bsw_max98090_ti.c
sound/soc/intel/boards/cht_bsw_nau8824.c
sound/soc/intel/boards/cht_bsw_rt5645.c
sound/soc/intel/boards/cht_bsw_rt5672.c

index 767ac2ae03e225a4afd425acb7fb6f2a3eff4c92..3b0a8aad7ad569f94a6c8aa4186b6986a176153a 100644 (file)
@@ -382,9 +382,19 @@ static struct snd_soc_dai_link cht_dailink[] = {
        },
 };
 
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
+/* use space before codec name to simplify card ID, and simplify driver name */
+#define CARD_NAME "bytcht max98090" /* card name will be 'sof-bytcht max98090 */
+#define DRIVER_NAME "SOF"
+#else
+#define CARD_NAME "chtmax98090"
+#define DRIVER_NAME NULL /* card name will be used for driver name */
+#endif
+
 /* SoC card */
 static struct snd_soc_card snd_soc_card_cht = {
-       .name = "chtmax98090",
+       .name = CARD_NAME,
+       .driver_name = DRIVER_NAME,
        .owner = THIS_MODULE,
        .dai_link = cht_dailink,
        .num_links = ARRAY_SIZE(cht_dailink),
index 2f7c94d335c1cea1107f897190a6f59b17994d65..31e9c77ef3d3bf429aea0c284f15a784ad266ec6 100644 (file)
@@ -231,9 +231,19 @@ static struct snd_soc_dai_link cht_dailink[] = {
        },
 };
 
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
+/* use space before codec name to simplify card ID, and simplify driver name */
+#define CARD_NAME "bytcht nau8824" /* card name will be 'sof-bytcht nau8824 */
+#define DRIVER_NAME "SOF"
+#else
+#define CARD_NAME "chtnau8824"
+#define DRIVER_NAME NULL /* card name will be used for driver name */
+#endif
+
 /* SoC card */
 static struct snd_soc_card snd_soc_card_cht = {
-       .name = "chtnau8824",
+       .name = CARD_NAME,
+       .driver_name = DRIVER_NAME,
        .owner = THIS_MODULE,
        .dai_link = cht_dailink,
        .num_links = ARRAY_SIZE(cht_dailink),
index 22de138ffa3379ca3d7af44bc6aee4cac5ade3de..27379b75674cde127cc9d138c75a4b361e796453 100644 (file)
@@ -479,9 +479,21 @@ static struct snd_soc_dai_link cht_dailink[] = {
        },
 };
 
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
+/* use space before codec name to simplify card ID, and simplify driver name */
+#define CARD_RT5645_NAME "bytcht rt5645" /* card name 'sof-bytcht rt5645' */
+#define CARD_RT5650_NAME "bytcht rt5650" /* card name 'sof-bytcht rt5650' */
+#define DRIVER_NAME "SOF"
+#else
+#define CARD_RT5645_NAME "chtrt5645"
+#define CARD_RT5650_NAME "chtrt5650"
+#define DRIVER_NAME NULL /* card name will be used for driver name */
+#endif
+
 /* SoC card */
 static struct snd_soc_card snd_soc_card_chtrt5645 = {
-       .name = "chtrt5645",
+       .name = CARD_RT5645_NAME,
+       .driver_name = DRIVER_NAME,
        .owner = THIS_MODULE,
        .dai_link = cht_dailink,
        .num_links = ARRAY_SIZE(cht_dailink),
@@ -494,7 +506,8 @@ static struct snd_soc_card snd_soc_card_chtrt5645 = {
 };
 
 static struct snd_soc_card snd_soc_card_chtrt5650 = {
-       .name = "chtrt5650",
+       .name = CARD_RT5650_NAME,
+       .driver_name = DRIVER_NAME,
        .owner = THIS_MODULE,
        .dai_link = cht_dailink,
        .num_links = ARRAY_SIZE(cht_dailink),
index 7a43c70a1378a2e62a22102377b1dc1d4f19387f..73ef709bdb48b670197bfb53bc4c5ae41ab47fe4 100644 (file)
@@ -379,9 +379,19 @@ static int cht_resume_post(struct snd_soc_card *card)
        return 0;
 }
 
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
+/* use space before codec name to simplify card ID, and simplify driver name */
+#define CARD_NAME "bytcht rt5672" /* card name will be 'sof-bytcht rt5672' */
+#define DRIVER_NAME "SOF"
+#else
+#define CARD_NAME "cht-bsw-rt5672"
+#define DRIVER_NAME NULL /* card name will be used for driver name */
+#endif
+
 /* SoC card */
 static struct snd_soc_card snd_soc_card_cht = {
-       .name = "cht-bsw-rt5672",
+       .name = CARD_NAME,
+       .driver_name = DRIVER_NAME,
        .owner = THIS_MODULE,
        .dai_link = cht_dailink,
        .num_links = ARRAY_SIZE(cht_dailink),