summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/mx5/clock.c
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>2012-09-27 10:24:13 +0000
committerTom Rini <trini@ti.com>2012-10-15 11:54:12 -0700
commitbe2f93b1ea03adc9409ae3243ae4c3b831f098ae (patch)
treee041ddc1d2032fdc144a11172ec3675c883bf487 /arch/arm/cpu/armv7/mx5/clock.c
parentd5fe220df4afb7dda1aeeced3635f7f745723685 (diff)
downloadu-boot-imx-be2f93b1ea03adc9409ae3243ae4c3b831f098ae.zip
u-boot-imx-be2f93b1ea03adc9409ae3243ae4c3b831f098ae.tar.gz
u-boot-imx-be2f93b1ea03adc9409ae3243ae4c3b831f098ae.tar.bz2
mx51: Fix I2C clock ID check
There are only 2 I²C instances on i.MX51, but 3 on i.MX53. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch/arm/cpu/armv7/mx5/clock.c')
-rw-r--r--arch/arm/cpu/armv7/mx5/clock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
index a59b88a..46983ff 100644
--- a/arch/arm/cpu/armv7/mx5/clock.c
+++ b/arch/arm/cpu/armv7/mx5/clock.c
@@ -111,12 +111,16 @@ void enable_usboh3_clk(unsigned char enable)
}
#ifdef CONFIG_I2C_MXC
-/* i2c_num can be from 0 - 2 */
+/* i2c_num can be from 0, to 1 for i.MX51 and 2 for i.MX53 */
int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
{
u32 mask;
+#if defined(CONFIG_MX51)
+ if (i2c_num > 1)
+#elif defined(CONFIG_MX53)
if (i2c_num > 2)
+#endif
return -EINVAL;
mask = MXC_CCM_CCGR_CG_MASK <<
(MXC_CCM_CCGR1_I2C1_OFFSET + (i2c_num << 1));