mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
hwmon: pmbus: add support for STEF48H28
Add support for STEF48H28 hot-swap controller. Signed-off-by: Charles Hsu <hsu.yungteng@gmail.com> Link: https://lore.kernel.org/r/20260126063712.1049025-2-hsu.yungteng@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
418a1828ca
commit
64824861eb
6 changed files with 166 additions and 0 deletions
|
|
@ -234,6 +234,7 @@ Hardware Monitoring Kernel Drivers
|
|||
shtc1
|
||||
sis5595
|
||||
sl28cpld
|
||||
stef48h28
|
||||
smpro-hwmon
|
||||
smsc47b397
|
||||
smsc47m192
|
||||
|
|
|
|||
73
Documentation/hwmon/stef48h28.rst
Normal file
73
Documentation/hwmon/stef48h28.rst
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Kernel driver stef48h28
|
||||
=======================
|
||||
|
||||
Supported chips:
|
||||
|
||||
* Analog Devices STEF48H28
|
||||
|
||||
Prefix: 'stef48h28'
|
||||
|
||||
Addresses scanned: -
|
||||
|
||||
Datasheet: https://www.st.com/resource/en/data_brief/stef48h28.pdf
|
||||
|
||||
Author:
|
||||
|
||||
- Charles Hsu <hsu.yungteng@gmail.com>
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The STEF48H28 is a 30 A integrated e-fuse for 9-80 V DC power rails.
|
||||
It provides inrush control, undervoltage/overvoltage lockout and
|
||||
overcurrent protection using an adaptive (I x t) scheme that permits
|
||||
short high-current pulses typical of CPU/GPU loads.
|
||||
|
||||
The device offers an analog current-monitor output and an on-chip
|
||||
temperature-monitor signal for system supervision. Startup behavior is
|
||||
programmable through insertion-delay and soft-start settings.
|
||||
|
||||
Additional features include power-good indication, self-diagnostics,
|
||||
thermal shutdown and a PMBus interface for telemetry and status
|
||||
reporting.
|
||||
|
||||
Platform data support
|
||||
---------------------
|
||||
|
||||
The driver supports standard PMBus driver platform data.
|
||||
|
||||
Sysfs entries
|
||||
-------------
|
||||
|
||||
=========================================================
|
||||
in1_label "vin".
|
||||
in1_input Measured voltage. From READ_VIN register.
|
||||
in1_min Minimum Voltage. From VIN_UV_WARN_LIMIT register.
|
||||
in1_max Maximum voltage. From VIN_OV_WARN_LIMIT register.
|
||||
|
||||
in2_label "vout1".
|
||||
in2_input Measured voltage. From READ_VOUT register.
|
||||
in2_min Minimum Voltage. From VOUT_UV_WARN_LIMIT register.
|
||||
in2_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
|
||||
|
||||
curr1_label "iin".
|
||||
curr1_input Measured current. From READ_IIN register.
|
||||
|
||||
curr2_label "iout1".
|
||||
curr2_input Measured current. From READ_IOUT register.
|
||||
|
||||
power1_label "pin"
|
||||
power1_input Measured input power. From READ_PIN register.
|
||||
|
||||
power2_label "pout1"
|
||||
power2_input Measured output power. From READ_POUT register.
|
||||
|
||||
temp1_input Measured temperature. From READ_TEMPERATURE_1 register.
|
||||
temp1_max Maximum temperature. From OT_WARN_LIMIT register.
|
||||
temp1_crit Critical high temperature. From OT_FAULT_LIMIT register.
|
||||
|
||||
temp2_input Measured temperature. From READ_TEMPERATURE_2 register.
|
||||
=========================================================
|
||||
|
|
@ -24710,6 +24710,13 @@ S: Maintained
|
|||
F: Documentation/devicetree/bindings/power/supply/st,stc3117.yaml
|
||||
F: drivers/power/supply/stc3117_fuel_gauge.c
|
||||
|
||||
ST STEF48H28 DRIVER
|
||||
M: Charles Hsu <hsu.yungteng@gmail.com>
|
||||
L: linux-hwmon@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/hwmon/stef48h28.rst
|
||||
F: drivers/hwmon/pmbus/stef48h28.c
|
||||
|
||||
ST STM32 FIREWALL
|
||||
M: Gatien Chevallier <gatien.chevallier@foss.st.com>
|
||||
S: Maintained
|
||||
|
|
|
|||
|
|
@ -585,6 +585,15 @@ config SENSORS_Q54SJ108A2
|
|||
This driver can also be built as a module. If so, the module will
|
||||
be called q54sj108a2.
|
||||
|
||||
config SENSORS_STEF48H28
|
||||
tristate "ST STEF48H28"
|
||||
help
|
||||
If you say yes here you get hardware monitoring support for ST
|
||||
STEF48H28.
|
||||
|
||||
This driver can also be built as a module. If so, the module will
|
||||
be called stef48h28.
|
||||
|
||||
config SENSORS_STPDDC60
|
||||
tristate "ST STPDDC60"
|
||||
help
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ obj-$(CONFIG_SENSORS_PLI1209BC) += pli1209bc.o
|
|||
obj-$(CONFIG_SENSORS_PM6764TR) += pm6764tr.o
|
||||
obj-$(CONFIG_SENSORS_PXE1610) += pxe1610.o
|
||||
obj-$(CONFIG_SENSORS_Q54SJ108A2) += q54sj108a2.o
|
||||
obj-$(CONFIG_SENSORS_STEF48H28) += stef48h28.o
|
||||
obj-$(CONFIG_SENSORS_STPDDC60) += stpddc60.o
|
||||
obj-$(CONFIG_SENSORS_TDA38640) += tda38640.o
|
||||
obj-$(CONFIG_SENSORS_TPS25990) += tps25990.o
|
||||
|
|
|
|||
75
drivers/hwmon/pmbus/stef48h28.c
Normal file
75
drivers/hwmon/pmbus/stef48h28.c
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Hardware monitoring driver for STMicroelectronics digital controller stef48h28
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include "pmbus.h"
|
||||
|
||||
static struct pmbus_driver_info stef48h28_info = {
|
||||
.pages = 1,
|
||||
.format[PSC_VOLTAGE_IN] = direct,
|
||||
.format[PSC_VOLTAGE_OUT] = direct,
|
||||
.format[PSC_CURRENT_IN] = direct,
|
||||
.format[PSC_CURRENT_OUT] = direct,
|
||||
.format[PSC_POWER] = direct,
|
||||
.format[PSC_TEMPERATURE] = direct,
|
||||
.m[PSC_VOLTAGE_IN] = 50,
|
||||
.b[PSC_VOLTAGE_IN] = 0,
|
||||
.R[PSC_VOLTAGE_IN] = 0,
|
||||
.m[PSC_VOLTAGE_OUT] = 50,
|
||||
.b[PSC_VOLTAGE_OUT] = 0,
|
||||
.R[PSC_VOLTAGE_OUT] = 0,
|
||||
.m[PSC_CURRENT_IN] = 100,
|
||||
.b[PSC_CURRENT_IN] = 0,
|
||||
.R[PSC_CURRENT_IN] = 0,
|
||||
.m[PSC_CURRENT_OUT] = 100,
|
||||
.b[PSC_CURRENT_OUT] = 0,
|
||||
.R[PSC_CURRENT_OUT] = 0,
|
||||
.m[PSC_POWER] = 9765,
|
||||
.b[PSC_POWER] = 0,
|
||||
.R[PSC_POWER] = -3,
|
||||
.m[PSC_TEMPERATURE] = 25,
|
||||
.b[PSC_TEMPERATURE] = 500,
|
||||
.R[PSC_TEMPERATURE] = 0,
|
||||
.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_PIN
|
||||
| PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2
|
||||
| PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
|
||||
| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_POUT
|
||||
};
|
||||
|
||||
static int stef48h28_probe(struct i2c_client *client)
|
||||
{
|
||||
return pmbus_do_probe(client, &stef48h28_info);
|
||||
}
|
||||
|
||||
static const struct i2c_device_id stef48h28_id[] = {
|
||||
{"stef48h28"},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, stef48h28_id);
|
||||
|
||||
static const struct of_device_id __maybe_unused stef48h28_of_match[] = {
|
||||
{.compatible = "st,stef48h28"},
|
||||
{}
|
||||
};
|
||||
|
||||
static struct i2c_driver stef48h28_driver = {
|
||||
.driver = {
|
||||
.name = "stef48h28",
|
||||
.of_match_table = of_match_ptr(stef48h28_of_match),
|
||||
},
|
||||
.probe = stef48h28_probe,
|
||||
.id_table = stef48h28_id,
|
||||
};
|
||||
|
||||
module_i2c_driver(stef48h28_driver);
|
||||
|
||||
MODULE_AUTHOR("Charles Hsu <hsu.yungteng@gmail.com>");
|
||||
MODULE_DESCRIPTION("PMBus driver for ST stef48h28");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_IMPORT_NS("PMBUS");
|
||||
Loading…
Add table
Add a link
Reference in a new issue