mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 06:24:53 +08:00
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>
This commit is contained in:
parent
e65de225ef
commit
0ee7f62426
@ -141,6 +141,12 @@ config SENSORS_IR38064
|
||||
This driver can also be built as a module. If so, the module will
|
||||
be called ir38064.
|
||||
|
||||
config SENSORS_IR38064_REGULATOR
|
||||
bool "Regulator support for IR38064 and compatibles"
|
||||
depends on SENSORS_IR38064 && REGULATOR
|
||||
help
|
||||
Uses the IR38064 or compatible as regulator.
|
||||
|
||||
config SENSORS_IRPS5401
|
||||
tristate "Infineon IRPS5401"
|
||||
help
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user