aboutsummaryrefslogtreecommitdiff
path: root/include/power/tps65910_pmic.h
blob: 66214786d3e6ec1fe9818be3aa537f05e1a4922f (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (C) EETS GmbH, 2017, Felix Brack <f.brack@eets.ch>
 */

#ifndef __TPS65910_PMIC_H_
#define __TPS65910_PMIC_H_

#define TPS65910_I2C_SEL_MASK		(0x1 << 4)
#define TPS65910_VDD_SR_MASK		(0x1 << 7)
#define TPS65910_GAIN_SEL_MASK		(0x3 << 6)
#define TPS65910_VDD_SEL_MASK		0x7f
#define TPS65910_VDD_SEL_MIN		3
#define TPS65910_VDD_SEL_MAX		75
#define TPS65910_SEL_MASK		(0x3 << 2)
#define TPS65910_SUPPLY_STATE_MASK	0x3
#define TPS65910_SUPPLY_STATE_OFF	0x0
#define TPS65910_SUPPLY_STATE_ON	0x1

/* i2c registers */
enum {
	TPS65910_REG_RTC_SEC			= 0x00,
	TPS65910_REG_RTC_MIN,
	TPS65910_REG_RTC_HOUR,
	TPS65910_REG_RTC_DAY,
	TPS65910_REG_RTC_MONTH,
	TPS65910_REG_RTC_YEAR,
	TPS65910_REG_RTC_WEEK,
	TPS65910_REG_RTC_ALARM_SEC		= 0x08,
	TPS65910_REG_RTC_ALARM_MIN,
	TPS65910_REG_RTC_ALARM_HOUR,
	TPS65910_REG_RTC_ALARM_DAY,
	TPS65910_REG_RTC_ALARM_MONTH,
	TPS65910_REG_RTC_ALARM_YEAR,
	TPS65910_REG_RTC_CTRL			= 0x10,
	TPS65910_REG_RTC_STAT,
	TPS65910_REG_RTC_INT,
	TPS65910_REG_RTC_COMP_LSB,
	TPS65910_REG_RTC_COMP_MSB,
	TPS65910_REG_RTC_RESISTOR_PRG,
	TPS65910_REG_RTC_RESET_STAT,
	TPS65910_REG_BACKUP1,
	TPS65910_REG_BACKUP2,
	TPS65910_REG_BACKUP3,
	TPS65910_REG_BACKUP4,
	TPS65910_REG_BACKUP5,
	TPS65910_REG_PUADEN,
	TPS65910_REG_REF,
	TPS65910_REG_VRTC,
	TPS65910_REG_VIO			= 0x20,
	TPS65910_REG_VDD1,
	TPS65910_REG_VDD1_VAL,
	TPS65910_REG_VDD1_VAL_SR,
	TPS65910_REG_VDD2,
	TPS65910_REG_VDD2_VAL,
	TPS65910_REG_VDD2_VAL_SR,
	TPS65910_REG_VDD3,
	TPS65910_REG_VDIG1			= 0x30,
	TPS65910_REG_VDIG2,
	TPS65910_REG_VAUX1,
	TPS65910_REG_VAUX2,
	TPS65910_REG_VAUX33,
	TPS65910_REG_VMMC,
	TPS65910_REG_VPLL,
	TPS65910_REG_VDAC,
	TPS65910_REG_THERM,
	TPS65910_REG_BATTERY_BACKUP_CHARGE,
	TPS65910_REG_DCDC_CTRL			= 0x3e,
	TPS65910_REG_DEVICE_CTRL,
	TPS65910_REG_DEVICE_CTRL2,
	TPS65910_REG_SLEEP_KEEP_LDO_ON,
	TPS65910_REG_SLEEP_KEEP_RES_ON,
	TPS65910_REG_SLEEP_SET_LDO_OFF,
	TPS65910_REG_SLEEP_SET_RES_OFF,
	TPS65910_REG_EN1_LDO_ASS,
	TPS65910_REG_EM1_SMPS_ASS,
	TPS65910_REG_EN2_LDO_ASS,
	TPS65910_REG_EM2_SMPS_ASS,
	TPS65910_REG_INT_STAT			= 0x50,
	TPS65910_REG_INT_MASK,
	TPS65910_REG_INT_STAT2,
	TPS65910_REG_INT_MASK2,
	TPS65910_REG_GPIO			= 0x60,
	TPS65910_REG_JTAGREVNUM			= 0x80,
	TPS65910_NUM_REGS
};

/* chip supplies */
enum {
	TPS65910_SUPPLY_VCCIO	= 0x00,
	TPS65910_SUPPLY_VCC1,
	TPS65910_SUPPLY_VCC2,
	TPS65910_SUPPLY_VCC3,
	TPS65910_SUPPLY_VCC4,
	TPS65910_SUPPLY_VCC5,
	TPS65910_SUPPLY_VCC6,
	TPS65910_SUPPLY_VCC7,
	TPS65910_NUM_SUPPLIES
};

/* regulator unit numbers */
enum {
	TPS65910_UNIT_VRTC = 0x00,
	TPS65910_UNIT_VIO,
	TPS65910_UNIT_VDD1,
	TPS65910_UNIT_VDD2,
	TPS65910_UNIT_VDD3,
	TPS65910_UNIT_VDIG1,
	TPS65910_UNIT_VDIG2,
	TPS65910_UNIT_VPLL,
	TPS65910_UNIT_VDAC,
	TPS65910_UNIT_VAUX1,
	TPS65910_UNIT_VAUX2,
	TPS65910_UNIT_VAUX33,
	TPS65910_UNIT_VMMC,
};

/* platform data */
struct tps65910_regulator_pdata {
	u32 supply;	/* regulator supply voltage in uV */
	uint unit;	/* unit-address according to DT */
};

/* driver names */
#define TPS65910_BUCK_DRIVER	"tps65910_buck"
#define TPS65910_BOOST_DRIVER	"tps65910_boost"
#define TPS65910_LDO_DRIVER	"tps65910_ldo"

#endif /* __TPS65910_PMIC_H_ */