#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#define RT4801_REG_VOP …
#define RT4801_REG_VON …
#define RT4801_REG_APPS …
#define VOUT_MASK …
#define MIN_UV …
#define STEP_UV …
#define MAX_UV …
#define N_VOLTAGES …
#define DSV_OUT_POS …
#define DSV_OUT_NEG …
#define DSV_OUT_MAX …
#define DSVP_ENABLE …
#define DSVN_ENABLE …
#define DSVALL_ENABLE …
struct rt4801_priv { … };
static int rt4801_of_parse_cb(struct device_node *np,
const struct regulator_desc *desc,
struct regulator_config *config)
{ … }
static int rt4801_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector)
{ … }
static int rt4801_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static int rt4801_enable(struct regulator_dev *rdev)
{ … }
static int rt4801_disable(struct regulator_dev *rdev)
{ … }
static int rt4801_is_enabled(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops rt4801_regulator_ops = …;
static const struct regulator_desc rt4801_regulator_descs[] = …;
static const struct regmap_config rt4801_regmap_config = …;
static int rt4801_probe(struct i2c_client *i2c)
{ … }
static const struct of_device_id __maybe_unused rt4801_of_id[] = …;
MODULE_DEVICE_TABLE(of, rt4801_of_id);
static struct i2c_driver rt4801_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;