summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/bytcht_es8316.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/boards/bytcht_es8316.c')
-rw-r--r--sound/soc/intel/boards/bytcht_es8316.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index 941a66f94660..cdf2061e7613 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -54,6 +54,7 @@ enum {
#define BYT_CHT_ES8316_MAP(quirk) ((quirk) & GENMASK(3, 0))
#define BYT_CHT_ES8316_SSP0 BIT(16)
+#define BYT_CHT_ES8316_MONO_SPEAKER BIT(17)
static int quirk;
@@ -69,6 +70,8 @@ static void log_quirks(struct device *dev)
dev_info(dev, "quirk IN2_MAP enabled");
if (quirk & BYT_CHT_ES8316_SSP0)
dev_info(dev, "quirk SSP0 enabled");
+ if (quirk & BYT_CHT_ES8316_MONO_SPEAKER)
+ dev_info(dev, "quirk MONO_SPEAKER enabled\n");
}
static int byt_cht_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,
@@ -352,6 +355,7 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = {
/* SoC card */
static char codec_name[SND_ACPI_I2C_ID_LEN];
+static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */
static int byt_cht_es8316_suspend(struct snd_soc_card *card)
{
@@ -433,6 +437,7 @@ static const struct acpi_gpio_mapping byt_cht_es8316_gpios[] = {
static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
{
+ const char * const mic_name[] = { "in1", "in2" };
struct byt_cht_es8316_private *priv;
struct device *dev = &pdev->dev;
struct snd_soc_acpi_mach *mach;
@@ -467,11 +472,13 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
/* Check for BYTCR or other platform and setup quirks */
if (x86_match_cpu(baytrail_cpu_ids) &&
mach->mach_params.acpi_ipc_irq_index == 0) {
- /* On BYTCR default to SSP0, internal-mic-in2-map */
- quirk = BYT_CHT_ES8316_SSP0 | BYT_CHT_ES8316_INTMIC_IN2_MAP;
+ /* On BYTCR default to SSP0, internal-mic-in2-map, mono-spk */
+ quirk = BYT_CHT_ES8316_SSP0 | BYT_CHT_ES8316_INTMIC_IN2_MAP |
+ BYT_CHT_ES8316_MONO_SPEAKER;
} else {
- /* Others default to internal-mic-in1-map */
- quirk = BYT_CHT_ES8316_INTMIC_IN1_MAP;
+ /* Others default to internal-mic-in1-map, mono-speaker */
+ quirk = BYT_CHT_ES8316_INTMIC_IN1_MAP |
+ BYT_CHT_ES8316_MONO_SPEAKER;
}
if (quirk_override != -1) {
dev_info(dev, "Overriding quirk 0x%x => 0x%x\n", quirk,
@@ -518,6 +525,10 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
}
/* register the soc card */
+ snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic",
+ (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
+ mic_name[BYT_CHT_ES8316_MAP(quirk)]);
+ byt_cht_es8316_card.long_name = long_name;
byt_cht_es8316_card.dev = dev;
snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);