1
2 #ifndef _LINUX_I2C_ALGO_PCA_H
3 #define _LINUX_I2C_ALGO_PCA_H
4
5
6 #define I2C_PCA_CHIP_9564 0x00
7 #define I2C_PCA_CHIP_9665 0x01
8
9
10 #define I2C_PCA_OSC_PER 3
11
12
13 #define I2C_PCA_CON_330kHz 0x00
14 #define I2C_PCA_CON_288kHz 0x01
15 #define I2C_PCA_CON_217kHz 0x02
16 #define I2C_PCA_CON_146kHz 0x03
17 #define I2C_PCA_CON_88kHz 0x04
18 #define I2C_PCA_CON_59kHz 0x05
19 #define I2C_PCA_CON_44kHz 0x06
20 #define I2C_PCA_CON_36kHz 0x07
21
22
23 #define I2C_PCA_STA 0x00
24 #define I2C_PCA_TO 0x00
25 #define I2C_PCA_DAT 0x01
26 #define I2C_PCA_ADR 0x02
27 #define I2C_PCA_CON 0x03
28
29
30 #define I2C_PCA_INDPTR 0x00
31 #define I2C_PCA_IND 0x02
32
33
34 #define I2C_PCA_ICOUNT 0x00
35 #define I2C_PCA_IADR 0x01
36 #define I2C_PCA_ISCLL 0x02
37 #define I2C_PCA_ISCLH 0x03
38 #define I2C_PCA_ITO 0x04
39 #define I2C_PCA_IPRESET 0x05
40 #define I2C_PCA_IMODE 0x06
41
42
43 #define I2C_PCA_MODE_STD 0x00
44 #define I2C_PCA_MODE_FAST 0x01
45 #define I2C_PCA_MODE_FASTP 0x02
46 #define I2C_PCA_MODE_TURBO 0x03
47
48
49 #define I2C_PCA_CON_AA 0x80
50 #define I2C_PCA_CON_ENSIO 0x40
51 #define I2C_PCA_CON_STA 0x20
52 #define I2C_PCA_CON_STO 0x10
53 #define I2C_PCA_CON_SI 0x08
54 #define I2C_PCA_CON_CR 0x07
55
56 struct i2c_algo_pca_data {
57 void *data;
58 void (*write_byte) (void *data, int reg, int val);
59 int (*read_byte) (void *data, int reg);
60 int (*wait_for_completion) (void *data);
61 void (*reset_chip) (void *data);
62
63
64
65 unsigned int i2c_clock;
66 unsigned int chip;
67 };
68
69 int i2c_pca_add_bus(struct i2c_adapter *);
70 int i2c_pca_add_numbered_bus(struct i2c_adapter *);
71
72 #endif