linux/drivers/regulator/tps65023-regulator.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * tps65023-regulator.c
 *
 * Supports TPS65023 Regulator
 *
 * Copyright (C) 2009 Texas Instrument Incorporated - https://www.ti.com/
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/regmap.h>

/* Register definitions */
#define TPS65023_REG_VERSION
#define TPS65023_REG_PGOODZ
#define TPS65023_REG_MASK
#define TPS65023_REG_REG_CTRL
#define TPS65023_REG_CON_CTRL
#define TPS65023_REG_CON_CTRL2
#define TPS65023_REG_DEF_CORE
#define TPS65023_REG_DEFSLEW
#define TPS65023_REG_LDO_CTRL

/* PGOODZ bitfields */
#define TPS65023_PGOODZ_PWRFAILZ
#define TPS65023_PGOODZ_LOWBATTZ
#define TPS65023_PGOODZ_VDCDC1
#define TPS65023_PGOODZ_VDCDC2
#define TPS65023_PGOODZ_VDCDC3
#define TPS65023_PGOODZ_LDO2
#define TPS65023_PGOODZ_LDO1

/* MASK bitfields */
#define TPS65023_MASK_PWRFAILZ
#define TPS65023_MASK_LOWBATTZ
#define TPS65023_MASK_VDCDC1
#define TPS65023_MASK_VDCDC2
#define TPS65023_MASK_VDCDC3
#define TPS65023_MASK_LDO2
#define TPS65023_MASK_LDO1

/* REG_CTRL bitfields */
#define TPS65023_REG_CTRL_VDCDC1_EN
#define TPS65023_REG_CTRL_VDCDC2_EN
#define TPS65023_REG_CTRL_VDCDC3_EN
#define TPS65023_REG_CTRL_LDO2_EN
#define TPS65023_REG_CTRL_LDO1_EN

/* REG_CTRL2 bitfields */
#define TPS65023_REG_CTRL2_GO
#define TPS65023_REG_CTRL2_CORE_ADJ
#define TPS65023_REG_CTRL2_DCDC2
#define TPS65023_REG_CTRL2_DCDC1
#define TPS65023_REG_CTRL2_DCDC3

/* Number of step-down converters available */
#define TPS65023_NUM_DCDC
/* Number of LDO voltage regulators  available */
#define TPS65023_NUM_LDO
/* Number of total regulators available */
#define TPS65023_NUM_REGULATOR

/* DCDCs */
#define TPS65023_DCDC_1
#define TPS65023_DCDC_2
#define TPS65023_DCDC_3
/* LDOs */
#define TPS65023_LDO_1
#define TPS65023_LDO_2

#define TPS65023_MAX_REG_ID

#define TPS65023_REGULATOR_DCDC(_num, _t, _em)							\

#define TPS65023_REGULATOR_LDO(_num, _t, _vm)							\

/* Supported voltage values for regulators */
static const unsigned int VCORE_VSEL_table[] =;

static const unsigned int DCDC_FIXED_3300000_VSEL_table[] =;

static const unsigned int DCDC_FIXED_1800000_VSEL_table[] =;

/* Supported voltage values for LDO regulators for tps65020 */
static const unsigned int TPS65020_LDO_VSEL_table[] =;

/* Supported voltage values for LDO regulators
 * for tps65021 and tps65023 */
static const unsigned int TPS65023_LDO1_VSEL_table[] =;

static const unsigned int TPS65023_LDO2_VSEL_table[] =;

/* PMIC details */
struct tps_pmic {};

/* Struct passed as driver data */
struct tps_driver_data {};

static int tps65023_dcdc_get_voltage_sel(struct regulator_dev *dev)
{}

static int tps65023_dcdc_set_voltage_sel(struct regulator_dev *dev,
					 unsigned selector)
{}

/* Operations permitted on VDCDCx */
static const struct regulator_ops tps65023_dcdc_ops =;

/* Operations permitted on LDOx */
static const struct regulator_ops tps65023_ldo_ops =;

static const struct regmap_config tps65023_regmap_config =;

static const struct regulator_desc tps65020_regulators[] =;

static const struct regulator_desc tps65021_regulators[] =;

static const struct regulator_desc tps65023_regulators[] =;

static struct tps_driver_data tps65020_drv_data =;

static struct tps_driver_data tps65021_drv_data =;

static struct tps_driver_data tps65023_drv_data =;

static int tps_65023_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver tps_65023_i2c_driver =;

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

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

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