linux/drivers/regulator/rtq2208-regulator.c

// SPDX-License-Identifier: GPL-2.0+

#include <linux/bitops.h>
#include <linux/bitfield.h>
#include <linux/util_macros.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mod_devicetable.h>

/* Register */
#define RTQ2208_REG_GLOBAL_INT1
#define RTQ2208_REG_FLT_RECORDBUCK_CB
#define RTQ2208_REG_GLOBAL_INT1_MASK
#define RTQ2208_REG_FLT_MASKBUCK_CB
#define RTQ2208_REG_BUCK_C_CFG0
#define RTQ2208_REG_BUCK_B_CFG0
#define RTQ2208_REG_BUCK_A_CFG0
#define RTQ2208_REG_BUCK_D_CFG0
#define RTQ2208_REG_BUCK_G_CFG0
#define RTQ2208_REG_BUCK_F_CFG0
#define RTQ2208_REG_BUCK_E_CFG0
#define RTQ2208_REG_BUCK_H_CFG0
#define RTQ2208_REG_LDO1_CFG
#define RTQ2208_REG_LDO2_CFG
#define RTQ2208_REG_LDO_DVS_CTRL

/* Mask */
#define RTQ2208_BUCK_NR_MTP_SEL_MASK
#define RTQ2208_BUCK_EN_NR_MTP_SEL0_MASK
#define RTQ2208_BUCK_EN_NR_MTP_SEL1_MASK
#define RTQ2208_BUCK_RSPUP_MASK
#define RTQ2208_BUCK_RSPDN_MASK
#define RTQ2208_BUCK_NRMODE_MASK
#define RTQ2208_BUCK_STRMODE_MASK
#define RTQ2208_BUCK_EN_STR_MASK
#define RTQ2208_LDO_EN_STR_MASK
#define RTQ2208_EN_DIS_MASK
#define RTQ2208_BUCK_RAMP_SEL_MASK
#define RTQ2208_HD_INT_MASK
#define RTQ2208_LDO1_DISCHG_EN_MASK
#define RTQ2208_LDO1_VOSEL_SD_MASK
#define RTQ2208_LDO2_DISCHG_EN_MASK
#define RTQ2208_LDO2_VOSEL_SD_MASK

/* Size */
#define RTQ2208_VOUT_MAXNUM
#define RTQ2208_BUCK_NUM_IRQ_REGS
#define RTQ2208_STS_NUM_IRQ_REGS

/* Value */
#define RTQ2208_RAMP_VALUE_MIN_uV
#define RTQ2208_RAMP_VALUE_MAX_uV

#define RTQ2208_BUCK_MASK(uv_irq, ov_irq)

enum {};

enum {};

struct rtq2208_regulator_desc {};

struct rtq2208_rdev_map {};

/* set Normal Auto/FCCM mode */
static int rtq2208_set_mode(struct regulator_dev *rdev, unsigned int mode)
{}

static unsigned int rtq2208_get_mode(struct regulator_dev *rdev)
{}

static int rtq2208_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
{}

static int rtq2208_set_suspend_enable(struct regulator_dev *rdev)
{}

static int rtq2208_set_suspend_disable(struct regulator_dev *rdev)
{}

static int rtq2208_set_suspend_mode(struct regulator_dev *rdev, unsigned int mode)
{}

static const struct regulator_ops rtq2208_regulator_buck_ops =;

static const struct regulator_ops rtq2208_regulator_ldo_fix_ops =;

static const struct regulator_ops rtq2208_regulator_ldo_adj_ops =;

static const unsigned int rtq2208_ldo_volt_table[] =;

static struct of_regulator_match rtq2208_ldo_match[] =;

static unsigned int rtq2208_of_map_mode(unsigned int mode)
{}

static int rtq2208_init_irq_mask(struct rtq2208_rdev_map *rdev_map, unsigned int *buck_masks)
{}

static irqreturn_t rtq2208_irq_handler(int irqno, void *devid)
{}

static int rtq2208_of_get_ldo_dvs_ability(struct device *dev)
{}


#define BUCK_INFO(_name, _id)

#define LDO_INFO(_name, _id)

#define BUCK_RG_SHIFT(_base, _shift)
#define VSEL_SHIFT(_sel)
#define MTP_SEL_MASK(_sel)

static const struct linear_range rtq2208_vout_range[] =;

static void rtq2208_init_regulator_desc(struct rtq2208_regulator_desc *rdesc, int mtp_sel, int idx)
{}

static int rtq2208_parse_regulator_dt_data(int n_regulator, const unsigned int *regulator_idx_table,
		struct rtq2208_regulator_desc *rdesc[RTQ2208_LDO_MAX], struct device *dev)
{}

/** different slave address corresponds different used bucks
 * slave address 0x10: BUCK[BCA FGE]
 * slave address 0x20: BUCK[BC FGHE]
 * slave address 0x40: BUCK[C G]
 */
static int rtq2208_regulator_check(int slave_addr, int *num,
				int *regulator_idx_table, unsigned int *buck_masks)
{}

static const struct regmap_config rtq2208_regmap_config =;

static int rtq2208_probe(struct i2c_client *i2c)
{}

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

static struct i2c_driver rtq2208_driver =;
module_i2c_driver();

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