From 2baf01434d39acdc45fdcc6c756d7121943e4c4f Mon Sep 17 00:00:00 2001 From: Mattias Wallin Date: Tue, 24 Aug 2010 14:28:22 +0200 Subject: AB8500 v2 change in VAUX3 register The AB8500 register 0x0421 have changed between version 1 and 2 of the hardware. This patch adds a version check and makes the necessary bit change to the VAUX3 low drop out regulator register. Change-Id: I49a6309f138da6bc46492dd4e39842988329c8cb Signed-off-by: Mattias Wallin Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/4060 Reviewed-by: Michael BRANDT --- board/st/u8500/u8500.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'board') diff --git a/board/st/u8500/u8500.c b/board/st/u8500/u8500.c index debcc117c..ea6873e61 100644 --- a/board/st/u8500/u8500.c +++ b/board/st/u8500/u8500.c @@ -347,19 +347,21 @@ unsigned int addr_vall_arr[] = { #define LDO_VAUX3_MASK 0x3 #define LDO_VAUX3_ENABLE 0x1 #define VAUX3_VOLTAGE_2_9V 0xd +#define VAUX3_V2_VOLTAGE_2_91V 0x7 static int hrefplus_mmc_power_init(void) { int ret; int val; + int rev; - if (!cpu_is_u8500v11()) + if (!cpu_is_u8500v11() && !cpu_is_u8500v2()) return 0; /* - * On v1.1 HREF boards (HREF+), Vaux3 needs to be enabled for the SD - * card to work. This is done by enabling the regulators in the AB8500 - * via PRCMU I2C transactions. + * On v1.1 HREF boards (HREF+) and v2 boards, Vaux3 needs to be + * enabled for the SD card to work. This is done by enabling + * the regulators in the AB8500 via PRCMU I2C transactions. * * This code is derived from the handling of AB8500_LDO_VAUX3 in * ab8500_ldo_enable() and ab8500_ldo_disable() in Linux. @@ -367,6 +369,12 @@ static int hrefplus_mmc_power_init(void) * Turn off and delay is required to have it work across soft reboots. */ + ret = ab8500_read(AB8500_MISC, AB8500_REV_REG); + if (ret < 0) + goto out; + + rev = ret; + ret = ab8500_read(AB8500_REGU_CTRL2, AB8500_REGU_VRF1VAUX3_REGU_REG); if (ret < 0) goto out; @@ -382,8 +390,13 @@ static int hrefplus_mmc_power_init(void) udelay(10 * 1000); /* Set the voltage to 2.9V */ - ret = ab8500_write(AB8500_REGU_CTRL2, - AB8500_REGU_VRF1VAUX3_SEL_REG, VAUX3_VOLTAGE_2_9V); + if (rev >= 0x20) + ret = ab8500_write(AB8500_REGU_CTRL2, + AB8500_REGU_VRF1VAUX3_SEL_REG, VAUX3_V2_VOLTAGE_2_91V); + else + ret = ab8500_write(AB8500_REGU_CTRL2, + AB8500_REGU_VRF1VAUX3_SEL_REG, VAUX3_VOLTAGE_2_9V); + if (ret < 0) goto out; -- cgit v1.2.3