linux/drivers/regulator/mc13892-regulator.c

// SPDX-License-Identifier: GPL-2.0
//
// Regulator Driver for Freescale MC13892 PMIC
//
// Copyright 2010 Yong Shen <[email protected]>
//
// Based on draft driver from Arnaud Patard <[email protected]>

#include <linux/mfd/mc13892.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 MC13892_REVISION

#define MC13892_POWERCTL0
#define MC13892_POWERCTL0_USEROFFSPI
#define MC13892_POWERCTL0_VCOINCELLVSEL
#define MC13892_POWERCTL0_VCOINCELLVSEL_M
#define MC13892_POWERCTL0_VCOINCELLEN

#define MC13892_SWITCHERS0_SWxHI

#define MC13892_SWITCHERS0
#define MC13892_SWITCHERS0_SW1VSEL
#define MC13892_SWITCHERS0_SW1VSEL_M
#define MC13892_SWITCHERS0_SW1HI
#define MC13892_SWITCHERS0_SW1EN

#define MC13892_SWITCHERS1
#define MC13892_SWITCHERS1_SW2VSEL
#define MC13892_SWITCHERS1_SW2VSEL_M
#define MC13892_SWITCHERS1_SW2HI
#define MC13892_SWITCHERS1_SW2EN

#define MC13892_SWITCHERS2
#define MC13892_SWITCHERS2_SW3VSEL
#define MC13892_SWITCHERS2_SW3VSEL_M
#define MC13892_SWITCHERS2_SW3HI
#define MC13892_SWITCHERS2_SW3EN

#define MC13892_SWITCHERS3
#define MC13892_SWITCHERS3_SW4VSEL
#define MC13892_SWITCHERS3_SW4VSEL_M
#define MC13892_SWITCHERS3_SW4HI
#define MC13892_SWITCHERS3_SW4EN

#define MC13892_SWITCHERS4
#define MC13892_SWITCHERS4_SW1MODE
#define MC13892_SWITCHERS4_SW1MODE_AUTO
#define MC13892_SWITCHERS4_SW1MODE_M
#define MC13892_SWITCHERS4_SW2MODE
#define MC13892_SWITCHERS4_SW2MODE_AUTO
#define MC13892_SWITCHERS4_SW2MODE_M

#define MC13892_SWITCHERS5
#define MC13892_SWITCHERS5_SW3MODE
#define MC13892_SWITCHERS5_SW3MODE_AUTO
#define MC13892_SWITCHERS5_SW3MODE_M
#define MC13892_SWITCHERS5_SW4MODE
#define MC13892_SWITCHERS5_SW4MODE_AUTO
#define MC13892_SWITCHERS5_SW4MODE_M
#define MC13892_SWITCHERS5_SWBSTEN

#define MC13892_REGULATORSETTING0
#define MC13892_REGULATORSETTING0_VGEN1VSEL
#define MC13892_REGULATORSETTING0_VDIGVSEL
#define MC13892_REGULATORSETTING0_VGEN2VSEL
#define MC13892_REGULATORSETTING0_VPLLVSEL
#define MC13892_REGULATORSETTING0_VUSB2VSEL
#define MC13892_REGULATORSETTING0_VGEN3VSEL
#define MC13892_REGULATORSETTING0_VCAMVSEL

#define MC13892_REGULATORSETTING0_VGEN1VSEL_M
#define MC13892_REGULATORSETTING0_VDIGVSEL_M
#define MC13892_REGULATORSETTING0_VGEN2VSEL_M
#define MC13892_REGULATORSETTING0_VPLLVSEL_M
#define MC13892_REGULATORSETTING0_VUSB2VSEL_M
#define MC13892_REGULATORSETTING0_VGEN3VSEL_M
#define MC13892_REGULATORSETTING0_VCAMVSEL_M

#define MC13892_REGULATORSETTING1
#define MC13892_REGULATORSETTING1_VVIDEOVSEL
#define MC13892_REGULATORSETTING1_VAUDIOVSEL
#define MC13892_REGULATORSETTING1_VSDVSEL

#define MC13892_REGULATORSETTING1_VVIDEOVSEL_M
#define MC13892_REGULATORSETTING1_VAUDIOVSEL_M
#define MC13892_REGULATORSETTING1_VSDVSEL_M

#define MC13892_REGULATORMODE0
#define MC13892_REGULATORMODE0_VGEN1EN
#define MC13892_REGULATORMODE0_VGEN1STDBY
#define MC13892_REGULATORMODE0_VGEN1MODE
#define MC13892_REGULATORMODE0_VIOHIEN
#define MC13892_REGULATORMODE0_VIOHISTDBY
#define MC13892_REGULATORMODE0_VIOHIMODE
#define MC13892_REGULATORMODE0_VDIGEN
#define MC13892_REGULATORMODE0_VDIGSTDBY
#define MC13892_REGULATORMODE0_VDIGMODE
#define MC13892_REGULATORMODE0_VGEN2EN
#define MC13892_REGULATORMODE0_VGEN2STDBY
#define MC13892_REGULATORMODE0_VGEN2MODE
#define MC13892_REGULATORMODE0_VPLLEN
#define MC13892_REGULATORMODE0_VPLLSTDBY
#define MC13892_REGULATORMODE0_VPLLMODE
#define MC13892_REGULATORMODE0_VUSB2EN
#define MC13892_REGULATORMODE0_VUSB2STDBY
#define MC13892_REGULATORMODE0_VUSB2MODE

