Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: adp5061: show unknown capacity_level as text

adp5061_get_battery_status() only defined show chg_status <= 4, others will
be show as '-1731902199' from /sys/class/power_supply/xx/capacity_level.
switch to show them as 'Unknown'.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Wei Yongjun and committed by
Sebastian Reichel
e568252d 9d47e01b

+3
+3
drivers/power/supply/adp5061.c
··· 493 493 case 0x4: /* VBAT_SNS > VWEAK */ 494 494 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL; 495 495 break; 496 + default: 497 + val->intval = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN; 498 + break; 496 499 } 497 500 498 501 return ret;