mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-12 06:42:12 +00:00
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>
This commit is contained in:
parent
5bfbdc9caa
commit
4ba1a9ff59
@ -388,7 +388,7 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
|
|||||||
>> ARIZONA_HP_IMPEDANCE_RANGE_SHIFT;
|
>> ARIZONA_HP_IMPEDANCE_RANGE_SHIFT;
|
||||||
|
|
||||||
if (range < ARRAY_SIZE(arizona_hpdet_b_ranges) - 1 &&
|
if (range < ARRAY_SIZE(arizona_hpdet_b_ranges) - 1 &&
|
||||||
(val < 100 || val > 0x3fb)) {
|
(val < 100 || val >= 0x3fb)) {
|
||||||
range++;
|
range++;
|
||||||
dev_dbg(arizona->dev, "Moving to HPDET range %d\n",
|
dev_dbg(arizona->dev, "Moving to HPDET range %d\n",
|
||||||
range);
|
range);
|
||||||
@ -401,7 +401,7 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If we go out of range report top of range */
|
/* If we go out of range report top of range */
|
||||||
if (val < 100 || val > 0x3fb) {
|
if (val < 100 || val >= 0x3fb) {
|
||||||
dev_dbg(arizona->dev, "Measurement out of range\n");
|
dev_dbg(arizona->dev, "Measurement out of range\n");
|
||||||
return ARIZONA_HPDET_MAX;
|
return ARIZONA_HPDET_MAX;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user