#include <linux/of.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/driver.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/regulator/da9121.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include "da9121-regulator.h"
struct da9121 { … };
struct da9121_range { … };
static struct da9121_range da9121_10A_2phase_current = …;
static struct da9121_range da9121_6A_2phase_current = …;
static struct da9121_range da9121_5A_1phase_current = …;
static struct da9121_range da9121_3A_1phase_current = …;
static struct da9121_range da914x_40A_4phase_current = …;
static struct da9121_range da914x_20A_2phase_current = …;
struct da9121_variant_info { … };
static const struct da9121_variant_info variant_parameters[] = …;
struct da9121_field { … };
static const struct da9121_field da9121_current_field[2] = …;
static const struct da9121_field da9121_mode_field[2] = …;
struct status_event_data { … };
#define DA9121_STATUS(id, bank, name, notification, warning) …
#define DA9xxx_STATUS(id, bank, name, notification, warning) …
static const struct status_event_data status_event_handling[] = …;
static int da9121_get_current_limit(struct regulator_dev *rdev)
{ … }
static int da9121_ceiling_selector(struct regulator_dev *rdev,
int min, int max,
unsigned int *selector)
{ … }
static int da9121_set_current_limit(struct regulator_dev *rdev,
int min_ua, int max_ua)
{ … }
static unsigned int da9121_map_mode(unsigned int mode)
{ … }
static int da9121_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
{ … }
static unsigned int da9121_buck_get_mode(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops da9121_buck_ops = …;
static struct of_regulator_match da9121_matches[] = …;
static int da9121_of_parse_cb(struct device_node *np,
const struct regulator_desc *desc,
struct regulator_config *config)
{ … }
#define DA9121_MIN_MV …
#define DA9121_MAX_MV …
#define DA9121_STEP_MV …
#define DA9121_MIN_SEL …
#define DA9121_N_VOLTAGES …
static const struct regulator_desc da9121_reg = …;
static const struct regulator_desc da9220_reg[2] = …;
static const struct regulator_desc da9122_reg[2] = …;
static const struct regulator_desc da9217_reg = …;
#define DA914X_MIN_MV …
#define DA914X_MAX_MV …
#define DA914X_STEP_MV …
#define DA914X_MIN_SEL …
#define DA914X_N_VOLTAGES …
static const struct regulator_desc da9141_reg = …;
static const struct regulator_desc da9142_reg = …;
static const struct regulator_desc *local_da9121_regulators[][DA9121_IDX_MAX] = …;
static void da9121_status_poll_on(struct work_struct *work)
{ … }
static irqreturn_t da9121_irq_handler(int irq, void *data)
{ … }
static int da9121_set_regulator_config(struct da9121 *chip)
{ … }
static const struct regmap_range da9121_1ch_readable_ranges[] = …;
static const struct regmap_access_table da9121_1ch_readable_table = …;
static const struct regmap_range da9121_2ch_readable_ranges[] = …;
static const struct regmap_access_table da9121_2ch_readable_table = …;
static const struct regmap_range da9121_1ch_writeable_ranges[] = …;
static const struct regmap_access_table da9121_1ch_writeable_table = …;
static const struct regmap_range da9121_2ch_writeable_ranges[] = …;
static const struct regmap_access_table da9121_2ch_writeable_table = …;
static const struct regmap_range da9121_volatile_ranges[] = …;
static const struct regmap_access_table da9121_volatile_table = …;
static const struct regmap_config da9121_1ch_regmap_config = …;
static const struct regmap_config da9121_2ch_regmap_config = …;
static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
{ … }
static int da9121_assign_chip_model(struct i2c_client *i2c,
struct da9121 *chip)
{ … }
static int da9121_config_irq(struct i2c_client *i2c,
struct da9121 *chip)
{ … }
static const struct of_device_id da9121_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, da9121_dt_ids);
static int da9121_i2c_probe(struct i2c_client *i2c)
{ … }
static void da9121_i2c_remove(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id da9121_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, da9121_i2c_id);
static struct i2c_driver da9121_regulator_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;