linux/drivers/regulator/mt6359-regulator.c

// SPDX-License-Identifier: GPL-2.0
//
// Copyright (c) 2021 MediaTek Inc.

#include <linux/platform_device.h>
#include <linux/mfd/mt6359/registers.h>
#include <linux/mfd/mt6359p/registers.h>
#include <linux/mfd/mt6397/core.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/mt6359-regulator.h>
#include <linux/regulator/of_regulator.h>

#define MT6359_BUCK_MODE_AUTO
#define MT6359_BUCK_MODE_FORCE_PWM
#define MT6359_BUCK_MODE_NORMAL
#define MT6359_BUCK_MODE_LP

/*
 * MT6359 regulators' information
 *
 * @desc: standard fields of regulator description.
 * @status_reg: for query status of regulators.
 * @qi: Mask for query enable signal status of regulators.
 * @modeset_reg: for operating AUTO/PWM mode register.
 * @modeset_mask: MASK for operating modeset register.
 */
struct mt6359_regulator_info {};

#define MT6359_BUCK(match, _name, min, max, step,		\
	_enable_reg, _status_reg,				\
	_vsel_reg, _vsel_mask,					\
	_lp_mode_reg, _lp_mode_shift,				\
	_modeset_reg, _modeset_shift)

#define MT6359_LDO_LINEAR(match, _name, min, max, step,		\
	_enable_reg, _status_reg, _vsel_reg, _vsel_mask)

#define MT6359_LDO(match, _name, _volt_table,			\
	_enable_reg, _enable_mask, _status_reg,			\
	_vsel_reg, _vsel_mask, _en_delay)

#define MT6359_REG_FIXED(match, _name, _enable_reg,	\
	_status_reg, _fixed_volt)

#define MT6359P_LDO1(match, _name, _ops, _volt_table,	\
	_enable_reg, _enable_mask, _status_reg,		\
	_vsel_reg, _vsel_mask)

static const unsigned int vsim1_voltages[] =;

static const unsigned int vibr_voltages[] =;

static const unsigned int vrf12_voltages[] =;

static const unsigned int volt18_voltages[] =;

static const unsigned int vcn13_voltages[] =;

static const unsigned int vcn33_voltages[] =;

static const unsigned int vefuse_voltages[] =;

static const unsigned int vxo22_voltages[] =;

static const unsigned int vrfck_voltages[] =;

static const unsigned int vrfck_voltages_1[] =;

static const unsigned int vio28_voltages[] =;

static const unsigned int vemc_voltages[] =;

static const unsigned int vemc_voltages_1[] =;

static const unsigned int va12_voltages[] =;

static const unsigned int va09_voltages[] =;

static const unsigned int vrf18_voltages[] =;

static const unsigned int vbbck_voltages[] =;

static const unsigned int vsim2_voltages[] =;

static inline unsigned int mt6359_map_mode(unsigned int mode)
{}

static int mt6359_get_status(struct regulator_dev *rdev)
{}

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

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

static int mt6359p_vemc_set_voltage_sel(struct regulator_dev *rdev,
					u32 sel)
{}

static int mt6359p_vemc_get_voltage_sel(struct regulator_dev *rdev)
{}

static const struct regulator_ops mt6359_volt_linear_ops =;

static const struct regulator_ops mt6359_volt_table_ops =;

static const struct regulator_ops mt6359_volt_fixed_ops =;

static const struct regulator_ops mt6359p_vemc_ops =;

/* The array is indexed by id(MT6359_ID_XXX) */
static struct mt6359_regulator_info mt6359_regulators[] =;

static struct mt6359_regulator_info mt6359p_regulators[] =;

static int mt6359_regulator_probe(struct platform_device *pdev)
{}

static const struct platform_device_id mt6359_platform_ids[] =;
MODULE_DEVICE_TABLE(platform, mt6359_platform_ids);

static struct platform_driver mt6359_regulator_driver =;

module_platform_driver();

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