Changeset 3072
- Timestamp:
- 09/07/05 22:16:18 (8 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/kernel/busses/i2c-nforce2.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/busses/i2c-nforce2.c
r2909 r3072 120 120 121 121 122 /* Other settings */123 #define MAX_TIMEOUT 256124 125 126 127 122 static s32 nforce2_access(struct i2c_adapter *adap, u16 addr, 128 123 unsigned short flags, char read_write, … … 150 145 unsigned char protocol, pec, temp; 151 146 unsigned char len = 0; /* to keep the compiler quiet */ 152 int timeout = 0;153 147 int i; 154 148 … … 209 203 printk(KERN_WARNING "i2c-nforce2.o: I2C_SMBUS_PROC_CALL not supported!\n"); 210 204 return -1; 211 /*212 outb_p(command, NVIDIA_SMB_CMD);213 outb_p(data->word, NVIDIA_SMB_DATA);214 outb_p(data->word >> 8, NVIDIA_SMB_DATA + 1);215 protocol = NVIDIA_SMB_PRTCL_PROC_CALL | pec;216 read_write = I2C_SMBUS_READ;217 break;218 */219 205 220 206 case I2C_SMBUS_BLOCK_PROC_CALL: 221 207 printk(KERN_WARNING "i2c-nforce2.o: I2C_SMBUS_BLOCK_PROC_CALL not supported!\n"); 222 208 return -1; 223 /*224 protocol |= pec;225 len = min_t(u8, data->block[0], 31);226 outb_p(command, NVIDIA_SMB_CMD);227 outb_p(len, NVIDIA_SMB_BCNT);228 for (i = 0; i < len; i++)229 outb_p(data->block[i + 1], NVIDIA_SMB_DATA + i);230 protocol = NVIDIA_SMB_PRTCL_BLOCK_PROC_CALL | pec;231 read_write = I2C_SMBUS_READ;232 break;233 */234 209 235 210 case I2C_SMBUS_WORD_DATA_PEC: … … 250 225 temp = inb_p(NVIDIA_SMB_STS); 251 226 252 #if 0253 do {254 i2c_delay(1);255 temp = inb_p(NVIDIA_SMB_STS);256 } while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT));257 #endif258 227 if (~temp & NVIDIA_SMB_STS_DONE) { 259 228 udelay(500); … … 265 234 } 266 235 267 if ((timeout >= MAX_TIMEOUT) || (~temp & NVIDIA_SMB_STS_DONE) || (temp & NVIDIA_SMB_STS_STATUS)) 236 if ((~temp & NVIDIA_SMB_STS_DONE) || (temp & NVIDIA_SMB_STS_STATUS)) { 237 printk(KERN_DEBUG "i2c-nforce2.o: SMBus Timeout! (0x%02x)\n", 238 temp); 268 239 return -1; 240 } 269 241 270 242 if (read_write == I2C_SMBUS_WRITE)
