diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-06-08 14:15:23 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2015-08-09 16:44:27 -0400 |
commit | 1f61cab8a729e00af77b51b44c3a8dc8ef3b3eb9 (patch) | |
tree | e50a28f26f95e50c4f50fdfbe81d69be9bce6886 /drivers/hwmon/pmbus/max20751.c | |
parent | 068c227056b9223fea1a759e08db2558d5cbb5ad (diff) |
hwmon: (pmbus) Add support for MAX20751
MAX20751 is a multiphase power controller with internal buck converter.
It uses VR12.0 to report the output voltage. This requires an explicit
driver, since the VR version can not be auto-detected.
The chip supports a manufacturer specific command to fine-tune the output
voltage. This command is not currently supported.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus/max20751.c')
-rw-r--r-- | drivers/hwmon/pmbus/max20751.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/max20751.c b/drivers/hwmon/pmbus/max20751.c new file mode 100644 index 000000000000..ab74aeae8cf2 --- /dev/null +++ b/drivers/hwmon/pmbus/max20751.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Hardware monitoring driver for Maxim MAX20751 | ||
3 | * | ||
4 | * Copyright (c) 2015 Guenter Roeck | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/i2c.h> | ||
22 | #include "pmbus.h" | ||
23 | |||
24 | static struct pmbus_driver_info max20751_info = { | ||
25 | .pages = 1, | ||
26 | .format[PSC_VOLTAGE_IN] = linear, | ||
27 | .format[PSC_VOLTAGE_OUT] = vid, | ||
28 | .vrm_version = vr12, | ||
29 | .format[PSC_TEMPERATURE] = linear, | ||
30 | .format[PSC_CURRENT_OUT] = linear, | ||
31 | .format[PSC_POWER] = linear, | ||
32 | .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | | ||
33 | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | | ||
34 | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | | ||
35 | PMBUS_HAVE_POUT, | ||
36 | }; | ||
37 | |||
38 | static int max20751_probe(struct i2c_client *client, | ||
39 | const struct i2c_device_id *id) | ||
40 | { | ||
41 | return pmbus_do_probe(client, id, &max20751_info); | ||
42 | } | ||
43 | |||
44 | static const struct i2c_device_id max20751_id[] = { | ||
45 | {"max20751", 0}, | ||
46 | {} | ||
47 | }; | ||
48 | |||
49 | MODULE_DEVICE_TABLE(i2c, max20751_id); | ||
50 | |||
51 | static struct i2c_driver max20751_driver = { | ||
52 | .driver = { | ||
53 | .name = "max20751", | ||
54 | }, | ||
55 | .probe = max20751_probe, | ||
56 | .remove = pmbus_do_remove, | ||
57 | .id_table = max20751_id, | ||
58 | }; | ||
59 | |||
60 | module_i2c_driver(max20751_driver); | ||
61 | |||
62 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); | ||
63 | MODULE_DESCRIPTION("PMBus driver for Maxim MAX20751"); | ||
64 | MODULE_LICENSE("GPL"); | ||