Source
x
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) EETS GmbH, 2017, Felix Brack <f.brack@eets.ch>
*/
/*
* struct regulator_props - Properties of a LDO and VIO SMPS regulator
*
* All of these regulators allow setting one out of four output voltages.
* These output voltages are only achievable when supplying the regulator
* with a minimum input voltage.
*
* @vin_min[]: minimum supply input voltage in uV required to achieve the
* corresponding vout[] voltage
* @vout[]: regulator output voltage in uV
* @reg: I2C register used to set regulator voltage
*/
struct regulator_props {
int vin_min[VOUT_CHOICE_COUNT];
int vout[VOUT_CHOICE_COUNT];
int reg;
};
static const struct regulator_props ldo_props_vdig1 = {
.vin_min = { 1700000, 2100000, 2700000, 3200000 },
.vout = { 1200000, 1500000, 1800000, 2700000 },
.reg = TPS65910_REG_VDIG1
};
static const struct regulator_props ldo_props_vdig2 = {
.vin_min = { 1700000, 1700000, 1700000, 2700000 },
.vout = { 1000000, 1100000, 1200000, 1800000 },
.reg = TPS65910_REG_VDIG2
};
static const struct regulator_props ldo_props_vpll = {
.vin_min = { 2700000, 2700000, 2700000, 3000000 },
.vout = { 1000000, 1100000, 1800000, 2500000 },
.reg = TPS65910_REG_VPLL
};
static const struct regulator_props ldo_props_vdac = {
.vin_min = { 2700000, 3000000, 3200000, 3200000 },
.vout = { 1800000, 2600000, 2800000, 2850000 },
.reg = TPS65910_REG_VDAC
};
static const struct regulator_props ldo_props_vaux1 = {
.vin_min = { 2700000, 3200000, 3200000, 3200000 },
.vout = { 1800000, 2500000, 2800000, 2850000 },
.reg = TPS65910_REG_VAUX1
};
static const struct regulator_props ldo_props_vaux2 = {
.vin_min = { 2700000, 3200000, 3200000, 3600000 },
.vout = { 1800000, 2800000, 2900000, 3300000 },
.reg = TPS65910_REG_VAUX2
};
static const struct regulator_props ldo_props_vaux33 = {
.vin_min = { 2700000, 2700000, 3200000, 3600000 },
.vout = { 1800000, 2000000, 2800000, 3300000 },
.reg = TPS65910_REG_VAUX33
};
static const struct regulator_props ldo_props_vmmc = {
.vin_min = { 2700000, 3200000, 3200000, 3600000 },
.vout = { 1800000, 2800000, 3000000, 3300000 },
.reg = TPS65910_REG_VMMC
};
static const struct regulator_props smps_props_vio = {
.vin_min = { 3200000, 3200000, 4000000, 4400000 },
.vout = { 1500000, 1800000, 2500000, 3300000 },
.reg = TPS65910_REG_VIO
};
/* lookup table of control registers indexed by regulator unit number */
static const int ctrl_regs[] = {
TPS65910_REG_VRTC,
TPS65910_REG_VIO,
TPS65910_REG_VDD1,
TPS65910_REG_VDD2,
TPS65910_REG_VDD3,