提交 84eaa136 编写于 作者: M Mark Brown

extcon: arizona: Attempt more microphone measurements

In some pathological use cases users may insert an accessory very slowly
causing multiple indeterminate measurements. Handle this by retrying many
measurements before we give up and declare a headphone.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 253b5374
......@@ -153,6 +153,8 @@ static void arizona_extcon_set_mode(struct arizona_extcon_info *info, int mode)
{
struct arizona *arizona = info->arizona;
mode %= info->num_micd_modes;
if (arizona->pdata.micd_pol_gpio > 0)
gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
info->micd_modes[mode].gpio);
......@@ -783,7 +785,7 @@ static irqreturn_t arizona_micdet(int irq, void *data)
* impedence then give up and report headphones.
*/
if (info->detecting && (val & 0x3f8)) {
if (info->jack_flips >= info->micd_num_modes) {
if (info->jack_flips >= info->micd_num_modes * 10) {
dev_dbg(arizona->dev, "Detected HP/line\n");
arizona_identify_headphone(info);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册