Unverified Commit 7bfbddfc authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: Intel: cht*: 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 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: 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>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-3-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b4ecd58b
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -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 */
/* SoC card */
static struct snd_soc_card snd_soc_card_cht = {
static struct snd_soc_card snd_soc_card_cht = {
	.name = "chtmax98090",
	.name = CARD_NAME,
	.driver_name = DRIVER_NAME,
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.dai_link = cht_dailink,
	.dai_link = cht_dailink,
	.num_links = ARRAY_SIZE(cht_dailink),
	.num_links = ARRAY_SIZE(cht_dailink),
+11 −1
Original line number Original line Diff line number Diff line
@@ -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 */
/* SoC card */
static struct snd_soc_card snd_soc_card_cht = {
static struct snd_soc_card snd_soc_card_cht = {
	.name = "chtnau8824",
	.name = CARD_NAME,
	.driver_name = DRIVER_NAME,
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.dai_link = cht_dailink,
	.dai_link = cht_dailink,
	.num_links = ARRAY_SIZE(cht_dailink),
	.num_links = ARRAY_SIZE(cht_dailink),
+15 −2
Original line number Original line Diff line number Diff line
@@ -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 */
/* SoC card */
static struct snd_soc_card snd_soc_card_chtrt5645 = {
static struct snd_soc_card snd_soc_card_chtrt5645 = {
	.name = "chtrt5645",
	.name = CARD_RT5645_NAME,
	.driver_name = DRIVER_NAME,
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.dai_link = cht_dailink,
	.dai_link = cht_dailink,
	.num_links = ARRAY_SIZE(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 = {
static struct snd_soc_card snd_soc_card_chtrt5650 = {
	.name = "chtrt5650",
	.name = CARD_RT5650_NAME,
	.driver_name = DRIVER_NAME,
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.dai_link = cht_dailink,
	.dai_link = cht_dailink,
	.num_links = ARRAY_SIZE(cht_dailink),
	.num_links = ARRAY_SIZE(cht_dailink),
+11 −1
Original line number Original line Diff line number Diff line
@@ -379,9 +379,19 @@ static int cht_resume_post(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 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 */
/* SoC card */
static struct snd_soc_card snd_soc_card_cht = {
static struct snd_soc_card snd_soc_card_cht = {
	.name = "cht-bsw-rt5672",
	.name = CARD_NAME,
	.driver_name = DRIVER_NAME,
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.dai_link = cht_dailink,
	.dai_link = cht_dailink,
	.num_links = ARRAY_SIZE(cht_dailink),
	.num_links = ARRAY_SIZE(cht_dailink),