#include <linux/interrupt.h>
#include <linux/mfd/stpmic1.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <dt-bindings/mfd/st,stpmic1.h>
struct stpmic1_regulator_cfg { … };
static int stpmic1_set_mode(struct regulator_dev *rdev, unsigned int mode);
static unsigned int stpmic1_get_mode(struct regulator_dev *rdev);
static int stpmic1_set_icc(struct regulator_dev *rdev, int lim, int severity,
bool enable);
static unsigned int stpmic1_map_mode(unsigned int mode);
enum { … };
#define PMIC_ENABLE_TIME_US …
#define PMIC_RAMP_DELAY …
static const struct linear_range buck1_ranges[] = …;
static const struct linear_range buck2_ranges[] = …;
static const struct linear_range buck3_ranges[] = …;
static const struct linear_range buck4_ranges[] = …;
static const struct linear_range ldo1_ranges[] = …;
static const struct linear_range ldo2_ranges[] = …;
static const struct linear_range ldo3_ranges[] = …;
static const struct linear_range ldo5_ranges[] = …;
static const struct linear_range ldo6_ranges[] = …;
static const struct regulator_ops stpmic1_ldo_ops = …;
static const struct regulator_ops stpmic1_ldo3_ops = …;
static const struct regulator_ops stpmic1_ldo4_fixed_regul_ops = …;
static const struct regulator_ops stpmic1_buck_ops = …;
static const struct regulator_ops stpmic1_vref_ddr_ops = …;
static const struct regulator_ops stpmic1_boost_regul_ops = …;
static const struct regulator_ops stpmic1_switch_regul_ops = …;
#define REG_LDO(ids, base) …
#define REG_LDO3(ids, base) …
#define REG_LDO4(ids, base) …
#define REG_BUCK(ids, base) …
#define REG_VREF_DDR(ids, base) …
#define REG_BOOST(ids, base) …
#define REG_VBUS_OTG(ids, base) …
#define REG_SW_OUT(ids, base) …
static const struct stpmic1_regulator_cfg stpmic1_regulator_cfgs[] = …;
static unsigned int stpmic1_map_mode(unsigned int mode)
{ … }
static unsigned int stpmic1_get_mode(struct regulator_dev *rdev)
{ … }
static int stpmic1_set_mode(struct regulator_dev *rdev, unsigned int mode)
{ … }
static int stpmic1_set_icc(struct regulator_dev *rdev, int lim, int severity,
bool enable)
{ … }
static irqreturn_t stpmic1_curlim_irq_handler(int irq, void *data)
{ … }
#define MATCH(_name, _id) …
static struct of_regulator_match stpmic1_matches[] = …;
static int stpmic1_regulator_register(struct platform_device *pdev, int id,
struct of_regulator_match *match,
const struct stpmic1_regulator_cfg *cfg)
{ … }
static int stpmic1_regulator_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id of_pmic_regulator_match[] = …;
MODULE_DEVICE_TABLE(of, of_pmic_regulator_match);
static struct platform_driver stpmic1_regulator_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;