aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-10-30 16:00:04 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-10-30 16:00:04 -0500
commit07b188ab773e183871e57b33ae37bf635c9f12ba (patch)
tree311df8a0dd12fb7bd3e9b5b1a5ca500f0428d679 /include/linux/i2c.h
parent47c564e10f219f867bdb49225972749a43485a47 (diff)
parent9f75e1eff3edb2bb07349b94c28f4f2a6c66ca43 (diff)
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h38
1 files changed, 4 insertions, 34 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 3d49a305bf88..f88577ca3b3a 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -23,14 +23,13 @@
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 */
35#include <asm/semaphore.h> 34#include <asm/semaphore.h>
36 35
@@ -94,10 +93,10 @@ extern s32 i2c_smbus_write_byte_data(struct i2c_client * client,
94extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); 93extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
95extern s32 i2c_smbus_write_word_data(struct i2c_client * client, 94extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
96 u8 command, u16 value); 95 u8 command, u16 value);
97/* Returns the number of bytes transferred */
98extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 96extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
99 u8 command, u8 length, 97 u8 command, u8 length,
100 u8 *values); 98 u8 *values);
99/* Returns the number of read bytes */
101extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 100extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
102 u8 command, u8 *values); 101 u8 command, u8 *values);
103 102
@@ -391,10 +390,6 @@ struct i2c_msg {
391#define I2C_FUNC_10BIT_ADDR 0x00000002 390#define I2C_FUNC_10BIT_ADDR 0x00000002
392#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 391#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
393#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ 392#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 */ 393#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
399#define I2C_FUNC_SMBUS_QUICK 0x00010000 394#define I2C_FUNC_SMBUS_QUICK 0x00010000
400#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 395#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
@@ -410,8 +405,6 @@ struct i2c_msg {
410#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ 405#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 */ 406#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. */ 407#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 408
416#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ 409#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
417 I2C_FUNC_SMBUS_WRITE_BYTE) 410 I2C_FUNC_SMBUS_WRITE_BYTE)
@@ -425,17 +418,6 @@ struct i2c_msg {
425 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) 418 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
426#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ 419#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \
427 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) 420 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 421
440#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ 422#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
441 I2C_FUNC_SMBUS_BYTE | \ 423 I2C_FUNC_SMBUS_BYTE | \
@@ -443,20 +425,17 @@ struct i2c_msg {
443 I2C_FUNC_SMBUS_WORD_DATA | \ 425 I2C_FUNC_SMBUS_WORD_DATA | \
444 I2C_FUNC_SMBUS_PROC_CALL | \ 426 I2C_FUNC_SMBUS_PROC_CALL | \
445 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ 427 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
446 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \
447 I2C_FUNC_SMBUS_I2C_BLOCK) 428 I2C_FUNC_SMBUS_I2C_BLOCK)
448 429
449/* 430/*
450 * Data for SMBus Messages 431 * Data for SMBus Messages
451 */ 432 */
452#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ 433#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 */
454union i2c_smbus_data { 434union i2c_smbus_data {
455 __u8 byte; 435 __u8 byte;
456 __u16 word; 436 __u16 word;
457 __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */ 437 __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
458 /* one more for read length in block process call */ 438 /* and one more for user-space compatibility */
459 /* and one more for PEC */
460}; 439};
461 440
462/* smbus_access read or write markers */ 441/* smbus_access read or write markers */
@@ -473,10 +452,6 @@ union i2c_smbus_data {
473#define I2C_SMBUS_BLOCK_DATA 5 452#define I2C_SMBUS_BLOCK_DATA 5
474#define I2C_SMBUS_I2C_BLOCK_DATA 6 453#define I2C_SMBUS_I2C_BLOCK_DATA 6
475#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ 454#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 455
481 456
482/* ----- commands for the ioctl like i2c_command call: 457/* ----- commands for the ioctl like i2c_command call:
@@ -506,11 +481,6 @@ union i2c_smbus_data {
506 481
507#define I2C_SMBUS 0x0720 /* SMBus-level access */ 482#define I2C_SMBUS 0x0720 /* SMBus-level access */
508 483
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 ------------------------- */ 484/* ----- I2C-DEV: char device interface stuff ------------------------- */
515 485
516#define I2C_MAJOR 89 /* Device major number */ 486#define I2C_MAJOR 89 /* Device major number */