diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 15:38:13 -0500 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 15:38:13 -0500 |
| commit | 87199134b4a85de56a7508c551ab3b3a3ee35035 (patch) | |
| tree | f7b0d0b4bce377c336a3c8cda0be762d29556cc7 /include/linux/i2c.h | |
| parent | ea37ccea66e6bdd9f3571418b6461850088c114e (diff) | |
| parent | 70d9d825e0a5a78ec1dacaaaf5c72ff5b0206fab (diff) | |
Merge branch 'master'
Diffstat (limited to 'include/linux/i2c.h')
| -rw-r--r-- | include/linux/i2c.h | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 3d49a305bf88..5e19a7ba69b2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -23,15 +23,15 @@ | |||
| 23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and | 23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and |
| 24 | Frodo Looijaard <frodol@dds.nl> */ | 24 | Frodo Looijaard <frodol@dds.nl> */ |
| 25 | 25 | ||
| 26 | /* $Id: i2c.h,v 1.68 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
| 27 | |||
| 28 | #ifndef _LINUX_I2C_H | 26 | #ifndef _LINUX_I2C_H |
| 29 | #define _LINUX_I2C_H | 27 | #define _LINUX_I2C_H |
| 30 | 28 | ||
| 31 | #include <linux/module.h> | 29 | #include <linux/module.h> |
| 32 | #include <linux/types.h> | 30 | #include <linux/types.h> |
| 33 | #include <linux/i2c-id.h> | 31 | #include <linux/i2c-id.h> |
| 32 | #include <linux/mod_devicetable.h> | ||
| 34 | #include <linux/device.h> /* for struct device */ | 33 | #include <linux/device.h> /* for struct device */ |
| 34 | #include <linux/sched.h> /* for completion */ | ||
| 35 | #include <asm/semaphore.h> | 35 | #include <asm/semaphore.h> |
| 36 | 36 | ||
| 37 | /* --- For i2c-isa ---------------------------------------------------- */ | 37 | /* --- For i2c-isa ---------------------------------------------------- */ |
| @@ -94,10 +94,10 @@ extern s32 i2c_smbus_write_byte_data(struct i2c_client * client, | |||
| 94 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); | 94 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); |
| 95 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | 95 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, |
| 96 | u8 command, u16 value); | 96 | u8 command, u16 value); |
| 97 | /* Returns the number of bytes transferred */ | ||
| 98 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 97 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
| 99 | u8 command, u8 length, | 98 | u8 command, u8 length, |
| 100 | u8 *values); | 99 | u8 *values); |
| 100 | /* Returns the number of read bytes */ | ||
| 101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
| 102 | u8 command, u8 *values); | 102 | u8 command, u8 *values); |
| 103 | 103 | ||
| @@ -391,10 +391,6 @@ struct i2c_msg { | |||
| 391 | #define I2C_FUNC_10BIT_ADDR 0x00000002 | 391 | #define I2C_FUNC_10BIT_ADDR 0x00000002 |
| 392 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ | 392 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ |
| 393 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ | 393 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ |
| 394 | #define I2C_FUNC_SMBUS_READ_WORD_DATA_PEC 0x00000800 /* SMBus 2.0 */ | ||
| 395 | #define I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC 0x00001000 /* SMBus 2.0 */ | ||
| 396 | #define I2C_FUNC_SMBUS_PROC_CALL_PEC 0x00002000 /* SMBus 2.0 */ | ||
| 397 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC 0x00004000 /* SMBus 2.0 */ | ||
| 398 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ | 394 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ |
| 399 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 | 395 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 |
| 400 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 | 396 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 |
| @@ -410,8 +406,6 @@ struct i2c_msg { | |||
| 410 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ | 406 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ |
| 411 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ | 407 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ |
| 412 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ | 408 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ |
| 413 | #define I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC 0x40000000 /* SMBus 2.0 */ | ||
| 414 | #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC 0x80000000 /* SMBus 2.0 */ | ||
| 415 | 409 | ||
| 416 | #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ | 410 | #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ |
| 417 | I2C_FUNC_SMBUS_WRITE_BYTE) | 411 | I2C_FUNC_SMBUS_WRITE_BYTE) |
| @@ -425,17 +419,6 @@ struct i2c_msg { | |||
| 425 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) | 419 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) |
| 426 | #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ | 420 | #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ |
| 427 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) | 421 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) |
| 428 | #define I2C_FUNC_SMBUS_BLOCK_DATA_PEC (I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC | \ | ||
| 429 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC) | ||
| 430 | #define I2C_FUNC_SMBUS_WORD_DATA_PEC (I2C_FUNC_SMBUS_READ_WORD_DATA_PEC | \ | ||
| 431 | I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC) | ||
| 432 | |||
| 433 | #define I2C_FUNC_SMBUS_READ_BYTE_PEC I2C_FUNC_SMBUS_READ_BYTE_DATA | ||
| 434 | #define I2C_FUNC_SMBUS_WRITE_BYTE_PEC I2C_FUNC_SMBUS_WRITE_BYTE_DATA | ||
| 435 | #define I2C_FUNC_SMBUS_READ_BYTE_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA | ||
| 436 | #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA_PEC I2C_FUNC_SMBUS_WRITE_WORD_DATA | ||
| 437 | #define I2C_FUNC_SMBUS_BYTE_PEC I2C_FUNC_SMBUS_BYTE_DATA | ||
| 438 | #define I2C_FUNC_SMBUS_BYTE_DATA_PEC I2C_FUNC_SMBUS_WORD_DATA | ||
| 439 | 422 | ||
| 440 | #define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ | 423 | #define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ |
| 441 | I2C_FUNC_SMBUS_BYTE | \ | 424 | I2C_FUNC_SMBUS_BYTE | \ |
| @@ -443,20 +426,17 @@ struct i2c_msg { | |||
| 443 | I2C_FUNC_SMBUS_WORD_DATA | \ | 426 | I2C_FUNC_SMBUS_WORD_DATA | \ |
| 444 | I2C_FUNC_SMBUS_PROC_CALL | \ | 427 | I2C_FUNC_SMBUS_PROC_CALL | \ |
| 445 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ | 428 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ |
| 446 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \ | ||
| 447 | I2C_FUNC_SMBUS_I2C_BLOCK) | 429 | I2C_FUNC_SMBUS_I2C_BLOCK) |
| 448 | 430 | ||
| 449 | /* | 431 | /* |
| 450 | * Data for SMBus Messages | 432 | * Data for SMBus Messages |
| 451 | */ | 433 | */ |
| 452 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ | 434 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ |
| 453 | #define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */ | ||
| 454 | union i2c_smbus_data { | 435 | union i2c_smbus_data { |
| 455 | __u8 byte; | 436 | __u8 byte; |
| 456 | __u16 word; | 437 | __u16 word; |
| 457 | __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */ | 438 | __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ |
| 458 | /* one more for read length in block process call */ | 439 | /* and one more for user-space compatibility */ |
| 459 | /* and one more for PEC */ | ||
| 460 | }; | 440 | }; |
| 461 | 441 | ||
| 462 | /* smbus_access read or write markers */ | 442 | /* smbus_access read or write markers */ |
| @@ -473,10 +453,6 @@ union i2c_smbus_data { | |||
| 473 | #define I2C_SMBUS_BLOCK_DATA 5 | 453 | #define I2C_SMBUS_BLOCK_DATA 5 |
| 474 | #define I2C_SMBUS_I2C_BLOCK_DATA 6 | 454 | #define I2C_SMBUS_I2C_BLOCK_DATA 6 |
| 475 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ | 455 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ |
| 476 | #define I2C_SMBUS_BLOCK_DATA_PEC 8 /* SMBus 2.0 */ | ||
| 477 | #define I2C_SMBUS_PROC_CALL_PEC 9 /* SMBus 2.0 */ | ||
| 478 | #define I2C_SMBUS_BLOCK_PROC_CALL_PEC 10 /* SMBus 2.0 */ | ||
| 479 | #define I2C_SMBUS_WORD_DATA_PEC 11 /* SMBus 2.0 */ | ||
| 480 | 456 | ||
| 481 | 457 | ||
| 482 | /* ----- commands for the ioctl like i2c_command call: | 458 | /* ----- commands for the ioctl like i2c_command call: |
| @@ -506,11 +482,6 @@ union i2c_smbus_data { | |||
| 506 | 482 | ||
| 507 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ | 483 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ |
| 508 | 484 | ||
| 509 | /* ... algo-bit.c recognizes */ | ||
| 510 | #define I2C_UDELAY 0x0705 /* set delay in microsecs between each */ | ||
| 511 | /* written byte (except address) */ | ||
| 512 | #define I2C_MDELAY 0x0706 /* millisec delay between written bytes */ | ||
| 513 | |||
| 514 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ | 485 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ |
| 515 | 486 | ||
| 516 | #define I2C_MAJOR 89 /* Device major number */ | 487 | #define I2C_MAJOR 89 /* Device major number */ |
