Module Name: src
Committed By: jakllsch
Date: Sat Jan 24 00:27:31 UTC 2015
Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c
Log Message:
If doing a read-only (that is, no initial command write phase) transfer,
do not send a 0-byte write to the device before performing data phase.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm2835_bsc.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/arch/arm/broadcom/bcm2835_bsc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.4 src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.5
--- src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.4 Sat Jan 24 00:23:37 2015
+++ src/sys/arch/arm/broadcom/bcm2835_bsc.c Sat Jan 24 00:27:31 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_bsc.c,v 1.4 2015/01/24 00:23:37 jakllsch Exp $ */
+/* $NetBSD: bcm2835_bsc.c,v 1.5 2015/01/24 00:27:31 jakllsch Exp $ */
/*
* Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.4 2015/01/24 00:23:37 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.5 2015/01/24 00:27:31 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -231,6 +231,9 @@ bsciic_exec(void *v, i2c_op_t op, i2c_ad
c |= BSC_C_INTR | BSC_C_INTT | BSC_C_INTD;
#endif
+ if (isread && cmdlen == 0)
+ goto only_read;
+
buf = __UNCONST(cmdbuf);
len = cmdlen;
@@ -301,6 +304,7 @@ flood_again:
if (!isread)
goto done;
+only_read:
c |= BSC_C_READ;
buf = databuf;