charger: max14577: Configure battery-dependent settings from DTS and sysfs

Remove hard-coded values for:
 - Fast Charge current,
 - End Of Charge current,
 - Fast Charge timer,
 - Overvoltage Protection Threshold,
 - Battery Constant Voltage,
and use DTS or sysfs to configure them. This allows using the max14577 charger
driver with different batteries.

Now the charger driver requires valid configuration data from DTS. In
case of wrong configuration data it fails during probe.

The fast charge timer is configured through sysfs entry.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
Krzysztof Kozlowski 2014-09-12 08:53:57 +02:00 committed by Lee Jones
parent b8f139f68f
commit e30110e9c9
4 changed files with 311 additions and 29 deletions

View file

@ -54,6 +54,13 @@ struct max14577_regulator_platform_data {
struct device_node *of_node;
};
struct max14577_charger_platform_data {
u32 constant_uvolt;
u32 fast_charge_uamp;
u32 eoc_uamp;
u32 ovp_uvolt;
};
/*
* MAX14577 MFD platform data
*/