summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fufutos <fufutos610@hotmail.com>2006-04-21 02:56:36 +0300
committerLuc Verhaegen <libv@skynet.be>2006-04-21 21:02:45 +0200
commit540bc376237c09a42372ca90a4dcc79ba1d9e67f (patch)
tree8258c4ab0f118a6e0106bc058e4c2e0a950883f8
parent56adbacdaf24c6c1ce8c5e77a90f535167cad676 (diff)
[PATCH] Fix I2C bus Mach64 initialisation failure (Samuel Thibault, #6623)
-rw-r--r--src/atii2c.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/atii2c.c b/src/atii2c.c
index e231035..1712d93 100644
--- a/src/atii2c.c
+++ b/src/atii2c.c
@@ -116,21 +116,22 @@
/*
- * ATII2CAddress --
+ * ATII2CStart --
*
- * This function puts a Start bit and an 8-bit address on the I2C bus.
+ * This function puts a start signal on the I2C bus.
*/
static Bool
-ATII2CAddress
+ATII2CStart
(
- I2CDevPtr pI2CDev,
- I2CSlaveAddr Address
+ I2CBusPtr pI2CBus,
+ int timeout
)
{
- I2CBusPtr pI2CBus = pI2CDev->pI2CBus;
ATII2CPtr pATII2C = pI2CBus->DriverPrivate.ptr;
ATIPtr pATI = pATII2C->pATI;
+ (void)timeout;
+
/*
* Set I2C line directions to out-bound. SCL will remain out-bound until
* next I2C Stop.
@@ -147,6 +148,23 @@ ATII2CAddress
ATII2CSDABitOff;
ATII2CSCLBitOff;
+ return TRUE;
+}
+
+/*
+ * ATII2CAddress --
+ *
+ * This function puts a Start bit and an 8-bit address on the I2C bus.
+ */
+static Bool
+ATII2CAddress
+(
+ I2CDevPtr pI2CDev,
+ I2CSlaveAddr Address
+)
+{
+ I2CBusPtr pI2CBus = pI2CDev->pI2CBus;
+
/* Send low byte of device address */
if ((*pI2CBus->I2CPutByte)(pI2CDev, (I2CByte)Address))
{
@@ -317,6 +335,7 @@ ATICreateI2CBusRec
pI2CBus->scrnIndex = iScreen;
pI2CBus->I2CAddress = ATII2CAddress;
+ pI2CBus->I2CStart = ATII2CStart;
pI2CBus->I2CStop = ATII2CStop;
pI2CBus->I2CPutByte = ATII2CPutByte;
pI2CBus->I2CGetByte = ATII2CGetByte;