Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/marvell Fix ack/no-ack. Last data sends with stop-b...



details:   https://anonhg.NetBSD.org/src/rev/50d2678c4985
branches:  trunk
changeset: 757916:50d2678c4985
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Sun Oct 03 07:14:33 2010 +0000

description:
Fix ack/no-ack.  Last data sends with stop-bit without ack.

diffstat:

 sys/dev/marvell/gttwsi.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 89a1602974e8 -r 50d2678c4985 sys/dev/marvell/gttwsi.c
--- a/sys/dev/marvell/gttwsi.c  Sun Oct 03 06:36:49 2010 +0000
+++ b/sys/dev/marvell/gttwsi.c  Sun Oct 03 07:14:33 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gttwsi.c,v 1.3 2010/08/01 06:57:06 kiyohara Exp $      */
+/*     $NetBSD: gttwsi.c,v 1.4 2010/10/03 07:14:33 kiyohara Exp $      */
 /*
  * Copyright (c) 2008 Eiji Kawauchi.
  * All rights reserved.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.3 2010/08/01 06:57:06 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.4 2010/10/03 07:14:33 kiyohara Exp $");
 #include "locators.h"
 
 #include <sys/param.h>
@@ -335,7 +335,10 @@
        struct gttwsi_softc *sc = v;
        int error;
 
-       error = gttwsi_wait(sc, CONTROL_ACK, STAT_MRRD_AT, flags);
+       if (flags & I2C_F_STOP)
+               error = gttwsi_wait(sc, 0, STAT_MRRD_ANT, flags);
+       else
+               error = gttwsi_wait(sc, CONTROL_ACK, STAT_MRRD_AT, flags);
        if (!error)
                *valp = RREG(sc, TWSI_DATA);
        if (flags & I2C_F_LAST)



Home | Main Index | Thread Index | Old Index