Commit e6a9be0b authored by Mark Brown's avatar Mark Brown

ASoC: Use a lower detection rate when monitoring headphones on WM8915

We only need to increase the detection rate to maximum if we're monitoring
for button presses as the response times needed for user interaction there
are much lower.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 1e025a36
...@@ -2288,6 +2288,12 @@ static void wm8915_micd(struct snd_soc_codec *codec) ...@@ -2288,6 +2288,12 @@ static void wm8915_micd(struct snd_soc_codec *codec)
SND_JACK_HEADSET | SND_JACK_BTN_0); SND_JACK_HEADSET | SND_JACK_BTN_0);
wm8915->jack_mic = true; wm8915->jack_mic = true;
wm8915->detecting = false; wm8915->detecting = false;
/* Increase poll rate to give better responsiveness
* for buttons */
snd_soc_update_bits(codec, WM8915_MIC_DETECT_1,
WM8915_MICD_RATE_MASK,
5 << WM8915_MICD_RATE_SHIFT);
} }
/* If we detected a lower impedence during initial startup /* If we detected a lower impedence during initial startup
...@@ -2328,15 +2334,17 @@ static void wm8915_micd(struct snd_soc_codec *codec) ...@@ -2328,15 +2334,17 @@ static void wm8915_micd(struct snd_soc_codec *codec)
SND_JACK_HEADPHONE, SND_JACK_HEADPHONE,
SND_JACK_HEADSET | SND_JACK_HEADSET |
SND_JACK_BTN_0); SND_JACK_BTN_0);
wm8915->detecting = false;
}
}
/* Increase poll rate to give better responsiveness for buttons */ /* Increase the detection rate a bit for
if (!wm8915->detecting) * responsiveness.
*/
snd_soc_update_bits(codec, WM8915_MIC_DETECT_1, snd_soc_update_bits(codec, WM8915_MIC_DETECT_1,
WM8915_MICD_RATE_MASK, WM8915_MICD_RATE_MASK,
5 << WM8915_MICD_RATE_SHIFT); 7 << WM8915_MICD_RATE_SHIFT);
wm8915->detecting = false;
}
}
} }
static irqreturn_t wm8915_irq(int irq, void *data) static irqreturn_t wm8915_irq(int irq, void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment