linux/drivers/regulator/da9121-regulator.c

// SPDX-License-Identifier: GPL-2.0-only
//
// DA9121 Single-channel dual-phase 10A buck converter
//
// Copyright (C) 2020 Axis Communications AB
//
// DA9130 Single-channel dual-phase 10A buck converter (Automotive)
// DA9217 Single-channel dual-phase  6A buck converter
// DA9122 Dual-channel single-phase  5A buck converter
// DA9131 Dual-channel single-phase  5A buck converter (Automotive)
// DA9220 Dual-channel single-phase  3A buck converter
// DA9132 Dual-channel single-phase  3A buck converter (Automotive)
//
// Copyright (C) 2020 Dialog Semiconductor

#include <linux/of.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/driver.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/regulator/da9121.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>

#include "da9121-regulator.h"

/* Chip data */
struct da9121 {};

/* Define ranges for different variants, enabling translation to/from
 * registers. Maximums give scope to allow for transients.
 */
struct da9121_range {};

static struct da9121_range da9121_10A_2phase_current =;

static struct da9121_range da9121_6A_2phase_current =;

static struct da9121_range da9121_5A_1phase_current =;

static struct da9121_range da9121_3A_1phase_current =;

static struct da9121_range da914x_40A_4phase_current =;

static struct da9121_range da914x_20A_2phase_current =;

struct da9121_variant_info {};

static const struct da9121_variant_info variant_parameters[] =;

struct da9121_field {};

static const struct da9121_field da9121_current_field[2] =;

static const struct da9121_field da9121_mode_field[2] =;

struct status_event_data {};

#define DA9121_STATUS(id, bank, name, notification, warning)

/* For second buck related event bits that are specific to DA9122, DA9220 variants */
#define DA9xxx_STATUS(id, bank, name, notification, warning)

/* The status signals that may need servicing, depending on device variant.
 * After assertion, they persist; so event is notified, the IRQ disabled,
 * and status polled until clear again and IRQ is reenabled.
 *
 * SG/PG1/PG2 should be set when device first powers up and should never
 * re-occur. When this driver starts, it is expected that these will have
 * self-cleared for when the IRQs are enabled, so these should never be seen.
 * If seen, the implication is that the device has reset.
 *
 * GPIO0/1/2 are not configured for use by default, so should not be seen.
 */
static const struct status_event_data status_event_handling[] =;

static int da9121_get_current_limit(struct regulator_dev *rdev)
{}

static int da9121_ceiling_selector(struct regulator_dev *rdev,
		int min, int max,
		unsigned int *selector)
{}

static int da9121_set_current_limit(struct regulator_dev *rdev,
				int min_ua, int max_ua)
{}

static unsigned int da9121_map_mode(unsigned int mode)
{}

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

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

static const struct regulator_ops da9121_buck_ops =;

static struct of_regulator_match da9121_matches[] =;

static int da9121_of_parse_cb(struct device_node *np,
				const struct regulator_desc *desc,
				struct regulator_config *config)
{}

#define DA9121_MIN_MV
#define DA9121_MAX_MV
#define DA9121_STEP_MV
#define DA9121_MIN_SEL
#define DA9121_N_VOLTAGES

static const struct regulator_desc da9121_reg =;

static const struct regulator_desc da9220_reg[2] =;

static const struct regulator_desc da9122_reg[2] =;

static const struct regulator_desc da9217_reg =;

#define DA914X_MIN_MV
#define DA914X_MAX_MV
#define DA914X_STEP_MV
#define DA914X_MIN_SEL
#define DA914X_N_VOLTAGES

static const struct regulator_desc da9141_reg =;

static const struct regulator_desc da9142_reg =;


static const struct regulator_desc *local_da9121_regulators[][DA9121_IDX_MAX] =;

static void da9121_status_poll_on(struct work_struct *work)
{}

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

static int da9121_set_regulator_config(struct da9121 *chip)
{}

/* DA9121 chip register model */
static const struct regmap_range da9121_1ch_readable_ranges[] =;

static const struct regmap_access_table da9121_1ch_readable_table =;

static const struct regmap_range da9121_2ch_readable_ranges[] =;

static const struct regmap_access_table da9121_2ch_readable_table =;

static const struct regmap_range da9121_1ch_writeable_ranges[] =;

static const struct regmap_access_table da9121_1ch_writeable_table =;

static const struct regmap_range da9121_2ch_writeable_ranges[] =;

static const struct regmap_access_table da9121_2ch_writeable_table =;


static const struct regmap_range da9121_volatile_ranges[] =;

static const struct regmap_access_table da9121_volatile_table =;

/* DA9121 regmap config for 1 channel variants */
static const struct regmap_config da9121_1ch_regmap_config =;

/* DA9121 regmap config for 2 channel variants */
static const struct regmap_config da9121_2ch_regmap_config =;

static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
{}

static int da9121_assign_chip_model(struct i2c_client *i2c,
			struct da9121 *chip)
{}

static int da9121_config_irq(struct i2c_client *i2c,
			struct da9121 *chip)
{}

static const struct of_device_id da9121_dt_ids[] =;
MODULE_DEVICE_TABLE(of, da9121_dt_ids);

static int da9121_i2c_probe(struct i2c_client *i2c)
{}

static void da9121_i2c_remove(struct i2c_client *i2c)
{}

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

static struct i2c_driver da9121_regulator_driver =;

module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();