Module Name: src Committed By: kiyohara Date: Sun Oct 3 07:14:34 UTC 2010
Modified Files: src/sys/dev/marvell: gttwsi.c Log Message: Fix ack/no-ack. Last data sends with stop-bit without ack. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/marvell/gttwsi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/marvell/gttwsi.c diff -u src/sys/dev/marvell/gttwsi.c:1.3 src/sys/dev/marvell/gttwsi.c:1.4 --- src/sys/dev/marvell/gttwsi.c:1.3 Sun Aug 1 06:57:06 2010 +++ src/sys/dev/marvell/gttwsi.c Sun Oct 3 07:14:33 2010 @@ -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)