diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2013-09-23 09:33:58 -0400 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2013-09-26 20:37:01 -0400 |
commit | 4ba1a9ff5955df443a0ed6c956501f796a18abfa (patch) | |
tree | 5bc3ae5f7fa9e5bcb1932fa5aae9b57475382c98 /drivers/extcon | |
parent | 5bfbdc9caa7e16b2a77a62a9f9a63b5693e23716 (diff) |
extcon: arizona: Correct typo in headphone detect range transitions
We should move range when the measured value is greater than or equal to
the max value not when greater than.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-arizona.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 2064eac1b92b..1878415bd1ae 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c | |||
@@ -388,7 +388,7 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info) | |||
388 | >> ARIZONA_HP_IMPEDANCE_RANGE_SHIFT; | 388 | >> ARIZONA_HP_IMPEDANCE_RANGE_SHIFT; |
389 | 389 | ||
390 | if (range < ARRAY_SIZE(arizona_hpdet_b_ranges) - 1 && | 390 | if (range < ARRAY_SIZE(arizona_hpdet_b_ranges) - 1 && |
391 | (val < 100 || val > 0x3fb)) { | 391 | (val < 100 || val >= 0x3fb)) { |
392 | range++; | 392 | range++; |
393 | dev_dbg(arizona->dev, "Moving to HPDET range %d\n", | 393 | dev_dbg(arizona->dev, "Moving to HPDET range %d\n", |
394 | range); | 394 | range); |
@@ -401,7 +401,7 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info) | |||
401 | } | 401 | } |
402 | 402 | ||
403 | /* If we go out of range report top of range */ | 403 | /* If we go out of range report top of range */ |
404 | if (val < 100 || val > 0x3fb) { | 404 | if (val < 100 || val >= 0x3fb) { |
405 | dev_dbg(arizona->dev, "Measurement out of range\n"); | 405 | dev_dbg(arizona->dev, "Measurement out of range\n"); |
406 | return ARIZONA_HPDET_MAX; | 406 | return ARIZONA_HPDET_MAX; |
407 | } | 407 | } |