]> www.infradead.org Git - users/jedix/linux-maple.git/commit
power: supply: rk817: Update battery capacity calibration
authorChris Morgan <macromorgan@hotmail.com>
Thu, 26 Sep 2024 14:43:46 +0000 (09:43 -0500)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 16 Oct 2024 21:40:02 +0000 (23:40 +0200)
commit1e5335d00707220b46c28ab09cd09a1837b84978
treea74909cdf82ca7ed6f0d234bce7ad3abd3f5bf85
parentbded860c3110a45fe091f67b2fe6f3b2bb096165
power: supply: rk817: Update battery capacity calibration

The battery capacity calibration function continues to be a source of
bugs for end users, especially when coming out of suspend. This occurs
when the device has incorrect readings for voltage, and causes the
current code to set fully charged capacity incorrectly.

Add checks to ensure we don't attempt a capacity calibration when we
have invalid voltage values or no battery present, and remove the code
that attempts to automatically set the fully charged capacity in lieu of
making the value writeable. This way userspace is able to adjust the
fully charged capacity for a degraded battery.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20240926144346.94630-3-macroalpha82@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/rk817_charger.c