#include <linux/module.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/slab.h>
#include <linux/regulator/max1586.h>
#include <linux/of.h>
#include <linux/regulator/of_regulator.h>
#define MAX1586_V3_MAX_VSEL …
#define MAX1586_V6_MAX_VSEL …
#define MAX1586_V3_MIN_UV …
#define MAX1586_V3_MAX_UV …
#define MAX1586_V6_MIN_UV …
#define MAX1586_V6_MAX_UV …
#define I2C_V3_SELECT …
#define I2C_V6_SELECT …
struct max1586_data { … };
static const unsigned int v6_voltages_uv[] = …;
static int max1586_v3_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static int max1586_v3_set_voltage_sel(struct regulator_dev *rdev,
unsigned selector)
{ … }
static int max1586_v6_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static int max1586_v6_set_voltage_sel(struct regulator_dev *rdev,
unsigned int selector)
{ … }
static const struct regulator_ops max1586_v3_ops = …;
static const struct regulator_ops max1586_v6_ops = …;
static struct regulator_desc max1586_reg[] = …;
static int of_get_max1586_platform_data(struct device *dev,
struct max1586_platform_data *pdata)
{ … }
static const struct of_device_id __maybe_unused max1586_of_match[] = …;
MODULE_DEVICE_TABLE(of, max1586_of_match);
static int max1586_pmic_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id max1586_id[] = …;
MODULE_DEVICE_TABLE(i2c, max1586_id);
static struct i2c_driver max1586_pmic_driver = …;
static int __init max1586_pmic_init(void)
{ … }
subsys_initcall(max1586_pmic_init);
static void __exit max1586_pmic_exit(void)
{ … }
module_exit(max1586_pmic_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;