linux/drivers/regulator/max77802-regulator.c

// SPDX-License-Identifier: GPL-2.0+
//
// max77802.c - Regulator driver for the Maxim 77802
//
// Copyright (C) 2013-2014 Google, Inc
// Simon Glass <[email protected]>
//
// 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/slab.h>
#include <linux/module.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>
#include <dt-bindings/regulator/maxim,max77802.h>

/* Default ramp delay in case it is not manually set */
#define MAX77802_RAMP_DELAY

#define MAX77802_OPMODE_SHIFT_LDO
#define MAX77802_OPMODE_BUCK234_SHIFT
#define MAX77802_OPMODE_MASK

#define MAX77802_VSEL_MASK
#define MAX77802_DVS_VSEL_MASK

#define MAX77802_RAMP_RATE_MASK_2BIT
#define MAX77802_RAMP_RATE_SHIFT_2BIT
#define MAX77802_RAMP_RATE_MASK_4BIT
#define MAX77802_RAMP_RATE_SHIFT_4BIT

#define MAX77802_STATUS_OFF
#define MAX77802_OFF_PWRREQ
#define MAX77802_LP_PWRREQ

static const unsigned int max77802_buck234_ramp_table[] =;

static const unsigned int max77802_buck16_ramp_table[] =;

struct max77802_regulator_prv {};

static inline unsigned int max77802_map_mode(unsigned int mode)
{}

static int max77802_get_opmode_shift(int id)
{}

/**
 * max77802_set_suspend_disable - Disable the regulator during system suspend
 * @rdev: regulator to mark as disabled
 *
 * All regulators expect LDO 1, 3, 20 and 21 support OFF by PWRREQ.
 * Configure the regulator so the PMIC will turn it OFF during system suspend.
 */
static int max77802_set_suspend_disable(struct regulator_dev *rdev)
{}

/*
 * Some LDOs support Low Power Mode while the system is running.
 *
 * LDOs 1, 3, 20, 21.
 */
static int max77802_set_mode(struct regulator_dev *rdev, unsigned int mode)
{}

static unsigned max77802_get_mode(struct regulator_dev *rdev)
{}

/**
 * max77802_set_suspend_mode - set regulator opmode when the system is suspended
 * @rdev: regulator to change mode
 * @mode: operating mode to be set
 *
 * Will set the operating mode for the regulators during system suspend.
 * This function is valid for the three different enable control logics:
 *
 * Enable Control Logic1 by PWRREQ (BUCK 2-4 and LDOs 2, 4-19, 22-35)
 * Enable Control Logic2 by PWRREQ (LDOs 1, 20, 21)
 * Enable Control Logic3 by PWRREQ (LDO 3)
 *
 * If setting the regulator mode fails, the function only warns but does
 * not return an error code to avoid the regulator core to stop setting
 * the operating mode for the remaining regulators.
 */
static int max77802_set_suspend_mode(struct regulator_dev *rdev,
				     unsigned int mode)
{}

static int max77802_enable(struct regulator_dev *rdev)
{}

/*
 * LDOs 2, 4-19, 22-35
 */
static const struct regulator_ops max77802_ldo_ops_logic1 =;

/*
 * LDOs 1, 20, 21, 3
 */
static const struct regulator_ops max77802_ldo_ops_logic2 =;

/* BUCKS 1, 6 */
static const struct regulator_ops max77802_buck_16_dvs_ops =;

/* BUCKs 2-4 */
static const struct regulator_ops max77802_buck_234_ops =;

/* BUCKs 5, 7-10 */
static const struct regulator_ops max77802_buck_dvs_ops =;

/* LDOs 3-7, 9-14, 18-26, 28, 29, 32-34 */
#define regulator_77802_desc_p_ldo(num, supply, log)

/* LDOs 1, 2, 8, 15, 17, 27, 30, 35 */
#define regulator_77802_desc_n_ldo(num, supply, log)

/* BUCKs 1, 6 */
#define regulator_77802_desc_16_buck(num)

/* BUCKS 2-4 */
#define regulator_77802_desc_234_buck(num)

/* BUCK 5 */
#define regulator_77802_desc_buck5(num)

/* BUCKs 7-10 */
#define regulator_77802_desc_buck7_10(num)

static const struct regulator_desc regulators[] =;

static int max77802_pmic_probe(struct platform_device *pdev)
{}

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

static struct platform_driver max77802_pmic_driver =;

module_platform_driver();

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