Skip to content

Commit 258a82e

Browse files
committed
hwmon: pmbus: add driver for ltp8800-1a, ltp8800-4a, and ltp8800-2
LTP8800-1A 150A DC/DC µModule Regulator with PMBus Interface LTP8800-4A 200A DC/DC µModule Regulator with PMBus Interface LTP8800-2 54V, 135A DC/DC μModule Regulator with PMBus Interface Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
1 parent 9df3ea4 commit 258a82e

File tree

6 files changed

+200
-0
lines changed

6 files changed

+200
-0
lines changed

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Hardware Monitoring Kernel Drivers
122122
ltc4245
123123
ltc4260
124124
ltc4261
125+
ltp8800
125126
max127
126127
max15301
127128
max16064

Documentation/hwmon/ltp8800.rst

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Kernel driver ltp8800
4+
=====================
5+
6+
Supported chips:
7+
8+
* Analog Devices LTP8800-1A
9+
10+
Prefix: 'ltp8800-1a'
11+
12+
Addresses scanned: I2C 0x40 - 0x4F
13+
14+
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ltp8800-1a.pdf
15+
16+
* Analog Devices LTP8800-4A
17+
18+
Prefix: 'ltp8800-4a'
19+
20+
Addresses scanned: I2C 0x40 - 0x4F
21+
22+
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ltp8800-4a.pdf
23+
24+
* Analog Devices LTP8800-2
25+
26+
Prefix: 'ltp8800-2'
27+
28+
Addresses scanned: I2C 0x40 - 0x4F
29+
30+
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ltp8800-2.pdf
31+
32+
Authors:
33+
- Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
34+
35+
36+
Description
37+
-----------
38+
39+
The LTP8800 is a family of step-down μModule regulators that provides
40+
microprocessor core voltage from 54V power distribution architecture. LTP8800
41+
features telemetry monitoring of input/output voltage, input current, output
42+
power, and temperature over PMBus.
43+
44+
The driver is a client driver to the core PMBus driver. Please see
45+
Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
46+
47+
Usage Notes
48+
-----------
49+
50+
This driver does not auto-detect devices. You will have to instantiate the
51+
devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
52+
details.
53+
54+
Platform data support
55+
---------------------
56+
57+
The driver supports standard PMBus driver platform data. Please see
58+
Documentation/hwmon/pmbus.rst for details.
59+
60+
Sysfs Attributes
61+
----------------
62+
63+
======================= ===========================
64+
curr1_label "iin"
65+
curr1_input Measured input current
66+
curr1_crit Critical maximum current
67+
curr1_crit_alarm Current critical high alarm
68+
69+
curr2_label "iout1"
70+
curr2_input Measured output current
71+
curr2_lcrit Critical minimum current
72+
curr2_crit Critical maximum current
73+
curr2_max Maximum output current
74+
curr2_alarm Current alarm
75+
76+
in1_label "vin"
77+
in1_input Measured input voltage
78+
in1_lcrit Critical minimum input voltage
79+
in1_lcrit_alarm Input voltage critical low alarm
80+
in1_crit Critical maximum input voltage
81+
in1_crit_alarm Input voltage critical high alarm
82+
83+
in2_label "vout1"
84+
in2_input Measured output voltage
85+
in2_lcrit Critical minimum output voltage
86+
in2_lcrit_alarm Output voltage critical low alarm
87+
in2_crit Critical maximum output voltage
88+
in2_crit_alarm Output voltage critical high alarm
89+
in2_max Maximum output voltage
90+
in2_max_alarm Output voltage high alarm
91+
in2_min Minimum output voltage
92+
in2_min_alarm Output voltage low alarm
93+
94+
power1_label "pout1"
95+
power1_input Measured output power
96+
power1_crit Critical maximum output power
97+
98+
temp1_input Measured temperature
99+
temp1_lcrit Critical low temperature
100+
temp1_lcrit_alarm Chip temperature critical low alarm
101+
temp1_crit Critical high temperature
102+
temp1_crit_alarm Chiptemperature critical high alarm
103+
======================= ===========================

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12260,6 +12260,8 @@ M: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
1226012260
L: linux-hwmon@vger.kernel.org
1226112261
S: Maintained
1226212262
F: Documentation/devicetree/bindings/hwmon/pmbus/adi,ltp8800.yaml
12263+
F: Documentation/hwmon/ltp8800.rst
12264+
F: drivers/hwmon/pmbus/ltp8800.c
1226312265

1226412266
LYNX 28G SERDES PHY DRIVER
1226512267
M: Ioana Ciornei <ioana.ciornei@nxp.com>

drivers/hwmon/pmbus/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,24 @@ config SENSORS_LTC3815
228228
This driver can also be built as a module. If so, the module will
229229
be called ltc3815.
230230

