#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_TRANS …
#define VREG_STATE …
#define VREG_VOLTAGE …
#define VREG_VOLTAGE_SMPS …
#define VREG_BC_ALL …
#define VREG_BC_REF …
#define VREG_BC_PROC …
#define VREG_BC_CLK_RST …
#define TWL6030_VREG_VOLTAGE_WR_S …
#define TWL6030_CFG_STATE_OFF …
#define TWL6030_CFG_STATE_ON …
#define TWL6030_CFG_STATE_OFF2 …
#define TWL6030_CFG_STATE_SLEEP …
#define TWL6030_CFG_STATE_GRP_SHIFT …
#define TWL6030_CFG_STATE_APP_SHIFT …
#define TWL6030_CFG_STATE_MASK …
#define TWL6030_CFG_STATE_APP_MASK …
#define TWL6030_CFG_STATE_APP(v) …
#define SMPS_OFFSET_EN …
#define SMPS_EXTENDED_EN …
#define TWL_6030_WARM_RESET …
#define TWL6030_SMPS_OFFSET …
#define TWL6030_SMPS_MULT …
#define SMPS_MULTOFFSET_SMPS4 …
#define SMPS_MULTOFFSET_VIO …
#define SMPS_MULTOFFSET_SMPS3 …
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_6030 …
#define P2_GRP_6030 …
#define P1_GRP_6030 …
static int twl6030reg_is_enabled(struct regulator_dev *rdev)
{ … }
#define PB_I2C_BUSY …
#define PB_I2C_BWEN …
static int twl6030reg_enable(struct regulator_dev *rdev)
{ … }
static int twl6030reg_disable(struct regulator_dev *rdev)
{ … }
static int twl6030reg_get_status(struct regulator_dev *rdev)
{ … }
static int twl6030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
{ … }
static int twl6030coresmps_set_voltage(struct regulator_dev *rdev, int min_uV,
int max_uV, unsigned *selector)
{ … }
static int twl6030coresmps_get_voltage(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops twl6030coresmps_ops = …;
static int
twl6030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
{ … }
static int twl6030ldo_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops twl6030ldo_ops = …;
static const struct regulator_ops twl6030fixed_ops = …;
static int twl6030smps_list_voltage(struct regulator_dev *rdev, unsigned index)
{ … }
static int twl6030smps_map_voltage(struct regulator_dev *rdev, int min_uV,
int max_uV)
{ … }
static int twl6030smps_set_voltage_sel(struct regulator_dev *rdev,
unsigned int selector)
{ … }
static int twl6030smps_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops twlsmps_ops = …;
static const struct linear_range twl6030ldo_linear_range[] = …;
#define TWL6030_ADJUSTABLE_SMPS(label) …
#define TWL6030_ADJUSTABLE_LDO(label, offset) …
#define TWL6032_ADJUSTABLE_LDO(label, offset) …
#define TWL6030_FIXED_LDO(label, offset, mVolts, turnon_delay) …
#define TWL6032_ADJUSTABLE_SMPS(label, offset) …
TWL6030_ADJUSTABLE_SMPS(…);
TWL6030_ADJUSTABLE_SMPS(…);
TWL6030_ADJUSTABLE_SMPS(…);
TWL6030_ADJUSTABLE_LDO(…);
TWL6030_ADJUSTABLE_LDO(…);
TWL6030_ADJUSTABLE_LDO(…);
TWL6030_ADJUSTABLE_LDO(…);
TWL6030_ADJUSTABLE_LDO(…);
TWL6030_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6032_ADJUSTABLE_LDO(…);
TWL6030_FIXED_LDO(…);
TWL6030_FIXED_LDO(…);
TWL6030_FIXED_LDO(…);
TWL6030_FIXED_LDO(…);
TWL6030_FIXED_LDO(…);
TWL6030_FIXED_LDO(…);
TWL6032_ADJUSTABLE_SMPS(…);
TWL6032_ADJUSTABLE_SMPS(…);
TWL6032_ADJUSTABLE_SMPS(…);
static u8 twl_get_smps_offset(void)
{ … }
static u8 twl_get_smps_mult(void)
{ … }
#define TWL_OF_MATCH(comp, family, 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(…) …;