summaryrefslogtreecommitdiff
path: root/include/linux/power/max17042_battery.h
AgeCommit message (Collapse)Author
2017-05-01power: supply: max17042_battery: Add support for the STATUS propertyHans de Goede
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>
2017-05-01power: supply: max17042_battery: Add default platform_data fallback dataHans de Goede
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>
2015-05-23power: max17042_battery: add HEALTH and TEMP_* properties supportRamakrishna Pallala
This patch adds the support for following battery properties to max17042 fuel gauge driver. POWER_SUPPLY_PROP_TEMP_ALERT_MIN POWER_SUPPLY_PROP_TEMP_ALERT_MAX POWER_SUPPLY_PROP_TEMP_MIN POWER_SUPPLY_PROP_TEMP_MAX POWER_SUPPLY_PROP_HEALTH Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-06power: max17042_battery: Use reg type instead of chip typeBeomho Seo
Currently, max17042 battery driver choose register map by MAX17042_DevName register. But it is return IC specific firmware version. So other maxim chip hard to use this drvier. This patch choose chip type from driver_data. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2012-05-05max17042_battery: Add support for max17047/50 chipRamakrishna Pallala
max17047 is improved version of max17042 chip. It has few HW bug fixes with minor changes in register set. max17050 is same as max17047 chip except its silicon packging. So from driver's point of view there is no difference btw max1047 and max1050. This patch adds the support to dynamically detect the chip type and adds steps to initialize the max17047 chip. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26max17042: Add POR init procedure from Maxim appnoteRamakrishna Pallala
Add power on reset (POR) init procedure defined by the maxim appnote. Using this procedure ensures that the part is configured/initialized correctly at POR and improves early accuracy of the fuel gauge and informs the fuel gauge with the battery characterization parameters. The battery characterization parameters come from the maxim characterization procedure. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-13max17042: Align register definitions with data sheet and init appnoteDirk Brandewie
align the register names with max17042 data sheet removing registers that are marked reserved that are not used. Add register definitions defined in the maxim initialization appnote Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2011-07-08power_supply: MAX17042: Support additional propertiesDonggeun Kim
This patch supports additional properties (PRESENT, CYCLE_COUNT, VOLTAGE_MAX, VOLTAGE_MIN_DESIGN, CURRENT_NOW, CURRENT_AVG, CHARGE_FULL, and TEMP). Plus, initialization code for registers is added. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: KyungMin Park <kyungmin.park@samsung.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-01-14power_supply: Add MAX17042 Fuel Gauge DriverMyungJoo Ham
The MAX17042 is a fuel gauge with an I2C interface for lithium-ion betteries. Unlike its predecessor MAX17040, MAX17042 uses 16bit registers. Besides, MAX17042 has much more features than MAX17040; e.g., a thermistor, current and current accumulation measurement, battery internal resistance estimate, average values of measurement, and others. This patch implements a driver for MAX17042. In this initial release, we have implemented the most basic features of a fuel gauge: measure the battery capacity and voltage. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>