extcon: arizona: Don't ground flip when using HPDET identification
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 1 Apr 2013 18:10:28 +0000 (19:10 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 2 Apr 2013 10:54:01 +0000 (11:54 +0100)
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>
drivers/extcon/extcon-arizona.c

index c18cf14067c661b90ec286a9c175ce960e74aeb0..7c4ce812d73547ae076f7a28c73909b405e73f41 100644 (file)
@@ -470,29 +470,7 @@ static int arizona_hpdet_do_id(struct arizona_extcon_info *info, int *reading)
         */
        if (arizona->pdata.hpdet_acc_id) {
                info->hpdet_res[info->num_hpdet_res++] = *reading;
-
-               /*
-                * If the impedence is too high don't measure the
-                * second ground.
-                */
-               if (info->num_hpdet_res == 1 && *reading >= 45) {
-                       dev_dbg(arizona->dev, "Skipping ground flip\n");
-                       info->hpdet_res[info->num_hpdet_res++] = *reading;
-               }
-
-               if (info->num_hpdet_res == 1) {
-                       dev_dbg(arizona->dev, "Flipping ground\n");
-
-                       regmap_update_bits(arizona->regmap,
-                                          ARIZONA_ACCESSORY_DETECT_MODE_1,
-                                          ARIZONA_ACCDET_SRC,
-                                          ~info->micd_modes[0].src);
-
-                       regmap_update_bits(arizona->regmap,
-                                          ARIZONA_HEADPHONE_DETECT_1,
-                                          ARIZONA_HP_POLL, ARIZONA_HP_POLL);
-                       return -EAGAIN;
-               }
+               info->hpdet_res[info->num_hpdet_res++] = *reading;
 
                /* Only check the mic directly if we didn't already ID it */
                if (id_gpio && info->num_hpdet_res == 2 &&