|
30 | 30 | #define ADP536X_VBAT_READ_H 0x25
|
31 | 31 | #define ADP536X_VBAT_READ_L 0x26
|
32 | 32 | #define ADP536X_FUEL_GAUGE_MODE 0x27
|
33 |
| -#define ADP536X_BUCK_CFG 0x29 |
34 |
| -#define ADP536X_BUCK_OUTPUT 0x2A |
35 |
| -#define ADP536X_BUCKBST_CFG 0x2B |
36 |
| -#define ADP536X_BUCKBST_OUTPUT 0x2C |
37 | 33 | #define ADP536X_DEFAULT_SET_REG 0x37
|
38 | 34 |
|
39 | 35 | /* Manufacturer and model ID register. */
|
|
119 | 115 | #define ADP536X_BAT_OC_CHG_DGT_OC_CHG_MSK GENMASK(4, 3)
|
120 | 116 | #define ADP536X_BAT_OC_CHG_DGT_OC_CHG(x) (((x) & 0x03) << 3)
|
121 | 117 |
|
122 |
| -/* Buck configure register. */ |
123 |
| -#define ADP536X_BUCK_CFG_DISCHG_BUCK_MSK BIT(1) |
124 |
| -#define ADP536X_BUCK_CFG_DISCHG_BUCK(x) (((x) & 0x01) << 1) |
125 |
| - |
126 |
| -/* Buck output voltage setting register. */ |
127 |
| -#define ADP536X_BUCK_OUTPUT_VOUT_BUCK_MSK GENMASK(5, 0) |
128 |
| -#define ADP536X_BUCK_OUTPUT_VOUT_BUCK(x) (((x) & 0x3F) << 0) |
129 |
| -#define ADP536X_BUCK_OUTPUT_BUCK_DLY_MSK GENMASK(7, 6) |
130 |
| -#define ADP536X_BUCK_OUTPUT_BUCK_DLY(x) (((x) & 0x03) << 6) |
131 |
| - |
132 |
| -/* Buck/boost output voltage setting register. */ |
133 |
| -#define ADP536X_BUCKBST_OUTPUT_VOUT_BUCKBST_MSK GENMASK(5, 0) |
134 |
| -#define ADP536X_BUCKBST_OUTPUT_VOUT_BUCKBST(x) (((x) & 0x3F) << 0) |
135 |
| -#define ADP536X_BUCKBST_OUT_BUCK_DLY_MSK GENMASK(7, 6) |
136 |
| -#define ADP536X_BUCKBST_OUT_BUCK_DLY(x) (((x) & 0x03) << 6) |
137 |
| - |
138 |
| -/* Buck/boost configure register. */ |
139 |
| -#define ADP536X_BUCKBST_CFG_EN_BUCKBST_MSK BIT(0) |
140 |
| -#define ADP536X_BUCKBST_CFG_EN_BUCKBST(x) (((x) & 0x01) << 0) |
141 |
| - |
142 | 118 | /* DEFAULT_SET register. */
|
143 | 119 | #define ADP536X_DEFAULT_SET_MSK GENMASK(7, 0)
|
144 | 120 | #define ADP536X_DEFAULT_SET(x) (((x) & 0xFF) << 0)
|
@@ -245,40 +221,6 @@ int adp536x_oc_chg_current_set(uint8_t value)
|
245 | 221 | ADP536X_BAT_OC_CHG_OC_CHG(value));
|
246 | 222 | }
|
247 | 223 |
|
248 |
| -int adp536x_buck_1v8_set(void) |
249 |
| -{ |
250 |
| - /* 1.8V equals to 0b11000 = 0x18 according to ADP536X datasheet. */ |
251 |
| - uint8_t value = 0x18; |
252 |
| - |
253 |
| - return adp536x_reg_write_mask(ADP536X_BUCK_OUTPUT, |
254 |
| - ADP536X_BUCK_OUTPUT_VOUT_BUCK_MSK, |
255 |
| - ADP536X_BUCK_OUTPUT_VOUT_BUCK(value)); |
256 |
| -} |
257 |
| - |
258 |
| -int adp536x_buck_discharge_set(bool enable) |
259 |
| -{ |
260 |
| - return adp536x_reg_write_mask(ADP536X_BUCK_CFG, |
261 |
| - ADP536X_BUCK_CFG_DISCHG_BUCK_MSK, |
262 |
| - ADP536X_BUCK_CFG_DISCHG_BUCK(enable)); |
263 |
| -} |
264 |
| - |
265 |
| -int adp536x_buckbst_3v3_set(void) |
266 |
| -{ |
267 |
| - /* 3.3V equals to 0b10011 = 0x13, according to ADP536X datasheet. */ |
268 |
| - uint8_t value = 0x13; |
269 |
| - |
270 |
| - return adp536x_reg_write_mask(ADP536X_BUCKBST_OUTPUT, |
271 |
| - ADP536X_BUCKBST_OUTPUT_VOUT_BUCKBST_MSK, |
272 |
| - ADP536X_BUCKBST_OUTPUT_VOUT_BUCKBST(value)); |
273 |
| -} |
274 |
| - |
275 |
| -int adp536x_buckbst_enable(bool enable) |
276 |
| -{ |
277 |
| - return adp536x_reg_write_mask(ADP536X_BUCKBST_CFG, |
278 |
| - ADP536X_BUCKBST_CFG_EN_BUCKBST_MSK, |
279 |
| - ADP536X_BUCKBST_CFG_EN_BUCKBST(enable)); |
280 |
| -} |
281 |
| - |
282 | 224 | static int adp536x_default_set(void)
|
283 | 225 | {
|
284 | 226 | /* The value 0x7F has to be written to this register to accomplish
|
|
0 commit comments