linux/drivers/regulator/tps62360-regulator.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * tps62360.c -- TI tps62360
 *
 * Driver for processor core supply tps62360, tps62361B, tps62362 and tps62363.
 *
 * Copyright (c) 2012, NVIDIA Corporation.
 *
 * Author: Laxman Dewangan <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/regulator/of_regulator.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/tps62360.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/regmap.h>

/* Register definitions */
#define REG_VSET0
#define REG_VSET1
#define REG_VSET2
#define REG_VSET3
#define REG_CONTROL
#define REG_TEMP
#define REG_RAMPCTRL
#define REG_CHIPID

#define FORCE_PWM_ENABLE

enum chips {};

#define TPS62360_BASE_VOLTAGE
#define TPS62360_N_VOLTAGES

#define TPS62361_BASE_VOLTAGE
#define TPS62361_N_VOLTAGES

/* tps 62360 chip information */
struct tps62360_chip {};

/*
 * find_voltage_set_register: Find new voltage configuration register
 * (VSET) id.
 * The finding of the new VSET register will be based on the LRU mechanism.
 * Each VSET register will have different voltage configured . This
 * Function will look if any of the VSET register have requested voltage set
 * or not.
 *     - If it is already there then it will make that register as most
 *       recently used and return as found so that caller need not to set
 *       the VSET register but need to set the proper gpios to select this
 *       VSET register.
 *     - If requested voltage is not found then it will use the least
 *       recently mechanism to get new VSET register for new configuration
 *       and will return not_found so that caller need to set new VSET
 *       register and then gpios (both).
 */
static bool find_voltage_set_register(struct tps62360_chip *tps,
		int req_vsel, int *vset_reg_id)
{}

static int tps62360_dcdc_get_voltage_sel(struct regulator_dev *dev)
{}

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

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

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

static const struct regulator_ops tps62360_dcdc_ops =;

static int tps62360_init_dcdc(struct tps62360_chip *tps,
		struct tps62360_regulator_platform_data *pdata)
{}

static const struct regmap_config tps62360_regmap_config =;

static struct tps62360_regulator_platform_data *
	of_get_tps62360_platform_data(struct device *dev,
				      const struct regulator_desc *desc)
{}

#if defined(CONFIG_OF)
static const struct of_device_id tps62360_of_match[] =;
MODULE_DEVICE_TABLE(of, tps62360_of_match);
#endif

static int tps62360_probe(struct i2c_client *client)
{}

static void tps62360_shutdown(struct i2c_client *client)
{}

static const struct i2c_device_id tps62360_id[] =;

MODULE_DEVICE_TABLE(i2c, tps62360_id);

static struct i2c_driver tps62360_i2c_driver =;

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

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

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