diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2016-08-12 17:27:45 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-15 10:14:57 -0400 |
commit | 68817cdb3b9f1a19ac6741cdb7151f463d86ec7f (patch) | |
tree | 3891166c9d17c65ce81b1ecfbb0ed746933b19d3 /sound/soc/intel/boards | |
parent | 73442e3ccbc3136cf92a6785d81d118932292681 (diff) |
ASoC: Intel: bytcr_rt5640: quirk for mono speaker
Some Baytrail devices only have a mono speaker, add quirk and enable
it for T100TAF.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards')
-rw-r--r-- | sound/soc/intel/boards/bytcr_rt5640.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 2d3441d58d6f..421a53cfa53f 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c | |||
@@ -40,6 +40,7 @@ enum { | |||
40 | 40 | ||
41 | #define BYT_RT5640_MAP(quirk) ((quirk) & 0xff) | 41 | #define BYT_RT5640_MAP(quirk) ((quirk) & 0xff) |
42 | #define BYT_RT5640_DMIC_EN BIT(16) | 42 | #define BYT_RT5640_DMIC_EN BIT(16) |
43 | #define BYT_RT5640_MONO_SPEAKER BIT(17) | ||
43 | 44 | ||
44 | static unsigned long byt_rt5640_quirk = BYT_RT5640_DMIC1_MAP | | 45 | static unsigned long byt_rt5640_quirk = BYT_RT5640_DMIC1_MAP | |
45 | BYT_RT5640_DMIC_EN; | 46 | BYT_RT5640_DMIC_EN; |
@@ -63,10 +64,6 @@ static const struct snd_soc_dapm_route byt_rt5640_audio_map[] = { | |||
63 | {"IN2P", NULL, "Headset Mic"}, | 64 | {"IN2P", NULL, "Headset Mic"}, |
64 | {"Headphone", NULL, "HPOL"}, | 65 | {"Headphone", NULL, "HPOL"}, |
65 | {"Headphone", NULL, "HPOR"}, | 66 | {"Headphone", NULL, "HPOR"}, |
66 | {"Speaker", NULL, "SPOLP"}, | ||
67 | {"Speaker", NULL, "SPOLN"}, | ||
68 | {"Speaker", NULL, "SPORP"}, | ||
69 | {"Speaker", NULL, "SPORN"}, | ||
70 | }; | 67 | }; |
71 | 68 | ||
72 | static const struct snd_soc_dapm_route byt_rt5640_intmic_dmic1_map[] = { | 69 | static const struct snd_soc_dapm_route byt_rt5640_intmic_dmic1_map[] = { |
@@ -82,6 +79,18 @@ static const struct snd_soc_dapm_route byt_rt5640_intmic_in1_map[] = { | |||
82 | {"IN1P", NULL, "Internal Mic"}, | 79 | {"IN1P", NULL, "Internal Mic"}, |
83 | }; | 80 | }; |
84 | 81 | ||
82 | static const struct snd_soc_dapm_route byt_rt5640_stereo_spk_map[] = { | ||
83 | {"Speaker", NULL, "SPOLP"}, | ||
84 | {"Speaker", NULL, "SPOLN"}, | ||
85 | {"Speaker", NULL, "SPORP"}, | ||
86 | {"Speaker", NULL, "SPORN"}, | ||
87 | }; | ||
88 | |||
89 | static const struct snd_soc_dapm_route byt_rt5640_mono_spk_map[] = { | ||
90 | {"Speaker", NULL, "SPOLP"}, | ||
91 | {"Speaker", NULL, "SPOLN"}, | ||
92 | }; | ||
93 | |||
85 | static const struct snd_kcontrol_new byt_rt5640_controls[] = { | 94 | static const struct snd_kcontrol_new byt_rt5640_controls[] = { |
86 | SOC_DAPM_PIN_SWITCH("Headphone"), | 95 | SOC_DAPM_PIN_SWITCH("Headphone"), |
87 | SOC_DAPM_PIN_SWITCH("Headset Mic"), | 96 | SOC_DAPM_PIN_SWITCH("Headset Mic"), |
@@ -138,7 +147,9 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { | |||
138 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | 147 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
139 | DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TAF"), | 148 | DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TAF"), |
140 | }, | 149 | }, |
141 | .driver_data = (unsigned long *)BYT_RT5640_IN1_MAP, | 150 | .driver_data = (unsigned long *)(BYT_RT5640_IN1_MAP | |
151 | BYT_RT5640_MONO_SPEAKER | ||
152 | ), | ||
142 | }, | 153 | }, |
143 | { | 154 | { |
144 | .callback = byt_rt5640_quirk_cb, | 155 | .callback = byt_rt5640_quirk_cb, |
@@ -200,6 +211,18 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) | |||
200 | if (ret) | 211 | if (ret) |
201 | return ret; | 212 | return ret; |
202 | 213 | ||
214 | if (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) { | ||
215 | ret = snd_soc_dapm_add_routes(&card->dapm, | ||
216 | byt_rt5640_mono_spk_map, | ||
217 | ARRAY_SIZE(byt_rt5640_mono_spk_map)); | ||
218 | } else { | ||
219 | ret = snd_soc_dapm_add_routes(&card->dapm, | ||
220 | byt_rt5640_stereo_spk_map, | ||
221 | ARRAY_SIZE(byt_rt5640_stereo_spk_map)); | ||
222 | } | ||
223 | if (ret) | ||
224 | return ret; | ||
225 | |||
203 | if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN) { | 226 | if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN) { |
204 | ret = rt5640_dmic_enable(codec, 0, 0); | 227 | ret = rt5640_dmic_enable(codec, 0, 0); |
205 | if (ret) | 228 | if (ret) |