diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-01 14:10:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-02 06:54:01 -0400 |
commit | db924ff5c7297cca85eb0faa79ea29e988f96420 (patch) | |
tree | 05f665120f345e1e841265baf9f874426fa538cf | |
parent | 9dd5e53d9d2f933039eb2d5e4052afa249f638ba (diff) |
extcon: arizona: Don't ground flip when using HPDET identification
This extra check makes the procedure take longer and is of marginal use
in identification so do not execute it.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/extcon/extcon-arizona.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index c18cf14067c6..7c4ce812d735 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c | |||
@@ -470,29 +470,7 @@ static int arizona_hpdet_do_id(struct arizona_extcon_info *info, int *reading) | |||
470 | */ | 470 | */ |
471 | if (arizona->pdata.hpdet_acc_id) { | 471 | if (arizona->pdata.hpdet_acc_id) { |
472 | info->hpdet_res[info->num_hpdet_res++] = *reading; | 472 | info->hpdet_res[info->num_hpdet_res++] = *reading; |
473 | 473 | info->hpdet_res[info->num_hpdet_res++] = *reading; | |
474 | /* | ||
475 | * If the impedence is too high don't measure the | ||
476 | * second ground. | ||
477 | */ | ||
478 | if (info->num_hpdet_res == 1 && *reading >= 45) { | ||
479 | dev_dbg(arizona->dev, "Skipping ground flip\n"); | ||
480 | info->hpdet_res[info->num_hpdet_res++] = *reading; | ||
481 | } | ||
482 | |||
483 | if (info->num_hpdet_res == 1) { | ||
484 | dev_dbg(arizona->dev, "Flipping ground\n"); | ||
485 | |||
486 | regmap_update_bits(arizona->regmap, | ||
487 | ARIZONA_ACCESSORY_DETECT_MODE_1, | ||
488 | ARIZONA_ACCDET_SRC, | ||
489 | ~info->micd_modes[0].src); | ||
490 | |||
491 | regmap_update_bits(arizona->regmap, | ||
492 | ARIZONA_HEADPHONE_DETECT_1, | ||
493 | ARIZONA_HP_POLL, ARIZONA_HP_POLL); | ||
494 | return -EAGAIN; | ||
495 | } | ||
496 | 474 | ||
497 | /* Only check the mic directly if we didn't already ID it */ | 475 | /* Only check the mic directly if we didn't already ID it */ |
498 | if (id_gpio && info->num_hpdet_res == 2 && | 476 | if (id_gpio && info->num_hpdet_res == 2 && |