aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRamakrishna Pallala <ramakrishna.pallala@intel.com>2012-05-05 05:04:26 -0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-05-05 23:28:11 -0400
commit9a8422d205ea142a27c2573e5ca3d2cc87d75260 (patch)
tree0a9d95c9b45028a25c0b0d9b46d28d899253a9e4 /include
parentb1f092f6480e0a9d8d5f99d3363e022952d1af83 (diff)
max17042_battery: Add support for max17047/50 chip
max17047 is improved version of max17042 chip. It has few HW bug fixes with minor changes in register set. max17050 is same as max17047 chip except its silicon packging. So from driver's point of view there is no difference btw max1047 and max1050. This patch adds the support to dynamically detect the chip type and adds steps to initialize the max17047 chip. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/power/max17042_battery.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h
index e01b167e66f0..89dd84f47c6e 100644
--- a/include/linux/power/max17042_battery.h
+++ b/include/linux/power/max17042_battery.h
@@ -116,6 +116,18 @@ enum max17042_register {
116 MAX17042_VFSOC = 0xFF, 116 MAX17042_VFSOC = 0xFF,
117}; 117};
118 118
119/* Registers specific to max17047/50 */
120enum max17047_register {
121 MAX17047_QRTbl00 = 0x12,
122 MAX17047_FullSOCThr = 0x13,
123 MAX17047_QRTbl10 = 0x22,
124 MAX17047_QRTbl20 = 0x32,
125 MAX17047_V_empty = 0x3A,
126 MAX17047_QRTbl30 = 0x42,
127};
128
129enum max170xx_chip_type {MAX17042, MAX17047};
130
119/* 131/*
120 * used for setting a register to a desired value 132 * used for setting a register to a desired value
121 * addr : address for a register 133 * addr : address for a register
@@ -144,6 +156,7 @@ struct max17042_config_data {
144 u16 shdntimer; /* 0x03F */ 156 u16 shdntimer; /* 0x03F */
145 157
146 /* App data */ 158 /* App data */
159 u16 full_soc_thresh; /* 0x13 */
147 u16 design_cap; /* 0x18 */ 160 u16 design_cap; /* 0x18 */
148 u16 ichgt_term; /* 0x1E */ 161 u16 ichgt_term; /* 0x1E */
149 162
@@ -162,6 +175,10 @@ struct max17042_config_data {
162 u16 lavg_empty; /* 0x36 */ 175 u16 lavg_empty; /* 0x36 */
163 u16 dqacc; /* 0x45 */ 176 u16 dqacc; /* 0x45 */
164 u16 dpacc; /* 0x46 */ 177 u16 dpacc; /* 0x46 */
178 u16 qrtbl00; /* 0x12 */
179 u16 qrtbl10; /* 0x22 */
180 u16 qrtbl20; /* 0x32 */
181 u16 qrtbl30; /* 0x42 */
165 182
166 /* Cell technology from power_supply.h */ 183 /* Cell technology from power_supply.h */
167 u16 cell_technology; 184 u16 cell_technology;