#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
enum { … };
struct mt6360_irq_mapping { … };
struct mt6360_regulator_desc { … };
struct mt6360_regulator_data { … };
static irqreturn_t mt6360_pgb_event_handler(int irq, void *data)
{ … }
static irqreturn_t mt6360_oc_event_handler(int irq, void *data)
{ … }
static irqreturn_t mt6360_ov_event_handler(int irq, void *data)
{ … }
static irqreturn_t mt6360_uv_event_handler(int irq, void *data)
{ … }
static const struct mt6360_irq_mapping buck1_irq_tbls[] = …;
static const struct mt6360_irq_mapping buck2_irq_tbls[] = …;
static const struct mt6360_irq_mapping ldo6_irq_tbls[] = …;
static const struct mt6360_irq_mapping ldo7_irq_tbls[] = …;
static const struct mt6360_irq_mapping ldo1_irq_tbls[] = …;
static const struct mt6360_irq_mapping ldo2_irq_tbls[] = …;
static const struct mt6360_irq_mapping ldo3_irq_tbls[] = …;
static const struct mt6360_irq_mapping ldo5_irq_tbls[] = …;
static const struct linear_range buck_vout_ranges[] = …;
static const struct linear_range ldo_vout_ranges1[] = …;
static const struct linear_range ldo_vout_ranges2[] = …;
static const struct linear_range ldo_vout_ranges3[] = …;
static int mt6360_regulator_set_mode(struct regulator_dev *rdev,
unsigned int mode)
{ … }
static unsigned int mt6360_regulator_get_mode(struct regulator_dev *rdev)
{ … }
static int mt6360_regulator_get_status(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops mt6360_regulator_ops = …;
static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
{ … }
#define MT6360_REGULATOR_DESC(match, _name, _sname, ereg, emask, vreg, \
vmask, mreg, mmask, streg, stmask, \
vranges, vcnts, offon_delay, irq_tbls) …
static const struct mt6360_regulator_desc mt6360_regulator_descs[] = …;
static int mt6360_regulator_irq_register(struct platform_device *pdev,
struct regulator_dev *rdev,
const struct mt6360_irq_mapping *tbls,
int tbl_size)
{ … }
static int mt6360_regulator_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id mt6360_regulator_id_table[] = …;
MODULE_DEVICE_TABLE(platform, mt6360_regulator_id_table);
static struct platform_driver mt6360_regulator_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;