[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120713063159.GB32184@pengutronix.de>
Date: Fri, 13 Jul 2012 08:31:59 +0200
From: Wolfram Sang <w.sang@...gutronix.de>
To: Sonic Zhang <sonic.adi@...il.com>
Cc: Ben Dooks <ben-linux@...ff.org>, linux-i2c@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
uclinux-dist-devel@...ckfin.uclinux.org,
Sonic Zhang <sonic.zhang@...log.com>
Subject: Re: [PATCH 4/8 v2] i2c: i2c-bfin-twi: Tighten condition when failing
I2C transfer if MEN bit is reset unexpectedly.
On Wed, Jun 13, 2012 at 04:22:43PM +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@...log.com>
>
> In order to mark I2C transfer fail when MEN bit in I2C controller is reset unexpeced
"unexpected"
> in MCOMP interrupt, interrupt status bits XMTSERV or RCVSERV should be checked.
>
> Master Transfer Complete (MCOMP).
> [1] The initiated master transfer has completed. In the absence of a
> repeat start, the bus has been released.
> [0] The completion of a transfer has not been detected.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@...log.com>
> ---
> drivers/i2c/busses/i2c-bfin-twi.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
> index a5ab454..2e59bbd 100644
> --- a/drivers/i2c/busses/i2c-bfin-twi.c
> +++ b/drivers/i2c/busses/i2c-bfin-twi.c
> @@ -201,7 +201,8 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
> return;
> }
> if (twi_int_status & MCOMP) {
> - if ((read_MASTER_CTL(iface) & MEN) == 0 &&
> + if (twi_int_status & (XMTSERV|RCVSERV) &&
Spaces around operators.
I fixed both for you.
> + (read_MASTER_CTL(iface) & MEN) == 0 &&
> (iface->cur_mode == TWI_I2C_MODE_REPEAT ||
> iface->cur_mode == TWI_I2C_MODE_COMBINED)) {
> iface->result = -1;
> --
> 1.7.0.4
>
>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists