diff options
Diffstat (limited to 'sound/soc/codecs/arizona.c')
-rw-r--r-- | sound/soc/codecs/arizona.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index ac948a671ea6..e7d34711412c 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
@@ -364,6 +364,39 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w, | |||
364 | } | 364 | } |
365 | EXPORT_SYMBOL_GPL(arizona_out_ev); | 365 | EXPORT_SYMBOL_GPL(arizona_out_ev); |
366 | 366 | ||
367 | int arizona_hp_ev(struct snd_soc_dapm_widget *w, | ||
368 | struct snd_kcontrol *kcontrol, | ||
369 | int event) | ||
370 | { | ||
371 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(w->codec); | ||
372 | unsigned int mask = 1 << w->shift; | ||
373 | unsigned int val; | ||
374 | |||
375 | switch (event) { | ||
376 | case SND_SOC_DAPM_POST_PMU: | ||
377 | val = mask; | ||
378 | break; | ||
379 | case SND_SOC_DAPM_PRE_PMD: | ||
380 | val = 0; | ||
381 | break; | ||
382 | default: | ||
383 | return -EINVAL; | ||
384 | } | ||
385 | |||
386 | /* Store the desired state for the HP outputs */ | ||
387 | priv->arizona->hp_ena &= ~mask; | ||
388 | priv->arizona->hp_ena |= val; | ||
389 | |||
390 | /* Force off if HPDET magic is active */ | ||
391 | if (priv->arizona->hpdet_magic) | ||
392 | val = 0; | ||
393 | |||
394 | snd_soc_update_bits(w->codec, ARIZONA_OUTPUT_ENABLES_1, mask, val); | ||
395 | |||
396 | return arizona_out_ev(w, kcontrol, event); | ||
397 | } | ||
398 | EXPORT_SYMBOL_GPL(arizona_hp_ev); | ||
399 | |||
367 | static unsigned int arizona_sysclk_48k_rates[] = { | 400 | static unsigned int arizona_sysclk_48k_rates[] = { |
368 | 6144000, | 401 | 6144000, |
369 | 12288000, | 402 | 12288000, |