linux/drivers/regulator/da9063-regulator.c

// SPDX-License-Identifier: GPL-2.0+
//
// Regulator driver for DA9063 PMIC series
//
// Copyright 2012 Dialog Semiconductors Ltd.
// Copyright 2013 Philipp Zabel, Pengutronix
//
// Author: Krystian Garbaciak <[email protected]>

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/of.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 <linux/mfd/da9063/core.h>
#include <linux/mfd/da9063/registers.h>


/* Definition for registering regmap bit fields using a mask */
#define BFIELD(_reg, _mask)

/* DA9063 and DA9063L regulator IDs */
enum {};

/* Old regulator platform data */
struct da9063_regulator_data {};

struct da9063_regulators_pdata {};

/* Regulator capabilities and registers description */
struct da9063_regulator_info {};

/* Macros for LDO */
#define DA9063_LDO(chip, regl_name, min_mV, step_mV, max_mV)

/* Macros for voltage DC/DC converters (BUCKs) */
#define DA9063_BUCK(chip, regl_name, min_mV, step_mV, max_mV, limits_array, \
		    creg, cmask)

#define DA9063_BUCK_COMMON_FIELDS(regl_name)

/* Defines asignment of regulators info table to chip model */
struct da9063_dev_model {};

/* Single regulator settings */
struct da9063_regulator {};

/* Encapsulates all information for the regulators driver */
struct da9063_regulators {};

/* BUCK modes for DA9063 */
enum {};

/* Regulator operations */

/*
 * Current limits array (in uA) for BCORE1, BCORE2, BPRO.
 * Entry indexes corresponds to register values.
 */
static const unsigned int da9063_buck_a_limits[] =;

/*
 * Current limits array (in uA) for BMEM, BIO, BPERI.
 * Entry indexes corresponds to register values.
 */
static const unsigned int da9063_buck_b_limits[] =;

/*
 * Current limits array (in uA) for merged BCORE1 and BCORE2.
 * Entry indexes corresponds to register values.
 */
static const unsigned int da9063_bcores_merged_limits[] =;

/*
 * Current limits array (in uA) for merged BMEM and BIO.
 * Entry indexes corresponds to register values.
 */
static const unsigned int da9063_bmem_bio_merged_limits[] =;

static int da9063_set_xvp(struct regulator_dev *rdev, int lim_uV, int severity, bool enable)
{}

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

/*
 * Bucks use single mode register field for normal operation
 * and suspend state.
 * There are 3 modes to map to: FAST, NORMAL, and STANDBY.
 */

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

/*
 * LDOs use sleep flags - one for normal and one for suspend state.
 * There are 2 modes to map to: NORMAL and STANDBY (sleep) for each state.
 */

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

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

static int da9063_buck_get_status(struct regulator_dev *rdev)
{}

static int da9063_ldo_get_status(struct regulator_dev *rdev)
{}

static int da9063_set_suspend_voltage(struct regulator_dev *rdev, int uV)
{}

static int da9063_suspend_enable(struct regulator_dev *rdev)
{}

static int da9063_suspend_disable(struct regulator_dev *rdev)
{}

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

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

static unsigned int da9063_get_overdrive_mask(const struct regulator_desc *desc)
{}

static int da9063_buck_set_limit_set_overdrive(struct regulator_dev *rdev,
					       int min_uA, int max_uA,
					       unsigned int overdrive_mask)
{}

static int da9063_buck_set_limit_clear_overdrive(struct regulator_dev *rdev,
						 int min_uA, int max_uA,
						 unsigned int overdrive_mask)
{}

static int da9063_buck_set_current_limit(struct regulator_dev *rdev,
					 int min_uA, int max_uA)
{}

static int da9063_buck_get_current_limit(struct regulator_dev *rdev)
{}

static const struct regulator_ops da9063_buck_ops =;

static const struct regulator_ops da9063_ldo_ops =;

/* Info of regulators for DA9063 */
static const struct da9063_regulator_info da9063_regulator_info[] =;

/* Link chip model with regulators info table */
static struct da9063_dev_model regulators_models[] =;

/* Regulator interrupt handlers */
static irqreturn_t da9063_ldo_lim_event(int irq, void *data)
{}

/*
 * Probing and Initialisation functions
 */
static const struct regulator_init_data *da9063_get_regulator_initdata(
		const struct da9063_regulators_pdata *regl_pdata, int id)
{}

static int da9063_check_xvp_constraints(struct regulator_config *config)
{}

static struct of_regulator_match da9063_matches[] =;

static struct da9063_regulators_pdata *da9063_parse_regulators_dt(
		struct platform_device *pdev,
		struct of_regulator_match **da9063_reg_matches)
{}

static int da9063_regulator_probe(struct platform_device *pdev)
{}

static struct platform_driver da9063_regulator_driver =;

static int __init da9063_regulator_init(void)
{}
subsys_initcall(da9063_regulator_init);

static void __exit da9063_regulator_cleanup(void)
{}
module_exit(da9063_regulator_cleanup);


/* Module information */
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();