Skip to content

Commit 2835f32

Browse files
andrealmeidrafaeljw
authored andcommitted
ACPI: battery: Accept charges over the design capacity as full
Some buggy firmware and/or brand new batteries can support a charge that's slightly over the reported design capacity. In such cases, the kernel will report to userspace that the charging state of the battery is "Unknown", when in reality the battery charge is "Full", at least from the design capacity point of view. Make the fallback condition accepts capacities over the designed capacity so userspace knows that is full. Signed-off-by: André Almeida <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 64570fb commit 2835f32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int acpi_battery_is_charged(struct acpi_battery *battery)
169169
return 1;
170170

171171
/* fallback to using design values for broken batteries */
172-
if (battery->design_capacity == battery->capacity_now)
172+
if (battery->design_capacity <= battery->capacity_now)
173173
return 1;
174174

175175
/* we don't do any sort of metric based on percentages */

0 commit comments

Comments
 (0)