diff options
Diffstat (limited to 'sound/soc/codecs/arizona.c')
-rw-r--r-- | sound/soc/codecs/arizona.c | 69 |
1 files changed, 66 insertions, 3 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index de625813c0e6..657808ba1418 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <sound/tlv.h> | 19 | #include <sound/tlv.h> |
20 | 20 | ||
21 | #include <linux/mfd/arizona/core.h> | 21 | #include <linux/mfd/arizona/core.h> |
22 | #include <linux/mfd/arizona/gpio.h> | ||
22 | #include <linux/mfd/arizona/registers.h> | 23 | #include <linux/mfd/arizona/registers.h> |
23 | 24 | ||
24 | #include "arizona.h" | 25 | #include "arizona.h" |
@@ -199,9 +200,16 @@ int arizona_init_spk(struct snd_soc_codec *codec) | |||
199 | if (ret != 0) | 200 | if (ret != 0) |
200 | return ret; | 201 | return ret; |
201 | 202 | ||
202 | ret = snd_soc_dapm_new_controls(&codec->dapm, &arizona_spkr, 1); | 203 | switch (arizona->type) { |
203 | if (ret != 0) | 204 | case WM8997: |
204 | return ret; | 205 | break; |
206 | default: | ||
207 | ret = snd_soc_dapm_new_controls(&codec->dapm, | ||
208 | &arizona_spkr, 1); | ||
209 | if (ret != 0) | ||
210 | return ret; | ||
211 | break; | ||
212 | } | ||
205 | 213 | ||
206 | ret = arizona_request_irq(arizona, ARIZONA_IRQ_SPK_SHUTDOWN_WARN, | 214 | ret = arizona_request_irq(arizona, ARIZONA_IRQ_SPK_SHUTDOWN_WARN, |
207 | "Thermal warning", arizona_thermal_warn, | 215 | "Thermal warning", arizona_thermal_warn, |
@@ -223,6 +231,41 @@ int arizona_init_spk(struct snd_soc_codec *codec) | |||
223 | } | 231 | } |
224 | EXPORT_SYMBOL_GPL(arizona_init_spk); | 232 | EXPORT_SYMBOL_GPL(arizona_init_spk); |
225 | 233 | ||
234 | int arizona_init_gpio(struct snd_soc_codec *codec) | ||
235 | { | ||
236 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); | ||
237 | struct arizona *arizona = priv->arizona; | ||
238 | int i; | ||
239 | |||
240 | switch (arizona->type) { | ||
241 | case WM5110: | ||
242 | snd_soc_dapm_disable_pin(&codec->dapm, "DRC2 Signal Activity"); | ||
243 | break; | ||
244 | default: | ||
245 | break; | ||
246 | } | ||
247 | |||
248 | snd_soc_dapm_disable_pin(&codec->dapm, "DRC1 Signal Activity"); | ||
249 | |||
250 | for (i = 0; i < ARRAY_SIZE(arizona->pdata.gpio_defaults); i++) { | ||
251 | switch (arizona->pdata.gpio_defaults[i] & ARIZONA_GPN_FN_MASK) { | ||
252 | case ARIZONA_GP_FN_DRC1_SIGNAL_DETECT: | ||
253 | snd_soc_dapm_enable_pin(&codec->dapm, | ||
254 | "DRC1 Signal Activity"); | ||
255 | break; | ||
256 | case ARIZONA_GP_FN_DRC2_SIGNAL_DETECT: | ||
257 | snd_soc_dapm_enable_pin(&codec->dapm, | ||
258 | "DRC2 Signal Activity"); | ||
259 | break; | ||
260 | default: | ||
261 | break; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | return 0; | ||
266 | } | ||
267 | EXPORT_SYMBOL_GPL(arizona_init_gpio); | ||
268 | |||
226 | const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = { | 269 | const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = { |
227 | "None", | 270 | "None", |
228 | "Tone Generator 1", | 271 | "Tone Generator 1", |
@@ -517,6 +560,26 @@ const struct soc_enum arizona_ng_hold = | |||
517 | 4, arizona_ng_hold_text); | 560 | 4, arizona_ng_hold_text); |
518 | EXPORT_SYMBOL_GPL(arizona_ng_hold); | 561 | EXPORT_SYMBOL_GPL(arizona_ng_hold); |
519 | 562 | ||
563 | static const char * const arizona_in_dmic_osr_text[] = { | ||
564 | "1.536MHz", "3.072MHz", "6.144MHz", | ||
565 | }; | ||
566 | |||
567 | const struct soc_enum arizona_in_dmic_osr[] = { | ||
568 | SOC_ENUM_SINGLE(ARIZONA_IN1L_CONTROL, ARIZONA_IN1_OSR_SHIFT, | ||
569 | ARRAY_SIZE(arizona_in_dmic_osr_text), | ||
570 | arizona_in_dmic_osr_text), | ||
571 | SOC_ENUM_SINGLE(ARIZONA_IN2L_CONTROL, ARIZONA_IN2_OSR_SHIFT, | ||
572 | ARRAY_SIZE(arizona_in_dmic_osr_text), | ||
573 | arizona_in_dmic_osr_text), | ||
574 | SOC_ENUM_SINGLE(ARIZONA_IN3L_CONTROL, ARIZONA_IN3_OSR_SHIFT, | ||
575 | ARRAY_SIZE(arizona_in_dmic_osr_text), | ||
576 | arizona_in_dmic_osr_text), | ||
577 | SOC_ENUM_SINGLE(ARIZONA_IN4L_CONTROL, ARIZONA_IN4_OSR_SHIFT, | ||
578 | ARRAY_SIZE(arizona_in_dmic_osr_text), | ||
579 | arizona_in_dmic_osr_text), | ||
580 | }; | ||
581 | EXPORT_SYMBOL_GPL(arizona_in_dmic_osr); | ||
582 | |||
520 | static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena) | 583 | static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena) |
521 | { | 584 | { |
522 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); | 585 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); |