Skip to content

Commit 88b5970

Browse files
ssekar15groeck
authored andcommitted
hwmon: (pmbus/core) Add helper macro to define single pmbus regulator
The bindings for single instance regulator should be named with no instance (e.g., buck not buck0). Introduce a new helper macro to define the single pmbus regulator. Signed-off-by: Saravanan Sekar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 90a801d commit 88b5970

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/hwmon/pmbus/pmbus.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,21 @@ extern const struct regulator_ops pmbus_regulator_ops;
489489

490490
#define PMBUS_REGULATOR(_name, _id) PMBUS_REGULATOR_STEP(_name, _id, 0, 0, 0)
491491

492+
#define PMBUS_REGULATOR_STEP_ONE(_name, _voltages, _step, _min_uV) \
493+
{ \
494+
.name = (_name), \
495+
.of_match = of_match_ptr(_name), \
496+
.regulators_node = of_match_ptr("regulators"), \
497+
.ops = &pmbus_regulator_ops, \
498+
.type = REGULATOR_VOLTAGE, \
499+
.owner = THIS_MODULE, \
500+
.n_voltages = _voltages, \
501+
.uV_step = _step, \
502+
.min_uV = _min_uV, \
503+
}
504+
505+
#define PMBUS_REGULATOR_ONE(_name) PMBUS_REGULATOR_STEP_ONE(_name, 0, 0, 0)
506+
492507
/* Function declarations */
493508

494509
void pmbus_clear_cache(struct i2c_client *client);

0 commit comments

Comments
 (0)