aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-09-12 02:53:57 -0400
committerLee Jones <lee.jones@linaro.org>2014-09-24 10:25:49 -0400
commite30110e9c96f48aea01abc3e6dfadb369cbafec3 (patch)
treeb0fffcc4dd9de5c4efad8dda1682d06acde65239 /include/linux/mfd
parentb8f139f68f2099b7f8b4ef470a1e53210e3aa025 (diff)
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>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/max14577-private.h19
-rw-r--r--include/linux/mfd/max14577.h7
2 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/mfd/max14577-private.h b/include/linux/mfd/max14577-private.h
index 7d514839c764..f01c1fae4d84 100644
--- a/include/linux/mfd/max14577-private.h
+++ b/include/linux/mfd/max14577-private.h
@@ -293,6 +293,25 @@ enum max14577_charger_reg {
293#define MAX77836_CHARGER_CURRENT_LIMIT_HIGH_STEP 25000U 293#define MAX77836_CHARGER_CURRENT_LIMIT_HIGH_STEP 25000U
294#define MAX77836_CHARGER_CURRENT_LIMIT_MAX 475000U 294#define MAX77836_CHARGER_CURRENT_LIMIT_MAX 475000U
295 295
296/*
297 * MAX14577 charger End-Of-Charge current limits
298 * (as in CHGCTRL5 register), uA
299 */
300#define MAX14577_CHARGER_EOC_CURRENT_LIMIT_MIN 50000U
301#define MAX14577_CHARGER_EOC_CURRENT_LIMIT_STEP 10000U
302#define MAX14577_CHARGER_EOC_CURRENT_LIMIT_MAX 200000U
303
304/*
305 * MAX14577/MAX77836 Battery Constant Voltage
306 * (as in CHGCTRL3 register), uV
307 */
308#define MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN 4000000U
309#define MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP 20000U
310#define MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX 4350000U
311
312/* Default value for fast charge timer, in hours */
313#define MAXIM_CHARGER_FAST_CHARGE_TIMER_DEFAULT 5
314
296/* MAX14577 regulator SFOUT LDO voltage, fixed, uV */ 315/* MAX14577 regulator SFOUT LDO voltage, fixed, uV */
297#define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000 316#define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000
298 317
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h
index 3c098d57b1d1..ccfaf952c31b 100644
--- a/include/linux/mfd/max14577.h
+++ b/include/linux/mfd/max14577.h
@@ -54,6 +54,13 @@ struct max14577_regulator_platform_data {
54 struct device_node *of_node; 54 struct device_node *of_node;
55}; 55};
56 56
57struct max14577_charger_platform_data {
58 u32 constant_uvolt;
59 u32 fast_charge_uamp;
60 u32 eoc_uamp;
61 u32 ovp_uvolt;
62};
63
57/* 64/*
58 * MAX14577 MFD platform data 65 * MAX14577 MFD platform data
59 */ 66 */