linux/drivers/regulator/stpmic1_regulator.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (C) STMicroelectronics 2018
// Author: Pascal Paillet <[email protected]> for STMicroelectronics.

#include <linux/interrupt.h>
#include <linux/mfd/stpmic1.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>

#include <dt-bindings/mfd/st,stpmic1.h>

/**
 * struct stpmic1_regulator_cfg - this structure is used as driver data
 * @desc: regulator framework description
 * @mask_reset_reg: mask reset register address
 * @mask_reset_mask: mask rank and mask reset register mask
 * @icc_reg: icc register address
 * @icc_mask: icc register mask
 */
struct stpmic1_regulator_cfg {};

static int stpmic1_set_mode(struct regulator_dev *rdev, unsigned int mode);
static unsigned int stpmic1_get_mode(struct regulator_dev *rdev);
static int stpmic1_set_icc(struct regulator_dev *rdev, int lim, int severity,
			   bool enable);
static unsigned int stpmic1_map_mode(unsigned int mode);

enum {};

/* Enable time worst case is 5000mV/(2250uV/uS) */
#define PMIC_ENABLE_TIME_US
/* Ramp delay worst case is (2250uV/uS) */
#define PMIC_RAMP_DELAY

static const struct linear_range buck1_ranges[] =;

static const struct linear_range buck2_ranges[] =;

static const struct linear_range buck3_ranges[] =;

static const struct linear_range buck4_ranges[] =;

static const struct linear_range ldo1_ranges[] =;

static const struct linear_range ldo2_ranges[] =;

static const struct linear_range ldo3_ranges[] =;

static const struct linear_range ldo5_ranges[] =;

static const struct linear_range ldo6_ranges[] =;

static const struct regulator_ops stpmic1_ldo_ops =;

static const struct regulator_ops stpmic1_ldo3_ops =;

static const struct regulator_ops stpmic1_ldo4_fixed_regul_ops =;

static const struct regulator_ops stpmic1_buck_ops =;

static const struct regulator_ops stpmic1_vref_ddr_ops =;

static const struct regulator_ops stpmic1_boost_regul_ops =;

static const struct regulator_ops stpmic1_switch_regul_ops =;

#define REG_LDO(ids, base)

#define REG_LDO3(ids, base)

#define REG_LDO4(ids, base)

#define REG_BUCK(ids, base)

#define REG_VREF_DDR(ids, base)

#define REG_BOOST(ids, base)

#define REG_VBUS_OTG(ids, base)

#define REG_SW_OUT(ids, base)

static const struct stpmic1_regulator_cfg stpmic1_regulator_cfgs[] =;

static unsigned int stpmic1_map_mode(unsigned int mode)
{}

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

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

static int stpmic1_set_icc(struct regulator_dev *rdev, int lim, int severity,
			   bool enable)
{}

static irqreturn_t stpmic1_curlim_irq_handler(int irq, void *data)
{}

#define MATCH(_name, _id)

static struct of_regulator_match stpmic1_matches[] =;

static int stpmic1_regulator_register(struct platform_device *pdev, int id,
				      struct of_regulator_match *match,
				      const struct stpmic1_regulator_cfg *cfg)
{}

static int stpmic1_regulator_probe(struct platform_device *pdev)
{}

static const struct of_device_id of_pmic_regulator_match[] =;

MODULE_DEVICE_TABLE(of, of_pmic_regulator_match);

static struct platform_driver stpmic1_regulator_driver =;

module_platform_driver();

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