#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/driver.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/mfd/rohm-generic.h>
#include <linux/mfd/rohm-bd71815.h>
#include <linux/regulator/of_regulator.h>
struct bd71815_regulator { … };
static const int bd7181x_wled_currents[] = …;
static const struct rohm_dvs_config buck1_dvs = …;
static const struct rohm_dvs_config buck2_dvs = …;
static const struct rohm_dvs_config buck3_dvs = …;
static const struct rohm_dvs_config buck4_dvs = …;
static const struct rohm_dvs_config ldo1_dvs = …;
static const struct rohm_dvs_config ldo2_dvs = …;
static const struct rohm_dvs_config ldo3_dvs = …;
static const struct rohm_dvs_config ldo4_dvs = …;
static const struct rohm_dvs_config ldo5_dvs = …;
static const struct rohm_dvs_config dvref_dvs = …;
static const struct rohm_dvs_config ldolpsr_dvs = …;
static const struct rohm_dvs_config buck5_dvs = …;
static int set_hw_dvs_levels(struct device_node *np,
const struct regulator_desc *desc,
struct regulator_config *cfg)
{ … }
static int buck12_set_hw_dvs_levels(struct device_node *np,
const struct regulator_desc *desc,
struct regulator_config *cfg)
{ … }
static const unsigned int bd7181x_ramp_table[] = …;
static int bd7181x_led_set_current_limit(struct regulator_dev *rdev,
int min_uA, int max_uA)
{ … }
static int bd7181x_buck12_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static int bd7181x_buck12_set_voltage_sel(struct regulator_dev *rdev,
unsigned int sel)
{ … }
static const struct regulator_ops bd7181x_ldo_regulator_ops = …;
static const struct regulator_ops bd7181x_fixed_regulator_ops = …;
static const struct regulator_ops bd7181x_buck_regulator_ops = …;
static const struct regulator_ops bd7181x_buck12_regulator_ops = …;
static const struct regulator_ops bd7181x_led_regulator_ops = …;
#define BD71815_FIXED_REG(_name, _id, ereg, emsk, voltage, _dvs) …
#define BD71815_BUCK_REG(_name, _id, vsel, ereg, min, max, step, _dvs) …
#define BD71815_BUCK12_REG(_name, _id, vsel, ereg, min, max, step, \
_dvs) …
#define BD71815_LED_REG(_name, _id, csel, mask, ereg, emsk, currents) …
#define BD71815_LDO_REG(_name, _id, vsel, ereg, emsk, min, max, step, \
_dvs) …
static const struct bd71815_regulator bd71815_regulators[] = …;
static int bd7181x_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id bd7181x_pmic_id[] = …;
MODULE_DEVICE_TABLE(platform, bd7181x_pmic_id);
static struct platform_driver bd7181x_regulator = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;