diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2012-05-05 09:24:10 -0400 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-05-05 22:48:50 -0400 |
commit | d829dc75bafb10754f35fb8895e5143d20267b04 (patch) | |
tree | 4cff2aa07dcf7c15ef931e3b9ab20a2d84fcf68d /include/linux/power | |
parent | 34298d40e5853bc195c9db012fc1ddccac9b6f7f (diff) |
charger-manager: Poll battery health in normal state
Charger-Manager needs to check battery health in normal state
as well as suspend-to-RAM state. When the battery is fully charged,
Charger-Manager needs to determine when the chargers restart charging.
This patch allows Charger-Manager to monitor battery health in normal
state and handle operation for chargers after battery is fully charged.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'include/linux/power')
-rw-r--r-- | include/linux/power/charger-manager.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index 4f75e531c112..baa299a95e13 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/power_supply.h> | 18 | #include <linux/power_supply.h> |
19 | 19 | ||
20 | enum data_source { | 20 | enum data_source { |
21 | CM_BATTERY_PRESENT, | ||
22 | CM_NO_BATTERY, | ||
21 | CM_FUEL_GAUGE, | 23 | CM_FUEL_GAUGE, |
22 | CM_CHARGER_STAT, | 24 | CM_CHARGER_STAT, |
23 | }; | 25 | }; |
@@ -38,11 +40,18 @@ enum polling_modes { | |||
38 | * rtc_only_wakeup() returning false. | 40 | * rtc_only_wakeup() returning false. |
39 | * If the RTC given to CM is the only wakeup reason, | 41 | * If the RTC given to CM is the only wakeup reason, |
40 | * rtc_only_wakeup should return true. | 42 | * rtc_only_wakeup should return true. |
43 | * @assume_timer_stops_in_suspend: | ||
44 | * Assume that the jiffy timer stops in suspend-to-RAM. | ||
45 | * When enabled, CM does not rely on jiffies value in | ||
46 | * suspend_again and assumes that jiffies value does not | ||
47 | * change during suspend. | ||
41 | */ | 48 | */ |
42 | struct charger_global_desc { | 49 | struct charger_global_desc { |
43 | char *rtc_name; | 50 | char *rtc_name; |
44 | 51 | ||
45 | bool (*rtc_only_wakeup)(void); | 52 | bool (*rtc_only_wakeup)(void); |
53 | |||
54 | bool assume_timer_stops_in_suspend; | ||
46 | }; | 55 | }; |
47 | 56 | ||
48 | /** | 57 | /** |
@@ -50,6 +59,11 @@ struct charger_global_desc { | |||
50 | * @psy_name: the name of power-supply-class for charger manager | 59 | * @psy_name: the name of power-supply-class for charger manager |
51 | * @polling_mode: | 60 | * @polling_mode: |
52 | * Determine which polling mode will be used | 61 | * Determine which polling mode will be used |
62 | * @fullbatt_vchkdrop_ms: | ||
63 | * @fullbatt_vchkdrop_uV: | ||
64 | * Check voltage drop after the battery is fully charged. | ||
65 | * If it has dropped more than fullbatt_vchkdrop_uV after | ||
66 | * fullbatt_vchkdrop_ms, CM will restart charging. | ||
53 | * @fullbatt_uV: voltage in microvolt | 67 | * @fullbatt_uV: voltage in microvolt |
54 | * If it is not being charged and VBATT >= fullbatt_uV, | 68 | * If it is not being charged and VBATT >= fullbatt_uV, |
55 | * it is assumed to be full. | 69 | * it is assumed to be full. |
@@ -76,6 +90,8 @@ struct charger_desc { | |||
76 | enum polling_modes polling_mode; | 90 | enum polling_modes polling_mode; |
77 | unsigned int polling_interval_ms; | 91 | unsigned int polling_interval_ms; |
78 | 92 | ||
93 | unsigned int fullbatt_vchkdrop_ms; | ||
94 | unsigned int fullbatt_vchkdrop_uV; | ||
79 | unsigned int fullbatt_uV; | 95 | unsigned int fullbatt_uV; |
80 | 96 | ||
81 | enum data_source battery_present; | 97 | enum data_source battery_present; |
@@ -101,6 +117,11 @@ struct charger_desc { | |||
101 | * @fuel_gauge: power_supply for fuel gauge | 117 | * @fuel_gauge: power_supply for fuel gauge |
102 | * @charger_stat: array of power_supply for chargers | 118 | * @charger_stat: array of power_supply for chargers |
103 | * @charger_enabled: the state of charger | 119 | * @charger_enabled: the state of charger |
120 | * @fullbatt_vchk_jiffies_at: | ||
121 | * jiffies at the time full battery check will occur. | ||
122 | * @fullbatt_vchk_uV: voltage in microvolt | ||
123 | * criteria for full battery | ||
124 | * @fullbatt_vchk_work: work queue for full battery check | ||
104 | * @emergency_stop: | 125 | * @emergency_stop: |
105 | * When setting true, stop charging | 126 | * When setting true, stop charging |
106 | * @last_temp_mC: the measured temperature in milli-Celsius | 127 | * @last_temp_mC: the measured temperature in milli-Celsius |
@@ -121,6 +142,10 @@ struct charger_manager { | |||
121 | 142 | ||
122 | bool charger_enabled; | 143 | bool charger_enabled; |
123 | 144 | ||
145 | unsigned long fullbatt_vchk_jiffies_at; | ||
146 | unsigned int fullbatt_vchk_uV; | ||
147 | struct delayed_work fullbatt_vchk_work; | ||
148 | |||
124 | int emergency_stop; | 149 | int emergency_stop; |
125 | int last_temp_mC; | 150 | int last_temp_mC; |
126 | 151 | ||