From dc1e289a611a17090e6dc7ae8a8d3f26d20df4eb Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 29 Jul 2006 01:05:35 +0300 Subject: Bug #6623: Fix I2C bus Mach64 initialisation failure. --- src/atii2c.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/atii2c.c b/src/atii2c.c index cb7bc04..35de71f 100644 --- a/src/atii2c.c +++ b/src/atii2c.c @@ -117,21 +117,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. @@ -148,6 +149,23 @@ ATII2CAddress ATII2CSDABitOff; ATII2CSCLBitOff; + return TRUE; +} + +/* + * ATII2CAddress -- + * + * This function puts 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)) { @@ -318,6 +336,7 @@ ATICreateI2CBusRec pI2CBus->scrnIndex = iScreen; pI2CBus->I2CAddress = ATII2CAddress; + pI2CBus->I2CStart = ATII2CStart; pI2CBus->I2CStop = ATII2CStop; pI2CBus->I2CPutByte = ATII2CPutByte; pI2CBus->I2CGetByte = ATII2CGetByte; -- cgit v1.2.3