summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaitanya Bandi <bandik@nvidia.com>2013-08-26 16:52:28 +0530
committerRiham Haidar <rhaidar@nvidia.com>2013-11-15 14:18:33 -0800
commit60b8af52417eb174a1373addedf8fffa87a215ad (patch)
tree124a12f33decaa964bba12a33ff7378a2e89e5cd
parentda8bab0a5be5d77a5cc9618ba0a17a720b004950 (diff)
i2c: tegra: Add debug prints for i2c timed out case
Added debug prints for i2c timed out case to help debug. Change-Id: Ib0696b8237b90cd511ac224a476dede8fae60ceb Signed-off-by: Chaitanya Bandi <bandik@nvidia.com> Reviewed-on: http://git-master/r/266050 (cherry picked from commit 3758f5013e3b9049bb0c6c8e58a60f017a825b28) Reviewed-on: http://git-master/r/330873 GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Sang-Hun Lee <sanlee@nvidia.com>
-rw-r--r--drivers/i2c/busses/i2c-tegra.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 8a70a60751bc..dded772afabe 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -880,6 +880,27 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_bus *i2c_bus,
ret = wait_for_completion_timeout(&i2c_dev->msg_complete,
TEGRA_I2C_TIMEOUT);
+ if (ret == 0) {
+
+ dev_err(i2c_dev->dev, "--- register dump for debugging ----\n");
+ dev_err(i2c_dev->dev, "I2C_CNFG - 0x%x\n", i2c_readl(i2c_dev, I2C_CNFG));
+ dev_err(i2c_dev->dev, "I2C_PACKET_TRANSFER_STATUS - 0x%x\n", i2c_readl(i2c_dev, I2C_PACKET_TRANSFER_STATUS));
+ dev_err(i2c_dev->dev, "I2C_FIFO_CONTROL - 0x%x\n", i2c_readl(i2c_dev, I2C_FIFO_CONTROL));
+ dev_err(i2c_dev->dev, "I2C_FIFO_STATUS - 0x%x\n", i2c_readl(i2c_dev, I2C_FIFO_STATUS));
+ dev_err(i2c_dev->dev, "I2C_INT_MASK - 0x%x\n", i2c_readl(i2c_dev, I2C_INT_MASK));
+ dev_err(i2c_dev->dev, "I2C_INT_STATUS - 0x%x\n", i2c_readl(i2c_dev, I2C_INT_STATUS));
+
+ dev_err(i2c_dev->dev, "msg->len - %d\n", msg->len);
+ dev_err(i2c_dev->dev, "is_msg_write - %d\n", !(msg->flags & I2C_M_RD));
+ if (next_msg != NULL) {
+ dev_err(i2c_dev->dev, "next_msg->len - %d\n", next_msg->len);
+ dev_err(i2c_dev->dev, "is_next_msg_write - %d\n", !(next_msg->flags & I2C_M_RD));
+ }
+ dev_err(i2c_dev->dev, "buf_remaining - %d\n", i2c_dev->msg_buf_remaining);
+
+
+ }
+
tegra_i2c_mask_irq(i2c_dev, int_mask);
if (i2c_dev->is_dvc)