diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c-algo-pca.h | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h index fce47c051bb1..adcb3dc7ac26 100644 --- a/include/linux/i2c-algo-pca.h +++ b/include/linux/i2c-algo-pca.h | |||
@@ -1,14 +1,41 @@ | |||
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 */ | ||
5 | #define I2C_PCA_CON_330kHz 0x00 | ||
6 | #define I2C_PCA_CON_288kHz 0x01 | ||
7 | #define I2C_PCA_CON_217kHz 0x02 | ||
8 | #define I2C_PCA_CON_146kHz 0x03 | ||
9 | #define I2C_PCA_CON_88kHz 0x04 | ||
10 | #define I2C_PCA_CON_59kHz 0x05 | ||
11 | #define I2C_PCA_CON_44kHz 0x06 | ||
12 | #define I2C_PCA_CON_36kHz 0x07 | ||
13 | |||
14 | /* PCA9564 registers */ | ||
15 | #define I2C_PCA_STA 0x00 /* STATUS Read Only */ | ||
16 | #define I2C_PCA_TO 0x00 /* TIMEOUT Write Only */ | ||
17 | #define I2C_PCA_DAT 0x01 /* DATA Read/Write */ | ||
18 | #define I2C_PCA_ADR 0x02 /* OWN ADR Read/Write */ | ||
19 | #define I2C_PCA_CON 0x03 /* CONTROL Read/Write */ | ||
20 | |||
21 | #define I2C_PCA_CON_AA 0x80 /* Assert Acknowledge */ | ||
22 | #define I2C_PCA_CON_ENSIO 0x40 /* Enable */ | ||
23 | #define I2C_PCA_CON_STA 0x20 /* Start */ | ||
24 | #define I2C_PCA_CON_STO 0x10 /* Stop */ | ||
25 | #define I2C_PCA_CON_SI 0x08 /* Serial Interrupt */ | ||
26 | #define I2C_PCA_CON_CR 0x07 /* Clock Rate (MASK) */ | ||
27 | |||
4 | struct i2c_algo_pca_data { | 28 | struct i2c_algo_pca_data { |
5 | int (*get_own) (struct i2c_algo_pca_data *adap); /* Obtain own address */ | 29 | void *data; /* private low level data */ |
6 | int (*get_clock) (struct i2c_algo_pca_data *adap); | 30 | void (*write_byte) (void *data, int reg, int val); |
7 | void (*write_byte) (struct i2c_algo_pca_data *adap, int reg, int val); | 31 | int (*read_byte) (void *data, int reg); |
8 | int (*read_byte) (struct i2c_algo_pca_data *adap, int reg); | 32 | int (*wait_for_completion) (void *data); |
9 | int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap); | 33 | void (*reset_chip) (void *data); |
34 | /* i2c_clock values are defined in linux/i2c-algo-pca.h */ | ||
35 | unsigned int i2c_clock; | ||
10 | }; | 36 | }; |
11 | 37 | ||
12 | int i2c_pca_add_bus(struct i2c_adapter *); | 38 | int i2c_pca_add_bus(struct i2c_adapter *); |
39 | int i2c_pca_add_numbered_bus(struct i2c_adapter *); | ||
13 | 40 | ||
14 | #endif /* _LINUX_I2C_ALGO_PCA_H */ | 41 | #endif /* _LINUX_I2C_ALGO_PCA_H */ |