diff options
Diffstat (limited to 'include/linux/i2c-algo-pca.h')
-rw-r--r-- | include/linux/i2c-algo-pca.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h index adcb3dc7ac26..1364d62e2fbe 100644 --- a/include/linux/i2c-algo-pca.h +++ b/include/linux/i2c-algo-pca.h | |||
@@ -1,7 +1,14 @@ | |||
1 | #ifndef _LINUX_I2C_ALGO_PCA_H | 1 | #ifndef _LINUX_I2C_ALGO_PCA_H |
2 | #define _LINUX_I2C_ALGO_PCA_H | 2 | #define _LINUX_I2C_ALGO_PCA_H |
3 | 3 | ||
4 | /* Clock speeds for the bus */ | 4 | /* Chips known to the pca algo */ |
5 | #define I2C_PCA_CHIP_9564 0x00 | ||
6 | #define I2C_PCA_CHIP_9665 0x01 | ||
7 | |||
8 | /* Internal period for PCA9665 oscilator */ | ||
9 | #define I2C_PCA_OSC_PER 3 /* e10-8s */ | ||
10 | |||
11 | /* Clock speeds for the bus for PCA9564*/ | ||
5 | #define I2C_PCA_CON_330kHz 0x00 | 12 | #define I2C_PCA_CON_330kHz 0x00 |
6 | #define I2C_PCA_CON_288kHz 0x01 | 13 | #define I2C_PCA_CON_288kHz 0x01 |
7 | #define I2C_PCA_CON_217kHz 0x02 | 14 | #define I2C_PCA_CON_217kHz 0x02 |
@@ -18,6 +25,26 @@ | |||
18 | #define I2C_PCA_ADR 0x02 /* OWN ADR Read/Write */ | 25 | #define I2C_PCA_ADR 0x02 /* OWN ADR Read/Write */ |
19 | #define I2C_PCA_CON 0x03 /* CONTROL Read/Write */ | 26 | #define I2C_PCA_CON 0x03 /* CONTROL Read/Write */ |
20 | 27 | ||
28 | /* PCA9665 registers */ | ||
29 | #define I2C_PCA_INDPTR 0x00 /* INDIRECT Pointer Write Only */ | ||
30 | #define I2C_PCA_IND 0x02 /* INDIRECT Read/Write */ | ||
31 | |||
32 | /* PCA9665 indirect registers */ | ||
33 | #define I2C_PCA_ICOUNT 0x00 /* Byte Count for buffered mode */ | ||
34 | #define I2C_PCA_IADR 0x01 /* OWN ADR */ | ||
35 | #define I2C_PCA_ISCLL 0x02 /* SCL LOW period */ | ||
36 | #define I2C_PCA_ISCLH 0x03 /* SCL HIGH period */ | ||
37 | #define I2C_PCA_ITO 0x04 /* TIMEOUT */ | ||
38 | #define I2C_PCA_IPRESET 0x05 /* Parallel bus reset */ | ||
39 | #define I2C_PCA_IMODE 0x06 /* I2C Bus mode */ | ||
40 | |||
41 | /* PCA9665 I2C bus mode */ | ||
42 | #define I2C_PCA_MODE_STD 0x00 /* Standard mode */ | ||
43 | #define I2C_PCA_MODE_FAST 0x01 /* Fast mode */ | ||
44 | #define I2C_PCA_MODE_FASTP 0x02 /* Fast Plus mode */ | ||
45 | #define I2C_PCA_MODE_TURBO 0x03 /* Turbo mode */ | ||
46 | |||
47 | |||
21 | #define I2C_PCA_CON_AA 0x80 /* Assert Acknowledge */ | 48 | #define I2C_PCA_CON_AA 0x80 /* Assert Acknowledge */ |
22 | #define I2C_PCA_CON_ENSIO 0x40 /* Enable */ | 49 | #define I2C_PCA_CON_ENSIO 0x40 /* Enable */ |
23 | #define I2C_PCA_CON_STA 0x20 /* Start */ | 50 | #define I2C_PCA_CON_STA 0x20 /* Start */ |
@@ -31,7 +58,9 @@ struct i2c_algo_pca_data { | |||
31 | int (*read_byte) (void *data, int reg); | 58 | int (*read_byte) (void *data, int reg); |
32 | int (*wait_for_completion) (void *data); | 59 | int (*wait_for_completion) (void *data); |
33 | void (*reset_chip) (void *data); | 60 | void (*reset_chip) (void *data); |
34 | /* i2c_clock values are defined in linux/i2c-algo-pca.h */ | 61 | /* For PCA9564, use one of the predefined frequencies: |
62 | * 330000, 288000, 217000, 146000, 88000, 59000, 44000, 36000 | ||
63 | * For PCA9665, use the frequency you want here. */ | ||
35 | unsigned int i2c_clock; | 64 | unsigned int i2c_clock; |
36 | }; | 65 | }; |
37 | 66 | ||