linux/drivers/regulator/mt6332-regulator.c

// SPDX-License-Identifier: GPL-2.0
//
// Copyright (c) 2022 Collabora Ltd.
// Author: AngeloGioacchino Del Regno <[email protected]>
//
// Based on mt6323-regulator.c,
//     Copyright (c) 2016 MediaTek Inc.
//

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

#define MT6332_LDO_MODE_NORMAL
#define MT6332_LDO_MODE_LP

/*
 * MT6332 regulators information
 *
 * @desc: standard fields of regulator description.
 * @qi: Mask for query enable signal status of regulators
 * @vselon_reg: Register sections for hardware control mode of bucks
 * @vselctrl_reg: Register for controlling the buck control mode.
 * @vselctrl_mask: Mask for query buck's voltage control mode.
 * @status_reg: Register for regulator enable status where qi unavailable
 * @status_mask: Mask for querying regulator enable status
 */
struct mt6332_regulator_info {};

#define MT6332_BUCK(match, vreg, min, max, step, volt_ranges, enreg,	\
		vosel, vosel_mask, voselon, vosel_ctrl)

#define MT6332_LDO_LINEAR(match, vreg, min, max, step, volt_ranges,	\
			  enreg, vosel, vosel_mask, voselon,		\
			  vosel_ctrl, _modeset_reg, _modeset_mask)

#define MT6332_LDO_AO(match, vreg, ldo_volt_table, vosel, vosel_mask)

#define MT6332_LDO(match, vreg, ldo_volt_table, enreg, enbit, vosel,	\
		   vosel_mask, _modeset_reg, _modeset_mask)

#define MT6332_REG_FIXED(match, vreg, enreg, enbit, qibit, volt, stbit)

static const struct linear_range boost_volt_range[] =;

static const struct linear_range buck_volt_range[] =;

static const struct linear_range buck_pa_volt_range[] =;

static const struct linear_range buck_rf_volt_range[] =;

static const unsigned int ldo_volt_table1[] =;

static const unsigned int ldo_volt_table2[] =;

static int mt6332_get_status(struct regulator_dev *rdev)
{}

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

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

static const struct regulator_ops mt6332_buck_volt_range_ops =;

static const struct regulator_ops mt6332_ldo_volt_range_ops =;

static const struct regulator_ops mt6332_volt_table_ops =;

static const struct regulator_ops mt6332_volt_table_ao_ops =;

static const struct regulator_ops mt6332_volt_fixed_ops =;

/* The array is indexed by id(MT6332_ID_XXX) */
static struct mt6332_regulator_info mt6332_regulators[] =;

static int mt6332_set_buck_vosel_reg(struct platform_device *pdev)
{}

static int mt6332_regulator_probe(struct platform_device *pdev)
{}

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

static struct platform_driver mt6332_regulator_driver =;

module_platform_driver();

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