/*
* tps65910.c -- TI tps65910
*
* Copyright 2010 Texas Instruments Inc.
*
* Author: Graeme Gregory <gg@slimlogic.co.uk>
* Author: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/mfd/tps65910.h>
#include <linux/regulator/of_regulator.h>
#define TPS65910_SUPPLY_STATE_ENABLED 0x1
#define EXT_SLEEP_CONTROL (TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 | \
TPS65910_SLEEP_CONTROL_EXT_INPUT_EN2 | \
TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 | \
TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP)
/* supported VIO voltages in microvolts */
static const unsigned int VIO_VSEL_table[] = {
1500000, 1800000, 2500000, 3300000,
};
/* VSEL tables for TPS65910 specific LDOs and dcdc's */
/* supported VRTC voltages in microvolts */
static const unsigned int VRTC_VSEL_table[] = {
1800000,
};
/* supported VDD3 voltages in microvolts */
static const unsigned int VDD3_VSEL_table[] = {
5000000,
};
/* supported VDIG1 voltages in microvolts */
static const unsigned int VDIG1_VSEL_table[] = {
1200000, 1500000, 1800000, 2700000,
};
/* supported VDIG2 voltages in microvolts */
static const unsigned int VDIG2_VSEL_table[] = {
1000000, 1100000, 1200000, 1800000,
};
/* supported VPLL voltages in microvolts */
static const unsigned int VPLL_VSEL_table[] = {
1000000, 1100000, 1800000, 2500000,
};
/* supported VDAC voltages in microvolts */
static const unsigned int VDAC_VSEL_table[] = {
1800000, 2600000, 2800000, 2850000,
};
/* supported VAUX1 voltages in microvolts */
static const unsigned int VAUX1_VSEL_table[] = {
1800000, 2500000, 2800000, 2850000,
};
/* supported VAUX2 voltages in microvolts */
static const unsigned int VAUX2_VSEL_table[] = {
1800000, 2800000, 2900000, 3300000,
};
/* supported VAUX33 voltages in microvolts */
static const unsigned int VAUX33_VSEL_table[] = {
1800000, 2000000, 2800000, 3300000,
};
/* supported VMMC voltages in microvolts */
static const unsigned int VMMC_VSEL_table[] = {
1800000, 2800000, 3000000, 3300000,
};
struct tps_info {
const char *name;
const char *vin_name;
u8 n_voltages;
const unsigned int *voltage_table;
int enable_time_us;
};
static struct tps_info tps65910_regs[] = {
{
.name = "vrtc",
.vin_name = "vcc7",
.n_voltages = ARRAY_SIZE(VRTC_VSEL_table),
.voltage_table = VRTC_VSEL_table,
.enable_time_us = 2200,
},
{
.name = "vio",
.vin_name