1
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
2
/*
3
- * Driver for MAX20730, MAX20734, and MAX20743 Integrated, Step-Down
4
- * Switching Regulators
3
+ * Driver for MAX20710, MAX20730, MAX20734, and MAX20743 Integrated,
4
+ * Step-Down Switching Regulators
5
5
*
6
6
* Copyright 2019 Google LLC.
7
+ * Copyright 2020 Maxim Integrated
7
8
*/
8
9
9
10
#include <linux/bits.h>
19
20
#include "pmbus.h"
20
21
21
22
enum chips {
23
+ max20710 ,
22
24
max20730 ,
23
25
max20734 ,
24
26
max20743
@@ -80,6 +82,7 @@ static long direct_to_val(u16 w, enum pmbus_sensor_classes class,
80
82
}
81
83
82
84
static u32 max_current [][5 ] = {
85
+ [max20710 ] = { 6200 , 8000 , 9700 , 11600 },
83
86
[max20730 ] = { 13000 , 16600 , 20100 , 23600 },
84
87
[max20734 ] = { 21000 , 27000 , 32000 , 38000 },
85
88
[max20743 ] = { 18900 , 24100 , 29200 , 34100 },
@@ -164,6 +167,35 @@ static int max20730_write_word_data(struct i2c_client *client, int page,
164
167
}
165
168
166
169
static const struct pmbus_driver_info max20730_info [] = {
170
+ [max20710 ] = {
171
+ .pages = 1 ,
172
+ .read_word_data = max20730_read_word_data ,
173
+ .write_word_data = max20730_write_word_data ,
174
+
175
+ /* Source : Maxim AN6140 and AN6042 */
176
+ .format [PSC_TEMPERATURE ] = direct ,
177
+ .m [PSC_TEMPERATURE ] = 21 ,
178
+ .b [PSC_TEMPERATURE ] = 5887 ,
179
+ .R [PSC_TEMPERATURE ] = -1 ,
180
+
181
+ .format [PSC_VOLTAGE_IN ] = direct ,
182
+ .m [PSC_VOLTAGE_IN ] = 3609 ,
183
+ .b [PSC_VOLTAGE_IN ] = 0 ,
184
+ .R [PSC_VOLTAGE_IN ] = -2 ,
185
+
186
+ .format [PSC_CURRENT_OUT ] = direct ,
187
+ .m [PSC_CURRENT_OUT ] = 153 ,
188
+ .b [PSC_CURRENT_OUT ] = 4976 ,
189
+ .R [PSC_CURRENT_OUT ] = -1 ,
190
+
191
+ .format [PSC_VOLTAGE_OUT ] = linear ,
192
+
193
+ .func [0 ] = PMBUS_HAVE_VIN |
194
+ PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
195
+ PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
196
+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
197
+ PMBUS_HAVE_STATUS_INPUT ,
198
+ },
167
199
[max20730 ] = {
168
200
.pages = 1 ,
169
201
.read_word_data = max20730_read_word_data ,
@@ -200,7 +232,8 @@ static const struct pmbus_driver_info max20730_info[] = {
200
232
.func [0 ] = PMBUS_HAVE_VIN |
201
233
PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
202
234
PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
203
- PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP ,
235
+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
236
+ PMBUS_HAVE_STATUS_INPUT ,
204
237
},
205
238
[max20734 ] = {
206
239
.pages = 1 ,
@@ -228,7 +261,8 @@ static const struct pmbus_driver_info max20730_info[] = {
228
261
.func [0 ] = PMBUS_HAVE_VIN |
229
262
PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
230
263
PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
231
- PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP ,
264
+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
265
+ PMBUS_HAVE_STATUS_INPUT ,
232
266
},
233
267
[max20743 ] = {
234
268
.pages = 1 ,
@@ -256,7 +290,8 @@ static const struct pmbus_driver_info max20730_info[] = {
256
290
.func [0 ] = PMBUS_HAVE_VIN |
257
291
PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
258
292
PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
259
- PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP ,
293
+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
294
+ PMBUS_HAVE_STATUS_INPUT ,
260
295
},
261
296
};
262
297
@@ -339,6 +374,7 @@ static int max20730_probe(struct i2c_client *client,
339
374
}
340
375
341
376
static const struct i2c_device_id max20730_id [] = {
377
+ { "max20710" , max20710 },
342
378
{ "max20730" , max20730 },
343
379
{ "max20734" , max20734 },
344
380
{ "max20743" , max20743 },
@@ -348,6 +384,7 @@ static const struct i2c_device_id max20730_id[] = {
348
384
MODULE_DEVICE_TABLE (i2c , max20730_id );
349
385
350
386
static const struct of_device_id max20730_of_match [] = {
387
+ { .compatible = "maxim,max20710" , .data = (void * )max20710 },
351
388
{ .compatible = "maxim,max20730" , .data = (void * )max20730 },
352
389
{ .compatible = "maxim,max20734" , .data = (void * )max20734 },
353
390
{ .compatible = "maxim,max20743" , .data = (void * )max20743 },
@@ -369,5 +406,5 @@ static struct i2c_driver max20730_driver = {
369
406
module_i2c_driver (max20730_driver );
370
407
371
408
MODULE_AUTHOR (
"Guenter Roeck <[email protected] >" );
372
- MODULE_DESCRIPTION ("PMBus driver for Maxim MAX20730 / MAX20734 / MAX20743" );
409
+ MODULE_DESCRIPTION ("PMBus driver for Maxim MAX20710 / MAX20730 / MAX20734 / MAX20743" );
373
410
MODULE_LICENSE ("GPL" );
0 commit comments