From 6a79244a1de1a7696bf37e319c8df9e887dd51fd Mon Sep 17 00:00:00 2001 From: Philip Edelbrock Date: Mon, 10 May 1999 00:11:08 +0000 Subject: [PATCH] (Phil) More fixes and changes. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@457 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-voodoo3.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kernel/busses/i2c-voodoo3.c b/kernel/busses/i2c-voodoo3.c index d1cad840..0d44a062 100644 --- a/kernel/busses/i2c-voodoo3.c +++ b/kernel/busses/i2c-voodoo3.c @@ -23,6 +23,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define DEBUG 1 + /* This interfaces to the I2C bus of the Voodoo3 to gain access to the BT869 and possibly other I2C devices. */ @@ -111,11 +113,14 @@ inline int rdat(void) return((readlong(0x78)&(1<<27) )!=0 ); } +/* Changing the Data line while clock is 'on' (high) is a + no-no, except for a start or stop. */ + void Voodoo3_I2CStart(void) { - dat(0); - clkon(); + clkon(); /* in theory, clk is already on */ out(); + dat(0); out(); clkoff(); out(); @@ -155,6 +160,8 @@ int Voodoo3_I2CReadByte() int i,temp; unsigned char data=0; + clkoff(); + out(); for (i=7; i>=0; i--) { out(); clkon(); @@ -177,6 +184,8 @@ int Voodoo3_I2CSendByte(unsigned char data) { int i,temp; + clkoff(); + out(); for (i=7; i>=0; i--) { dat(temp=data&(1<