linux/drivers/regulator/mc13783-regulator.c

// SPDX-License-Identifier: GPL-2.0
//
// Regulator Driver for Freescale MC13783 PMIC
//
// Copyright 2010 Yong Shen <[email protected]>
// Copyright (C) 2008 Sascha Hauer, Pengutronix <[email protected]>
// Copyright 2009 Alberto Panizzo <[email protected]>

#include <linux/mfd/mc13783.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/driver.h>
#include <linux/platform_device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/module.h>
#include "mc13xxx.h"

#define MC13783_REG_SWITCHERS0
/* Enable does not exist for SW1A */
#define MC13783_REG_SWITCHERS0_SW1AEN
#define MC13783_REG_SWITCHERS0_SW1AVSEL
#define MC13783_REG_SWITCHERS0_SW1AVSEL_M

#define MC13783_REG_SWITCHERS1
/* Enable does not exist for SW1B */
#define MC13783_REG_SWITCHERS1_SW1BEN
#define MC13783_REG_SWITCHERS1_SW1BVSEL
#define MC13783_REG_SWITCHERS1_SW1BVSEL_M

#define MC13783_REG_SWITCHERS2
/* Enable does not exist for SW2A */
#define MC13783_REG_SWITCHERS2_SW2AEN
#define MC13783_REG_SWITCHERS2_SW2AVSEL
#define MC13783_REG_SWITCHERS2_SW2AVSEL_M

#define MC13783_REG_SWITCHERS3
/* Enable does not exist for SW2B */
#define MC13783_REG_SWITCHERS3_SW2BEN
#define MC13783_REG_SWITCHERS3_SW2BVSEL
#define MC13783_REG_SWITCHERS3_SW2BVSEL_M

#define MC13783_REG_SWITCHERS5
#define MC13783_REG_SWITCHERS5_SW3EN
#define MC13783_REG_SWITCHERS5_SW3VSEL
#define MC13783_REG_SWITCHERS5_SW3VSEL_M

#define MC13783_REG_REGULATORSETTING0
#define MC13783_REG_REGULATORSETTING0_VIOLOVSEL
#define MC13783_REG_REGULATORSETTING0_VDIGVSEL
#define MC13783_REG_REGULATORSETTING0_VGENVSEL
#define MC13783_REG_REGULATORSETTING0_VRFDIGVSEL
#define MC13783_REG_REGULATORSETTING0_VRFREFVSEL
#define MC13783_REG_REGULATORSETTING0_VRFCPVSEL
#define MC13783_REG_REGULATORSETTING0_VSIMVSEL
#define MC13783_REG_REGULATORSETTING0_VESIMVSEL
#define MC13783_REG_REGULATORSETTING0_VCAMVSEL

#define MC13783_REG_REGULATORSETTING0_VIOLOVSEL_M
#define MC13783_REG_REGULATORSETTING0_VDIGVSEL_M
#define MC13783_REG_REGULATORSETTING0_VGENVSEL_M
#define MC13783_REG_REGULATORSETTING0_VRFDIGVSEL_M
#define MC13783_REG_REGULATORSETTING0_VRFREFVSEL_M
#define MC13783_REG_REGULATORSETTING0_VRFCPVSEL_M
#define MC13783_REG_REGULATORSETTING0_VSIMVSEL_M
#define MC13783_REG_REGULATORSETTING0_VESIMVSEL_M
#define MC13783_REG_REGULATORSETTING0_VCAMVSEL_M

#define MC13783_REG_REGULATORSETTING1
#define MC13783_REG_REGULATORSETTING1_VVIBVSEL
#define MC13783_REG_REGULATORSETTING1_VRF1VSEL
#define MC13783_REG_REGULATORSETTING1_VRF2VSEL
#define MC13783_REG_REGULATORSETTING1_VMMC1VSEL
#define MC13783_REG_REGULATORSETTING1_VMMC2VSEL

#define MC13783_REG_REGULATORSETTING1_VVIBVSEL_M
#define MC13783_REG_REGULATORSETTING1_VRF1VSEL_M
#define MC13783_REG_REGULATORSETTING1_VRF2VSEL_M
#define MC13783_REG_REGULATORSETTING1_VMMC1VSEL_M
#define MC13783_REG_REGULATORSETTING1_VMMC2VSEL_M