#define MC13892_REGULATORMODE1
#define MC13892_REGULATORMODE1_VGEN3EN
#define MC13892_REGULATORMODE1_VGEN3STDBY
#define MC13892_REGULATORMODE1_VGEN3MODE
#define MC13892_REGULATORMODE1_VCAMEN
#define MC13892_REGULATORMODE1_VCAMSTDBY
#define MC13892_REGULATORMODE1_VCAMMODE
#define MC13892_REGULATORMODE1_VCAMCONFIGEN
#define MC13892_REGULATORMODE1_VVIDEOEN
#define MC13892_REGULATORMODE1_VVIDEOSTDBY
#define MC13892_REGULATORMODE1_VVIDEOMODE
#define MC13892_REGULATORMODE1_VAUDIOEN
#define MC13892_REGULATORMODE1_VAUDIOSTDBY
#define MC13892_REGULATORMODE1_VAUDIOMODE
#define MC13892_REGULATORMODE1_VSDEN
#define MC13892_REGULATORMODE1_VSDSTDBY
#define MC13892_REGULATORMODE1_VSDMODE

#define MC13892_POWERMISC
#define MC13892_POWERMISC_GPO1EN
#define MC13892_POWERMISC_GPO2EN
#define MC13892_POWERMISC_GPO3EN
#define MC13892_POWERMISC_GPO4EN
#define MC13892_POWERMISC_PWGT1SPIEN
#define MC13892_POWERMISC_PWGT2SPIEN
#define MC13892_POWERMISC_GPO4ADINEN

#define MC13892_POWERMISC_PWGTSPI_M

#define MC13892_USB1
#define MC13892_USB1_VUSBEN

static const unsigned int mc13892_vcoincell[] =;

static const unsigned int mc13892_sw1[] =;

/*
 * Note: this table is used to derive SWxVSEL by index into
 * the array. Offset the values by the index of 1100000uV
 * to get the actual register value for that voltage selector
 * if the HI bit is to be set as well.
 */
#define MC13892_SWxHI_SEL_OFFSET

static const unsigned int mc13892_sw[] =;

static const unsigned int mc13892_swbst[] =;

static const unsigned int mc13892_viohi[] =;

static const unsigned int mc13892_vpll[] =;

static const unsigned int mc13892_vdig[] =;

static const unsigned int mc13892_vsd[] =;

static const unsigned int mc13892_vusb2[] =;

static const unsigned int mc13892_vvideo[] =;

static const unsigned int mc13892_vaudio[] =;

static const unsigned int mc13892_vcam[] =;

static const unsigned int mc13892_vgen1[] =;

static const unsigned int mc13892_vgen2[] =;

static const unsigned int mc13892_vgen3[] =;

static const unsigned int mc13892_vusb[] =;

static const unsigned int mc13892_gpo[] =;

static const unsigned int mc13892_pwgtdrv[] =;

static const struct regulator_ops mc13892_gpo_regulator_ops;
static const struct regulator_ops mc13892_sw_regulator_ops;


#define MC13892_FIXED_DEFINE(name, node, reg, voltages)

#define MC13892_GPO_DEFINE(name, node, reg, voltages)

#define MC13892_SW_DEFINE(name, node, reg, vsel_reg, voltages)

#define MC13892_DEFINE_REGU(name, node, reg, vsel_reg, voltages)

static struct mc13xxx_regulator mc13892_regulators[] =;

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

static int mc13892_gpo_regulator_enable(struct regulator_dev *rdev)
{}

static int mc13892_gpo_regulator_disable(struct regulator_dev *rdev)
{}

static int mc13892_gpo_regulator_is_enabled(struct regulator_dev *rdev)
{}


static const struct regulator_ops mc13892_gpo_regulator_ops =;

static int mc13892_sw_regulator_get_voltage_sel(struct regulator_dev *rdev)
{}

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

static const struct regulator_ops mc13892_sw_regulator_ops =;

static int mc13892_vcam_set_mode(struct regulator_dev *rdev, unsigned int mode)
{}

static unsigned int mc13892_vcam_get_mode(struct regulator_dev *rdev)
{}

static struct regulator_ops mc13892_vcam_ops;

static int mc13892_regulator_probe(struct platform_device *pdev)
{}

static struct platform_driver mc13892_regulator_driver =;

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

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

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