Skip to content
/ linux Public

Commit 9054416

Browse files
Greg.Schwendimann@infineon.comgroeck
authored andcommitted
hwmon: (pmbus) Add support for Infineon Digital Multi-phase xdp152 family controllers
Add support for devices XDPE152C4, XDPE12584. Signed-off-by: Greg Schwendimann <Greg.Schwendimann@infineon.com> Link: https://lore.kernel.org/r/5e6d50e9b28140158f339b0de343eea4@infineon.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent b90f994 commit 9054416

File tree

5 files changed

+204
-0
lines changed

5 files changed

+204
-0
lines changed

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ Hardware Monitoring Kernel Drivers
223223
wm8350
224224
xgene-hwmon
225225
xdpe12284
226+
xdpe152c4
226227
zl6100
227228

228229
.. only:: subproject and html

Documentation/hwmon/xdpe152c4.rst

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Kernel driver xdpe152
4+
=====================
5+
6+
Supported chips:
7+
8+
* Infineon XDPE152C4
9+
10+
Prefix: 'xdpe152c4'
11+
12+
* Infineon XDPE15284
13+
14+
Prefix: 'xdpe15284'
15+
16+
Authors:
17+
18+
Greg Schwendimann <greg.schwendimann@infineon.com>
19+
20+
Description
21+
-----------
22+
23+
This driver implements support for Infineon Digital Multi-phase Controller
24+
XDPE152C4 and XDPE15284 dual loop voltage regulators.
25+
The devices are compliant with:
26+
27+
- Intel VR13, VR13HC and VR14 rev 1.86
28+
converter specification.
29+
- Intel SVID rev 1.93. protocol.
30+
- PMBus rev 1.3.1 interface.
31+
32+
Devices support linear format for reading input and output voltage, input
33+
and output current, input and output power and temperature.
34+
35+
Devices support two pages for telemetry.
36+
37+
The driver provides for current: input, maximum and critical thresholds
38+
and maximum and critical alarms. Low Critical thresholds and Low critical alarm are
39+
supported only for current output.
40+
The driver exports the following attributes for via the sysfs files, where
41+
indexes 1, 2 are for "iin" and 3, 4 for "iout":
42+
43+
**curr[1-4]_crit**
44+
45+
**curr[1-4]_crit_alarm**
46+
47+
**curr[1-4]_input**
48+
49+
**curr[1-4]_label**
50+
51+
**curr[1-4]_max**
52+
53+
**curr[1-4]_max_alarm**
54+
55+
**curr[3-4]_lcrit**
56+
57+
**curr[3-4]_lcrit_alarm**
58+
59+
**curr[3-4]_rated_max**
60+
61+
The driver provides for voltage: input, critical and low critical thresholds
62+
and critical and low critical alarms.
63+
The driver exports the following attributes for via the sysfs files, where
64+
indexes 1, 2 are for "vin" and 3, 4 for "vout":
65+
66+
**in[1-4]_min**
67+
68+
**in[1-4]_crit**
69+
70+
**in[1-4_crit_alarm**
71+
72+
**in[1-4]_input**
73+
74+
**in[1-4]_label**
75+
76+
**in[1-4]_max**
77+
78+
**in[1-4]_max_alarm**
79+
80+
**in[1-4]_min**
81+
82+
**in[1-4]_min_alarm**
83+
84+
**in[3-4]_lcrit**
85+
86+
**in[3-4]_lcrit_alarm**
87+
88+
**in[3-4]_rated_max**
89+
90+
**in[3-4]_rated_min**
91+
92+
The driver provides for power: input and alarms.
93+
The driver exports the following attributes for via the sysfs files, where
94+
indexes 1, 2 are for "pin" and 3, 4 for "pout":
95+
96+
**power[1-2]_alarm**
97+
98+
**power[1-4]_input**
99+
100+
**power[1-4]_label**
101+
102+
**power[1-4]_max**
103+
104+
**power[1-4]_rated_max**
105+
106+
The driver provides for temperature: input, maximum and critical thresholds
107+
and maximum and critical alarms.
108+
The driver exports the following attributes for via the sysfs files:
109+
110+
**temp[1-2]_crit**
111+
112+
**temp[1-2]_crit_alarm**
113+
114+
**temp[1-2]_input**
115+
116+
**temp[1-2]_max**
117+
118+
**temp[1-2]_max_alarm**

drivers/hwmon/pmbus/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,15 @@ config SENSORS_UCD9200
408408
This driver can also be built as a module. If so, the module will
409409
be called ucd9200.
410410

411+
config SENSORS_XDPE152
412+
tristate "Infineon XDPE152 family"
413+
help
414+
If you say yes here you get hardware monitoring support for Infineon
415+
XDPE15284, XDPE152C4, device.
416+
417+
This driver can also be built as a module. If so, the module will
418+
be called xdpe152c4.
419+
411420
config SENSORS_XDPE122
412421
tristate "Infineon XDPE122 family"
413422
help

drivers/hwmon/pmbus/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ obj-$(CONFIG_SENSORS_TPS53679) += tps53679.o
4343
obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o
4444
obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o
4545
obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o
46+
obj-$(CONFIG_SENSORS_XDPE152) += xdpe152c4.o
4647
obj-$(CONFIG_SENSORS_ZL6100) += zl6100.o
4748
obj-$(CONFIG_SENSORS_PIM4328) += pim4328.o

drivers/hwmon/pmbus/xdpe152c4.c

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later
2+
/*
3+
* Hardware monitoring driver for Infineon Multi-phase Digital VR Controllers
4+
*
5+
* Copyright (c) 2022 Infineon Technologies. All rights reserved.
6+
*/
7+
8+
#include <linux/err.h>
9+
#include <linux/i2c.h>
10+
#include <linux/init.h>
11+
#include <linux/kernel.h>
12+
#include <linux/module.h>
13+
#include "pmbus.h"
14+
15+
#define XDPE152_PAGE_NUM 2
16+
17+
static struct pmbus_driver_info xdpe152_info = {
18+
.pages = XDPE152_PAGE_NUM,
19+
.format[PSC_VOLTAGE_IN] = linear,
20+
.format[PSC_VOLTAGE_OUT] = linear,
21+
.format[PSC_TEMPERATURE] = linear,
22+
.format[PSC_CURRENT_IN] = linear,
23+
.format[PSC_CURRENT_OUT] = linear,
24+
.format[PSC_POWER] = linear,
25+
.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
26+
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
27+
PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP |
28+
PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT,
29+
.func[1] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
30+
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
31+
PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT,
32+
};
33+
34+
static int xdpe152_probe(struct i2c_client *client)
35+
{
36+
struct pmbus_driver_info *info;
37+
38+
info = devm_kmemdup(&client->dev, &xdpe152_info, sizeof(*info),
39+
GFP_KERNEL);
40+
if (!info)
41+
return -ENOMEM;
42+
43+
return pmbus_do_probe(client, info);
44+
}
45+
46+
static const struct i2c_device_id xdpe152_id[] = {
47+
{"xdpe152c4", 0},
48+
{"xdpe15284", 0},
49+
{}
50+
};
51+
52+
MODULE_DEVICE_TABLE(i2c, xdpe152_id);
53+
54+
static const struct of_device_id __maybe_unused xdpe152_of_match[] = {
55+
{.compatible = "infineon,xdpe152c4"},
56+
{.compatible = "infineon,xdpe15284"},
57+
{}
58+
};
59+
MODULE_DEVICE_TABLE(of, xdpe152_of_match);
60+
61+
static struct i2c_driver xdpe152_driver = {
62+
.driver = {
63+
.name = "xdpe152c4",
64+
.of_match_table = of_match_ptr(xdpe152_of_match),
65+
},
66+
.probe_new = xdpe152_probe,
67+
.id_table = xdpe152_id,
68+
};
69+
70+
module_i2c_driver(xdpe152_driver);
71+
72+
MODULE_AUTHOR("Greg Schwendimann <greg.schwendimann@infineon.com>");
73+
MODULE_DESCRIPTION("PMBus driver for Infineon XDPE152 family");
74+
MODULE_LICENSE("GPL");
75+
MODULE_IMPORT_NS(PMBUS);

0 commit comments

Comments
 (0)