#define MC13783_REG_REGULATORMODE0
#define MC13783_REG_REGULATORMODE0_VAUDIOEN
#define MC13783_REG_REGULATORMODE0_VIOHIEN
#define MC13783_REG_REGULATORMODE0_VIOLOEN
#define MC13783_REG_REGULATORMODE0_VDIGEN
#define MC13783_REG_REGULATORMODE0_VGENEN
#define MC13783_REG_REGULATORMODE0_VRFDIGEN
#define MC13783_REG_REGULATORMODE0_VRFREFEN
#define MC13783_REG_REGULATORMODE0_VRFCPEN

#define MC13783_REG_REGULATORMODE1
#define MC13783_REG_REGULATORMODE1_VSIMEN
#define MC13783_REG_REGULATORMODE1_VESIMEN
#define MC13783_REG_REGULATORMODE1_VCAMEN
#define MC13783_REG_REGULATORMODE1_VRFBGEN
#define MC13783_REG_REGULATORMODE1_VVIBEN
#define MC13783_REG_REGULATORMODE1_VRF1EN
#define MC13783_REG_REGULATORMODE1_VRF2EN
#define MC13783_REG_REGULATORMODE1_VMMC1EN
#define MC13783_REG_REGULATORMODE1_VMMC2EN

#define MC13783_REG_POWERMISC
#define MC13783_REG_POWERMISC_GPO1EN
#define MC13783_REG_POWERMISC_GPO2EN
#define MC13783_REG_POWERMISC_GPO3EN
#define MC13783_REG_POWERMISC_GPO4EN
#define MC13783_REG_POWERMISC_PWGT1SPIEN
#define MC13783_REG_POWERMISC_PWGT2SPIEN

#define MC13783_REG_POWERMISC_PWGTSPI_M


/* Voltage Values */
static const int mc13783_sw1x_val[] =;

static const int mc13783_sw2x_val[] =;

static const unsigned int mc13783_sw3_val[] =;

static const unsigned int mc13783_vaudio_val[] =;

static const unsigned int mc13783_viohi_val[] =;

static const unsigned int mc13783_violo_val[] =;

static const unsigned int mc13783_vdig_val[] =;

static const unsigned int mc13783_vgen_val[] =;

static const unsigned int mc13783_vrfdig_val[] =;

static const unsigned int mc13783_vrfref_val[] =;

static const unsigned int mc13783_vrfcp_val[] =;

static const unsigned int mc13783_vsim_val[] =;

static const unsigned int mc13783_vesim_val[] =;

static const unsigned int mc13783_vcam_val[] =;

static const unsigned int mc13783_vrfbg_val[] =;

static const unsigned int mc13783_vvib_val[] =;

static const unsigned int mc13783_vmmc_val[] =;

static const unsigned int mc13783_vrf_val[] =;

static const unsigned int mc13783_gpo_val[] =;

static const unsigned int mc13783_pwgtdrv_val[] =;

static const struct regulator_ops mc13783_gpo_regulator_ops;

#define MC13783_DEFINE(prefix, name, node, reg, vsel_reg, voltages)

#define MC13783_FIXED_DEFINE(prefix, name, node, reg, voltages)

#define MC13783_GPO_DEFINE(prefix, name, node, reg, voltages)

#define MC13783_DEFINE_SW(_name, _node, _reg, _vsel_reg, _voltages)
#define MC13783_DEFINE_REGU(_name, _node, _reg, _vsel_reg, _voltages)

static struct mc13xxx_regulator mc13783_regulators[] =;

static int mc13783_powermisc_rmw(struct mc13xxx_regulator_priv *priv, u32 mask,
		u32 val)
{}

static int mc13783_gpo_regulator_enable(struct regulator_dev *rdev)
{}

static int mc13783_gpo_regulator_disable(struct regulator_dev *rdev)
{}

static int mc13783_gpo_regulator_is_enabled(struct regulator_dev *rdev)
{}

static const struct regulator_ops mc13783_gpo_regulator_ops =;

static int mc13783_regulator_probe(struct platform_device *pdev)
{}

static struct platform_driver mc13783_regulator_driver =;

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

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

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