hwmon: (pmbus) Add support for Infineon Digital Multi-phase xdp152 faimly controllers
Subsystems (2)
PATCH v4 1/2 hwmon: (pmbus) Add support for Infineon Digital Multi-phase xdp152 faimly controllers
Add support for devices XDPE152C4, XDPE12584.
Signed-off-by Greg Schwendimann <[email protected]>
---
Separated the device tree bindings documentation
Resending from same email as Signed-off-by header
Documentation/hwmon/index.rst | 1 + Documentation/hwmon/xdpe152c4.rst | 118 ++++++++++++++++++++++++++++++ drivers/hwmon/pmbus/Kconfig | 9 +++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/xdpe152c4.c | 75 +++++++++++++++++++ 5 files changed, 204 insertions(+) create mode 100644 Documentation/hwmon/xdpe152c4.rst create mode 100644 drivers/hwmon/pmbus/xdpe152c4.c
Documentation/hwmon/index.rst +1 -0
@@ -223,6 +223,7 @@ Hardware Monitoring Kernel Drivers wm8350 xgene-hwmon xdpe12284 + xdpe152c4 zl6100 .. only:: subproject and html
Documentation/hwmon/xdpe152c4.rst new file +118 -0
118 lines not on this page · raw message
drivers/hwmon/pmbus/Kconfig +9 -0
@@ -408,6 +408,15 @@ config SENSORS_UCD9200 This driver can also be built as a module. If so, the module will be called ucd9200. +config SENSORS_XDPE152 + tristate "Infineon XDPE152 family" + help + If you say yes here you get hardware monitoring support for Infineon + XDPE15284, XDPE152C4, device. + + This driver can also be built as a module. If so, the module will + be called xdpe152c4. + config SENSORS_XDPE122 tristate "Infineon XDPE122 family" help
drivers/hwmon/pmbus/Makefile +1 -0
@@ -43,5 +43,6 @@ obj-$(CONFIG_SENSORS_TPS53679) += tps53679.o obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o +obj-$(CONFIG_SENSORS_XDPE152) += xdpe152c4.o obj-$(CONFIG_SENSORS_ZL6100) += zl6100.o obj-$(CONFIG_SENSORS_PIM4328) += pim4328.o
drivers/hwmon/pmbus/xdpe152c4.c new file +75 -0
75 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 4 lines · On Wed, Apr 27, 2022 at 06:40:12PM +0000, [email protected] wrote:
Add support for devices XDPE152C4, XDPE12584.
Signed-off-by Greg Schwendimann <[email protected]>---
Applied.
Thanks,
Guenter
Quoted 260 lines
Separated the device tree bindings documentation
Resending from same email as Signed-off-by headerDocumentation/hwmon/index.rst | 1 + Documentation/hwmon/xdpe152c4.rst | 118 ++++++++++++++++++++++++++++++ drivers/hwmon/pmbus/Kconfig | 9 +++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/xdpe152c4.c | 75 +++++++++++++++++++ 5 files changed, 204 insertions(+) create mode 100644 Documentation/hwmon/xdpe152c4.rst create mode 100644 drivers/hwmon/pmbus/xdpe152c4.cDocumentation/hwmon/index.rst +1
-0@@ -223,6 +223,7 @@ Hardware Monitoring Kernel Drivers wm8350 xgene-hwmon xdpe12284 + xdpe152c4 zl6100 .. only:: subproject and htmlDocumentation/hwmon/xdpe152c4.rst new file +118
-0@@ -0,0 +1,118 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver xdpe152 +===================== + +Supported chips: + + * Infineon XDPE152C4 + + Prefix: 'xdpe152c4' + + * Infineon XDPE15284 + + Prefix: 'xdpe15284' + +Authors: + + Greg Schwendimann <[email protected]> + +Description +----------- + +This driver implements support for Infineon Digital Multi-phase Controller +XDPE152C4 and XDPE15284 dual loop voltage regulators. +The devices are compliant with: + +- Intel VR13, VR13HC and VR14 rev 1.86 + converter specification. +- Intel SVID rev 1.93. protocol. +- PMBus rev 1.3.1 interface. + +Devices support linear format for reading input and output voltage, input +and output current, input and output power and temperature. + +Devices support two pages for telemetry. + +The driver provides for current: input, maximum and critical thresholds +and maximum and critical alarms. Low Critical thresholds and Low critical alarm are +supported only for current output. +The driver exports the following attributes for via the sysfs files, where +indexes 1, 2 are for "iin" and 3, 4 for "iout": + +**curr[1-4]_crit** + +**curr[1-4]_crit_alarm** + +**curr[1-4]_input** + +**curr[1-4]_label** + +**curr[1-4]_max** + +**curr[1-4]_max_alarm** + +**curr[3-4]_lcrit** + +**curr[3-4]_lcrit_alarm** + +**curr[3-4]_rated_max** + +The driver provides for voltage: input, critical and low critical thresholds +and critical and low critical alarms. +The driver exports the following attributes for via the sysfs files, where +indexes 1, 2 are for "vin" and 3, 4 for "vout": + +**in[1-4]_min** + +**in[1-4]_crit** + +**in[1-4_crit_alarm** + +**in[1-4]_input** + +**in[1-4]_label** + +**in[1-4]_max** + +**in[1-4]_max_alarm** + +**in[1-4]_min** + +**in[1-4]_min_alarm** + +**in[3-4]_lcrit** + +**in[3-4]_lcrit_alarm** + +**in[3-4]_rated_max** + +**in[3-4]_rated_min** + +The driver provides for power: input and alarms. +The driver exports the following attributes for via the sysfs files, where +indexes 1, 2 are for "pin" and 3, 4 for "pout": + +**power[1-2]_alarm** + +**power[1-4]_input** + +**power[1-4]_label** + +**power[1-4]_max** + +**power[1-4]_rated_max** + +The driver provides for temperature: input, maximum and critical thresholds +and maximum and critical alarms. +The driver exports the following attributes for via the sysfs files: + +**temp[1-2]_crit** + +**temp[1-2]_crit_alarm** + +**temp[1-2]_input** + +**temp[1-2]_max** + +**temp[1-2]_max_alarm**drivers/hwmon/pmbus/Kconfig +9
-0@@ -408,6 +408,15 @@ config SENSORS_UCD9200 This driver can also be built as a module. If so, the module will be called ucd9200. +config SENSORS_XDPE152 + tristate "Infineon XDPE152 family" + help + If you say yes here you get hardware monitoring support for Infineon + XDPE15284, XDPE152C4, device. + + This driver can also be built as a module. If so, the module will + be called xdpe152c4. + config SENSORS_XDPE122 tristate "Infineon XDPE122 family" helpdrivers/hwmon/pmbus/Makefile +1
-0@@ -43,5 +43,6 @@ obj-$(CONFIG_SENSORS_TPS53679) += tps53679.o obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o +obj-$(CONFIG_SENSORS_XDPE152) += xdpe152c4.o obj-$(CONFIG_SENSORS_ZL6100) += zl6100.o obj-$(CONFIG_SENSORS_PIM4328) += pim4328.odrivers/hwmon/pmbus/xdpe152c4.c new file +75
-0@@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Hardware monitoring driver for Infineon Multi-phase Digital VR Controllers +* +* Copyright (c) 2022 Infineon Technologies. All rights reserved. +*/ + +#include <linux/err.h> +#include <linux/i2c.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/module.h> +#include "pmbus.h" + +#define XDPE152_PAGE_NUM 2 + +static struct pmbus_driver_info xdpe152_info = { + .pages =XDPE152_PAGE_NUM , + .format[PSC_VOLTAGE_IN ] = linear, + .format[PSC_VOLTAGE_OUT ] = linear, + .format[PSC_TEMPERATURE ] = linear, + .format[PSC_CURRENT_IN ] = linear, + .format[PSC_CURRENT_OUT ] = linear, + .format[PSC_POWER ] = linear, + .func[0 ] =PMBUS_HAVE_VIN |PMBUS_HAVE_VOUT |PMBUS_HAVE_STATUS_VOUT | +PMBUS_HAVE_IIN |PMBUS_HAVE_IOUT |PMBUS_HAVE_STATUS_IOUT | +PMBUS_HAVE_TEMP |PMBUS_HAVE_TEMP2 |PMBUS_HAVE_STATUS_TEMP | +PMBUS_HAVE_POUT |PMBUS_HAVE_PIN |PMBUS_HAVE_STATUS_INPUT , + .func[1 ] =PMBUS_HAVE_VIN |PMBUS_HAVE_VOUT |PMBUS_HAVE_STATUS_VOUT | +PMBUS_HAVE_IIN |PMBUS_HAVE_IOUT |PMBUS_HAVE_STATUS_IOUT | +PMBUS_HAVE_POUT |PMBUS_HAVE_PIN |PMBUS_HAVE_STATUS_INPUT , +}; + +static int xdpe152_probe (struct i2c_client *client) +{ +struct pmbus_driver_info *info; + + info =devm_kmemdup (&client->dev, &xdpe152_info,sizeof (*info), +GFP_KERNEL ); +if (!info) +return -ENOMEM ; + +return pmbus_do_probe (client, info); +} + +static const struct i2c_device_id xdpe152_id[] = { + {"xdpe152c4" ,0 }, + {"xdpe15284" ,0 }, + {} +}; + +MODULE_DEVICE_TABLE (i2c, xdpe152_id); + +static const struct of_device_id __maybe_unused xdpe152_of_match[] = { + {.compatible ="infineon,xdpe152c4" }, + {.compatible ="infineon,xdpe15284" }, + {} +}; +MODULE_DEVICE_TABLE (of, xdpe152_of_match); + +static struct i2c_driver xdpe152_driver = { + .driver = { + .name ="xdpe152c4" , + .of_match_table =of_match_ptr (xdpe152_of_match), + }, + .probe_new = xdpe152_probe, + .id_table = xdpe152_id, +}; + +module_i2c_driver (xdpe152_driver); + +MODULE_AUTHOR ("Greg Schwendimann <[email protected]>" ); +MODULE_DESCRIPTION ("PMBus driver for Infineon XDPE152 family" ); +MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (PMBUS );