Skip to content

Commit 65c84e0

Browse files
andrealmeidgregkh
authored andcommitted
ACPI: battery: Accept charges over the design capacity as full
[ Upstream commit 2835f32 ] 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 <andrealmeid@collabora.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b600866 commit 65c84e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/battery.c

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

176176
/* fallback to using design values for broken batteries */
177-
if (battery->design_capacity == battery->capacity_now)
177+
if (battery->design_capacity <= battery->capacity_now)
178178
return 1;
179179

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

0 commit comments

Comments
 (0)