]> git.karo-electronics.de Git - karo-tx-linux.git/commit
power: supply: max17042_battery: Add support for the STATUS property
authorHans de Goede <hdegoede@redhat.com>
Fri, 14 Apr 2017 18:32:51 +0000 (20:32 +0200)
committerSebastian Reichel <sre@kernel.org>
Mon, 1 May 2017 10:37:29 +0000 (12:37 +0200)
commita9df22c00d7c2c9c2944c62f1b819de6c214660f
tree8c81794bb217d09821e704bbb3566b09d228d291
parent917362135b8a5c0680acf08807e9fc6179eb6c79
power: supply: max17042_battery: Add support for the STATUS property

Userspace prefers the driver having a status property over having to guess
itself. Specifically this will properly make the GNOME3 UI (and likely
others) properly show discharging / charging / full status, instead
of always showing discharging as status.

Note that in the case there is no charger driver supplying the max17042,
then a status of unknown will get returned. At least upower treats
this the same as not having a status attribute, so in this case nothing
changes from a userspace pov.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/max17042_battery.c
include/linux/power/max17042_battery.h