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 | |
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>
-rw-r--r-- | Documentation/hwmon/max20751 | 77 | ||||
-rw-r--r-- | MAINTAINERS | 7 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/Kconfig | 10 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/Makefile | 1 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/max20751.c | 64 |
5 files changed, 159 insertions, 0 deletions
diff --git a/Documentation/hwmon/max20751 b/Documentation/hwmon/max20751 new file mode 100644 index 000000000000..f9fa25ebb521 --- /dev/null +++ b/Documentation/hwmon/max20751 | |||
@@ -0,0 +1,77 @@ | |||
1 | Kernel driver max20751 | ||
2 | ====================== | ||
3 | |||
4 | Supported chips: | ||
5 | * maxim MAX20751 | ||
6 | Prefix: 'max20751' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX20751.pdf | ||
9 | Application note: http://pdfserv.maximintegrated.com/en/an/AN5941.pdf | ||
10 | |||
11 | Author: Guenter Roeck <linux@roeck-us.net> | ||
12 | |||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | This driver supports MAX20751 Multiphase Master with PMBus Interface | ||
18 | and Internal Buck Converter. | ||
19 | |||
20 | The driver is a client driver to the core PMBus driver. | ||
21 | Please see Documentation/hwmon/pmbus for details on PMBus client drivers. | ||
22 | |||
23 | |||
24 | Usage Notes | ||
25 | ----------- | ||
26 | |||
27 | This driver does not auto-detect devices. You will have to instantiate the | ||
28 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | ||
29 | details. | ||
30 | |||
31 | |||
32 | Platform data support | ||
33 | --------------------- | ||
34 | |||
35 | The driver supports standard PMBus driver platform data. | ||
36 | |||
37 | |||
38 | Sysfs entries | ||
39 | ------------- | ||
40 | |||
41 | The following attributes are supported. | ||
42 | |||
43 | in1_label "vin1" | ||
44 | in1_input Measured voltage. | ||
45 | in1_min Minimum input voltage. | ||
46 | in1_max Maximum input voltage. | ||
47 | in1_lcrit Critical minimum input voltage. | ||
48 | in1_crit Critical maximum input voltage. | ||
49 | in1_min_alarm Input voltage low alarm. | ||
50 | in1_lcrit_alarm Input voltage critical low alarm. | ||
51 | in1_min_alarm Input voltage low alarm. | ||
52 | in1_max_alarm Input voltage high alarm. | ||
53 | |||
54 | in2_label "vout1" | ||
55 | in2_input Measured voltage. | ||
56 | in2_min Minimum output voltage. | ||
57 | in2_max Maximum output voltage. | ||
58 | in2_lcrit Critical minimum output voltage. | ||
59 | in2_crit Critical maximum output voltage. | ||
60 | in2_min_alarm Output voltage low alarm. | ||
61 | in2_lcrit_alarm Output voltage critical low alarm. | ||
62 | in2_min_alarm Output voltage low alarm. | ||
63 | in2_max_alarm Output voltage high alarm. | ||
64 | |||
65 | curr1_input Measured output current. | ||
66 | curr1_label "iout1" | ||
67 | curr1_max Maximum output current. | ||
68 | curr1_alarm Current high alarm. | ||
69 | |||
70 | temp1_input Measured temperature. | ||
71 | temp1_max Maximum temperature. | ||
72 | temp1_crit Critical high temperature. | ||
73 | temp1_max_alarm Chip temperature high alarm. | ||
74 | temp1_crit_alarm Chip temperature critical high alarm. | ||
75 | |||
76 | power1_input Output power. | ||
77 | power1_label "pout1" | ||
diff --git a/MAINTAINERS b/MAINTAINERS index a9ae6c105520..6a406b607eeb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -6539,6 +6539,13 @@ S: Maintained | |||
6539 | F: Documentation/hwmon/max16065 | 6539 | F: Documentation/hwmon/max16065 |
6540 | F: drivers/hwmon/max16065.c | 6540 | F: drivers/hwmon/max16065.c |
6541 | 6541 | ||
6542 | MAX20751 HARDWARE MONITOR DRIVER | ||
6543 | M: Guenter Roeck <linux@roeck-us.net> | ||
6544 | L: lm-sensors@lm-sensors.org | ||
6545 | S: Maintained | ||
6546 | F: Documentation/hwmon/max20751 | ||
6547 | F: drivers/hwmon/max20751.c | ||
6548 | |||
6542 | MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER | 6549 | MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER |
6543 | M: "Hans J. Koch" <hjk@hansjkoch.de> | 6550 | M: "Hans J. Koch" <hjk@hansjkoch.de> |
6544 | L: lm-sensors@lm-sensors.org | 6551 | L: lm-sensors@lm-sensors.org |
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index 67901cb08f77..6e1e6fe434f7 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig | |||
@@ -73,6 +73,16 @@ config SENSORS_MAX16064 | |||
73 | This driver can also be built as a module. If so, the module will | 73 | This driver can also be built as a module. If so, the module will |
74 | be called max16064. | 74 | be called max16064. |
75 | 75 | ||
76 | config SENSORS_MAX20751 | ||
77 | tristate "Maxim MAX20751" | ||
78 | default n | ||
79 | help | ||
80 | If you say yes here you get hardware monitoring support for Maxim | ||
81 | MAX20751. | ||
82 | |||
83 | This driver can also be built as a module. If so, the module will | ||
84 | be called max20751. | ||
85 | |||
76 | config SENSORS_MAX34440 | 86 | config SENSORS_MAX34440 |
77 | tristate "Maxim MAX34440 and compatibles" | 87 | tristate "Maxim MAX34440 and compatibles" |
78 | default n | 88 | default n |
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile index 1454293e985c..bce046d37f02 100644 --- a/drivers/hwmon/pmbus/Makefile +++ b/drivers/hwmon/pmbus/Makefile | |||
@@ -8,6 +8,7 @@ obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o | |||
8 | obj-$(CONFIG_SENSORS_LM25066) += lm25066.o | 8 | obj-$(CONFIG_SENSORS_LM25066) += lm25066.o |
9 | obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o | 9 | obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o |
10 | obj-$(CONFIG_SENSORS_MAX16064) += max16064.o | 10 | obj-$(CONFIG_SENSORS_MAX16064) += max16064.o |
11 | obj-$(CONFIG_SENSORS_MAX20751) += max20751.o | ||
11 | obj-$(CONFIG_SENSORS_MAX34440) += max34440.o | 12 | obj-$(CONFIG_SENSORS_MAX34440) += max34440.o |
12 | obj-$(CONFIG_SENSORS_MAX8688) += max8688.o | 13 | obj-$(CONFIG_SENSORS_MAX8688) += max8688.o |
13 | obj-$(CONFIG_SENSORS_TPS40422) += tps40422.o | 14 | obj-$(CONFIG_SENSORS_TPS40422) += tps40422.o |
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"); | ||