linux/drivers/regulator/88pm800-regulator.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Regulators driver for Marvell 88PM800
 *
 * Copyright (C) 2012 Marvell International Ltd.
 * Joseph(Yossi) Hanin <[email protected]>
 * Yi Zhang <[email protected]>
 */
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/mfd/88pm80x.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/regulator/of_regulator.h>

/* LDO1 with DVC[0..3] */
#define PM800_LDO1_VOUT
#define PM800_LDO1_VOUT_2
#define PM800_LDO1_VOUT_3
#define PM800_LDO2_VOUT
#define PM800_LDO3_VOUT
#define PM800_LDO4_VOUT
#define PM800_LDO5_VOUT
#define PM800_LDO6_VOUT
#define PM800_LDO7_VOUT
#define PM800_LDO8_VOUT
#define PM800_LDO9_VOUT
#define PM800_LDO10_VOUT
#define PM800_LDO11_VOUT
#define PM800_LDO12_VOUT
#define PM800_LDO13_VOUT
#define PM800_LDO14_VOUT
#define PM800_LDO15_VOUT
#define PM800_LDO16_VOUT
#define PM800_LDO17_VOUT
#define PM800_LDO18_VOUT
#define PM800_LDO19_VOUT

/* BUCK1 with DVC[0..3] */
#define PM800_BUCK1
#define PM800_BUCK1_1
#define PM800_BUCK1_2
#define PM800_BUCK1_3
#define PM800_BUCK2
#define PM800_BUCK3
#define PM800_BUCK4
#define PM800_BUCK4_1
#define PM800_BUCK4_2
#define PM800_BUCK4_3
#define PM800_BUCK5

#define PM800_BUCK_ENA
#define PM800_LDO_ENA1_1
#define PM800_LDO_ENA1_2
#define PM800_LDO_ENA1_3

#define PM800_LDO_ENA2_1
#define PM800_LDO_ENA2_2
#define PM800_LDO_ENA2_3

#define PM800_BUCK1_MISC1
#define PM800_BUCK3_MISC1
#define PM800_BUCK4_MISC1
#define PM800_BUCK5_MISC1

struct pm800_regulator_info {};

/*
 * vreg - the buck regs string.
 * ereg - the string for the enable register.
 * ebit - the bit number in the enable register.
 * amax - the current
 * Buck has 2 kinds of voltage steps. It is easy to find voltage by ranges,
 * not the constant voltage table.
 * n_volt - Number of available selectors
 */
#define PM800_BUCK(match, vreg, ereg, ebit, amax, volt_ranges, n_volt)

/*
 * vreg - the LDO regs string
 * ereg -  the string for the enable register.
 * ebit - the bit number in the enable register.
 * amax - the current
 * volt_table - the LDO voltage table
 * For all the LDOes, there are too many ranges. Using volt_table will be
 * simpler and faster.
 */
#define PM800_LDO(match, vreg, ereg, ebit, amax, ldo_volt_table)

/* Ranges are sorted in ascending order. */
static const struct linear_range buck1_volt_range[] =;

/* BUCK 2~5 have same ranges. */
static const struct linear_range buck2_5_volt_range[] =;

static const unsigned int ldo1_volt_table[] =;

static const unsigned int ldo2_volt_table[] =;

/* LDO 3~17 have same voltage table. */
static const unsigned int ldo3_17_volt_table[] =;

/* LDO 18~19 have same voltage table. */
static const unsigned int ldo18_19_volt_table[] =;

static int pm800_get_current_limit(struct regulator_dev *rdev)
{}

static const struct regulator_ops pm800_volt_range_ops =;

static const struct regulator_ops pm800_volt_table_ops =;

/* The array is indexed by id(PM800_ID_XXX) */
static struct pm800_regulator_info pm800_regulator_info[] =;

static int pm800_regulator_probe(struct platform_device *pdev)
{}

static struct platform_driver pm800_regulator_driver =;

module_platform_driver();

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