summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus/ir38064.c
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2021-12-13 15:28:14 +0100
committerGuenter Roeck <linux@roeck-us.net>2021-12-26 15:02:07 -0800
commit0ee7f624263e6492b5e541c86b0fc716349da7bf (patch)
treee5c6239e81d579f716115244a87621ff5f022fdb /drivers/hwmon/pmbus/ir38064.c
parente65de225ef2f7eade2888b00970eec37aeca0044 (diff)
downloadlinux-0ee7f624263e6492b5e541c86b0fc716349da7bf.tar.bz2
hwmon/pmbus: (ir38064) Expose a regulator
The chip series supported by this driver are voltage regulators, so expose them to the regulator subsystem. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Link: https://lore.kernel.org/r/20211213142814.264802-4-arthur.heymans@9elements.com [groeck: Added brief patch description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus/ir38064.c')
-rw-r--r--drivers/hwmon/pmbus/ir38064.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/ir38064.c b/drivers/hwmon/pmbus/ir38064.c
index 4211de048069..07bdbb16f216 100644
--- a/drivers/hwmon/pmbus/ir38064.c
+++ b/drivers/hwmon/pmbus/ir38064.c
@@ -17,8 +17,15 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_device.h>
+#include <linux/regulator/driver.h>
#include "pmbus.h"
+#if IS_ENABLED(CONFIG_SENSORS_IR38064_REGULATOR)
+static const struct regulator_desc ir38064_reg_desc[] = {
+ PMBUS_REGULATOR("vout", 0),
+};
+#endif /* CONFIG_SENSORS_IR38064_REGULATOR */
+
static struct pmbus_driver_info ir38064_info = {
.pages = 1,
.format[PSC_VOLTAGE_IN] = linear,
@@ -34,6 +41,10 @@ static struct pmbus_driver_info ir38064_info = {
| PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
| PMBUS_HAVE_POUT,
+#if IS_ENABLED(CONFIG_SENSORS_IR38064_REGULATOR)
+ .num_regulators = 1,
+ .reg_desc = ir38064_reg_desc,
+#endif
};
static int ir38064_probe(struct i2c_client *client)