linux/drivers/regulator/max8660.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * max8660.c  --  Voltage regulation for the Maxim 8660/8661
 *
 * based on max1586.c and wm8400-regulator.c
 *
 * Copyright (C) 2009 Wolfram Sang, Pengutronix e.K.
 *
 * Some info:
 *
 * Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8660-MAX8661.pdf
 *
 * This chip is a bit nasty because it is a write-only device. Thus, the driver
 * uses shadow registers to keep track of its values. The main problem appears
 * to be the initialization: When Linux boots up, we cannot know if the chip is
 * in the default state or not, so we would have to pass such information in
 * platform_data. As this adds a bit of complexity to the driver, this is left
 * out for now until it is really needed.
 *
 * [A|S|M]DTV1 registers are currently not used, but [A|S|M]DTV2.
 *
 * If the driver is feature complete, it might be worth to check if one set of
 * functions for V3-V7 is sufficient. For maximum flexibility during
 * development, they are separated for now.
 */

#include <linux/module.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/slab.h>
#include <linux/regulator/max8660.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/regulator/of_regulator.h>

#define MAX8660_DCDC_MIN_UV
#define MAX8660_DCDC_MAX_UV
#define MAX8660_DCDC_STEP
#define MAX8660_DCDC_MAX_SEL

#define MAX8660_LDO5_MIN_UV
#define MAX8660_LDO5_MAX_UV
#define MAX8660_LDO5_STEP
#define MAX8660_LDO5_MAX_SEL

#define MAX8660_LDO67_MIN_UV
#define MAX8660_LDO67_MAX_UV
#define MAX8660_LDO67_STEP
#define MAX8660_LDO67_MAX_SEL

enum {};

struct max8660 {};

static int max8660_write(struct max8660 *max8660, u8 reg, u8 mask, u8 val)
{}


/*
 * DCDC functions
 */

static int max8660_dcdc_is_enabled(struct regulator_dev *rdev)
{}

static int max8660_dcdc_enable(struct regulator_dev *rdev)
{}

static int max8660_dcdc_disable(struct regulator_dev *rdev)
{}

static int max8660_dcdc_get_voltage_sel(struct regulator_dev *rdev)
{}

static int max8660_dcdc_set_voltage_sel(struct regulator_dev *rdev,
					unsigned int selector)
{}

static struct regulator_ops max8660_dcdc_ops =;


/*
 * LDO5 functions
 */

static int max8660_ldo5_get_voltage_sel(struct regulator_dev *rdev)
{}

static int max8660_ldo5_set_voltage_sel(struct regulator_dev *rdev,
					unsigned int selector)
{}

static const struct regulator_ops max8660_ldo5_ops =;


/*
 * LDO67 functions
 */

static int max8660_ldo67_is_enabled(struct regulator_dev *rdev)
{}

static int max8660_ldo67_enable(struct regulator_dev *rdev)
{}

static int max8660_ldo67_disable(struct regulator_dev *rdev)
{}

static int max8660_ldo67_get_voltage_sel(struct regulator_dev *rdev)
{}

static int max8660_ldo67_set_voltage_sel(struct regulator_dev *rdev,
					 unsigned int selector)
{}

static const struct regulator_ops max8660_ldo67_ops =;

static const struct regulator_desc max8660_reg[] =;

enum {};

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

static int max8660_pdata_from_dt(struct device *dev,
				 struct device_node **of_node,
				 struct max8660_platform_data *pdata)
{}
#else
static inline int max8660_pdata_from_dt(struct device *dev,
					struct device_node **of_node,
					struct max8660_platform_data *pdata)
{
	return 0;
}
#endif

static int max8660_probe(struct i2c_client *client)
{}

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

static struct i2c_driver max8660_driver =;

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

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

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