aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorHans-Frieder Vogt <hfvogt@gmx.net>2005-07-23 09:33:39 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-05 12:14:04 -0400
commit5033017c2678df9dc75be0139f19701ff224a498 (patch)
tree8be76d0a5c08d37230ecd66c06d08d39650b4d31 /drivers/i2c/busses
parenta8decc658a8800e61f13b9240125f2a34d7fd3f5 (diff)
[PATCH] I2C: cleanup of i2c-nforce2
attached is a small patch that removes unused code from i2c-nforce2 and adds a single debug message. The patch is against 2.6.13-rc3-mm1. I have tested the patch with 2.6.13-rc3: compiles cleanly and works as without the patch (as expected). Signed-off-by: Hans-Frieder Vogt <hfvogt@arcor.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-nforce2.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index 74eb89aa9350..1df601bb7f4f 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -131,7 +131,6 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
131 struct nforce2_smbus *smbus = adap->algo_data; 131 struct nforce2_smbus *smbus = adap->algo_data;
132 unsigned char protocol, pec, temp; 132 unsigned char protocol, pec, temp;
133 unsigned char len = 0; /* to keep the compiler quiet */ 133 unsigned char len = 0; /* to keep the compiler quiet */
134 int timeout = 0;
135 int i; 134 int i;
136 135
137 protocol = (read_write == I2C_SMBUS_READ) ? NVIDIA_SMB_PRTCL_READ : 136 protocol = (read_write == I2C_SMBUS_READ) ? NVIDIA_SMB_PRTCL_READ :
@@ -191,29 +190,10 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
191 case I2C_SMBUS_PROC_CALL: 190 case I2C_SMBUS_PROC_CALL:
192 dev_err(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n"); 191 dev_err(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n");
193 return -1; 192 return -1;
194 /*
195 outb_p(command, NVIDIA_SMB_CMD);
196 outb_p(data->word, NVIDIA_SMB_DATA);
197 outb_p(data->word >> 8, NVIDIA_SMB_DATA + 1);
198 protocol = NVIDIA_SMB_PRTCL_PROC_CALL | pec;
199 read_write = I2C_SMBUS_READ;
200 break;
201 */
202 193
203 case I2C_SMBUS_BLOCK_PROC_CALL: 194 case I2C_SMBUS_BLOCK_PROC_CALL:
204 dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n"); 195 dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n");
205 return -1; 196 return -1;
206 /*
207 protocol |= pec;
208 len = min_t(u8, data->block[0], 31);
209 outb_p(command, NVIDIA_SMB_CMD);
210 outb_p(len, NVIDIA_SMB_BCNT);
211 for (i = 0; i < len; i++)
212 outb_p(data->block[i + 1], NVIDIA_SMB_DATA + i);
213 protocol = NVIDIA_SMB_PRTCL_BLOCK_PROC_CALL | pec;
214 read_write = I2C_SMBUS_READ;
215 break;
216 */
217 197
218 case I2C_SMBUS_WORD_DATA_PEC: 198 case I2C_SMBUS_WORD_DATA_PEC:
219 case I2C_SMBUS_BLOCK_DATA_PEC: 199 case I2C_SMBUS_BLOCK_DATA_PEC:
@@ -232,12 +212,6 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
232 212
233 temp = inb_p(NVIDIA_SMB_STS); 213 temp = inb_p(NVIDIA_SMB_STS);
234 214
235#if 0
236 do {
237 i2c_do_pause(1);
238 temp = inb_p(NVIDIA_SMB_STS);
239 } while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT));
240#endif
241 if (~temp & NVIDIA_SMB_STS_DONE) { 215 if (~temp & NVIDIA_SMB_STS_DONE) {
242 udelay(500); 216 udelay(500);
243 temp = inb_p(NVIDIA_SMB_STS); 217 temp = inb_p(NVIDIA_SMB_STS);
@@ -247,9 +221,10 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
247 temp = inb_p(NVIDIA_SMB_STS); 221 temp = inb_p(NVIDIA_SMB_STS);
248 } 222 }
249 223
250 if ((timeout >= MAX_TIMEOUT) || (~temp & NVIDIA_SMB_STS_DONE) 224 if ((~temp & NVIDIA_SMB_STS_DONE) || (temp & NVIDIA_SMB_STS_STATUS)) {
251 || (temp & NVIDIA_SMB_STS_STATUS)) 225 dev_dbg(&adap->dev, "SMBus Timeout! (0x%02x)\n", temp);
252 return -1; 226 return -1;
227 }
253 228
254 if (read_write == I2C_SMBUS_WRITE) 229 if (read_write == I2C_SMBUS_WRITE)
255 return 0; 230 return 0;