#include <linux/bug.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/lp3971.h>
#include <linux/slab.h>
struct lp3971 { … };
static u8 lp3971_reg_read(struct lp3971 *lp3971, u8 reg);
static int lp3971_set_bits(struct lp3971 *lp3971, u8 reg, u16 mask, u16 val);
#define LP3971_SYS_CONTROL1_REG …
#define SYS_CONTROL1_INIT_VAL …
#define SYS_CONTROL1_INIT_MASK …
#define LP3971_BUCK_VOL_ENABLE_REG …
#define LP3971_BUCK_VOL_CHANGE_REG …
#define BUCK_VOL_CHANGE_SHIFT(x) …
#define BUCK_VOL_CHANGE_FLAG_GO …
#define BUCK_VOL_CHANGE_FLAG_TARGET …
#define BUCK_VOL_CHANGE_FLAG_MASK …
#define LP3971_BUCK1_BASE …
#define LP3971_BUCK2_BASE …
#define LP3971_BUCK3_BASE …
static const int buck_base_addr[] = …;
#define LP3971_BUCK_TARGET_VOL1_REG(x) …
#define LP3971_BUCK_TARGET_VOL2_REG(x) …
static const unsigned int buck_voltage_map[] = …;
#define BUCK_TARGET_VOL_MASK …
#define LP3971_BUCK_RAMP_REG(x) …
#define LP3971_LDO_ENABLE_REG …
#define LP3971_LDO_VOL_CONTR_BASE …
#define LP3971_LDO_VOL_CONTR_REG(x) …
#define LDO_VOL_CONTR_SHIFT(x) …
#define LDO_VOL_CONTR_MASK …
static const unsigned int ldo45_voltage_map[] = …;
static const unsigned int ldo123_voltage_map[] = …;
#define LDO_VOL_MIN_IDX …
#define LDO_VOL_MAX_IDX …
static int lp3971_ldo_is_enabled(struct regulator_dev *dev)
{ … }
static int lp3971_ldo_enable(struct regulator_dev *dev)
{ … }
static int lp3971_ldo_disable(struct regulator_dev *dev)
{ … }
static int lp3971_ldo_get_voltage_sel(struct regulator_dev *dev)
{ … }
static int lp3971_ldo_set_voltage_sel(struct regulator_dev *dev,
unsigned int selector)
{ … }
static const struct regulator_ops lp3971_ldo_ops = …;
static int lp3971_dcdc_is_enabled(struct regulator_dev *dev)
{ … }
static int lp3971_dcdc_enable(struct regulator_dev *dev)
{ … }
static int lp3971_dcdc_disable(struct regulator_dev *dev)
{ … }
static int lp3971_dcdc_get_voltage_sel(struct regulator_dev *dev)
{ … }
static int lp3971_dcdc_set_voltage_sel(struct regulator_dev *dev,
unsigned int selector)
{ … }
static const struct regulator_ops lp3971_dcdc_ops = …;
static const struct regulator_desc regulators[] = …;
static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
u16 *dest)
{ … }
static int lp3971_i2c_write(struct i2c_client *i2c, char reg, int count,
const u16 *src)
{ … }
static u8 lp3971_reg_read(struct lp3971 *lp3971, u8 reg)
{ … }
static int lp3971_set_bits(struct lp3971 *lp3971, u8 reg, u16 mask, u16 val)
{ … }
static int setup_regulators(struct lp3971 *lp3971,
struct lp3971_platform_data *pdata)
{ … }
static int lp3971_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id lp3971_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, lp3971_i2c_id);
static struct i2c_driver lp3971_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;