[PATCH 2/7] qi-delay-after-stop.patch

Andy Green andy at openmoko.com
Fri Oct 10 12:51:32 CEST 2008


Bitbang I2C could do with delay after last stop before next back-back transaction

Signed-off-by: Andy Green <andy at openmoko.com>
---

 include/i2c-bitbang.h     |    3 ++-
 src/drivers/i2c-bitbang.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/include/i2c-bitbang.h b/include/i2c-bitbang.h
index 0873b3b..f5b86ef 100644
--- a/include/i2c-bitbang.h
+++ b/include/i2c-bitbang.h
@@ -53,7 +53,8 @@ enum i2c_bitbang_states {
 
 	IBS_STOP1,
 	IBS_STOP2,
-	IBS_STOP3
+	IBS_STOP3,
+	IBS_STOP4
 };
 
 /* context for bitbang GPIO pins and transaction */
diff --git a/src/drivers/i2c-bitbang.c b/src/drivers/i2c-bitbang.c
index 9762415..eef28a6 100644
--- a/src/drivers/i2c-bitbang.c
+++ b/src/drivers/i2c-bitbang.c
@@ -194,6 +194,11 @@ int i2c_next_state(struct i2c_bitbang * bb)
 
 	case IBS_STOP3:
 		(bb->set)(1, 1);
+		bb->state = IBS_STOP4;
+		break;
+
+	case IBS_STOP4:
+		(bb->set)(1, 1);
 		return 1; /* done */
 	}
 




More information about the openmoko-kernel mailing list