linux/drivers/regulator/lp8788-buck.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * TI LP8788 MFD - buck regulator driver
 *
 * Copyright 2012 Texas Instruments
 *
 * Author: Milo(Woogyom) Kim <[email protected]>
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/mfd/lp8788.h>
#include <linux/gpio/consumer.h>

/* register address */
#define LP8788_EN_BUCK
#define LP8788_BUCK_DVS_SEL
#define LP8788_BUCK1_VOUT0
#define LP8788_BUCK1_VOUT1
#define LP8788_BUCK1_VOUT2
#define LP8788_BUCK1_VOUT3
#define LP8788_BUCK2_VOUT0
#define LP8788_BUCK2_VOUT1
#define LP8788_BUCK2_VOUT2
#define LP8788_BUCK2_VOUT3
#define LP8788_BUCK3_VOUT
#define LP8788_BUCK4_VOUT
#define LP8788_BUCK1_TIMESTEP
#define LP8788_BUCK_PWM

/* mask/shift bits */
#define LP8788_EN_BUCK1_M
#define LP8788_EN_BUCK2_M
#define LP8788_EN_BUCK3_M
#define LP8788_EN_BUCK4_M
#define LP8788_BUCK1_DVS_SEL_M
#define LP8788_BUCK1_DVS_M
#define LP8788_BUCK1_DVS_S
#define LP8788_BUCK2_DVS_SEL_M
#define LP8788_BUCK2_DVS_M
#define LP8788_BUCK2_DVS_S
#define LP8788_BUCK1_DVS_I2C
#define LP8788_BUCK2_DVS_I2C
#define LP8788_BUCK1_DVS_PIN
#define LP8788_BUCK2_DVS_PIN
#define LP8788_VOUT_M
#define LP8788_STARTUP_TIME_M
#define LP8788_STARTUP_TIME_S
#define LP8788_FPWM_BUCK1_M
#define LP8788_FPWM_BUCK1_S
#define LP8788_FPWM_BUCK2_M
#define LP8788_FPWM_BUCK2_S
#define LP8788_FPWM_BUCK3_M
#define LP8788_FPWM_BUCK3_S
#define LP8788_FPWM_BUCK4_M
#define LP8788_FPWM_BUCK4_S

#define INVALID_ADDR
#define LP8788_FORCE_PWM
#define LP8788_AUTO_PWM
#define PIN_LOW
#define PIN_HIGH
#define ENABLE_TIME_USEC

#define BUCK_FPWM_MASK(x)
#define BUCK_FPWM_SHIFT(x)

enum lp8788_dvs_state {};

enum lp8788_dvs_mode {};

enum lp8788_buck_id {};

struct lp8788_buck {};

/* BUCK 1 ~ 4 voltage ranges */
static const struct linear_range buck_volt_ranges[] =;

static void lp8788_buck1_set_dvs(struct lp8788_buck *buck)
{}

static void lp8788_buck2_set_dvs(struct lp8788_buck *buck)
{}

static void lp8788_set_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id)
{}

static enum lp8788_dvs_mode
lp8788_get_buck_dvs_ctrl_mode(struct lp8788_buck *buck, enum lp8788_buck_id id)
{}

static bool lp8788_is_valid_buck_addr(u8 addr)
{}

static u8 lp8788_select_buck_vout_addr(struct lp8788_buck *buck,
					enum lp8788_buck_id id)
{}

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

static int lp8788_buck12_get_voltage_sel(struct regulator_dev *rdev)
{}

static int lp8788_buck_enable_time(struct regulator_dev *rdev)
{}

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

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

static const struct regulator_ops lp8788_buck12_ops =;

static const struct regulator_ops lp8788_buck34_ops =;

static const struct regulator_desc lp8788_buck_desc[] =;

static int lp8788_dvs_gpio_request(struct platform_device *pdev,
				struct lp8788_buck *buck,
				enum lp8788_buck_id id)
{}

static int lp8788_init_dvs(struct platform_device *pdev,
			struct lp8788_buck *buck, enum lp8788_buck_id id)
{}

static int lp8788_buck_probe(struct platform_device *pdev)
{}

static struct platform_driver lp8788_buck_driver =;

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

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

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