summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh Bhagat <rajesh.bhagat@nxp.com>2017-08-25 08:01:15 (GMT)
committerPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>2017-08-30 09:52:48 (GMT)
commitd8ada44e3127d8f48bf96da7c6a60ff9adc143c6 (patch)
treee7a8301a103259d85e142842ce36cfe9a2e1792a
parent0750586385112be4abf3c7590e0c619310961c39 (diff)
downloadu-boot-d8ada44e3127d8f48bf96da7c6a60ff9adc143c6.tar.xz
board: common: vid: Move IR chip specific code in flag
Moves IR chip (IR36021) specific code in flag to resolve compilation issue where it is not present. For example, LS1088A is having a new LTC3882 voltage chip. Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
-rw-r--r--board/freescale/common/vid.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
index 8fee5ba..a920849 100644
--- a/board/freescale/common/vid.c
+++ b/board/freescale/common/vid.c
@@ -184,6 +184,7 @@ static int read_voltage(int i2caddress)
return voltage_read;
}
+#ifdef CONFIG_VOL_MONITOR_IR36021_SET
/*
* We need to calculate how long before the voltage stops to drop
* or increase. It returns with the loop count. Each loop takes
@@ -243,7 +244,6 @@ static int wait_for_voltage_stable(int i2caddress)
return vdd_current;
}
-#ifdef CONFIG_VOL_MONITOR_IR36021_SET
/* Set the voltage to the IR chip */
static int set_voltage_to_IR(int i2caddress, int vdd)
{
@@ -298,7 +298,12 @@ int adjust_vdd(ulong vdd_override)
int re_enable = disable_interrupts();
struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
u32 fusesr;
+#if defined(CONFIG_VOL_MONITOR_IR36021_SET) || \
+ defined(CONFIG_VOL_MONITOR_IR36021_READ)
u8 vid, buf;
+#else
+ u8 vid;
+#endif
int vdd_target, vdd_current, vdd_last;
int ret, i2caddress;
unsigned long vdd_string_override;
@@ -369,6 +374,8 @@ int adjust_vdd(ulong vdd_override)
ret = -1;
goto exit;
}
+#if defined(CONFIG_VOL_MONITOR_IR36021_SET) || \
+ defined(CONFIG_VOL_MONITOR_IR36021_READ)
ret = find_ir_chip_on_i2c();
if (ret < 0) {
printf("VID: Could not find voltage regulator on I2C.\n");
@@ -393,6 +400,7 @@ int adjust_vdd(ulong vdd_override)
ret = -1;
goto exit;
}
+#endif
/* get the voltage ID from fuse status register */
fusesr = in_le32(&gur->dcfg_fusesr);