#include <linux/slab.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/hi6421-pmic.h>
struct hi6421_regulator_pdata { … };
struct hi6421_regulator_info { … };
enum hi6421_regulator_id { … };
static const unsigned int ldo_0_voltages[] = …;
static const unsigned int ldo_8_voltages[] = …;
static const struct linear_range ldo_audio_volt_range[] = …;
static const unsigned int buck_3_voltages[] = …;
static const unsigned int buck_4_voltages[] = …;
static const unsigned int buck_5_voltages[] = …;
static const struct regulator_ops hi6421_ldo_ops;
static const struct regulator_ops hi6421_ldo_linear_ops;
static const struct regulator_ops hi6421_ldo_linear_range_ops;
static const struct regulator_ops hi6421_buck012_ops;
static const struct regulator_ops hi6421_buck345_ops;
#define HI6421_LDO_ENABLE_TIME …
#define HI6421_LDO(_id, _match, v_table, vreg, vmask, ereg, emask, \
odelay, ecomask, ecoamp) …
#define HI6421_LDO_LINEAR(_id, _match, _min_uV, n_volt, vstep, vreg, vmask,\
ereg, emask, odelay, ecomask, ecoamp) …
#define HI6421_LDO_LINEAR_RANGE(_id, _match, n_volt, volt_ranges, vreg, vmask,\
ereg, emask, odelay, ecomask, ecoamp) …
#define HI6421_BUCK012(_id, _match, vreg, vmask, ereg, emask, sleepmask,\
etime, odelay) …
#define HI6421_BUCK345(_id, _match, v_table, vreg, vmask, ereg, emask, \
odelay, sleepmask) …
static struct hi6421_regulator_info
hi6421_regulator_info[HI6421_NUM_REGULATORS] = …;
static int hi6421_regulator_enable(struct regulator_dev *rdev)
{ … }
static unsigned int hi6421_regulator_ldo_get_mode(struct regulator_dev *rdev)
{ … }
static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *rdev)
{ … }
static int hi6421_regulator_ldo_set_mode(struct regulator_dev *rdev,
unsigned int mode)
{ … }
static int hi6421_regulator_buck_set_mode(struct regulator_dev *rdev,
unsigned int mode)
{ … }
static unsigned int
hi6421_regulator_ldo_get_optimum_mode(struct regulator_dev *rdev,
int input_uV, int output_uV, int load_uA)
{ … }
static const struct regulator_ops hi6421_ldo_ops = …;
static const struct regulator_ops hi6421_ldo_linear_ops = …;
static const struct regulator_ops hi6421_ldo_linear_range_ops = …;
static const struct regulator_ops hi6421_buck012_ops = …;
static const struct regulator_ops hi6421_buck345_ops = …;
static int hi6421_regulator_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id hi6421_regulator_table[] = …;
MODULE_DEVICE_TABLE(platform, hi6421_regulator_table);
static struct platform_driver hi6421_regulator_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;