]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: max17042_battery: Add default platform_data fallback data
authorHans de Goede <hdegoede@redhat.com>
Fri, 14 Apr 2017 18:32:49 +0000 (20:32 +0200)
committerSebastian Reichel <sre@kernel.org>
Mon, 1 May 2017 10:37:25 +0000 (12:37 +0200)
commite057c6572afc2fdd4af7af3e61d4f7f32f817f20
treebb20f3213be8e5e6aad36ab8ab333b7c1f1d85b8
parent6ec6387e03f3f7695fc971fa733b46f64563e978
power: supply: max17042_battery: Add default platform_data fallback data

Some x86 machines use a max17047 fuel-gauge and x86 might be missing
platform_data if not provided by SFI.

This commit adds default platform_data as fallback option so that the
driver can work on boards where no platform_data is provided.

Since not all boards have a thermistor hooked up, set temp_min to 0 and
change the health checks from temp <= temp_min to temp < temp_min to
not trigger on such boards (where temp reads 0).

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