linux/drivers/regulator/mp5416.c

// SPDX-License-Identifier: GPL-2.0+
//
// mp5416.c  - regulator driver for mps mp5416
//
// Copyright 2020 Monolithic Power Systems, Inc
//
// Author: Saravanan Sekar <[email protected]>

#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>

#define MP5416_REG_CTL0
#define MP5416_REG_CTL1
#define MP5416_REG_CTL2
#define MP5416_REG_ILIM
#define MP5416_REG_BUCK1
#define MP5416_REG_BUCK2
#define MP5416_REG_BUCK3
#define MP5416_REG_BUCK4
#define MP5416_REG_LDO1
#define MP5416_REG_LDO2
#define MP5416_REG_LDO3
#define MP5416_REG_LDO4

#define MP5416_REGULATOR_EN
#define MP5416_MASK_VSET
#define MP5416_MASK_BUCK1_ILIM
#define MP5416_MASK_BUCK2_ILIM
#define MP5416_MASK_BUCK3_ILIM
#define MP5416_MASK_BUCK4_ILIM
#define MP5416_MASK_DVS_SLEWRATE

/* values in uV */
#define MP5416_VOLT1_MIN
#define MP5416_VOLT1_MAX
#define MP5416_VOLT1_STEP
#define MP5416_VOLT2_MIN
#define MP5416_VOLT2_MAX
#define MP5416_VOLT2_STEP

#define MP5416_VOLT1_RANGE
#define MP5416_VOLT2_RANGE

#define MP5416BUCK(_name, _id, _ilim, _dreg, _dval, _vsel)

#define MP5416LDO(_name, _id, _dval)

enum mp5416_regulators {};

static const struct regmap_config mp5416_regmap_config =;

/* Current limits array (in uA)
 * ILIM1 & ILIM3
 */
static const unsigned int mp5416_I_limits1[] =;

/* ILIM2 & ILIM4 */
static const unsigned int mp5416_I_limits2[] =;

/*
 * DVS ramp rate BUCK1 to BUCK4
 * 00: 32mV/us
 * 01: 16mV/us
 * 10: 8mV/us
 * 11: 4mV/us
 */
static const unsigned int mp5416_buck_ramp_table[] =;

static const struct regulator_ops mp5416_ldo_ops =;

static const struct regulator_ops mp5416_buck_ops =;

static struct regulator_desc mp5416_regulators_desc[MP5416_MAX_REGULATORS] =;

static struct regulator_desc mp5496_regulators_desc[MP5416_MAX_REGULATORS] =;

static int mp5416_i2c_probe(struct i2c_client *client)
{}

static const struct of_device_id mp5416_of_match[] =;
MODULE_DEVICE_TABLE(of, mp5416_of_match);

static const struct i2c_device_id mp5416_id[] =;
MODULE_DEVICE_TABLE(i2c, mp5416_id);

static struct i2c_driver mp5416_regulator_driver =;
module_i2c_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();