From: Michael Hennerich Date: Mon, 22 Mar 2010 07:23:17 +0000 (-0400) Subject: i2c-bfin-twi: add debug output for error status X-Git-Tag: upstream/snapshot3+hdmi~14574^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cfafc18f38aa6701f581bee875fb0b19f3b3b4b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git i2c-bfin-twi: add debug output for error status Add some debug() code to decode the error register. Signed-off-by: Michael Hennerich Signed-off-by: Mike Frysinger Signed-off-by: Ben Dooks --- diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 441134a..0279a7a 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c @@ -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. */