#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/mfd/rohm-bd957x.h>
#include <linux/mfd/rohm-generic.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#define BD957X_VOUTS1_VOLT …
#define BD957X_VOUTS4_BASE_VOLT …
#define BD957X_VOUTS34_NUM_VOLT …
#define BD9576_THERM_IRQ_MASK_TW …
#define BD9576_xVD_IRQ_MASK_VOUTL1 …
#define BD9576_UVD_IRQ_MASK_VOUTS1_OCW …
#define BD9576_xVD_IRQ_MASK_VOUT1TO4 …
static const unsigned int vout1_volt_table[] = …;
static const unsigned int vout2_volt_table[] = …;
static const unsigned int voutl1_volt_table[] = …;
static const struct linear_range vout1_xvd_ranges[] = …;
static const struct linear_range vout234_xvd_ranges[] = …;
static const struct linear_range voutL1_xvd_ranges[] = …;
static struct linear_range voutS1_ocw_ranges_internal[] = …;
static struct linear_range voutS1_ocw_ranges[] = …;
static struct linear_range voutS1_ocp_ranges_internal[] = …;
static struct linear_range voutS1_ocp_ranges[] = …;
struct bd957x_regulator_data { … };
#define BD9576_NUM_REGULATORS …
#define BD9576_NUM_OVD_REGULATORS …
struct bd957x_data { … };
static int bd957x_vout34_list_voltage(struct regulator_dev *rdev,
unsigned int selector)
{ … }
static int bd957x_list_voltage(struct regulator_dev *rdev,
unsigned int selector)
{ … }
static void bd9576_fill_ovd_flags(struct bd957x_regulator_data *data,
bool warn)
{ … }
static void bd9576_fill_ocp_flags(struct bd957x_regulator_data *data,
bool warn)
{ … }
static void bd9576_fill_uvd_flags(struct bd957x_regulator_data *data,
bool warn)
{ … }
static void bd9576_fill_temp_flags(struct bd957x_regulator_data *data,
bool enable, bool warn)
{ … }
static int bd9576_set_limit(const struct linear_range *r, int num_ranges,
struct regmap *regmap, int reg, int mask, int lim)
{ … }
static bool check_ocp_flag_mismatch(struct regulator_dev *rdev, int severity,
struct bd957x_regulator_data *r)
{ … }
static bool check_uvd_flag_mismatch(struct regulator_dev *rdev, int severity,
struct bd957x_regulator_data *r)
{ … }
static bool check_ovd_flag_mismatch(struct regulator_dev *rdev, int severity,
struct bd957x_regulator_data *r)
{ … }
static bool check_temp_flag_mismatch(struct regulator_dev *rdev, int severity,
struct bd957x_regulator_data *r)
{ … }
static int bd9576_set_ocp(struct regulator_dev *rdev, int lim_uA, int severity,
bool enable)
{ … }
static int bd9576_set_uvp(struct regulator_dev *rdev, int lim_uV, int severity,
bool enable)
{ … }
static int bd9576_set_ovp(struct regulator_dev *rdev, int lim_uV, int severity,
bool enable)
{ … }
static int bd9576_set_tw(struct regulator_dev *rdev, int lim, int severity,
bool enable)
{ … }
static const struct regulator_ops bd9573_vout34_ops = …;
static const struct regulator_ops bd9576_vout34_ops = …;
static const struct regulator_ops bd9573_vouts1_regulator_ops = …;
static const struct regulator_ops bd9576_vouts1_regulator_ops = …;
static const struct regulator_ops bd9573_ops = …;
static const struct regulator_ops bd9576_ops = …;
static const struct regulator_ops *bd9573_ops_arr[] = …;
static const struct regulator_ops *bd9576_ops_arr[] = …;
static int vouts1_get_fet_res(struct device_node *np,
const struct regulator_desc *desc,
struct regulator_config *cfg)
{ … }
static struct bd957x_data bd957x_regulators = …;
static int bd9576_renable(struct regulator_irq_data *rid, int reg, int mask)
{ … }
static int bd9576_uvd_renable(struct regulator_irq_data *rid)
{ … }
static int bd9576_ovd_renable(struct regulator_irq_data *rid)
{ … }
static int bd9576_temp_renable(struct regulator_irq_data *rid)
{ … }
static int bd9576_uvd_handler(int irq, struct regulator_irq_data *rid,
unsigned long *dev_mask)
{ … }
static int bd9576_ovd_handler(int irq, struct regulator_irq_data *rid,
unsigned long *dev_mask)
{ … }
#define BD9576_DEV_MASK_ALL_REGULATORS …
static int bd9576_thermal_handler(int irq, struct regulator_irq_data *rid,
unsigned long *dev_mask)
{ … }
static int bd957x_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id bd957x_pmic_id[] = …;
MODULE_DEVICE_TABLE(platform, bd957x_pmic_id);
static struct platform_driver bd957x_regulator = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;