Commit b4ecd58b authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASoC: Intel: byt*: simplify card names for SOF uses

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 byt* 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: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-2-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e50186e1
...@@ -205,9 +205,19 @@ static struct snd_soc_dai_link byt_cht_cx2072x_dais[] = { ...@@ -205,9 +205,19 @@ static struct snd_soc_dai_link byt_cht_cx2072x_dais[] = {
}, },
}; };
#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 cx2072x" /* card name will be 'sof-bytcht cx2072x' */
#define DRIVER_NAME "SOF"
#else
#define CARD_NAME "bytcht-cx2072x"
#define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
/* SoC card */ /* SoC card */
static struct snd_soc_card byt_cht_cx2072x_card = { static struct snd_soc_card byt_cht_cx2072x_card = {
.name = "bytcht-cx2072x", .name = CARD_NAME,
.driver_name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dai_link = byt_cht_cx2072x_dais, .dai_link = byt_cht_cx2072x_dais,
.num_links = ARRAY_SIZE(byt_cht_cx2072x_dais), .num_links = ARRAY_SIZE(byt_cht_cx2072x_dais),
......
...@@ -205,9 +205,19 @@ static struct snd_soc_dai_link dailink[] = { ...@@ -205,9 +205,19 @@ static struct snd_soc_dai_link 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 da7213" /* card name will be 'sof-bytcht da7213' */
#define DRIVER_NAME "SOF"
#else
#define CARD_NAME "bytcht-da7213"
#define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
/* SoC card */ /* SoC card */
static struct snd_soc_card bytcht_da7213_card = { static struct snd_soc_card bytcht_da7213_card = {
.name = "bytcht-da7213", .name = CARD_NAME,
.driver_name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dai_link = dailink, .dai_link = dailink,
.num_links = ARRAY_SIZE(dailink), .num_links = ARRAY_SIZE(dailink),
......
...@@ -407,8 +407,18 @@ static int byt_cht_es8316_resume(struct snd_soc_card *card) ...@@ -407,8 +407,18 @@ static int byt_cht_es8316_resume(struct snd_soc_card *card)
return 0; 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 es8316" /* card name will be 'sof-bytcht es8316' */
#define DRIVER_NAME "SOF"
#else
#define CARD_NAME "bytcht-es8316"
#define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
static struct snd_soc_card byt_cht_es8316_card = { static struct snd_soc_card byt_cht_es8316_card = {
.name = "bytcht-es8316", .name = CARD_NAME,
.driver_name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dai_link = byt_cht_es8316_dais, .dai_link = byt_cht_es8316_dais,
.num_links = ARRAY_SIZE(byt_cht_es8316_dais), .num_links = ARRAY_SIZE(byt_cht_es8316_dais),
......
...@@ -1127,8 +1127,18 @@ static int byt_rt5640_resume(struct snd_soc_card *card) ...@@ -1127,8 +1127,18 @@ static int byt_rt5640_resume(struct snd_soc_card *card)
return 0; 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 rt5640" /* card name will be 'sof-bytcht rt5640' */
#define DRIVER_NAME "SOF"
#else
#define CARD_NAME "bytcr-rt5640"
#define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
static struct snd_soc_card byt_rt5640_card = { static struct snd_soc_card byt_rt5640_card = {
.name = "bytcr-rt5640", .name = CARD_NAME,
.driver_name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dai_link = byt_rt5640_dais, .dai_link = byt_rt5640_dais,
.num_links = ARRAY_SIZE(byt_rt5640_dais), .num_links = ARRAY_SIZE(byt_rt5640_dais),
......
...@@ -827,8 +827,18 @@ static int byt_rt5651_resume(struct snd_soc_card *card) ...@@ -827,8 +827,18 @@ static int byt_rt5651_resume(struct snd_soc_card *card)
return 0; 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 rt5651" /* card name will be 'sof-bytcht rt5651' */
#define DRIVER_NAME "SOF"
#else
#define CARD_NAME "bytcr-rt5651"
#define DRIVER_NAME NULL /* card name will be used for driver name */
#endif
static struct snd_soc_card byt_rt5651_card = { static struct snd_soc_card byt_rt5651_card = {
.name = "bytcr-rt5651", .name = CARD_NAME,
.driver_name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dai_link = byt_rt5651_dais, .dai_link = byt_rt5651_dais,
.num_links = ARRAY_SIZE(byt_rt5651_dais), .num_links = ARRAY_SIZE(byt_rt5651_dais),
......
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