#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/twl.h>
#include <linux/delay.h>
struct twlreg_info { … };
#define VREG_GRP …
#define VREG_TYPE …
#define VREG_REMAP …
#define VREG_DEDICATED …
#define VREG_VOLTAGE_SMPS_4030 …
#define VREG_TRANS …
#define VREG_STATE …
#define VREG_VOLTAGE …
#define VREG_VOLTAGE_SMPS …
static inline int
twlreg_read(struct twlreg_info *info, unsigned slave_subgp, unsigned offset)
{ … }
static inline int
twlreg_write(struct twlreg_info *info, unsigned slave_subgp, unsigned offset,
u8 value)
{ … }
static int twlreg_grp(struct regulator_dev *rdev)
{ … }
#define P3_GRP_4030 …
#define P2_GRP_4030 …
#define P1_GRP_4030 …
#define P3_GRP_6030 …
#define P2_GRP_6030 …
#define P1_GRP_6030 …
static int twl4030reg_is_enabled(struct regulator_dev *rdev)
{ … }
#define PB_I2C_BUSY …
#define PB_I2C_BWEN …
static int twl4030_wait_pb_ready(void)
{ … }
static int twl4030_send_pb_msg(unsigned msg)
{ … }
static int twl4030reg_enable(struct regulator_dev *rdev)
{ … }
static int twl4030reg_disable(struct regulator_dev *rdev)
{ … }
static int twl4030reg_get_status(struct regulator_dev *rdev)
{ … }
static int twl4030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
{ … }
static inline unsigned int twl4030reg_map_mode(unsigned int mode)
{ … }
#define UNSUP_MASK …
#define UNSUP(x) …
#define IS_UNSUP(info, x) …
#define LDO_MV(x) …
static const u16 VAUX1_VSEL_table[] = …;
static const u16 VAUX2_4030_VSEL_table[] = …;
static const u16 VAUX2_VSEL_table[] = …;
static const u16 VAUX3_VSEL_table[] = …;
static const u16 VAUX4_VSEL_table[] = …;
static const u16 VMMC1_VSEL_table[] = …;
static const u16 VMMC2_VSEL_table[] = …;
static const u16 VPLL1_VSEL_table[] = …;
static const u16 VPLL2_VSEL_table[] = …;
static const u16 VSIM_VSEL_table[] = …;
static const u16 VDAC_VSEL_table[] = …;
static const u16 VIO_VSEL_table[] = …;
static const u16 VINTANA2_VSEL_table[] = …;
static const struct linear_range VDD1_ranges[] = …;
static const struct linear_range VDD2_ranges[] = …;
static int twl4030ldo_list_voltage(struct regulator_dev *rdev, unsigned index)
{ … }
static int
twl4030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
{ … }
static int twl4030ldo_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops twl4030ldo_ops = …;
static int
twl4030smps_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
unsigned *selector)
{ … }
static int twl4030smps_get_voltage(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops twl4030smps_ops = …;
static const struct regulator_ops twl4030fixed_ops = …;
#define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) …
#define TWL4030_ADJUSTABLE_SMPS(label, offset, num, turnon_delay, remap_conf, \
n_volt) …
#define TWL4030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
remap_conf) …
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_LDO(…);
TWL4030_ADJUSTABLE_SMPS(…);
TWL4030_ADJUSTABLE_SMPS(…);
TWL4030_FIXED_LDO(…);
TWL4030_FIXED_LDO(…);
TWL4030_FIXED_LDO(…);
TWL4030_FIXED_LDO(…);
TWL4030_FIXED_LDO(…);
#define TWL_OF_MATCH(comp, family, label) …
#define TWL4030_OF_MATCH(comp, label) …
#define TWL6030_OF_MATCH(comp, label) …
#define TWL6032_OF_MATCH(comp, label) …
#define TWLFIXED_OF_MATCH(comp, label) …
#define TWLSMPS_OF_MATCH(comp, label) …
static const struct of_device_id twl_of_match[] = …;
MODULE_DEVICE_TABLE(of, twl_of_match);
static int twlreg_probe(struct platform_device *pdev)
{ … }
MODULE_ALIAS(…) …;
static struct platform_driver twlreg_driver = …;
static int __init twlreg_init(void)
{ … }
subsys_initcall(twlreg_init);
static void __exit twlreg_exit(void)
{ … }
module_exit(…)
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;