linux/drivers/regulator/rk808-regulator.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Regulator driver for Rockchip RK805/RK808/RK818
 *
 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
 * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
 *
 * Author: Chris Zhong <[email protected]>
 * Author: Zhang Qing <[email protected]>
 * Author: Xu Shengfei <[email protected]>
 *
 * Copyright (C) 2016 PHYTEC Messtechnik GmbH
 *
 * Author: Wadim Egorov <[email protected]>
 */

#include <linux/delay.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/mfd/rk808.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
#include <linux/gpio/consumer.h>

/* Field Definitions */
#define RK808_BUCK_VSEL_MASK
#define RK808_BUCK4_VSEL_MASK
#define RK808_LDO_VSEL_MASK

#define RK809_BUCK5_VSEL_MASK

#define RK817_LDO_VSEL_MASK
#define RK817_BOOST_VSEL_MASK
#define RK817_BUCK_VSEL_MASK

#define RK818_BUCK_VSEL_MASK
#define RK818_BUCK4_VSEL_MASK
#define RK818_LDO_VSEL_MASK
#define RK818_LDO3_ON_VSEL_MASK
#define RK818_BOOST_ON_VSEL_MASK

#define RK806_DCDC_SLP_REG_OFFSET
#define RK806_NLDO_SLP_REG_OFFSET
#define RK806_PLDO_SLP_REG_OFFSET

#define RK806_BUCK_SEL_CNT
#define RK806_LDO_SEL_CNT

/* Ramp rate definitions for buck1 / buck2 only */
#define RK808_RAMP_RATE_OFFSET
#define RK808_RAMP_RATE_MASK
#define RK808_RAMP_RATE_2MV_PER_US
#define RK808_RAMP_RATE_4MV_PER_US
#define RK808_RAMP_RATE_6MV_PER_US
#define RK808_RAMP_RATE_10MV_PER_US

#define RK808_DVS2_POL
#define RK808_DVS1_POL

/* Offset from XXX_ON_VSEL to XXX_SLP_VSEL */
#define RK808_SLP_REG_OFFSET

/* Offset from XXX_ON_VSEL to XXX_DVS_VSEL */
#define RK808_DVS_REG_OFFSET

/* Offset from XXX_EN_REG to SLEEP_SET_OFF_XXX */
#define RK808_SLP_SET_OFF_REG_OFFSET

/* max steps for increase voltage of Buck1/2, equal 100mv*/
#define MAX_STEPS_ONE_TIME

#define ENABLE_MASK(id)
#define DISABLE_VAL(id)

#define RK817_BOOST_DESC(_id, _match, _supply, _min, _max, _step, _vreg,\
	_vmask, _ereg, _emask, _enval, _disval, _etime, m_drop)

#define RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg,	\
	_vmask, _ereg, _emask, _enval, _disval, _etime, _ops)

#define RK805_DESC(_id, _match, _supply, _min, _max, _step, _vreg,	\
	_vmask, _ereg, _emask, _etime)

#define RK806_REGULATOR(_name, _supply_name, _id, _ops,\
			_n_voltages, _vr, _er, _lr, ctrl_bit,\
			_rr, _rm, _rt)

#define RK8XX_DESC(_id, _match, _supply, _min, _max, _step, _vreg,	\
	_vmask, _ereg, _emask, _etime)

#define RK816_DESC(_id, _match, _supply, _min, _max, _step, _vreg,	\
	_vmask, _ereg, _emask, _disval, _etime)

#define RK817_DESC(_id, _match, _supply, _min, _max, _step, _vreg,	\
	_vmask, _ereg, _emask, _disval, _etime)

#define RKXX_DESC_SWITCH_COM(_id, _match, _supply, _ereg, _emask,	\
	_enval, _disval, _ops)

#define RK817_DESC_SWITCH(_id, _match, _supply, _ereg, _emask,		\
	_disval)

#define RK8XX_DESC_SWITCH(_id, _match, _supply, _ereg, _emask)

struct rk8xx_register_bit {};

#define RK8XX_REG_BIT(_reg, _bit)

struct rk808_regulator_data {};

static const struct linear_range rk808_ldo3_voltage_ranges[] =;

#define RK809_BUCK5_SEL_CNT

static const struct linear_range rk809_buck5_voltage_ranges[] =;

#define RK817_BUCK1_MIN0
#define RK817_BUCK1_MAX0

#define RK817_BUCK1_MIN1
#define RK817_BUCK1_MAX1

#define RK817_BUCK3_MAX1

#define RK817_BUCK1_STP0
#define RK817_BUCK1_STP1

#define RK817_BUCK1_SEL0
#define RK817_BUCK1_SEL1

#define RK817_BUCK3_SEL1

#define RK817_BUCK1_SEL_CNT
#define RK817_BUCK3_SEL_CNT

static const struct linear_range rk817_buck1_voltage_ranges[] =;

