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>
This commit is contained in:
parent
9d47e01b9d
commit
e568252d72
@ -493,6 +493,9 @@ static int adp5061_get_battery_status(struct adp5061_state *st,
|
|||||||
case 0x4: /* VBAT_SNS > VWEAK */
|
case 0x4: /* VBAT_SNS > VWEAK */
|
||||||
val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
|
val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
val->intval = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user