Commit 88b5970e authored by Saravanan Sekar's avatar Saravanan Sekar Committed by Guenter Roeck

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: default avatarSaravanan Sekar <saravanan@linumiz.com>
Link: https://lore.kernel.org/r/20231011164754.449399-4-saravanan@linumiz.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 90a801d5
......@@ -489,6 +489,21 @@ extern const struct regulator_ops pmbus_regulator_ops;
#define PMBUS_REGULATOR(_name, _id) PMBUS_REGULATOR_STEP(_name, _id, 0, 0, 0)
#define PMBUS_REGULATOR_STEP_ONE(_name, _voltages, _step, _min_uV) \
{ \
.name = (_name), \
.of_match = of_match_ptr(_name), \
.regulators_node = of_match_ptr("regulators"), \
.ops = &pmbus_regulator_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.n_voltages = _voltages, \
.uV_step = _step, \
.min_uV = _min_uV, \
}
#define PMBUS_REGULATOR_ONE(_name) PMBUS_REGULATOR_STEP_ONE(_name, 0, 0, 0)
/* Function declarations */
void pmbus_clear_cache(struct i2c_client *client);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment