linux/drivers/regulator/da9211-regulator.c

// SPDX-License-Identifier: GPL-2.0+
//
// da9211-regulator.c - Regulator device driver for DA9211/DA9212
// /DA9213/DA9223/DA9214/DA9224/DA9215/DA9225
// Copyright (C) 2015  Dialog Semiconductor Ltd.

#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regmap.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/da9211.h>
#include <dt-bindings/regulator/dlg,da9211-regulator.h>
#include "da9211-regulator.h"

/* DEVICE IDs */
#define DA9211_DEVICE_ID
#define DA9213_DEVICE_ID
#define DA9215_DEVICE_ID

/* DA9211 REGULATOR IDs */
#define DA9211_ID_BUCKA
#define DA9211_ID_BUCKB

struct da9211 {};

static const struct regmap_range_cfg da9211_regmap_range[] =;

static bool da9211_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct regmap_config da9211_regmap_config =;

/* Default limits measured in millivolts and milliamps */
#define DA9211_MIN_MV
#define DA9211_MAX_MV
#define DA9211_STEP_MV

/* Current limits for DA9211 buck (uA) indices
 * corresponds with register values
 */
static const int da9211_current_limits[] =;
/* Current limits for DA9213 buck (uA) indices
 * corresponds with register values
 */
static const int da9213_current_limits[] =;
/* Current limits for DA9215 buck (uA) indices
 * corresponds with register values
 */
static const int da9215_current_limits[] =;

static unsigned int da9211_map_buck_mode(unsigned int mode)
{}

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

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

static int da9211_set_current_limit(struct regulator_dev *rdev, int min,
				    int max)
{}

static int da9211_get_current_limit(struct regulator_dev *rdev)
{}

static const struct regulator_ops da9211_buck_ops =;

#define DA9211_BUCK(_id)

static const struct regulator_desc da9211_regulators[] =;

#ifdef CONFIG_OF
static struct of_regulator_match da9211_matches[] =;

static struct da9211_pdata *da9211_parse_regulators_dt(
		struct device *dev)
{}
#else
static struct da9211_pdata *da9211_parse_regulators_dt(
		struct device *dev)
{
	return ERR_PTR(-ENODEV);
}
#endif

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

static int da9211_regulator_init(struct da9211 *chip)
{}

/*
 * I2C driver interface functions
 */
static int da9211_i2c_probe(struct i2c_client *i2c)
{}

static const struct i2c_device_id da9211_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, da9211_i2c_id);

#ifdef CONFIG_OF
static const struct of_device_id da9211_dt_ids[] =;
MODULE_DEVICE_TABLE(of, da9211_dt_ids);
#endif

static struct i2c_driver da9211_regulator_driver =;

module_i2c_driver();

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