From: Mike Frysinger <vapier@gentoo.org>
To: Andrew Morton <akpm@linux-foundation.org>,
linux-i2c@vger.kernel.org, Ben Dooks <ben-linux@fluff.org>
Cc: linux-kernel@vger.kernel.org,
uclinux-dist-devel@blackfin.uclinux.org,
Michael Hennerich <michael.hennerich@analog.com>
Subject: [PATCH 2/5] i2c-bfin-twi: add debug output for error status
Date: Mon, 22 Mar 2010 03:23:17 -0400 [thread overview]
Message-ID: <1269242600-30147-3-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1269242600-30147-1-git-send-email-vapier@gentoo.org>
From: Michael Hennerich <michael.hennerich@analog.com>
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>
---
drivers/i2c/busses/i2c-bfin-twi.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index e016b1b..758bb1f 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
@@ -156,6 +156,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.
*/
--
1.7.0.2
next prev parent reply other threads:[~2010-03-22 7:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-22 7:23 [PATCH 0/5] Blackfin I2C updates Mike Frysinger
2010-03-22 7:23 ` [PATCH 1/5] i2c-bfin-twi: integrate timeout timer with completion interface Mike Frysinger
2010-03-22 7:23 ` Mike Frysinger [this message]
[not found] ` <1269242600-30147-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2010-03-22 7:23 ` [PATCH 3/5] i2c-bfin-twi: fix lost interrupts at high speeds Mike Frysinger
2010-03-22 7:23 ` [PATCH 4/5] i2c-bfin-twi: remove redundant retry Mike Frysinger
2010-04-28 22:09 ` [Uclinux-dist-devel] [PATCH 0/5] Blackfin I2C updates Mike Frysinger
2010-03-22 7:23 ` [PATCH 5/5] i2c-bfin-twi: return completion in interrupt for smbus quick transfers Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1269242600-30147-3-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=akpm@linux-foundation.org \
--cc=ben-linux@fluff.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).