2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

check for invalid transaction type

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1778 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker
2003-06-10 01:07:54 +00:00
parent e9c0fce42a
commit 79adb8ba49
6 changed files with 27 additions and 20 deletions

View File

@@ -413,11 +413,6 @@ s32 ali1535_access(struct i2c_adapter * adap, u16 addr,
outb_p(0xFF, SMBHSTSTS);
switch (size) {
case I2C_SMBUS_PROC_CALL:
printk
("i2c-ali1535.o: I2C_SMBUS_PROC_CALL not supported!\n");
result = -1;
goto EXIT;
case I2C_SMBUS_QUICK:
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
SMBHSTADD);
@@ -474,6 +469,11 @@ s32 ali1535_access(struct i2c_adapter * adap, u16 addr,
outb_p(data->block[i], SMBBLKDAT);
}
break;
default:
printk
(KERN_WARNING "i2c-ali1535.o: Unsupported transaction %d\n", size);
result = -1;
goto EXIT;
}
if (ali1535_transaction()) /* Error in transaction */

View File

@@ -367,9 +367,6 @@ static s32 ali15x3_access(struct i2c_adapter * adap, u16 addr,
}
switch (size) {
case I2C_SMBUS_PROC_CALL:
dev_err(adap, "I2C_SMBUS_PROC_CALL not supported!\n");
return -1;
case I2C_SMBUS_QUICK:
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
SMBHSTADD);
@@ -422,6 +419,10 @@ static s32 ali15x3_access(struct i2c_adapter * adap, u16 addr,
}
size = ALI15X3_BLOCK_DATA;
break;
default:
printk
(KERN_WARNING "i2c-ali15x3.o: Unsupported transaction %d\n", size);
return -1;
}
outb_p(size, SMBHSTCNT); /* output command */

View File

@@ -211,10 +211,7 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
/** TODO: Should I supporte the 10-bit transfers? */
switch (size) {
case I2C_SMBUS_PROC_CALL:
pr_debug(DRV_NAME ": I2C_SMBUS_PROC_CALL not supported!\n");
/* TODO: Well... It is supported, I'm just not sure what to do here... */
return -1;
/* TODO: proc call is supported, I'm just not sure what to do here... */
case I2C_SMBUS_QUICK:
outw_p(((addr & 0x7f) << 1) | (read_write & 0x01),
SMB_HOST_ADDRESS);
@@ -262,6 +259,10 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
}
size = AMD756_BLOCK_DATA;
break;
default:
printk
(KERN_WARNING "i2c-amd756.o: Unsupported transaction %d\n", size);
return -1;
}
/* How about enabling interrupts... */

View File

@@ -339,10 +339,6 @@ s32 piix4_access(struct i2c_adapter * adap, u16 addr,
int i, len;
switch (size) {
case I2C_SMBUS_PROC_CALL:
printk
(KERN_ERR "i2c-piix4.o: I2C_SMBUS_PROC_CALL not supported!\n");
return -1;
case I2C_SMBUS_QUICK:
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
SMBHSTADD);
@@ -390,6 +386,10 @@ s32 piix4_access(struct i2c_adapter * adap, u16 addr,
}
size = PIIX4_BLOCK_DATA;
break;
default:
printk
(KERN_WARNING "i2c-piix4.o: Unsupported transaction %d\n", size);
return -1;
}
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);

View File

@@ -351,10 +351,16 @@ s32 sis5595_access(struct i2c_adapter * adap, u16 addr,
I2C_SMBUS_PROC_CALL) ? SIS5595_PROC_CALL :
SIS5595_WORD_DATA;
break;
/*
case I2C_SMBUS_BLOCK_DATA:
printk("sis5595.o: Block data not yet implemented!\n");
return -1;
break;
*/
default:
printk
(KERN_WARNING "sis5595.o: Unsupported transaction %d\n", size);
return -1;
}
sis5595_write(SMB_CTL_LO, ((size & 0x0E)));

View File

@@ -195,10 +195,6 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
int i, len;
switch (size) {
case I2C_SMBUS_PROC_CALL:
dev_info(&vt596_adapter,
"I2C_SMBUS_PROC_CALL not supported!\n");
return -1;
case I2C_SMBUS_QUICK:
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
SMBHSTADD);
@@ -246,6 +242,9 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
}
size = VT596_BLOCK_DATA;
break;
default:
dev_warn(&vt596_adapter, "Unsupported transaction %d\n", size);
return -1;
}
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);