static const struct linear_range rk817_buck3_voltage_ranges[] =;

static const unsigned int rk808_buck1_2_ramp_table[] =;

/* RK817/RK809/RK816 (buck 1/2 only) */
static const unsigned int rk817_buck1_4_ramp_table[] =;

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

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

static const struct rk8xx_register_bit rk806_dcdc_rate2[] =;

static const unsigned int rk806_ramp_delay_table_dcdc[] =;

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

static const unsigned int rk806_ramp_delay_table_ldo[] =;

static int rk806_set_suspend_voltage_range(struct regulator_dev *rdev, int reg_offset, int uv)
{}

static int rk806_set_suspend_voltage_range_dcdc(struct regulator_dev *rdev, int uv)
{}

static int rk806_set_suspend_voltage_range_nldo(struct regulator_dev *rdev, int uv)
{}

static int rk806_set_suspend_voltage_range_pldo(struct regulator_dev *rdev, int uv)
{}

static int rk808_buck1_2_get_voltage_sel_regmap(struct regulator_dev *rdev)
{}

static int rk808_buck1_2_i2c_set_voltage_sel(struct regulator_dev *rdev,
					     unsigned sel)
{}

static int rk808_buck1_2_set_voltage_sel(struct regulator_dev *rdev,
					 unsigned sel)
{}

static int rk808_buck1_2_set_voltage_time_sel(struct regulator_dev *rdev,
				       unsigned int old_selector,
				       unsigned int new_selector)
{}

static int rk808_set_suspend_voltage(struct regulator_dev *rdev, int uv)
{}

static int rk808_set_suspend_voltage_range(struct regulator_dev *rdev, int uv)
{}

static int rk805_set_suspend_enable(struct regulator_dev *rdev)
{}

static int rk805_set_suspend_disable(struct regulator_dev *rdev)
{}

static const struct rk8xx_register_bit rk806_suspend_bits[] =;

static int rk806_set_suspend_enable(struct regulator_dev *rdev)
{}

static int rk806_set_suspend_disable(struct regulator_dev *rdev)
{}

static int rk808_set_suspend_enable(struct regulator_dev *rdev)
{}

static int rk808_set_suspend_disable(struct regulator_dev *rdev)
{}

static const struct rk8xx_register_bit rk816_suspend_bits[] =;

static int rk816_set_suspend_enable(struct regulator_dev *rdev)
{}

static int rk816_set_suspend_disable(struct regulator_dev *rdev)
{}

static int rk817_set_suspend_enable_ctrl(struct regulator_dev *rdev,
					 unsigned int en)
{}

static int rk817_set_suspend_enable(struct regulator_dev *rdev)
{}

static int rk817_set_suspend_disable(struct regulator_dev *rdev)
{}

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

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

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

static int rk8xx_is_enabled_wmsk_regmap(struct regulator_dev *rdev)
{}

static unsigned int rk8xx_regulator_of_map_mode(unsigned int mode)
{}

static const struct regulator_ops rk805_reg_ops =;

static const struct regulator_ops rk805_switch_ops =;

static const struct regulator_ops rk806_ops_dcdc =;

static const struct regulator_ops rk806_ops_nldo =;

static const struct regulator_ops rk806_ops_pldo =;

static const struct regulator_ops rk808_buck1_2_ops =;

static const struct regulator_ops rk808_reg_ops =;

static const struct regulator_ops rk808_reg_ops_ranges =;

static const struct regulator_ops rk808_switch_ops =;

static const struct linear_range rk805_buck_1_2_voltage_ranges[] =;

static const struct regulator_ops rk809_buck5_ops_range =;

static const struct regulator_ops rk816_buck1_2_ops_ranges =;

static const struct regulator_ops rk816_buck4_ops_ranges =;

static const struct regulator_ops rk816_reg_ops =;

static const struct regulator_ops rk817_reg_ops =;

static const struct regulator_ops rk817_boost_ops =;

static const struct regulator_ops rk817_buck_ops_range =;

static const struct regulator_ops rk817_switch_ops =;

static const struct regulator_desc rk805_reg[] =;

static const struct linear_range rk806_buck_voltage_ranges[] =;

static const struct linear_range rk806_ldo_voltage_ranges[] =;

static const struct regulator_desc rk806_reg[] =;


static const struct regulator_desc rk808_reg[] =;

static const struct regulator_desc rk809_reg[] =;

static const struct linear_range rk816_buck_4_voltage_ranges[] =;

static const struct regulator_desc rk816_reg[] =;

static const struct regulator_desc rk817_reg[] =;

static const struct regulator_desc rk818_reg[] =;

static int rk808_regulator_dt_parse_pdata(struct device *dev,
				   struct regmap *map,
				   struct rk808_regulator_data *pdata)
{}

static int rk808_regulator_probe(struct platform_device *pdev)
{}

static struct platform_driver rk808_regulator_driver =;

module_platform_driver();

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