mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-09-03 15:55:15 +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:
@@ -413,11 +413,6 @@ s32 ali1535_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
outb_p(0xFF, SMBHSTSTS);
|
outb_p(0xFF, SMBHSTSTS);
|
||||||
|
|
||||||
switch (size) {
|
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:
|
case I2C_SMBUS_QUICK:
|
||||||
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
||||||
SMBHSTADD);
|
SMBHSTADD);
|
||||||
@@ -474,6 +469,11 @@ s32 ali1535_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
outb_p(data->block[i], SMBBLKDAT);
|
outb_p(data->block[i], SMBBLKDAT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
printk
|
||||||
|
(KERN_WARNING "i2c-ali1535.o: Unsupported transaction %d\n", size);
|
||||||
|
result = -1;
|
||||||
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ali1535_transaction()) /* Error in transaction */
|
if (ali1535_transaction()) /* Error in transaction */
|
||||||
|
@@ -367,9 +367,6 @@ static s32 ali15x3_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case I2C_SMBUS_PROC_CALL:
|
|
||||||
dev_err(adap, "I2C_SMBUS_PROC_CALL not supported!\n");
|
|
||||||
return -1;
|
|
||||||
case I2C_SMBUS_QUICK:
|
case I2C_SMBUS_QUICK:
|
||||||
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
||||||
SMBHSTADD);
|
SMBHSTADD);
|
||||||
@@ -422,6 +419,10 @@ static s32 ali15x3_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
}
|
}
|
||||||
size = ALI15X3_BLOCK_DATA;
|
size = ALI15X3_BLOCK_DATA;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
printk
|
||||||
|
(KERN_WARNING "i2c-ali15x3.o: Unsupported transaction %d\n", size);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
outb_p(size, SMBHSTCNT); /* output command */
|
outb_p(size, SMBHSTCNT); /* output command */
|
||||||
|
@@ -211,10 +211,7 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
|
|
||||||
/** TODO: Should I supporte the 10-bit transfers? */
|
/** TODO: Should I supporte the 10-bit transfers? */
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case I2C_SMBUS_PROC_CALL:
|
/* TODO: proc call is supported, I'm just not sure what to do here... */
|
||||||
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;
|
|
||||||
case I2C_SMBUS_QUICK:
|
case I2C_SMBUS_QUICK:
|
||||||
outw_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
outw_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
||||||
SMB_HOST_ADDRESS);
|
SMB_HOST_ADDRESS);
|
||||||
@@ -262,6 +259,10 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
}
|
}
|
||||||
size = AMD756_BLOCK_DATA;
|
size = AMD756_BLOCK_DATA;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
printk
|
||||||
|
(KERN_WARNING "i2c-amd756.o: Unsupported transaction %d\n", size);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* How about enabling interrupts... */
|
/* How about enabling interrupts... */
|
||||||
|
@@ -339,10 +339,6 @@ s32 piix4_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
int i, len;
|
int i, len;
|
||||||
|
|
||||||
switch (size) {
|
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:
|
case I2C_SMBUS_QUICK:
|
||||||
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
||||||
SMBHSTADD);
|
SMBHSTADD);
|
||||||
@@ -390,6 +386,10 @@ s32 piix4_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
}
|
}
|
||||||
size = PIIX4_BLOCK_DATA;
|
size = PIIX4_BLOCK_DATA;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
printk
|
||||||
|
(KERN_WARNING "i2c-piix4.o: Unsupported transaction %d\n", size);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);
|
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);
|
||||||
|
@@ -351,10 +351,16 @@ s32 sis5595_access(struct i2c_adapter * adap, u16 addr,
|
|||||||
I2C_SMBUS_PROC_CALL) ? SIS5595_PROC_CALL :
|
I2C_SMBUS_PROC_CALL) ? SIS5595_PROC_CALL :
|
||||||
SIS5595_WORD_DATA;
|
SIS5595_WORD_DATA;
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
case I2C_SMBUS_BLOCK_DATA:
|
case I2C_SMBUS_BLOCK_DATA:
|
||||||
printk("sis5595.o: Block data not yet implemented!\n");
|
printk("sis5595.o: Block data not yet implemented!\n");
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
|
default:
|
||||||
|
printk
|
||||||
|
(KERN_WARNING "sis5595.o: Unsupported transaction %d\n", size);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sis5595_write(SMB_CTL_LO, ((size & 0x0E)));
|
sis5595_write(SMB_CTL_LO, ((size & 0x0E)));
|
||||||
|
@@ -195,10 +195,6 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
|
|||||||
int i, len;
|
int i, len;
|
||||||
|
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case I2C_SMBUS_PROC_CALL:
|
|
||||||
dev_info(&vt596_adapter,
|
|
||||||
"I2C_SMBUS_PROC_CALL not supported!\n");
|
|
||||||
return -1;
|
|
||||||
case I2C_SMBUS_QUICK:
|
case I2C_SMBUS_QUICK:
|
||||||
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
|
||||||
SMBHSTADD);
|
SMBHSTADD);
|
||||||
@@ -246,6 +242,9 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
|
|||||||
}
|
}
|
||||||
size = VT596_BLOCK_DATA;
|
size = VT596_BLOCK_DATA;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
dev_warn(&vt596_adapter, "Unsupported transaction %d\n", size);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);
|
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);
|
||||||
|
Reference in New Issue
Block a user