Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (pmbus) Add Infineon IRPS5401 driver

Add a driver to support the Infineon IRPS5401 PMIC. This chip has 5
pages corresponding to 4 switching outputs and one linear (LDO) output.
The switching and LDO outputs have slightly different supported
parameters.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Robert Hancock and committed by
Guenter Roeck
9158411b b67b7356

+77
+9
drivers/hwmon/pmbus/Kconfig
··· 64 64 This driver can also be built as a module. If so, the module will 65 65 be called ir38064. 66 66 67 + config SENSORS_IRPS5401 68 + tristate "Infineon IRPS5401" 69 + help 70 + If you say yes here you get hardware monitoring support for the 71 + Infineon IRPS5401 controller. 72 + 73 + This driver can also be built as a module. If so, the module will 74 + be called irps5401. 75 + 67 76 config SENSORS_ISL68137 68 77 tristate "Intersil ISL68137" 69 78 help
+1
drivers/hwmon/pmbus/Makefile
··· 9 9 obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o 10 10 obj-$(CONFIG_SENSORS_IR35221) += ir35221.o 11 11 obj-$(CONFIG_SENSORS_IR38064) += ir38064.o 12 + obj-$(CONFIG_SENSORS_IRPS5401) += irps5401.o 12 13 obj-$(CONFIG_SENSORS_ISL68137) += isl68137.o 13 14 obj-$(CONFIG_SENSORS_LM25066) += lm25066.o 14 15 obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o
+67
drivers/hwmon/pmbus/irps5401.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Hardware monitoring driver for the Infineon IRPS5401M PMIC. 4 + * 5 + * Copyright (c) 2019 SED Systems, a division of Calian Ltd. 6 + * 7 + * The device supports VOUT_PEAK, IOUT_PEAK, and TEMPERATURE_PEAK, however 8 + * this driver does not currently support them. 9 + */ 10 + 11 + #include <linux/err.h> 12 + #include <linux/i2c.h> 13 + #include <linux/init.h> 14 + #include <linux/kernel.h> 15 + #include <linux/module.h> 16 + #include "pmbus.h" 17 + 18 + #define IRPS5401_SW_FUNC (PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | \ 19 + PMBUS_HAVE_STATUS_INPUT | \ 20 + PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | \ 21 + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | \ 22 + PMBUS_HAVE_PIN | PMBUS_HAVE_POUT | \ 23 + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP) 24 + 25 + #define IRPS5401_LDO_FUNC (PMBUS_HAVE_VIN | \ 26 + PMBUS_HAVE_STATUS_INPUT | \ 27 + PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | \ 28 + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | \ 29 + PMBUS_HAVE_PIN | PMBUS_HAVE_POUT | \ 30 + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP) 31 + 32 + static struct pmbus_driver_info irps5401_info = { 33 + .pages = 5, 34 + .func[0] = IRPS5401_SW_FUNC, 35 + .func[1] = IRPS5401_SW_FUNC, 36 + .func[2] = IRPS5401_SW_FUNC, 37 + .func[3] = IRPS5401_SW_FUNC, 38 + .func[4] = IRPS5401_LDO_FUNC, 39 + }; 40 + 41 + static int irps5401_probe(struct i2c_client *client, 42 + const struct i2c_device_id *id) 43 + { 44 + return pmbus_do_probe(client, id, &irps5401_info); 45 + } 46 + 47 + static const struct i2c_device_id irps5401_id[] = { 48 + {"irps5401", 0}, 49 + {} 50 + }; 51 + 52 + MODULE_DEVICE_TABLE(i2c, irps5401_id); 53 + 54 + static struct i2c_driver irps5401_driver = { 55 + .driver = { 56 + .name = "irps5401", 57 + }, 58 + .probe = irps5401_probe, 59 + .remove = pmbus_do_remove, 60 + .id_table = irps5401_id, 61 + }; 62 + 63 + module_i2c_driver(irps5401_driver); 64 + 65 + MODULE_AUTHOR("Robert Hancock"); 66 + MODULE_DESCRIPTION("PMBus driver for Infineon IRPS5401"); 67 + MODULE_LICENSE("GPL");