231+
config SENSORS_LTP8800
232+
tristate "Analog Devices LTP8800 and compatibles"
233+
help
234+
If you say yes here you get hardware monitoring support for Analog
235+
Devices LTP8800-1A, LTP8800-4A, and LTP8800-2.
236+
237+
This driver can also be built as a module. If so, the module will
238+
be called ltp8800.
239+
240+
config SENSORS_LTP8800_REGULATOR
241+
bool "Regulator support for LTP8800 and compatibles"
242+
depends on SENSORS_LTP8800 && REGULATOR
243+
help
244+
If you say yes here you get regulator support for Analog Devices
245+
LTP8800-1A, LTP8800-4A, and LTP8800-2. LTP8800 is a family of DC/DC
246+
µModule regulators that can provide microprocessor power from 54V
247+
power distribution architecture.
248+
231249
config SENSORS_MAX15301
232250
tristate "Maxim MAX15301"
233251
help

drivers/hwmon/pmbus/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ obj-$(CONFIG_SENSORS_LM25066) += lm25066.o
2424
obj-$(CONFIG_SENSORS_LT7182S) += lt7182s.o
2525
obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o
2626
obj-$(CONFIG_SENSORS_LTC3815) += ltc3815.o
27+
obj-$(CONFIG_SENSORS_LTP8800) += ltp8800.o
2728
obj-$(CONFIG_SENSORS_MAX15301) += max15301.o
2829
obj-$(CONFIG_SENSORS_MAX16064) += max16064.o
2930
obj-$(CONFIG_SENSORS_MAX16601) += max16601.o

drivers/hwmon/pmbus/ltp8800.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
2+
/*
3+
* Hardware monitoring driver for Analog Devices LTP8800
4+
*
5+
* Copyright (C) 2024 Analog Devices, Inc.
6+
*/
7+
#include <linux/bits.h>
8+
#include <linux/i2c.h>
9+
#include <linux/module.h>
10+
#include <linux/mod_devicetable.h>
11+
#include "pmbus.h"
12+
13+
static const struct regulator_desc __maybe_unused ltp8800_reg_desc[] = {
14+
PMBUS_REGULATOR("vout", 0),
15+
};
16+
17+
static struct pmbus_driver_info ltp8800_info = {
18+
.pages = 1,
19+
.format[PSC_VOLTAGE_IN] = linear,
20+
.format[PSC_VOLTAGE_OUT] = linear,
21+
.format[PSC_CURRENT_IN] = linear,
22+
.format[PSC_TEMPERATURE] = linear,
23+
.func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
24+
PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT |
25+
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT |
26+
PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
27+
PMBUS_HAVE_POUT,
28+
#if IS_ENABLED(CONFIG_SENSORS_LTP8800_REGULATOR)
29+
.num_regulators = 1,
30+
.reg_desc = ltp8800_reg_desc,
31+
#endif
32+
};
33+
34+
/* 6.1 requires i2c_device_id */
35+
static int ltp8800_probe(struct i2c_client *client,
36+
const struct i2c_device_id *id)
37+
{
38+
if (!i2c_check_functionality(client->adapter,
39+
I2C_FUNC_SMBUS_READ_BYTE_DATA |
40+
I2C_FUNC_SMBUS_READ_WORD_DATA))
41+
return -ENODEV;
42+
43+
return pmbus_do_probe(client, &ltp8800_info);
44+
}
45+
46+
static const struct i2c_device_id ltp8800_id[] = {
47+
{"ltp8800-1a", 0},
48+
{"ltp8800-4a", 0},
49+
{"ltp8800-2", 0},
50+
{}
51+
};
52+
MODULE_DEVICE_TABLE(i2c, ltp8800_id);
53+
54+
static const struct of_device_id ltp8800_of_match[] = {
55+
{ .compatible = "adi,ltp8800-1a"},
56+
{ .compatible = "adi,ltp8800-4a"},
57+
{ .compatible = "adi,ltp8800-2"},
58+
{}
59+
};
60+
MODULE_DEVICE_TABLE(of, ltp8800_of_match);
61+
62+
static struct i2c_driver ltp8800_driver = {
63+
.driver = {
64+
.name = "ltp8800",
65+
.of_match_table = ltp8800_of_match,
66+
},
67+
.probe = ltp8800_probe,
68+
.id_table = ltp8800_id,
69+
};
70+
module_i2c_driver(ltp8800_driver);
71+
72+
MODULE_AUTHOR("Cedric Encarnacion <cedricjustine.encarnacion@analog.com>");
73+
MODULE_DESCRIPTION("Analog Devices LTP8800 HWMON PMBus Driver");
74+
MODULE_LICENSE("GPL");
75+
MODULE_IMPORT_NS(PMBUS);

0 commit comments

Comments
 (0)