#include <linux/bug.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/lp3972.h>
#include <linux/slab.h>
struct lp3972 { … };
#define LP3972_SCR_REG …
#define LP3972_OVER1_REG …
#define LP3972_OVSR1_REG …
#define LP3972_OVER2_REG …
#define LP3972_OVSR2_REG …
#define LP3972_VCC1_REG …
#define LP3972_ADTV1_REG …
#define LP3972_ADTV2_REG …
#define LP3972_AVRC_REG …
#define LP3972_CDTC1_REG …
#define LP3972_CDTC2_REG …
#define LP3972_SDTV1_REG …
#define LP3972_SDTV2_REG …
#define LP3972_MDTV1_REG …
#define LP3972_MDTV2_REG …
#define LP3972_L2VCR_REG …
#define LP3972_L34VCR_REG …
#define LP3972_SCR1_REG …
#define LP3972_SCR2_REG …
#define LP3972_OEN3_REG …
#define LP3972_OSR3_REG …
#define LP3972_LOER4_REG …
#define LP3972_B2TV_REG …
#define LP3972_B3TV_REG …
#define LP3972_B32RC_REG …
#define LP3972_ISRA_REG …
#define LP3972_BCCR_REG …
#define LP3972_II1RR_REG …
#define LP3972_II2RR_REG …
#define LP3972_SYS_CONTROL1_REG …
#define SYS_CONTROL1_INIT_VAL …
#define SYS_CONTROL1_INIT_MASK …
#define LP3972_VOL_CHANGE_REG …
#define LP3972_VOL_CHANGE_FLAG_GO …
#define LP3972_VOL_CHANGE_FLAG_MASK …
#define LP3972_OEN3_L1EN …
#define LP3972_OVER2_LDO2_EN …
#define LP3972_OVER2_LDO3_EN …
#define LP3972_OVER2_LDO4_EN …
#define LP3972_OVER1_S_EN …
static const unsigned int ldo1_voltage_map[] = …;
static const unsigned int ldo23_voltage_map[] = …;
static const unsigned int ldo4_voltage_map[] = …;
static const unsigned int ldo5_voltage_map[] = …;
static const unsigned int buck1_voltage_map[] = …;
static const unsigned int buck23_voltage_map[] = …;
static const int ldo_output_enable_mask[] = …;
static const int ldo_output_enable_addr[] = …;
static const int ldo_vol_ctl_addr[] = …;
static const int buck_vol_enable_addr[] = …;
static const int buck_base_addr[] = …;
#define LP3972_LDO_OUTPUT_ENABLE_MASK(x) …
#define LP3972_LDO_OUTPUT_ENABLE_REG(x) …
#define LP3972_LDO_VOL_CONTR_SHIFT(x) …
#define LP3972_LDO_VOL_CONTR_REG(x) …
#define LP3972_LDO_VOL_CHANGE_SHIFT(x) …
#define LP3972_LDO_VOL_MASK(x) …
#define LP3972_LDO_VOL_MIN_IDX(x) …
#define LP3972_LDO_VOL_MAX_IDX(x) …
#define LP3972_BUCK_VOL_ENABLE_REG(x) …
#define LP3972_BUCK_VOL1_REG(x) …
#define LP3972_BUCK_VOL_MASK …
static int lp3972_i2c_read(struct i2c_client *i2c, char reg, int count,
u16 *dest)
{ … }
static int lp3972_i2c_write(struct i2c_client *i2c, char reg, int count,
const u16 *src)
{ … }
static u8 lp3972_reg_read(struct lp3972 *lp3972, u8 reg)
{ … }
static int lp3972_set_bits(struct lp3972 *lp3972, u8 reg, u16 mask, u16 val)
{ … }
static int lp3972_ldo_is_enabled(struct regulator_dev *dev)
{ … }
static int lp3972_ldo_enable(struct regulator_dev *dev)
{ … }
static int lp3972_ldo_disable(struct regulator_dev *dev)
{ … }
static int lp3972_ldo_get_voltage_sel(struct regulator_dev *dev)
{ … }
static int lp3972_ldo_set_voltage_sel(struct regulator_dev *dev,
unsigned int selector)
{ … }
static const struct regulator_ops lp3972_ldo_ops = …;
static int lp3972_dcdc_is_enabled(struct regulator_dev *dev)
{ … }
static int lp3972_dcdc_enable(struct regulator_dev *dev)
{ … }
static int lp3972_dcdc_disable(struct regulator_dev *dev)
{ … }
static int lp3972_dcdc_get_voltage_sel(struct regulator_dev *dev)
{ … }
static int lp3972_dcdc_set_voltage_sel(struct regulator_dev *dev,
unsigned int selector)
{ … }
static const struct regulator_ops lp3972_dcdc_ops = …;
static const struct regulator_desc regulators[] = …;
static int setup_regulators(struct lp3972 *lp3972,
struct lp3972_platform_data *pdata)
{ … }
static int lp3972_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id lp3972_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, lp3972_i2c_id);
static struct i2c_driver lp3972_i2c_driver = …;
static int __init lp3972_module_init(void)
{ … }
subsys_initcall(lp3972_module_init);
static void __exit lp3972_module_exit(void)
{ … }
module_exit(lp3972_module_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;