summaryrefslogtreecommitdiff
path: root/include/linux/qpnp/qpnp-revid.h
blob: b025df5682590b2623bf2d76ea6275297272a85b (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __QPNP_REVID
#define __QPNP_REVID

/* Common TYPE for all PMICs */
#define PMIC_TYPE		0x51

/* PM8994 */
#define PM8941_SUBTYPE		0x01

#define PM8941_V1P0_REV1	0x00
#define PM8941_V1P0_REV2	0x00
#define PM8941_V1P0_REV3	0x00
#define PM8941_V1P0_REV4	0x01

#define PM8941_V2P0_REV1	0x00
#define PM8941_V2P0_REV2	0x00
#define PM8941_V2P0_REV3	0x00
#define PM8941_V2P0_REV4	0x01

#define PM8941_V3P0_REV1	0x00
#define PM8941_V3P0_REV2	0x00
#define PM8941_V3P0_REV3	0x00
#define PM8941_V3P0_REV4	0x03

#define PM8941_V3P1_REV1	0x00
#define PM8941_V3P1_REV2	0x00
#define PM8941_V3P1_REV3	0x01
#define PM8941_V3P1_REV4	0x03

/* PM8841 */
#define PM8841_SUBTYPE		0x02

/* PM8019 */
#define PM8019_SUBTYPE		0x03

/* PM8226 */
#define PM8226_SUBTYPE		0x04

#define PM8226_V2P2_REV1	0x00
#define PM8226_V2P2_REV2	0x00
#define PM8226_V2P2_REV3	0x02
#define PM8226_V2P2_REV4	0x02

#define PM8226_V2P1_REV1	0x00
#define PM8226_V2P1_REV2	0x00
#define PM8226_V2P1_REV3	0x01
#define PM8226_V2P1_REV4	0x02

#define PM8226_V2P0_REV1	0x00
#define PM8226_V2P0_REV2	0x00
#define PM8226_V2P0_REV3	0x00
#define PM8226_V2P0_REV4	0x02

#define PM8226_V1P0_REV1	0x00
#define PM8226_V1P0_REV2	0x00
#define PM8226_V1P0_REV3	0x00
#define PM8226_V1P0_REV4	0x00

/* PM8110 */
#define PM8110_SUBTYPE		0x05

#define PM8110_V1P0_REV1	0x00
#define PM8110_V1P0_REV2	0x00
#define PM8110_V1P0_REV3	0x00
#define PM8110_V1P0_REV4	0x01

#define PM8110_V1P1_REV1	0x00
#define PM8110_V1P1_REV2	0x01
#define PM8110_V1P1_REV3	0x00
#define PM8110_V1P1_REV4	0x01

#define PM8110_V1P3_REV1	0x00
#define PM8110_V1P3_REV2	0x03
#define PM8110_V1P3_REV3	0x00
#define PM8110_V1P3_REV4	0x01

#define PM8110_V2P0_REV1	0x00
#define PM8110_V2P0_REV2	0x00
#define PM8110_V2P0_REV3	0x00
#define PM8110_V2P0_REV4	0x02

/* PMA8084 */
#define PMA8084_SUBTYPE		0x06

/* PMI8962 */
#define PMI8962_SUBTYPE		0x07

/* PMD9635 */
#define PMD9635_SUBTYPE		0x08
/* PM8994 */
#define PM8994_SUBTYPE		0x09

/* PMI8994 */
#define PMI8994_TYPE		0x51
#define PMI8994_SUBTYPE		0x0A

#define PMI8994_V1P0_REV1	0x00
#define PMI8994_V1P0_REV2	0x00
#define PMI8994_V1P0_REV3	0x00
#define PMI8994_V1P0_REV4	0x01

#define PMI8994_V2P0_REV1	0x00
#define PMI8994_V2P0_REV2	0x00
#define PMI8994_V2P0_REV3	0x00
#define PMI8994_V2P0_REV4	0x02

/* PM8916 */
#define PM8916_SUBTYPE		0x0B

#define PM8916_V1P0_REV1	0x00
#define PM8916_V1P0_REV2	0x00
#define PM8916_V1P0_REV3	0x00
#define PM8916_V1P0_REV4	0x01

#define PM8916_V1P1_REV1	0x00
#define PM8916_V1P1_REV2	0x00
#define PM8916_V1P1_REV3	0x01
#define PM8916_V1P1_REV4	0x01

#define PM8916_V2P0_REV1	0x00
#define PM8916_V2P0_REV2	0x00
#define PM8916_V2P0_REV3	0x00
#define PM8916_V2P0_REV4	0x02

/* PM8004 */
#define PM8004_SUBTYPE		0x0C

/* PM8909 */
#define PM8909_SUBTYPE		0x0D

#define PM8909_V1P0_REV1	0x00
#define PM8909_V1P0_REV2	0x00
#define PM8909_V1P0_REV3	0x00
#define PM8909_V1P0_REV4	0x01

#define PM8909_V1P1_REV1	0x00
#define PM8909_V1P1_REV2	0x00
#define PM8909_V1P1_REV3	0x01
#define PM8909_V1P1_REV4	0x01

/* PM2433 */
#define PM2433_SUBTYPE		0x0E

/* PMD9655 */
#define PMD9655_SUBTYPE		0x0F

/* PM8950 */
#define PM8950_SUBTYPE		0x10
#define PM8950_V1P0_REV4	0x01

#define PM8950_V2P0_REV4	0x02

/* PMI8950 */
#define PMI8950_SUBTYPE		0x11

/* PMK8001 */
#define PMK8001_SUBTYPE		0x12

/* PMI8996 */
#define PMI8996_SUBTYPE		0x13

/* PM8998 */
#define PM8998_SUBTYPE	0x14

/* PMI8998 */
#define PMI8998_SUBTYPE	0x15

/* PM660 */
#define PM660L_SUBTYPE	0x1A
#define PM660_SUBTYPE	0x1B

/* PMI8998 REV_ID */
#define PMI8998_V1P0_REV1	0x00
#define PMI8998_V1P0_REV2	0x00
#define PMI8998_V1P0_REV3	0x00
#define PMI8998_V1P0_REV4	0x01

#define PMI8998_V1P1_REV1	0x00
#define PMI8998_V1P1_REV2	0x00
#define PMI8998_V1P1_REV3	0x01
#define PMI8998_V1P1_REV4	0x01

#define PMI8998_V2P0_REV1	0x00
#define PMI8998_V2P0_REV2	0x00
#define PMI8998_V2P0_REV3	0x00
#define PMI8998_V2P0_REV4	0x02

/* PM660 REV_ID */
#define PM660_V1P0_REV1		0x00
#define PM660_V1P0_REV2		0x00
#define PM660_V1P0_REV3		0x00
#define PM660_V1P0_REV4		0x01

#define PM660_V1P1_REV1		0x00
#define PM660_V1P1_REV2		0x00
#define PM660_V1P1_REV3		0x01
#define PM660_V1P1_REV4		0x01

/* PM660L REV_ID */
#define PM660L_V1P1_REV1	0x00
#define PM660L_V1P1_REV2	0x00
#define PM660L_V1P1_REV3	0x01
#define PM660L_V1P1_REV4	0x01

#define PM660L_V2P0_REV1	0x00
#define PM660L_V2P0_REV2	0x00
#define PM660L_V2P0_REV3	0x00
#define PM660L_V2P0_REV4	0x02

/* PMI8998 FAB_ID */
#define PMI8998_FAB_ID_SMIC	0x11
#define PMI8998_FAB_ID_GF	0x30

/* PM660 FAB_ID */
#define PM660_FAB_ID_GF		0x0
#define PM660_FAB_ID_TSMC	0x2
#define PM660_FAB_ID_MX		0x3

/* PM8005 */
#define PM8005_SUBTYPE		0x18

/* PM8937 */
#define PM8937_SUBTYPE		0x19

/* PMI8937 */
#define PMI8937_SUBTYPE		0x37

/* SMB1381 */
#define SMB1381_SUBTYPE		0x17

/* SMB1355 */
#define SMB1355_SUBTYPE		0x1C

struct pmic_revid_data {
	u8		rev1;
	u8		rev2;
	u8		rev3;
	u8		rev4;
	u8		pmic_type;
	u8		pmic_subtype;
	const char	*pmic_name;
	int		fab_id;
};

#ifdef CONFIG_QPNP_REVID
struct pmic_revid_data *get_revid_data(struct device_node *dev_node);
#else
static inline
struct pmic_revid_data *get_revid_data(struct device_node *dev_node)
{
	return NULL;
}
#endif
#endif