aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/i2c/dev-interface11
-rw-r--r--drivers/i2c/busses/i2c-amd8111.c2
-rw-r--r--drivers/i2c/busses/i2c-i801.c2
-rw-r--r--include/linux/i2c.h5
4 files changed, 13 insertions, 7 deletions
diff --git a/Documentation/i2c/dev-interface b/Documentation/i2c/dev-interface
index b849ad63658..9dd79123ddd 100644
--- a/Documentation/i2c/dev-interface
+++ b/Documentation/i2c/dev-interface
@@ -90,12 +90,15 @@ ioctl(file,I2C_SLAVE,long addr)
90 90
91ioctl(file,I2C_TENBIT,long select) 91ioctl(file,I2C_TENBIT,long select)
92 Selects ten bit addresses if select not equals 0, selects normal 7 bit 92 Selects ten bit addresses if select not equals 0, selects normal 7 bit
93 addresses if select equals 0. Default 0. 93 addresses if select equals 0. Default 0. This request is only valid
94 if the adapter has I2C_FUNC_10BIT_ADDR.
94 95
95ioctl(file,I2C_PEC,long select) 96ioctl(file,I2C_PEC,long select)
96 Selects SMBus PEC (packet error checking) generation and verification 97 Selects SMBus PEC (packet error checking) generation and verification
97 if select not equals 0, disables if select equals 0. Default 0. 98 if select not equals 0, disables if select equals 0. Default 0.
98 Used only for SMBus transactions. 99 Used only for SMBus transactions. This request only has an effect if the
100 the adapter has I2C_FUNC_SMBUS_PEC; it is still safe if not, it just
101 doesn't have any effect.
99 102
100ioctl(file,I2C_FUNCS,unsigned long *funcs) 103ioctl(file,I2C_FUNCS,unsigned long *funcs)
101 Gets the adapter functionality and puts it in *funcs. 104 Gets the adapter functionality and puts it in *funcs.
@@ -103,8 +106,10 @@ ioctl(file,I2C_FUNCS,unsigned long *funcs)
103ioctl(file,I2C_RDWR,struct i2c_rdwr_ioctl_data *msgset) 106ioctl(file,I2C_RDWR,struct i2c_rdwr_ioctl_data *msgset)
104 107
105 Do combined read/write transaction without stop in between. 108 Do combined read/write transaction without stop in between.
106 The argument is a pointer to a struct i2c_rdwr_ioctl_data { 109 Only valid if the adapter has I2C_FUNC_I2C. The argument is
110 a pointer to a
107 111
112 struct i2c_rdwr_ioctl_data {
108 struct i2c_msg *msgs; /* ptr to array of simple messages */ 113 struct i2c_msg *msgs; /* ptr to array of simple messages */
109 int nmsgs; /* number of messages to exchange */ 114 int nmsgs; /* number of messages to exchange */
110 } 115 }
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
index c9fca7b4926..5d1a27ef250 100644
--- a/drivers/i2c/busses/i2c-amd8111.c
+++ b/drivers/i2c/busses/i2c-amd8111.c
@@ -326,7 +326,7 @@ static u32 amd8111_func(struct i2c_adapter *adapter)
326 I2C_FUNC_SMBUS_BYTE_DATA | 326 I2C_FUNC_SMBUS_BYTE_DATA |
327 I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA | 327 I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA |
328 I2C_FUNC_SMBUS_PROC_CALL | I2C_FUNC_SMBUS_BLOCK_PROC_CALL | 328 I2C_FUNC_SMBUS_PROC_CALL | I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
329 I2C_FUNC_SMBUS_I2C_BLOCK | I2C_FUNC_SMBUS_HWPEC_CALC; 329 I2C_FUNC_SMBUS_I2C_BLOCK | I2C_FUNC_SMBUS_PEC;
330} 330}
331 331
332static const struct i2c_algorithm smbus_algorithm = { 332static const struct i2c_algorithm smbus_algorithm = {
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index f78a8086717..ac27e5f84eb 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -516,7 +516,7 @@ static u32 i801_func(struct i2c_adapter *adapter)
516 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | 516 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
517 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | 517 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
518 I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 518 I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK
519 | (isich4 ? I2C_FUNC_SMBUS_HWPEC_CALC : 0); 519 | (isich4 ? I2C_FUNC_SMBUS_PEC : 0);
520} 520}
521 521
522static const struct i2c_algorithm smbus_algorithm = { 522static const struct i2c_algorithm smbus_algorithm = {
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index e43d99d7551..8033e6b3327 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -491,7 +491,7 @@ struct i2c_msg {
491#define I2C_FUNC_I2C 0x00000001 491#define I2C_FUNC_I2C 0x00000001
492#define I2C_FUNC_10BIT_ADDR 0x00000002 492#define I2C_FUNC_10BIT_ADDR 0x00000002
493#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 493#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
494#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ 494#define I2C_FUNC_SMBUS_PEC 0x00000008
495#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ 495#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
496#define I2C_FUNC_SMBUS_QUICK 0x00010000 496#define I2C_FUNC_SMBUS_QUICK 0x00010000
497#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 497#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
@@ -527,7 +527,8 @@ struct i2c_msg {
527 I2C_FUNC_SMBUS_WORD_DATA | \ 527 I2C_FUNC_SMBUS_WORD_DATA | \
528 I2C_FUNC_SMBUS_PROC_CALL | \ 528 I2C_FUNC_SMBUS_PROC_CALL | \
529 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ 529 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
530 I2C_FUNC_SMBUS_I2C_BLOCK) 530 I2C_FUNC_SMBUS_I2C_BLOCK | \
531 I2C_FUNC_SMBUS_PEC)
531 532
532/* 533/*
533 * Data for SMBus Messages 534 * Data for SMBus Messages