]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/i2c-algo-pca.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[mirror_ubuntu-bionic-kernel.git] / include / linux / i2c-algo-pca.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_I2C_ALGO_PCA_H
2#define _LINUX_I2C_ALGO_PCA_H
3
c01b0831
WS
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
1da177e4 28struct i2c_algo_pca_data {
c01b0831
WS
29 void *data; /* private low level data */
30 void (*write_byte) (void *data, int reg, int val);
31 int (*read_byte) (void *data, int reg);
32 int (*wait_for_completion) (void *data);
33 void (*reset_chip) (void *data);
34 /* i2c_clock values are defined in linux/i2c-algo-pca.h */
35 unsigned int i2c_clock;
1da177e4
LT
36};
37
1da177e4 38int i2c_pca_add_bus(struct i2c_adapter *);
c01b0831 39int i2c_pca_add_numbered_bus(struct i2c_adapter *);
1da177e4
LT
40
41#endif /* _LINUX_I2C_ALGO_PCA_H */