power: supply: cpcap-charger: fix small mistake in current to register conversion
authorCarl Philipp Klemm <philipp@uvos.xyz>
Sun, 17 Jan 2021 21:47:45 +0000 (22:47 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 5 Apr 2021 08:21:12 +0000 (10:21 +0200)
Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/cpcap-charger.c

index 641dcad..3f06eb8 100644 (file)
@@ -318,7 +318,7 @@ static int cpcap_charger_current_to_regval(int microamp)
                return CPCAP_REG_CRM_ICHRG(0x0);
        if (miliamp < 177)
                return CPCAP_REG_CRM_ICHRG(0x1);
-       if (miliamp > 1596)
+       if (miliamp >= 1596)
                return CPCAP_REG_CRM_ICHRG(0xe);
 
        res = microamp / 88666;