aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2015-01-20 05:00:53 -0500
committerSebastian Reichel <sre@kernel.org>2015-01-20 08:04:12 -0500
commit4b6eade76ad19183464b739e9af1efacdb1bbda8 (patch)
tree0ce7e5d10c2a9ef29940affc75e98ce4146cb768
parent97d1596614dc3c7946aed8f6aa5e40748441b395 (diff)
mfd: max77693: Add defines for MAX77693 charger driver
Prepare for adding support for Maxim 77693 charger by adding necessary new defines. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r--include/linux/mfd/max77693-private.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 08dae01258b9..955dd990beaf 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -143,10 +143,118 @@ enum max77693_pmic_reg {
143#define FLASH_INT_FLED1_SHORT BIT(3) 143#define FLASH_INT_FLED1_SHORT BIT(3)
144#define FLASH_INT_OVER_CURRENT BIT(4) 144#define FLASH_INT_OVER_CURRENT BIT(4)
145 145
146/* Fast charge timer in in hours */
147#define DEFAULT_FAST_CHARGE_TIMER 4
148/* microamps */
149#define DEFAULT_TOP_OFF_THRESHOLD_CURRENT 150000
150/* minutes */
151#define DEFAULT_TOP_OFF_TIMER 30
152/* microvolts */
153#define DEFAULT_CONSTANT_VOLT 4200000
154/* microvolts */
155#define DEFAULT_MIN_SYSTEM_VOLT 3600000
156/* celsius */
157#define DEFAULT_THERMAL_REGULATION_TEMP 100
158/* microamps */
159#define DEFAULT_BATTERY_OVERCURRENT 3500000
160/* microvolts */
161#define DEFAULT_CHARGER_INPUT_THRESHOLD_VOLT 4300000
162
163/* MAX77693_CHG_REG_CHG_INT_OK register */
164#define CHG_INT_OK_BYP_SHIFT 0
165#define CHG_INT_OK_BAT_SHIFT 3
166#define CHG_INT_OK_CHG_SHIFT 4
167#define CHG_INT_OK_CHGIN_SHIFT 6
168#define CHG_INT_OK_DETBAT_SHIFT 7
169#define CHG_INT_OK_BYP_MASK BIT(CHG_INT_OK_BYP_SHIFT)
170#define CHG_INT_OK_BAT_MASK BIT(CHG_INT_OK_BAT_SHIFT)
171#define CHG_INT_OK_CHG_MASK BIT(CHG_INT_OK_CHG_SHIFT)
172#define CHG_INT_OK_CHGIN_MASK BIT(CHG_INT_OK_CHGIN_SHIFT)
173#define CHG_INT_OK_DETBAT_MASK BIT(CHG_INT_OK_DETBAT_SHIFT)
174
175/* MAX77693_CHG_REG_CHG_DETAILS_00 register */
176#define CHG_DETAILS_00_CHGIN_SHIFT 5
177#define CHG_DETAILS_00_CHGIN_MASK (0x3 << CHG_DETAILS_00_CHGIN_SHIFT)
178
179/* MAX77693_CHG_REG_CHG_DETAILS_01 register */
180#define CHG_DETAILS_01_CHG_SHIFT 0
181#define CHG_DETAILS_01_BAT_SHIFT 4
182#define CHG_DETAILS_01_TREG_SHIFT 7
183#define CHG_DETAILS_01_CHG_MASK (0xf << CHG_DETAILS_01_CHG_SHIFT)
184#define CHG_DETAILS_01_BAT_MASK (0x7 << CHG_DETAILS_01_BAT_SHIFT)
185#define CHG_DETAILS_01_TREG_MASK BIT(7)
186
187/* MAX77693_CHG_REG_CHG_DETAILS_01/CHG field */
188enum max77693_charger_charging_state {
189 MAX77693_CHARGING_PREQUALIFICATION = 0x0,
190 MAX77693_CHARGING_FAST_CONST_CURRENT,
191 MAX77693_CHARGING_FAST_CONST_VOLTAGE,
192 MAX77693_CHARGING_TOP_OFF,
193 MAX77693_CHARGING_DONE,
194 MAX77693_CHARGING_HIGH_TEMP,
195 MAX77693_CHARGING_TIMER_EXPIRED,
196 MAX77693_CHARGING_THERMISTOR_SUSPEND,
197 MAX77693_CHARGING_OFF,
198 MAX77693_CHARGING_RESERVED,
199 MAX77693_CHARGING_OVER_TEMP,
200 MAX77693_CHARGING_WATCHDOG_EXPIRED,
201};
202
203/* MAX77693_CHG_REG_CHG_DETAILS_01/BAT field */
204enum max77693_charger_battery_state {
205 MAX77693_BATTERY_NOBAT = 0x0,
206 /* Dead-battery or low-battery prequalification */
207 MAX77693_BATTERY_PREQUALIFICATION,
208 MAX77693_BATTERY_TIMER_EXPIRED,
209 MAX77693_BATTERY_GOOD,
210 MAX77693_BATTERY_LOWVOLTAGE,
211 MAX77693_BATTERY_OVERVOLTAGE,
212 MAX77693_BATTERY_OVERCURRENT,
213 MAX77693_BATTERY_RESERVED,
214};
215
216/* MAX77693_CHG_REG_CHG_DETAILS_02 register */
217#define CHG_DETAILS_02_BYP_SHIFT 0
218#define CHG_DETAILS_02_BYP_MASK (0xf << CHG_DETAILS_02_BYP_SHIFT)
219
146/* MAX77693 CHG_CNFG_00 register */ 220/* MAX77693 CHG_CNFG_00 register */
147#define CHG_CNFG_00_CHG_MASK 0x1 221#define CHG_CNFG_00_CHG_MASK 0x1
148#define CHG_CNFG_00_BUCK_MASK 0x4 222#define CHG_CNFG_00_BUCK_MASK 0x4
149 223
224/* MAX77693_CHG_REG_CHG_CNFG_01 register */
225#define CHG_CNFG_01_FCHGTIME_SHIFT 0
226#define CHG_CNFG_01_CHGRSTRT_SHIFT 4
227#define CHG_CNFG_01_PQEN_SHIFT 7
228#define CHG_CNFG_01_FCHGTIME_MASK (0x7 << CHG_CNFG_01_FCHGTIME_SHIFT)
229#define CHG_CNFG_01_CHGRSTRT_MASK (0x3 << CHG_CNFG_01_CHGRSTRT_SHIFT)
230#define CHG_CNFG_01_PQEN_MAKS BIT(CHG_CNFG_01_PQEN_SHIFT)
231
232/* MAX77693_CHG_REG_CHG_CNFG_03 register */
233#define CHG_CNFG_03_TOITH_SHIFT 0
234#define CHG_CNFG_03_TOTIME_SHIFT 3
235#define CHG_CNFG_03_TOITH_MASK (0x7 << CHG_CNFG_03_TOITH_SHIFT)
236#define CHG_CNFG_03_TOTIME_MASK (0x7 << CHG_CNFG_03_TOTIME_SHIFT)
237
238/* MAX77693_CHG_REG_CHG_CNFG_04 register */
239#define CHG_CNFG_04_CHGCVPRM_SHIFT 0
240#define CHG_CNFG_04_MINVSYS_SHIFT 5
241#define CHG_CNFG_04_CHGCVPRM_MASK (0x1f << CHG_CNFG_04_CHGCVPRM_SHIFT)
242#define CHG_CNFG_04_MINVSYS_MASK (0x7 << CHG_CNFG_04_MINVSYS_SHIFT)
243
244/* MAX77693_CHG_REG_CHG_CNFG_06 register */
245#define CHG_CNFG_06_CHGPROT_SHIFT 2
246#define CHG_CNFG_06_CHGPROT_MASK (0x3 << CHG_CNFG_06_CHGPROT_SHIFT)
247
248/* MAX77693_CHG_REG_CHG_CNFG_07 register */
249#define CHG_CNFG_07_REGTEMP_SHIFT 5
250#define CHG_CNFG_07_REGTEMP_MASK (0x3 << CHG_CNFG_07_REGTEMP_SHIFT)
251
252/* MAX77693_CHG_REG_CHG_CNFG_12 register */
253#define CHG_CNFG_12_B2SOVRC_SHIFT 0
254#define CHG_CNFG_12_VCHGINREG_SHIFT 3
255#define CHG_CNFG_12_B2SOVRC_MASK (0x7 << CHG_CNFG_12_B2SOVRC_SHIFT)
256#define CHG_CNFG_12_VCHGINREG_MASK (0x3 << CHG_CNFG_12_VCHGINREG_SHIFT)
257
150/* MAX77693 CHG_CNFG_09 Register */ 258/* MAX77693 CHG_CNFG_09 Register */
151#define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F 259#define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F
152 260