linux/drivers/regulator/max77686-regulator.c

// SPDX-License-Identifier: GPL-2.0+
//
// max77686.c - Regulator driver for the Maxim 77686
//
// Copyright (C) 2012 Samsung Electronics
// Chiwoong Byun <[email protected]>
// Jonghwa Lee <[email protected]>
//
// This driver is based on max8997.c

#include <linux/kernel.h>
#include <linux/bug.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/max77686.h>
#include <linux/mfd/max77686-private.h>

#define MAX77686_LDO_MINUV
#define MAX77686_LDO_UVSTEP
#define MAX77686_LDO_LOW_MINUV
#define MAX77686_LDO_LOW_UVSTEP
#define MAX77686_BUCK_MINUV
#define MAX77686_BUCK_UVSTEP
#define MAX77686_BUCK_ENABLE_TIME
#define MAX77686_DVS_ENABLE_TIME
#define MAX77686_RAMP_DELAY
#define MAX77686_DVS_RAMP_DELAY
#define MAX77686_DVS_MINUV
#define MAX77686_DVS_UVSTEP

/*
 * Value for configuring buck[89] and LDO{20,21,22} as GPIO control.
 * It is the same as 'off' for other regulators.
 */
#define MAX77686_GPIO_CONTROL
/*
 * Values used for configuring LDOs and bucks.
 * Forcing low power mode: LDO1, 3-5, 9, 13, 17-26
 */
#define MAX77686_LDO_LOWPOWER
/*
 * On/off controlled by PWRREQ:
 *  - LDO2, 6-8, 10-12, 14-16
 *  - buck[1234]
 */
#define MAX77686_OFF_PWRREQ
/* Low power mode controlled by PWRREQ: All LDOs */
#define MAX77686_LDO_LOWPOWER_PWRREQ
/* Forcing low power mode: buck[234] */
#define MAX77686_BUCK_LOWPOWER
#define MAX77686_NORMAL

#define MAX77686_OPMODE_SHIFT
#define MAX77686_OPMODE_BUCK234_SHIFT
#define MAX77686_OPMODE_MASK

#define MAX77686_VSEL_MASK
#define MAX77686_DVS_VSEL_MASK

#define MAX77686_RAMP_RATE_MASK

#define MAX77686_REGULATORS
#define MAX77686_LDOS

struct max77686_data {};

static unsigned int max77686_get_opmode_shift(int id)
{}

/*
 * When regulator is configured for GPIO control then it
 * replaces "normal" mode. Any change from low power mode to normal
 * should actually change to GPIO control.
 * Map normal mode to proper value for such regulators.
 */
static unsigned int max77686_map_normal_mode(struct max77686_data *max77686,
					     int id)
{}

/* Some BUCKs and LDOs supports Normal[ON/OFF] mode during suspend */
static int max77686_set_suspend_disable(struct regulator_dev *rdev)
{}

/* Some LDOs supports [LPM/Normal]ON mode during suspend state */
static int max77686_set_suspend_mode(struct regulator_dev *rdev,
				     unsigned int mode)
{}

/* Some LDOs supports LPM-ON/OFF/Normal-ON mode during suspend state */
static int max77686_ldo_set_suspend_mode(struct regulator_dev *rdev,
				     unsigned int mode)
{}

static int max77686_enable(struct regulator_dev *rdev)
{}

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

static const unsigned int max77686_buck_dvs_ramp_table[] =;

static const struct regulator_ops max77686_ops =;

static const struct regulator_ops max77686_ldo_ops =;

static const struct regulator_ops max77686_buck1_ops =;

static const struct regulator_ops max77686_buck_dvs_ops =;

#define regulator_desc_ldo(num)
#define regulator_desc_lpm_ldo(num)
#define regulator_desc_ldo_low(num)
#define regulator_desc_ldo1_low(num)
#define regulator_desc_buck(num)
#define regulator_desc_buck1(num)
#define regulator_desc_buck_dvs(num)

static const struct regulator_desc regulators[] =;

static int max77686_pmic_probe(struct platform_device *pdev)
{}

static const struct platform_device_id max77686_pmic_id[] =;
MODULE_DEVICE_TABLE(platform, max77686_pmic_id);

static struct platform_driver max77686_pmic_driver =;

module_platform_driver();

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