Skip to content

Commit 55b6f82

Browse files
jdelvarewsakernel
authored andcommitted
i2c: i801: Add support for the Process Call command
The Process Call command is implemented by the hardware since the very first Intel 82801 chipset, and trivial to support. Oscar Romero Matamala from the Georgia Institute of Technology told me it is needed for an experiment his team is working on at the moment, so let's just add support for it. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 9c02c63 commit 55b6f82

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/i2c/busses/i2c-i801.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
#define I801_BYTE 0x04
167167
#define I801_BYTE_DATA 0x08
168168
#define I801_WORD_DATA 0x0C
169-
#define I801_PROC_CALL 0x10 /* unimplemented */
169+
#define I801_PROC_CALL 0x10
170170
#define I801_BLOCK_DATA 0x14
171171
#define I801_I2C_BLOCK_DATA 0x18 /* ICH5 and later */
172172
#define I801_BLOCK_PROC_CALL 0x1C
@@ -838,6 +838,14 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
838838
}
839839
xact = I801_WORD_DATA;
840840
break;
841+
case I2C_SMBUS_PROC_CALL:
842+
outb_p((addr & 0x7f) << 1, SMBHSTADD(priv));
843+
outb_p(command, SMBHSTCMD(priv));
844+
outb_p(data->word & 0xff, SMBHSTDAT0(priv));
845+
outb_p((data->word & 0xff00) >> 8, SMBHSTDAT1(priv));
846+
xact = I801_PROC_CALL;
847+
read_write = I2C_SMBUS_READ;
848+
break;
841849
case I2C_SMBUS_BLOCK_DATA:
842850
outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
843851
SMBHSTADD(priv));
@@ -910,6 +918,7 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
910918
data->byte = inb_p(SMBHSTDAT0(priv));
911919
break;
912920
case I801_WORD_DATA:
921+
case I801_PROC_CALL:
913922
data->word = inb_p(SMBHSTDAT0(priv)) +
914923
(inb_p(SMBHSTDAT1(priv)) << 8);
915924
break;
@@ -935,6 +944,7 @@ static u32 i801_func(struct i2c_adapter *adapter)
935944

936945
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
937946
I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
947+
I2C_FUNC_SMBUS_PROC_CALL |
938948
I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK |
939949
((priv->features & FEATURE_SMBUS_PEC) ? I2C_FUNC_SMBUS_PEC : 0) |
940950
((priv->features & FEATURE_BLOCK_PROC) ?

0 commit comments

Comments
 (0)