Skip to content

Commit

Permalink
ASoC: Tune the accessory detection rates for WM8996
Browse files Browse the repository at this point in the history
Use longer intervals when the microphone is not inserted to increase
robustness against leisurely insertion.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Dec 14, 2011
1 parent a346249 commit 45ba82d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions sound/soc/codecs/wm8996.c
Original file line number Diff line number Diff line change
Expand Up @@ -2572,8 +2572,10 @@ static void wm8996_micd(struct snd_soc_codec *codec)
SND_JACK_BTN_0);

snd_soc_update_bits(codec, WM8996_MIC_DETECT_1,
WM8996_MICD_RATE_MASK,
WM8996_MICD_RATE_MASK);
WM8996_MICD_RATE_MASK |
WM8996_MICD_BIAS_STARTTIME_MASK,
WM8996_MICD_RATE_MASK |
9 << WM8996_MICD_BIAS_STARTTIME_SHIFT);
return;
}

Expand All @@ -2590,8 +2592,10 @@ static void wm8996_micd(struct snd_soc_codec *codec)
/* Increase poll rate to give better responsiveness
* for buttons */
snd_soc_update_bits(codec, WM8996_MIC_DETECT_1,
WM8996_MICD_RATE_MASK,
5 << WM8996_MICD_RATE_SHIFT);
WM8996_MICD_RATE_MASK |
WM8996_MICD_BIAS_STARTTIME_MASK,
5 << WM8996_MICD_RATE_SHIFT |
7 << WM8996_MICD_BIAS_STARTTIME_SHIFT);
} else {
dev_dbg(codec->dev, "Mic button up\n");
snd_soc_jack_report(wm8996->jack, 0, SND_JACK_BTN_0);
Expand Down Expand Up @@ -2639,8 +2643,10 @@ static void wm8996_micd(struct snd_soc_codec *codec)
* responsiveness.
*/
snd_soc_update_bits(codec, WM8996_MIC_DETECT_1,
WM8996_MICD_RATE_MASK,
7 << WM8996_MICD_RATE_SHIFT);
WM8996_MICD_RATE_MASK |
WM8996_MICD_BIAS_STARTTIME_MASK,
7 << WM8996_MICD_RATE_SHIFT |
7 << WM8996_MICD_BIAS_STARTTIME_SHIFT);
}
}
}
Expand Down

0 comments on commit 45ba82d

Please sign in to comment.