linux/drivers/regulator/bcm590xx-regulator.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Broadcom BCM590xx regulator driver
 *
 * Copyright 2014 Linaro Limited
 * Author: Matt Porter <[email protected]>
 */

#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mfd/bcm590xx.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/slab.h>

/* I2C slave 0 registers */
#define BCM590XX_RFLDOPMCTRL1
#define BCM590XX_IOSR1PMCTRL1
#define BCM590XX_IOSR2PMCTRL1
#define BCM590XX_CSRPMCTRL1
#define BCM590XX_SDSR1PMCTRL1
#define BCM590XX_SDSR2PMCTRL1
#define BCM590XX_MSRPMCTRL1
#define BCM590XX_VSRPMCTRL1
#define BCM590XX_RFLDOCTRL
#define BCM590XX_CSRVOUT1

/* I2C slave 1 registers */
#define BCM590XX_GPLDO5PMCTRL1
#define BCM590XX_GPLDO6PMCTRL1
#define BCM590XX_GPLDO1CTRL
#define BCM590XX_GPLDO2CTRL
#define BCM590XX_GPLDO3CTRL
#define BCM590XX_GPLDO4CTRL
#define BCM590XX_GPLDO5CTRL
#define BCM590XX_GPLDO6CTRL
#define BCM590XX_OTG_CTRL
#define BCM590XX_GPLDO1PMCTRL1
#define BCM590XX_GPLDO2PMCTRL1
#define BCM590XX_GPLDO3PMCTRL1
#define BCM590XX_GPLDO4PMCTRL1

#define BCM590XX_REG_ENABLE
#define BCM590XX_VBUS_ENABLE
#define BCM590XX_LDO_VSEL_MASK
#define BCM590XX_SR_VSEL_MASK

/*
 * RFLDO to VSR regulators are
 * accessed via I2C slave 0
 */

/* LDO regulator IDs */
#define BCM590XX_REG_RFLDO
#define BCM590XX_REG_CAMLDO1
#define BCM590XX_REG_CAMLDO2
#define BCM590XX_REG_SIMLDO1
#define BCM590XX_REG_SIMLDO2
#define BCM590XX_REG_SDLDO
#define BCM590XX_REG_SDXLDO
#define BCM590XX_REG_MMCLDO1
#define BCM590XX_REG_MMCLDO2
#define BCM590XX_REG_AUDLDO
#define BCM590XX_REG_MICLDO
#define BCM590XX_REG_USBLDO
#define BCM590XX_REG_VIBLDO

/* DCDC regulator IDs */
#define BCM590XX_REG_CSR
#define BCM590XX_REG_IOSR1
#define BCM590XX_REG_IOSR2
#define BCM590XX_REG_MSR
#define BCM590XX_REG_SDSR1
#define BCM590XX_REG_SDSR2
#define BCM590XX_REG_VSR

/*
 * GPLDO1 to VBUS regulators are
 * accessed via I2C slave 1
 */

#define BCM590XX_REG_GPLDO1
#define BCM590XX_REG_GPLDO2
#define BCM590XX_REG_GPLDO3
#define BCM590XX_REG_GPLDO4
#define BCM590XX_REG_GPLDO5
#define BCM590XX_REG_GPLDO6
#define BCM590XX_REG_VBUS

#define BCM590XX_NUM_REGS

#define BCM590XX_REG_IS_LDO(n)
#define BCM590XX_REG_IS_GPLDO(n)
#define BCM590XX_REG_IS_VBUS(n)

/* LDO group A: supported voltages in microvolts */
static const unsigned int ldo_a_table[] =;

/* LDO group C: supported voltages in microvolts */
static const unsigned int ldo_c_table[] =;

static const unsigned int ldo_vbus[] =;

/* DCDC group CSR: supported voltages in microvolts */
static const struct linear_range dcdc_csr_ranges[] =;

/* DCDC group IOSR1: supported voltages in microvolts */
static const struct linear_range dcdc_iosr1_ranges[] =;

/* DCDC group SDSR1: supported voltages in microvolts */
static const struct linear_range dcdc_sdsr1_ranges[] =;

struct bcm590xx_info {};

#define BCM590XX_REG_TABLE(_name, _table)

#define BCM590XX_REG_RANGES(_name, _ranges)

static struct bcm590xx_info bcm590xx_regs[] =;

struct bcm590xx_reg {};

static int bcm590xx_get_vsel_register(int id)
{}

static int bcm590xx_get_enable_register(int id)
{}

static const struct regulator_ops bcm590xx_ops_ldo =;

static const struct regulator_ops bcm590xx_ops_dcdc =;

static const struct regulator_ops bcm590xx_ops_vbus =;

static int bcm590xx_probe(struct platform_device *pdev)
{}

static struct platform_driver bcm590xx_regulator_driver =;
module_platform_driver();

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