summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2010-08-23 19:11:17 +0530
committerYu-Huan Hsu <yhsu@nvidia.com>2010-08-24 18:30:55 -0700
commit46346d35721caf61eabdd5e7b7ce614a3c71e2a9 (patch)
treea922b60e05d7aaf02482fc6b4cbe4f7ed2a2b78c
parent11b96133c20610225d86625ed434f2c90ebf16f8 (diff)
[arm/tegra] i2c: Enabling Newslave always.
It is recommended by ASIC to enable the new slave whenever new master is enable in i2c controller. It should be enable even if the controller only works in master mode. This will avoid the misbehaving of the old slave which is enable by default. Change-Id: Ifd2a9626d95e97865cc4f6b7151b2cb47a14840f (cherry picked from commit 498b4e1e113b8db86d5af5425476d2aac5f75442) Reviewed-on: http://git-master/r/5489 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/nvrm/io/ap20/ap20rm_i2c.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/nvrm/io/ap20/ap20rm_i2c.c b/arch/arm/mach-tegra/nvrm/io/ap20/ap20rm_i2c.c
index 272abadb4e75..de5cbc0c06f0 100644
--- a/arch/arm/mach-tegra/nvrm/io/ap20/ap20rm_i2c.c
+++ b/arch/arm/mach-tegra/nvrm/io/ap20/ap20rm_i2c.c
@@ -435,10 +435,20 @@ GetPacketHeaders(
static void StartI2cPacketMode(NvRmI2cControllerHandle hRmI2cCont)
{
NvU32 I2cConfig;
+ NvU32 I2cSlaveConfig;
// PACKET_MODE_TRANSFER_EN field of I2C Controller configuration Register
I2cConfig = NV_DRF_DEF(I2C, I2C_CNFG, NEW_MASTER_FSM, ENABLE);
I2cConfig = NV_FLD_SET_DRF_DEF(I2C, I2C_CNFG, PACKET_MODE_EN, GO, I2cConfig);
I2C_REGW(hRmI2cCont, I2C_CNFG, I2cConfig);
+
+ // Configuring the new slave to avoid any instability when doing
+ // master communciation.
+ if (hRmI2cCont->ModuleId == NvRmModuleID_I2c)
+ {
+ I2cSlaveConfig = I2C2_REGR(hRmI2cCont, I2C_SL_CNFG);
+ I2cSlaveConfig = NV_FLD_SET_DRF_DEF(I2C, I2C_SL_CNFG, NEWSL, ENABLE, I2cSlaveConfig);
+ I2C2_REGW(hRmI2cCont, I2C_SL_CNFG, I2cSlaveConfig);
+ }
}
static void