blob: 086bf13edb19395ea4100e61385a2813d5a81370 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/* Copyright 2018 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* TI bq25710 battery charger driver.
*/
#ifndef __CROS_EC_BQ25710_H
#define __CROS_EC_BQ25710_H
/* SMBUS Interface */
#define BQ25710_SMBUS_ADDR1 0x12
#define BQ25710_BC12_MIN_VOLTAGE_MV 1408
/* Registers */
#define BQ25710_REG_CHARGE_OPTION_0 0x12
#define BQ25710_REG_CHARGE_CURRENT 0x14
#define BQ25710_REG_MAX_CHARGE_VOLTAGE 0x15
#define BQ25710_REG_CHARGE_OPTION_1 0x30
#define BQ25710_REG_CHARGE_OPTION_2 0x31
#define BQ25710_REG_CHARGE_OPTION_3 0x32
#define BQ25710_REG_PROCHOT_OPTION_0 0x33
#define BQ25710_REG_PROCHOT_OPTION_1 0x34
#define BQ25710_REG_ADC_OPTION 0x35
#define BQ25710_REG_CHARGER_STATUS 0x20
#define BQ25710_REG_PROCHOT_STATUS 0x21
#define BQ25710_REG_IIN_DPM 0x22
#define BQ25710_REG_ADC_VBUS_PSYS 0x23
#define BQ25710_REG_ADC_IBAT 0x24
#define BQ25710_REG_ADC_CMPIN_IIN 0x25
#define BQ25710_REG_ADC_VSYS_VBAT 0x2C
#define BQ25710_REG_PROCHOT_OPTION_1 0x34
#define BQ25710_REG_OTG_VOLTAGE 0x3B
#define BQ25710_REG_OTG_CURRENT 0x3C
#define BQ25710_REG_INPUT_VOLTAGE 0x3D
#define BQ25710_REG_MIN_SYSTEM_VOLTAGE 0x3E
#define BQ25710_REG_IIN_HOST 0x3F
#define BQ25710_REG_MANUFACTURER_ID 0xFE
#define BQ25710_REG_DEVICE_ADDRESS 0xFF
/* ChargeOption0 Register */
#define BQ25710_CHARGE_OPTION_0_LOW_POWER_MODE (1 << 15)
#define BQ25710_CHARGE_OPTION_0_EN_LEARN (1 << 5)
#define BQ25710_CHARGE_OPTION_0_CHRG_INHIBIT (1 << 0)
/* ChargeOption2 Register */
#define BQ25710_CHARGE_OPTION_2_EN_EXTILIM (1 << 7)
/* ChargeOption3 Register */
#define BQ25710_CHARGE_OPTION_3_EN_ICO_MODE (1 << 11)
/* ChargeStatus Register */
#define BQ25710_CHARGE_STATUS_ICO_DONE (1 << 14)
/* IIN_DPM Register */
#define BQ25710_CHARGE_IIN_BIT_0FFSET 8
#define BQ25710_CHARGE_MA_PER_STEP 50
/* ADCOption Register */
#define BQ25710_ADC_OPTION_ADC_START (1 << 14)
#define BQ25710_ADC_OPTION_EN_ADC_VBUS (1 << 6)
#define BQ25710_ADC_OPTION_EN_ADC_IIN (1 << 4)
#define BQ25710_ADC_OPTION_EN_ADC_ALL 0xFF
/* ADCVBUS/PSYS Register */
#define BQ25710_ADC_VBUS_STEP_MV 64
#define BQ25710_ADC_VBUS_BASE_MV 3200
#define BQ25710_ADC_VBUS_STEP_BIT_OFFSET 8
/* ADCIIN Register */
#define BQ25710_ADC_IIN_STEP_MA 50
#define BQ25710_ADC_IIN_STEP_BIT_OFFSET 8
/* ProchotOption1 Register */
#define BQ25710_PROCHOT_PROFILE_VDPM (1 << 7)
#endif /* __CROS_EC_BQ25710_H */
|