i2c-bfin-twi: add debug output for error status
authorMichael Hennerich <michael.hennerich@analog.com>
Mon, 22 Mar 2010 07:23:17 +0000 (03:23 -0400)
committerBen Dooks <ben-linux@fluff.org>
Wed, 19 May 2010 23:18:58 +0000 (00:18 +0100)
Add some debug() code to decode the error register.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
drivers/i2c/busses/i2c-bfin-twi.c

index 441134a1df92bf125564c44a760cc628cb54d826..0279a7a6b86c5785b7235082cbf82c69e8bd073c 100644 (file)
@@ -157,6 +157,18 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface)
                write_MASTER_CTL(iface, 0);
                SSYNC();
                iface->result = -EIO;
+
+               if (mast_stat & LOSTARB)
+                       dev_dbg(&iface->adap.dev, "Lost Arbitration\n");
+               if (mast_stat & ANAK)
+                       dev_dbg(&iface->adap.dev, "Address Not Acknowledged\n");
+               if (mast_stat & DNAK)
+                       dev_dbg(&iface->adap.dev, "Data Not Acknowledged\n");
+               if (mast_stat & BUFRDERR)
+                       dev_dbg(&iface->adap.dev, "Buffer Read Error\n");
+               if (mast_stat & BUFWRERR)
+                       dev_dbg(&iface->adap.dev, "Buffer Write Error\n");
+
                /* if both err and complete int stats are set, return proper
                 * results.
                 */