diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2014-10-01 08:08:15 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-01 12:04:34 -0400 |
commit | a5f0ab05b67213ef33107b716e8596a480b5875f (patch) | |
tree | 33577e0e29f4822ec787f29e5eb7541147323a7b | |
parent | 1400760c4637e1b3aa4460176d4f81ded58df393 (diff) |
ASoC: Intel: byt-rt5640: Enable DMIC interface for default DAPM route
It turned out DMIC interface wasn't enabled/disabled runtime for active
DMIC route in the rt5640 codec driver anymore after commit
71d97a794301 ("ASoC: rt5640: Use the platform data for DMIC settings").
Since DMIC interface must be enabled explicitly either by passing platform
data to rt5640 codec driver or by calling new rt5640_dmic_enable() this
patch adds a DMI quirk flag that is used to conditionally enable DMIC
interface during sound card init time.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/byt-rt5640.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/soc/intel/byt-rt5640.c b/sound/soc/intel/byt-rt5640.c index c323a101214e..8392c160d9e2 100644 --- a/sound/soc/intel/byt-rt5640.c +++ b/sound/soc/intel/byt-rt5640.c | |||
@@ -59,7 +59,11 @@ enum { | |||
59 | BYT_RT5640_IN1_MAP, | 59 | BYT_RT5640_IN1_MAP, |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static unsigned long byt_rt5640_custom_map = BYT_RT5640_DMIC1_MAP; | 62 | #define BYT_RT5640_MAP(quirk) ((quirk) & 0xff) |
63 | #define BYT_RT5640_DMIC_EN BIT(16) | ||
64 | |||
65 | static unsigned long byt_rt5640_quirk = BYT_RT5640_DMIC1_MAP | | ||
66 | BYT_RT5640_DMIC_EN; | ||
63 | 67 | ||
64 | static const struct snd_kcontrol_new byt_rt5640_controls[] = { | 68 | static const struct snd_kcontrol_new byt_rt5640_controls[] = { |
65 | SOC_DAPM_PIN_SWITCH("Headphone"), | 69 | SOC_DAPM_PIN_SWITCH("Headphone"), |
@@ -94,7 +98,7 @@ static int byt_rt5640_hw_params(struct snd_pcm_substream *substream, | |||
94 | 98 | ||
95 | static int byt_rt5640_quirk_cb(const struct dmi_system_id *id) | 99 | static int byt_rt5640_quirk_cb(const struct dmi_system_id *id) |
96 | { | 100 | { |
97 | byt_rt5640_custom_map = (unsigned long)id->driver_data; | 101 | byt_rt5640_quirk = (unsigned long)id->driver_data; |
98 | return 1; | 102 | return 1; |
99 | } | 103 | } |
100 | 104 | ||
@@ -129,7 +133,7 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) | |||
129 | } | 133 | } |
130 | 134 | ||
131 | dmi_check_system(byt_rt5640_quirk_table); | 135 | dmi_check_system(byt_rt5640_quirk_table); |
132 | switch (byt_rt5640_custom_map) { | 136 | switch (BYT_RT5640_MAP(byt_rt5640_quirk)) { |
133 | case BYT_RT5640_IN1_MAP: | 137 | case BYT_RT5640_IN1_MAP: |
134 | custom_map = byt_rt5640_intmic_in1_map; | 138 | custom_map = byt_rt5640_intmic_in1_map; |
135 | num_routes = ARRAY_SIZE(byt_rt5640_intmic_in1_map); | 139 | num_routes = ARRAY_SIZE(byt_rt5640_intmic_in1_map); |
@@ -143,6 +147,12 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) | |||
143 | if (ret) | 147 | if (ret) |
144 | return ret; | 148 | return ret; |
145 | 149 | ||
150 | if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN) { | ||
151 | ret = rt5640_dmic_enable(codec, 0, 0); | ||
152 | if (ret) | ||
153 | return ret; | ||
154 | } | ||
155 | |||
146 | snd_soc_dapm_ignore_suspend(dapm, "HPOL"); | 156 | snd_soc_dapm_ignore_suspend(dapm, "HPOL"); |
147 | snd_soc_dapm_ignore_suspend(dapm, "HPOR"); | 157 | snd_soc_dapm_ignore_suspend(dapm, "HPOR"); |
148 | 158 | ||