2010-09-15 17:50:59 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) ST-Ericsson SA 2010
|
|
|
|
*
|
|
|
|
* License Terms: GNU General Public License v2
|
|
|
|
*
|
2010-12-10 18:08:48 +08:00
|
|
|
* Authors: Sundar Iyer <sundar.iyer@stericsson.com>
|
|
|
|
* Bengt Jonsson <bengt.g.jonsson@stericsson.com>
|
2010-09-15 17:50:59 +08:00
|
|
|
*
|
|
|
|
* MOP500 board specific initialization for regulators
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/regulator/machine.h>
|
2010-12-10 18:08:48 +08:00
|
|
|
#include <linux/regulator/ab8500.h>
|
2013-03-29 00:11:04 +08:00
|
|
|
#include <mach/id.h> /* to identify older boards for fixes */
|
2010-12-03 00:10:14 +08:00
|
|
|
#include "board-mop500-regulators.h"
|
|
|
|
|
2012-09-03 21:33:39 +08:00
|
|
|
static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
|
|
|
|
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
struct regulator_init_data gpio_en_3v3_regulator = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "EN-3V3",
|
|
|
|
.min_uV = 3300000,
|
|
|
|
.max_uV = 3300000,
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
|
|
|
|
.consumer_supplies = gpio_en_3v3_consumers,
|
|
|
|
};
|
|
|
|
|
2011-03-07 18:48:15 +08:00
|
|
|
/*
|
|
|
|
* TPS61052 regulator
|
|
|
|
*/
|
|
|
|
static struct regulator_consumer_supply tps61052_vaudio_consumers[] = {
|
|
|
|
/*
|
|
|
|
* Boost converter supply to raise voltage on audio speaker, this
|
|
|
|
* is actually connected to three pins, VInVhfL (left amplifier)
|
|
|
|
* VInVhfR (right amplifier) and VIntDClassInt - all three must
|
|
|
|
* be connected to the same voltage.
|
|
|
|
*/
|
|
|
|
REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
struct regulator_init_data tps61052_regulator = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "vaudio-hf",
|
|
|
|
.min_uV = 4500000,
|
|
|
|
.max_uV = 4500000,
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers),
|
|
|
|
.consumer_supplies = tps61052_vaudio_consumers,
|
|
|
|
};
|
|
|
|
|
2010-12-03 00:10:14 +08:00
|
|
|
static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
|
2013-03-21 23:59:05 +08:00
|
|
|
/* Main display, u8500 R3 uib */
|
|
|
|
REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"),
|
|
|
|
/* Main display, u8500 uib and ST uib */
|
|
|
|
REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.0"),
|
|
|
|
/* Secondary display, ST uib */
|
|
|
|
REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.1"),
|
2010-12-03 00:10:14 +08:00
|
|
|
/* SFH7741 proximity sensor */
|
|
|
|
REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
|
|
|
|
/* BH1780GLS ambient light sensor */
|
|
|
|
REGULATOR_SUPPLY("vcc", "2-0029"),
|
|
|
|
/* lsm303dlh accelerometer */
|
|
|
|
REGULATOR_SUPPLY("vdd", "3-0018"),
|
2013-03-21 23:59:21 +08:00
|
|
|
/* lsm303dlhc accelerometer */
|
|
|
|
REGULATOR_SUPPLY("vdd", "2-0019"),
|
2010-12-03 00:10:14 +08:00
|
|
|
/* lsm303dlh magnetometer */
|
2013-03-21 23:59:21 +08:00
|
|
|
REGULATOR_SUPPLY("vdd", "2-001e"),
|
2010-12-03 00:10:14 +08:00
|
|
|
/* Rohm BU21013 Touchscreen devices */
|
|
|
|
REGULATOR_SUPPLY("avdd", "3-005c"),
|
|
|
|
REGULATOR_SUPPLY("avdd", "3-005d"),
|
|
|
|
/* Synaptics RMI4 Touchscreen device */
|
|
|
|
REGULATOR_SUPPLY("vdd", "3-004b"),
|
2013-03-21 23:59:10 +08:00
|
|
|
/* L3G4200D Gyroscope device */
|
|
|
|
REGULATOR_SUPPLY("vdd", "2-0068"),
|
2013-03-21 23:59:11 +08:00
|
|
|
/* Ambient light sensor device */
|
|
|
|
REGULATOR_SUPPLY("vdd", "3-0029"),
|
2013-03-21 23:59:12 +08:00
|
|
|
/* Pressure sensor device */
|
|
|
|
REGULATOR_SUPPLY("vdd", "2-005c"),
|
2013-03-21 23:59:13 +08:00
|
|
|
/* Cypress TrueTouch Touchscreen device */
|
|
|
|
REGULATOR_SUPPLY("vcpin", "spi8.0"),
|
2013-03-21 23:59:14 +08:00
|
|
|
/* Camera device */
|
|
|
|
REGULATOR_SUPPLY("vaux12v5", "mmio_camera"),
|
2010-12-03 00:10:14 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct regulator_consumer_supply ab8500_vaux2_consumers[] = {
|
|
|
|
/* On-board eMMC power */
|
|
|
|
REGULATOR_SUPPLY("vmmc", "sdi4"),
|
|
|
|
/* AB8500 audio codec */
|
|
|
|
REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct regulator_consumer_supply ab8500_vaux3_consumers[] = {
|
|
|
|
/* External MMC slot power */
|
|
|
|
REGULATOR_SUPPLY("vmmc", "sdi0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct regulator_consumer_supply ab8500_vtvout_consumers[] = {
|
|
|
|
/* TV-out DENC supply */
|
|
|
|
REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
|
|
|
|
/* Internal general-purpose ADC */
|
|
|
|
REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
|
|
|
|
};
|
|
|
|
|
2012-02-01 21:18:10 +08:00
|
|
|
static struct regulator_consumer_supply ab8500_vaud_consumers[] = {
|
|
|
|
/* AB8500 audio-codec main supply */
|
|
|
|
REGULATOR_SUPPLY("vaud", "ab8500-codec.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct regulator_consumer_supply ab8500_vamic1_consumers[] = {
|
|
|
|
/* AB8500 audio-codec Mic1 supply */
|
|
|
|
REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct regulator_consumer_supply ab8500_vamic2_consumers[] = {
|
|
|
|
/* AB8500 audio-codec Mic2 supply */
|
|
|
|
REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct regulator_consumer_supply ab8500_vdmic_consumers[] = {
|
|
|
|
/* AB8500 audio-codec DMic supply */
|
|
|
|
REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"),
|
|
|
|
};
|
|
|
|
|
2010-12-03 00:10:14 +08:00
|
|
|
static struct regulator_consumer_supply ab8500_vintcore_consumers[] = {
|
|
|
|
/* SoC core supply, no device */
|
|
|
|
REGULATOR_SUPPLY("v-intcore", NULL),
|
2011-06-24 02:39:20 +08:00
|
|
|
/* USB Transceiver */
|
2010-12-03 00:10:14 +08:00
|
|
|
REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct regulator_consumer_supply ab8500_vana_consumers[] = {
|
|
|
|
/* External displays, connector on board, 1v8 power supply */
|
|
|
|
REGULATOR_SUPPLY("vsmps2", "mcde.0"),
|
|
|
|
};
|
2010-09-15 17:50:59 +08:00
|
|
|
|
2011-03-09 20:34:17 +08:00
|
|
|
/* ab8500 regulator register initialization */
|
2013-03-21 23:59:03 +08:00
|
|
|
static struct ab8500_regulator_reg_init ab8500_reg_init[] = {
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VanaRequestCtrl = HP/LP depending on VxRequest
|
|
|
|
* VextSupply1RequestCtrl = HP/LP depending on VxRequest
|
|
|
|
*/
|
2013-03-21 23:59:15 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xf0, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VextSupply2RequestCtrl = HP/LP depending on VxRequest
|
|
|
|
* VextSupply3RequestCtrl = HP/LP depending on VxRequest
|
|
|
|
* Vaux1RequestCtrl = HP/LP depending on VxRequest
|
|
|
|
* Vaux2RequestCtrl = HP/LP depending on VxRequest
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vaux3RequestCtrl = HP/LP depending on VxRequest
|
|
|
|
* SwHPReq = Control through SWValid disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VanaSysClkReq1HPValid = disabled
|
|
|
|
* Vaux1SysClkReq1HPValid = disabled
|
|
|
|
* Vaux2SysClkReq1HPValid = disabled
|
|
|
|
* Vaux3SysClkReq1HPValid = disabled
|
|
|
|
*/
|
2013-03-21 23:59:15 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VextSupply1SysClkReq1HPValid = disabled
|
|
|
|
* VextSupply2SysClkReq1HPValid = disabled
|
|
|
|
* VextSupply3SysClkReq1HPValid = SysClkReq1 controlled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VanaHwHPReq1Valid = disabled
|
|
|
|
* Vaux1HwHPreq1Valid = disabled
|
|
|
|
* Vaux2HwHPReq1Valid = disabled
|
|
|
|
* Vaux3HwHPReqValid = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VextSupply1HwHPReq1Valid = disabled
|
|
|
|
* VextSupply2HwHPReq1Valid = disabled
|
|
|
|
* VextSupply3HwHPReq1Valid = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VanaHwHPReq2Valid = disabled
|
|
|
|
* Vaux1HwHPReq2Valid = disabled
|
|
|
|
* Vaux2HwHPReq2Valid = disabled
|
|
|
|
* Vaux3HwHPReq2Valid = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VextSupply1HwHPReq2Valid = disabled
|
|
|
|
* VextSupply2HwHPReq2Valid = disabled
|
|
|
|
* VextSupply3HwHPReq2Valid = HWReq2 controlled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VanaSwHPReqValid = disabled
|
|
|
|
* Vaux1SwHPReqValid = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vaux2SwHPReqValid = disabled
|
|
|
|
* Vaux3SwHPReqValid = disabled
|
|
|
|
* VextSupply1SwHPReqValid = disabled
|
|
|
|
* VextSupply2SwHPReqValid = disabled
|
|
|
|
* VextSupply3SwHPReqValid = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* SysClkReq2Valid1 = SysClkReq2 controlled
|
|
|
|
* SysClkReq3Valid1 = disabled
|
|
|
|
* SysClkReq4Valid1 = SysClkReq4 controlled
|
|
|
|
* SysClkReq5Valid1 = disabled
|
|
|
|
* SysClkReq6Valid1 = SysClkReq6 controlled
|
|
|
|
* SysClkReq7Valid1 = disabled
|
|
|
|
* SysClkReq8Valid1 = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* SysClkReq2Valid2 = disabled
|
|
|
|
* SysClkReq3Valid2 = disabled
|
|
|
|
* SysClkReq4Valid2 = disabled
|
|
|
|
* SysClkReq5Valid2 = disabled
|
|
|
|
* SysClkReq6Valid2 = SysClkReq6 controlled
|
|
|
|
* SysClkReq7Valid2 = disabled
|
|
|
|
* SysClkReq8Valid2 = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VTVoutEna = disabled
|
|
|
|
* Vintcore12Ena = disabled
|
|
|
|
* Vintcore12Sel = 1.25 V
|
|
|
|
* Vintcore12LP = inactive (HP)
|
|
|
|
* VTVoutLP = inactive (HP)
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VaudioEna = disabled
|
|
|
|
* VdmicEna = disabled
|
|
|
|
* Vamic1Ena = disabled
|
|
|
|
* Vamic2Ena = disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vamic1_dzout = high-Z when Vamic1 is disabled
|
|
|
|
* Vamic2_dzout = high-Z when Vamic2 is disabled
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00),
|
2013-03-21 23:58:58 +08:00
|
|
|
/*
|
2013-03-21 23:59:15 +08:00
|
|
|
* VPll = Hw controlled (NOTE! PRCMU bits)
|
2011-03-09 20:34:17 +08:00
|
|
|
* VanaRegu = force off
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VrefDDREna = disabled
|
|
|
|
* VrefDDRSleepMode = inactive (no pulldown)
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
2013-03-29 00:11:02 +08:00
|
|
|
* VextSupply1Regu = force LP
|
|
|
|
* VextSupply2Regu = force OFF
|
|
|
|
* VextSupply3Regu = force HP (-> STBB2=LP and TPS=LP)
|
2011-03-09 20:34:17 +08:00
|
|
|
* ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0
|
|
|
|
* ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0
|
|
|
|
*/
|
2013-03-29 00:11:02 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x13),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vaux1Regu = force HP
|
|
|
|
* Vaux2Regu = force off
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
2013-03-21 23:58:58 +08:00
|
|
|
* Vaux3Regu = force off
|
2011-03-09 20:34:17 +08:00
|
|
|
*/
|
2013-03-21 23:59:15 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x03, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vaux1Sel = 2.5 V
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x08),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vaux2Sel = 2.9 V
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vaux3Sel = 2.91 V
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VextSupply12LP = disabled (no LP)
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* Vaux1Disch = short discharge time
|
|
|
|
* Vaux2Disch = short discharge time
|
|
|
|
* Vaux3Disch = short discharge time
|
|
|
|
* Vintcore12Disch = short discharge time
|
|
|
|
* VTVoutDisch = short discharge time
|
|
|
|
* VaudioDisch = short discharge time
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
/*
|
|
|
|
* VanaDisch = short discharge time
|
|
|
|
* VdmicPullDownEna = pulldown disabled when Vdmic is disabled
|
|
|
|
* VdmicDisch = short discharge time
|
|
|
|
*/
|
2013-03-21 23:59:01 +08:00
|
|
|
INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00),
|
2011-03-09 20:34:17 +08:00
|
|
|
};
|
|
|
|
|
2010-12-10 18:08:48 +08:00
|
|
|
/* AB8500 regulators */
|
2013-03-21 23:59:03 +08:00
|
|
|
static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supplies to the display/camera */
|
|
|
|
[AB8500_LDO_AUX1] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-DISPLAY",
|
|
|
|
.min_uV = 2500000,
|
|
|
|
.max_uV = 2900000,
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS,
|
2011-04-04 16:44:51 +08:00
|
|
|
.boot_on = 1, /* display is on at boot */
|
|
|
|
/*
|
|
|
|
* This voltage cannot be disabled right now because
|
|
|
|
* it is somehow affecting the external MMC
|
|
|
|
* functionality, though that typically will use
|
|
|
|
* AUX3.
|
|
|
|
*/
|
|
|
|
.always_on = 1,
|
2010-12-10 18:08:48 +08:00
|
|
|
},
|
2010-12-03 00:10:14 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
|
|
|
|
.consumer_supplies = ab8500_vaux1_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supplies to the on-board eMMC */
|
|
|
|
[AB8500_LDO_AUX2] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-eMMC1",
|
|
|
|
.min_uV = 1100000,
|
|
|
|
.max_uV = 3300000,
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2010-12-03 00:10:14 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers),
|
|
|
|
.consumer_supplies = ab8500_vaux2_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for VAUX3, supplies to SDcard slots */
|
|
|
|
[AB8500_LDO_AUX3] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-MMC-SD",
|
|
|
|
.min_uV = 1100000,
|
|
|
|
.max_uV = 3300000,
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2010-12-03 00:10:14 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers),
|
|
|
|
.consumer_supplies = ab8500_vaux3_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for tvout, gpadc, TVOUT LDO */
|
|
|
|
[AB8500_LDO_TVOUT] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-TVOUT",
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2010-12-03 00:10:14 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers),
|
|
|
|
.consumer_supplies = ab8500_vtvout_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for ab8500-vaudio, VAUDIO LDO */
|
|
|
|
[AB8500_LDO_AUDIO] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-AUD",
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2012-02-01 21:18:10 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers),
|
|
|
|
.consumer_supplies = ab8500_vaud_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for v-anamic1 VAMic1-LDO */
|
|
|
|
[AB8500_LDO_ANAMIC1] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-AMIC1",
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2012-02-01 21:18:10 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers),
|
|
|
|
.consumer_supplies = ab8500_vamic1_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
|
|
|
|
[AB8500_LDO_ANAMIC2] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-AMIC2",
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2012-02-01 21:18:10 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers),
|
|
|
|
.consumer_supplies = ab8500_vamic2_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for v-dmic, VDMIC LDO */
|
|
|
|
[AB8500_LDO_DMIC] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-DMIC",
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2012-02-01 21:18:10 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vdmic_consumers),
|
|
|
|
.consumer_supplies = ab8500_vdmic_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for v-intcore12, VINTCORE12 LDO */
|
|
|
|
[AB8500_LDO_INTCORE] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-INTCORE",
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2010-12-03 00:10:14 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers),
|
|
|
|
.consumer_supplies = ab8500_vintcore_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
2010-12-10 18:08:48 +08:00
|
|
|
/* supply for U8500 CSI/DSI, VANA LDO */
|
|
|
|
[AB8500_LDO_ANA] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "V-CSI/DSI",
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
},
|
2010-12-03 00:10:14 +08:00
|
|
|
.num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers),
|
|
|
|
.consumer_supplies = ab8500_vana_consumers,
|
2010-09-15 17:50:59 +08:00
|
|
|
},
|
|
|
|
};
|
2013-03-21 23:59:03 +08:00
|
|
|
|
2013-03-29 00:11:02 +08:00
|
|
|
/* supply for VextSupply3 */
|
|
|
|
static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = {
|
|
|
|
/* SIM supply for 3 V SIM cards */
|
|
|
|
REGULATOR_SUPPLY("vinvsim", "sim-detect.0"),
|
|
|
|
};
|
|
|
|
|
|
|
|
/* extended configuration for VextSupply2, only used for HREFP_V20 boards */
|
|
|
|
static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = {
|
|
|
|
.hwreq = true,
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* AB8500 external regulators
|
|
|
|
*/
|
|
|
|
static struct regulator_init_data ab8500_ext_regulators[] = {
|
|
|
|
/* fixed Vbat supplies VSMPS1_EXT_1V8 */
|
|
|
|
[AB8500_EXT_SUPPLY1] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "ab8500-ext-supply1",
|
|
|
|
.min_uV = 1800000,
|
|
|
|
.max_uV = 1800000,
|
|
|
|
.initial_mode = REGULATOR_MODE_IDLE,
|
|
|
|
.boot_on = 1,
|
|
|
|
.always_on = 1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/* fixed Vbat supplies VSMPS2_EXT_1V36 and VSMPS5_EXT_1V15 */
|
|
|
|
[AB8500_EXT_SUPPLY2] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "ab8500-ext-supply2",
|
|
|
|
.min_uV = 1360000,
|
|
|
|
.max_uV = 1360000,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/* fixed Vbat supplies VSMPS3_EXT_3V4 and VSMPS4_EXT_3V4 */
|
|
|
|
[AB8500_EXT_SUPPLY3] = {
|
|
|
|
.constraints = {
|
|
|
|
.name = "ab8500-ext-supply3",
|
|
|
|
.min_uV = 3400000,
|
|
|
|
.max_uV = 3400000,
|
|
|
|
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
|
|
|
.boot_on = 1,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies =
|
|
|
|
ARRAY_SIZE(ab8500_ext_supply3_consumers),
|
|
|
|
.consumer_supplies = ab8500_ext_supply3_consumers,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2013-03-21 23:59:03 +08:00
|
|
|
struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
|
|
|
|
.reg_init = ab8500_reg_init,
|
|
|
|
.num_reg_init = ARRAY_SIZE(ab8500_reg_init),
|
|
|
|
.regulator = ab8500_regulators,
|
|
|
|
.num_regulator = ARRAY_SIZE(ab8500_regulators),
|
2013-03-29 00:11:02 +08:00
|
|
|
.ext_regulator = ab8500_ext_regulators,
|
|
|
|
.num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators),
|
2013-03-21 23:59:03 +08:00
|
|
|
};
|
2013-03-29 00:11:03 +08:00
|
|
|
|
|
|
|
static void ab8500_modify_reg_init(int id, u8 mask, u8 value)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) {
|
|
|
|
if (ab8500_reg_init[i].id == id) {
|
|
|
|
u8 initval = ab8500_reg_init[i].value;
|
|
|
|
initval = (initval & ~mask) | (value & mask);
|
|
|
|
ab8500_reg_init[i].value = initval;
|
|
|
|
|
|
|
|
BUG_ON(mask & ~ab8500_reg_init[i].mask);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BUG_ON(1);
|
|
|
|
}
|
2013-03-29 00:11:04 +08:00
|
|
|
|
|
|
|
void mop500_regulator_init(void)
|
|
|
|
{
|
|
|
|
struct regulator_init_data *regulator;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle VextSupply1 on older boards than HREFP_V22_V1x
|
|
|
|
* (turn off in suspend)
|
|
|
|
*/
|
|
|
|
if (cpu_is_u8500v20() || cpu_is_u8500v21()) {
|
|
|
|
/* disable VextSupply1 in suspend */
|
|
|
|
regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY1];
|
|
|
|
regulator->constraints.state_mem.disabled = 1;
|
|
|
|
regulator->constraints.state_standby.disabled = 1;
|
|
|
|
}
|
|
|
|
}
|