#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/regulator/of_regulator.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/tps62360.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/regmap.h>
#define REG_VSET0 …
#define REG_VSET1 …
#define REG_VSET2 …
#define REG_VSET3 …
#define REG_CONTROL …
#define REG_TEMP …
#define REG_RAMPCTRL …
#define REG_CHIPID …
#define FORCE_PWM_ENABLE …
enum chips { … };
#define TPS62360_BASE_VOLTAGE …
#define TPS62360_N_VOLTAGES …
#define TPS62361_BASE_VOLTAGE …
#define TPS62361_N_VOLTAGES …
struct tps62360_chip { … };
static bool find_voltage_set_register(struct tps62360_chip *tps,
int req_vsel, int *vset_reg_id)
{ … }
static int tps62360_dcdc_get_voltage_sel(struct regulator_dev *dev)
{ … }
static int tps62360_dcdc_set_voltage_sel(struct regulator_dev *dev,
unsigned selector)
{ … }
static int tps62360_set_mode(struct regulator_dev *rdev, unsigned int mode)
{ … }
static unsigned int tps62360_get_mode(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops tps62360_dcdc_ops = …;
static int tps62360_init_dcdc(struct tps62360_chip *tps,
struct tps62360_regulator_platform_data *pdata)
{ … }
static const struct regmap_config tps62360_regmap_config = …;
static struct tps62360_regulator_platform_data *
of_get_tps62360_platform_data(struct device *dev,
const struct regulator_desc *desc)
{ … }
#if defined(CONFIG_OF)
static const struct of_device_id tps62360_of_match[] = …;
MODULE_DEVICE_TABLE(of, tps62360_of_match);
#endif
static int tps62360_probe(struct i2c_client *client)
{ … }
static void tps62360_shutdown(struct i2c_client *client)
{ … }
static const struct i2c_device_id tps62360_id[] = …;
MODULE_DEVICE_TABLE(i2c, tps62360_id);
static struct i2c_driver tps62360_i2c_driver = …;
static int __init tps62360_init(void)
{ … }
subsys_initcall(tps62360_init);
static void __exit tps62360_cleanup(void)
{ … }
module_exit(tps62360_cleanup);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;