summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Sloyko <maxims@google.com>2019-04-12 16:37:56 -0400
committerGuenter Roeck <linux@roeck-us.net>2019-04-15 20:19:53 -0400
commit00669d196c616c0a9970a3a9ee66efab6868df0c (patch)
tree8dd0fadd55b1e4b6c714bc105da522eea8001e77
parentc49b7b3981f5c39b9b50dc65e32d3c6a553825de (diff)
hwmon: (pmbus/ir38064) Add driver for Infineon IR38064 Voltage Regulator
Add the pmbus driver for the Infineon ir38064 voltage regulator. VOUT_MODE is not supported by the device. The driver fakes linear16 mode with exponent value -8. The device supports VOUT_PEAK, IOUT_PEAK, and TEMPERATURE_PEAK, however this driver does not enable them. Signed-off-by: Maxim Sloyko <maxims@google.com> Signed-off-by: Patrick Venture <venture@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--Documentation/hwmon/ir3806464
-rw-r--r--drivers/hwmon/pmbus/Kconfig9
-rw-r--r--drivers/hwmon/pmbus/Makefile1
-rw-r--r--drivers/hwmon/pmbus/ir38064.c65
4 files changed, 139 insertions, 0 deletions
diff --git a/Documentation/hwmon/ir38064 b/Documentation/hwmon/ir38064
new file mode 100644
index 000000000000..c3697d7aaaa4
--- /dev/null
+++ b/Documentation/hwmon/ir38064
@@ -0,0 +1,64 @@
1Kernel driver ir38064
2=====================
3
4Supported chips:
5 * Infineon IR38064
6 Prefix: 'ir38064'
7 Addresses scanned: -
8 Datasheet: Publicly available at the Infineon webiste
9 https://www.infineon.com/dgdl/Infineon-IR38064MTRPBF-DS-v03_07-EN.pdf?fileId=5546d462584d1d4a0158db0d9efb67ca
10
11Datasheet is not publicly available.
12
13
14Authors:
15 Maxim Sloyko <maxims@google.com>
16 Patrick Venture <venture@google.com>
17
18Description
19-----------
20
21IR38064 is a Single-input Voltage, Synchronous Buck Regulator, DC-DC Converter.
22
23Usage Notes
24-----------
25
26This driver does not probe for PMBus devices. You will have to instantiate
27devices explicitly.
28
29Sysfs attributes
30----------------
31
32curr1_label "iout1"
33curr1_input Measured output current
34curr1_crit Critical maximum current
35curr1_crit_alarm Current critical high alarm
36curr1_max Maximum current
37curr1_max_alarm Current high alarm
38
39in1_label "vin"
40in1_input Measured input voltage
41in1_crit Critical maximum input voltage
42in1_crit_alarm Input voltage critical high alarm
43in1_min Minimum input voltage
44in1_min_alarm Input voltage low alarm
45
46in2_label "vout1"
47in2_input Measured output voltage
48in2_lcrit Critical minimum output voltage
49in2_lcrit_alarm Output voltage critical low alarm
50in2_crit Critical maximum output voltage
51in2_crit_alarm Output voltage critical high alarm
52in2_max Maximum output voltage
53in2_max_alarm Output voltage high alarm
54in2_min Minimum output voltage
55in2_min_alarm Output voltage low alarm
56
57power1_label "pout1"
58power1_input Measured output power
59
60temp1_input Measured temperature
61temp1_crit Critical high temperature
62temp1_crit_alarm Chip temperature critical high alarm
63temp1_max Maximum temperature
64temp1_max_alarm Chip temperature high alarm
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index 629cb45f8557..de87abab990e 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -54,6 +54,15 @@ config SENSORS_IR35221
54 This driver can also be built as a module. If so, the module will 54 This driver can also be built as a module. If so, the module will
55 be called ir35521. 55 be called ir35521.
56 56
57config SENSORS_IR38064
58 tristate "Infineon IR38064"
59 help
60 If you say yes here you get hardware monitoring support for Infineon
61 IR38064.
62
63 This driver can also be built as a module. If so, the module will
64 be called ir38064.
65
57config SENSORS_LM25066 66config SENSORS_LM25066
58 tristate "National Semiconductor LM25066 and compatibles" 67 tristate "National Semiconductor LM25066 and compatibles"
59 help 68 help
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
index ea0e39518c21..7d1fa6b3c8c9 100644
--- a/drivers/hwmon/pmbus/Makefile
+++ b/drivers/hwmon/pmbus/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_SENSORS_PMBUS) += pmbus.o
8obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o 8obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o
9obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o 9obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o
10obj-$(CONFIG_SENSORS_IR35221) += ir35221.o 10obj-$(CONFIG_SENSORS_IR35221) += ir35221.o
11obj-$(CONFIG_SENSORS_IR38064) += ir38064.o
11obj-$(CONFIG_SENSORS_LM25066) += lm25066.o 12obj-$(CONFIG_SENSORS_LM25066) += lm25066.o
12obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o 13obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o
13obj-$(CONFIG_SENSORS_LTC3815) += ltc3815.o 14obj-$(CONFIG_SENSORS_LTC3815) += ltc3815.o
diff --git a/drivers/hwmon/pmbus/ir38064.c b/drivers/hwmon/pmbus/ir38064.c
new file mode 100644
index 000000000000..1820f5077f66
--- /dev/null
+++ b/drivers/hwmon/pmbus/ir38064.c
@@ -0,0 +1,65 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Hardware monitoring driver for Infineon IR38064
4 *
5 * Copyright (c) 2017 Google Inc
6 *
7 * VOUT_MODE is not supported by the device. The driver fakes VOUT linear16
8 * mode with exponent value -8 as direct mode with m=256/b=0/R=0.
9 *
10 * The device supports VOUT_PEAK, IOUT_PEAK, and TEMPERATURE_PEAK, however
11 * this driver does not currently support them.
12 */
13
14#include <linux/err.h>
15#include <linux/i2c.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include "pmbus.h"
20
21static struct pmbus_driver_info ir38064_info = {
22 .pages = 1,
23 .format[PSC_VOLTAGE_IN] = linear,
24 .format[PSC_VOLTAGE_OUT] = direct,
25 .format[PSC_CURRENT_OUT] = linear,
26 .format[PSC_POWER] = linear,
27 .format[PSC_TEMPERATURE] = linear,
28 .m[PSC_VOLTAGE_OUT] = 256,
29 .b[PSC_VOLTAGE_OUT] = 0,
30 .R[PSC_VOLTAGE_OUT] = 0,
31 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
32 | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
33 | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
34 | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
35 | PMBUS_HAVE_POUT,
36};
37
38static int ir38064_probe(struct i2c_client *client,
39 const struct i2c_device_id *id)
40{
41 return pmbus_do_probe(client, id, &ir38064_info);
42}
43
44static const struct i2c_device_id ir38064_id[] = {
45 {"ir38064", 0},
46 {}
47};
48
49MODULE_DEVICE_TABLE(i2c, ir38064_id);
50
51/* This is the driver that will be inserted */
52static struct i2c_driver ir38064_driver = {
53 .driver = {
54 .name = "ir38064",
55 },
56 .probe = ir38064_probe,
57 .remove = pmbus_do_remove,
58 .id_table = ir38064_id,
59};
60
61module_i2c_driver(ir38064_driver);
62
63MODULE_AUTHOR("Maxim Sloyko <maxims@google.com>");
64MODULE_DESCRIPTION("PMBus driver for Infineon IR38064");
65MODULE_LICENSE("GPL");