#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/bits.h>
#include <linux/gpio/consumer.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/max8998.h>
#include <linux/mfd/max8998-private.h>
struct max8998_data { … };
static const unsigned int charger_current_table[] = …;
static int max8998_get_enable_register(struct regulator_dev *rdev,
int *reg, int *shift)
{ … }
static int max8998_ldo_is_enabled(struct regulator_dev *rdev)
{ … }
static int max8998_ldo_is_enabled_inverted(struct regulator_dev *rdev)
{ … }
static int max8998_ldo_enable(struct regulator_dev *rdev)
{ … }
static int max8998_ldo_disable(struct regulator_dev *rdev)
{ … }
static int max8998_get_voltage_register(struct regulator_dev *rdev,
int *_reg, int *_shift, int *_mask)
{ … }
static int max8998_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static int max8998_set_voltage_ldo_sel(struct regulator_dev *rdev,
unsigned selector)
{ … }
static inline void buck1_gpio_set(struct gpio_desc *gpio1, struct gpio_desc *gpio2, int v)
{ … }
static inline void buck2_gpio_set(struct gpio_desc *gpio, int v)
{ … }
static int max8998_set_voltage_buck_sel(struct regulator_dev *rdev,
unsigned selector)
{ … }
static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,
unsigned int old_selector,
unsigned int new_selector)
{ … }
static int max8998_set_current_limit(struct regulator_dev *rdev,
int min_uA, int max_uA)
{ … }
static int max8998_get_current_limit(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops max8998_ldo_ops = …;
static const struct regulator_ops max8998_buck_ops = …;
static const struct regulator_ops max8998_charger_ops = …;
static const struct regulator_ops max8998_others_ops = …;
#define MAX8998_LINEAR_REG(_name, _ops, _min, _step, _max) …
#define MAX8998_CURRENT_REG(_name, _ops, _table, _reg, _mask) …
#define MAX8998_OTHERS_REG(_name, _id) …
static const struct regulator_desc regulators[] = …;
static int max8998_pmic_dt_parse_pdata(struct max8998_dev *iodev,
struct max8998_platform_data *pdata)
{ … }
static int max8998_pmic_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id max8998_pmic_id[] = …;
MODULE_DEVICE_TABLE(platform, max8998_pmic_id);
static struct platform_driver max8998_pmic_driver = …;
static int __init max8998_pmic_init(void)
{ … }
subsys_initcall(max8998_pmic_init);
static void __exit max8998_pmic_cleanup(void)
{ … }
module_exit(max8998_pmic_cleanup);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;