#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/gpio/consumer.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/tps65090.h>
#define MAX_CTRL_READ_TRIES …
#define MAX_FET_ENABLE_TRIES …
#define CTRL_EN_BIT …
#define CTRL_WT_BIT …
#define CTRL_PG_BIT …
#define CTRL_TO_BIT …
#define MAX_OVERCURRENT_WAIT …
struct tps65090_regulator { … };
static const struct regulator_ops tps65090_ext_control_ops = …;
static int tps65090_reg_set_overcurrent_wait(struct tps65090_regulator *ri,
struct regulator_dev *rdev)
{ … }
static int tps65090_try_enable_fet(struct regulator_dev *rdev)
{ … }
static int tps65090_fet_enable(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops tps65090_reg_control_ops = …;
static const struct regulator_ops tps65090_fet_control_ops = …;
static const struct regulator_ops tps65090_ldo_ops = …;
#define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) …
#define tps65090_REG_FIXEDV(_id, _sname, en_reg, _en_bits, _volt, _ops) …
#define tps65090_REG_SWITCH(_id, _sname, en_reg, _en_bits, _ops) …
static struct regulator_desc tps65090_regulator_desc[] = …;
static inline bool is_dcdc(int id)
{ … }
static int tps65090_config_ext_control(
struct tps65090_regulator *ri, bool enable)
{ … }
static int tps65090_regulator_disable_ext_control(
struct tps65090_regulator *ri,
struct tps65090_regulator_plat_data *tps_pdata)
{ … }
#ifdef CONFIG_OF
static struct of_regulator_match tps65090_matches[] = …;
static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
struct platform_device *pdev,
struct of_regulator_match **tps65090_reg_matches)
{ … }
#else
static inline struct tps65090_platform_data *tps65090_parse_dt_reg_data(
struct platform_device *pdev,
struct of_regulator_match **tps65090_reg_matches)
{
*tps65090_reg_matches = NULL;
return NULL;
}
#endif
static int tps65090_regulator_probe(struct platform_device *pdev)
{ … }
static struct platform_driver tps65090_regulator_driver = …;
static int __init tps65090_regulator_init(void)
{ … }
subsys_initcall(tps65090_regulator_init);
static void __exit tps65090_regulator_exit(void)
{ … }
module_exit(tps65090_regulator_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;