linux/drivers/regulator/max8997-regulator.c

// SPDX-License-Identifier: GPL-2.0+
//
// max8997.c - Regulator driver for the Maxim 8997/8966
//
// Copyright (C) 2011 Samsung Electronics
// MyungJoo Ham <[email protected]>
//
// This driver is based on max8998.c

#include <linux/bug.h>
#include <linux/err.h>
#include <linux/gpio/consumer.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/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
#include <linux/regulator/of_regulator.h>

struct max8997_data {};

static const unsigned int safeoutvolt[] =;

static inline void max8997_set_gpio(struct max8997_data *max8997)
{}

struct voltage_map_desc {};

/* Voltage maps in uV */
static const struct voltage_map_desc ldo_voltage_map_desc =; /* LDO1 ~ 18, 21 all */

static const struct voltage_map_desc buck1245_voltage_map_desc =; /* Buck1, 2, 4, 5 */

static const struct voltage_map_desc buck37_voltage_map_desc =; /* Buck3, 7 */

/* current map in uA */
static const struct voltage_map_desc charger_current_map_desc =;

static const struct voltage_map_desc topoff_current_map_desc =;

static const struct voltage_map_desc *reg_voltage_map[] =;

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

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

static int max8997_get_enable_register(struct regulator_dev *rdev,
		int *reg, int *mask, int *pattern)
{}

static int max8997_reg_is_enabled(struct regulator_dev *rdev)
{}

static int max8997_reg_enable(struct regulator_dev *rdev)
{}

static int max8997_reg_disable(struct regulator_dev *rdev)
{}

static int max8997_get_voltage_register(struct regulator_dev *rdev,
		int *_reg, int *_shift, int *_mask)
{}

static int max8997_get_voltage_sel(struct regulator_dev *rdev)
{}

static inline int max8997_get_voltage_proper_val(
		const struct voltage_map_desc *desc,
		int min_vol, int max_vol)
{}

static int max8997_set_voltage_charger_cv(struct regulator_dev *rdev,
		int min_uV, int max_uV, unsigned *selector)
{}

/*
 * For LDO1 ~ LDO21, BUCK1~5, BUCK7, CHARGER, CHARGER_TOPOFF
 * BUCK1, 2, and 5 are available if they are not controlled by gpio
 */
static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
		int min_uV, int max_uV, unsigned *selector)
{}

static int max8997_set_voltage_buck_time_sel(struct regulator_dev *rdev,
						unsigned int old_selector,
						unsigned int new_selector)
{}

/*
 * Assess the damage on the voltage setting of BUCK1,2,5 by the change.
 *
 * When GPIO-DVS mode is used for multiple bucks, changing the voltage value
 * of one of the bucks may affect that of another buck, which is the side
 * effect of the change (set_voltage). This function examines the GPIO-DVS
 * configurations and checks whether such side-effect exists.
 */
static int max8997_assess_side_effect(struct regulator_dev *rdev,
		u8 new_val, int *best)
{}

/*
 * For Buck 1 ~ 5 and 7. If it is not controlled by GPIO, this calls
 * max8997_set_voltage_ldobuck to do the job.
 */
static int max8997_set_voltage_buck(struct regulator_dev *rdev,
		int min_uV, int max_uV, unsigned *selector)
{}

/* For SAFEOUT1 and SAFEOUT2 */
static int max8997_set_voltage_safeout_sel(struct regulator_dev *rdev,
					   unsigned selector)
{}

static int max8997_reg_disable_suspend(struct regulator_dev *rdev)
{}

static const struct regulator_ops max8997_ldo_ops =;

static const struct regulator_ops max8997_buck_ops =;

static const struct regulator_ops max8997_fixedvolt_ops =;

static const struct regulator_ops max8997_safeout_ops =;

static const struct regulator_ops max8997_fixedstate_ops =;

static int max8997_set_current_limit(struct regulator_dev *rdev,
				     int min_uA, int max_uA)
{}

static int max8997_get_current_limit(struct regulator_dev *rdev)
{}

static const struct regulator_ops max8997_charger_ops =;

static const struct regulator_ops max8997_charger_fixedstate_ops =;

#define MAX8997_VOLTAGE_REGULATOR(_name, _ops)

#define MAX8997_CURRENT_REGULATOR(_name, _ops)

static struct regulator_desc regulators[] =;

#ifdef CONFIG_OF
static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
					struct max8997_platform_data *pdata)
{}
#else
static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
					struct max8997_platform_data *pdata)
{
	return 0;
}
#endif /* CONFIG_OF */

static int max8997_pmic_probe(struct platform_device *pdev)
{}

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

static struct platform_driver max8997_pmic_driver =;

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

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

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