diff options
author | Todd E Brandt <todd.e.brandt@linux.intel.com> | 2015-01-07 16:25:52 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2015-01-22 10:56:05 -0500 |
commit | 774e0b41d485e18e655247441b8ca8b8dbe217c4 (patch) | |
tree | 6de0fbaeafcdd6c3f268d965e889c0fb501f527a | |
parent | fef22cb414387a1b8f57cbbca310fdb3895ab4da (diff) |
mfd: axp20x: Add support for fuel gauge cell driver
mfd/axp20x: add support for fuel gauge cell
Register definitions and platform data structure
for fuel gauge cell devices.
Signed-off-by: Todd Brandt <todd.e.brandt@intel.com>
Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | include/linux/mfd/axp20x.h | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 81589d176ae8..dfabd6db7ddf 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h | |||
@@ -124,10 +124,27 @@ enum { | |||
124 | #define AXP288_PMIC_ADC_H 0x56 | 124 | #define AXP288_PMIC_ADC_H 0x56 |
125 | #define AXP288_PMIC_ADC_L 0x57 | 125 | #define AXP288_PMIC_ADC_L 0x57 |
126 | #define AXP288_ADC_TS_PIN_CTRL 0x84 | 126 | #define AXP288_ADC_TS_PIN_CTRL 0x84 |
127 | |||
128 | #define AXP288_PMIC_ADC_EN 0x84 | 127 | #define AXP288_PMIC_ADC_EN 0x84 |
129 | #define AXP288_FG_TUNE5 0xed | ||
130 | 128 | ||
129 | /* Fuel Gauge */ | ||
130 | #define AXP288_FG_RDC1_REG 0xba | ||
131 | #define AXP288_FG_RDC0_REG 0xbb | ||
132 | #define AXP288_FG_OCVH_REG 0xbc | ||
133 | #define AXP288_FG_OCVL_REG 0xbd | ||
134 | #define AXP288_FG_OCV_CURVE_REG 0xc0 | ||
135 | #define AXP288_FG_DES_CAP1_REG 0xe0 | ||
136 | #define AXP288_FG_DES_CAP0_REG 0xe1 | ||
137 | #define AXP288_FG_CC_MTR1_REG 0xe2 | ||
138 | #define AXP288_FG_CC_MTR0_REG 0xe3 | ||
139 | #define AXP288_FG_OCV_CAP_REG 0xe4 | ||
140 | #define AXP288_FG_CC_CAP_REG 0xe5 | ||
141 | #define AXP288_FG_LOW_CAP_REG 0xe6 | ||
142 | #define AXP288_FG_TUNE0 0xe8 | ||
143 | #define AXP288_FG_TUNE1 0xe9 | ||
144 | #define AXP288_FG_TUNE2 0xea | ||
145 | #define AXP288_FG_TUNE3 0xeb | ||
146 | #define AXP288_FG_TUNE4 0xec | ||
147 | #define AXP288_FG_TUNE5 0xed | ||
131 | 148 | ||
132 | /* Regulators IDs */ | 149 | /* Regulators IDs */ |
133 | enum { | 150 | enum { |
@@ -236,4 +253,26 @@ struct axp20x_dev { | |||
236 | const struct regmap_irq_chip *regmap_irq_chip; | 253 | const struct regmap_irq_chip *regmap_irq_chip; |
237 | }; | 254 | }; |
238 | 255 | ||
256 | #define BATTID_LEN 64 | ||
257 | #define OCV_CURVE_SIZE 32 | ||
258 | #define MAX_THERM_CURVE_SIZE 25 | ||
259 | #define PD_DEF_MIN_TEMP 0 | ||
260 | #define PD_DEF_MAX_TEMP 55 | ||
261 | |||
262 | struct axp20x_fg_pdata { | ||
263 | char battid[BATTID_LEN + 1]; | ||
264 | int design_cap; | ||
265 | int min_volt; | ||
266 | int max_volt; | ||
267 | int max_temp; | ||
268 | int min_temp; | ||
269 | int cap1; | ||
270 | int cap0; | ||
271 | int rdc1; | ||
272 | int rdc0; | ||
273 | int ocv_curve[OCV_CURVE_SIZE]; | ||
274 | int tcsz; | ||
275 | int thermistor_curve[MAX_THERM_CURVE_SIZE][2]; | ||
276 | }; | ||
277 | |||
239 | #endif /* __LINUX_MFD_AXP20X_H */ | 278 | #endif /* __LINUX_MFD_AXP20X_H */ |