Skip to content

Commit

Permalink
extcon: arizona: Always take the first HPDET reading as the final one
Browse files Browse the repository at this point in the history
This should always be the most accurate reading for supported accessory
configurations.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Feb 11, 2013
1 parent 5d9ab70 commit c37b387
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/extcon/extcon-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,10 @@ static int arizona_hpdet_do_id(struct arizona_extcon_info *info, int *reading)
info->hpdet_res[0], info->hpdet_res[1],
info->hpdet_res[2]);


/* Take the headphone impedance for the main report */
*reading = info->hpdet_res[0];

/*
* Either the two grounds measure differently or we
* measure the mic as high impedance.
Expand All @@ -466,9 +470,6 @@ static int arizona_hpdet_do_id(struct arizona_extcon_info *info, int *reading)
dev_err(arizona->dev,
"Failed to report mic: %d\n", ret);
}

/* Take the headphone impedance for the main report */
*reading = info->hpdet_res[1];
} else {
dev_dbg(arizona->dev, "Detected headphone\n");
}
Expand Down

0 comments on commit c37b387

Please sign in to comment.