#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/mfd/lp873x.h>
#define LP873X_REGULATOR(_name, _id, _of, _ops, _n, _vr, _vm, _er, _em, \
.supply_name = _of "-in", \
.of_match = of_match_ptr(_of), \
.regulators_node = of_match_ptr("regulators"),\
.type = REGULATOR_VOLTAGE, \
.n_linear_ranges = ARRAY_SIZE(_lr), \
.curr_table = lp873x_buck_uA, \
.n_current_limits = ARRAY_SIZE(lp873x_buck_uA), \
.csel_mask = LP873X_BUCK0_CTRL_2_BUCK0_ILIM,\
struct lp873x_regulator {
struct regulator_desc desc;
static const struct lp873x_regulator regulators[];
static const struct regulator_linear_range buck0_buck1_ranges[] = {
REGULATOR_LINEAR_RANGE(0, 0x0, 0x13, 0),
REGULATOR_LINEAR_RANGE(700000, 0x14, 0x17, 10000),
REGULATOR_LINEAR_RANGE(735000, 0x18, 0x9d, 5000),
REGULATOR_LINEAR_RANGE(1420000, 0x9e, 0xff, 20000),