Merge tag 'lsk-android-14.05' into develop-3.10
[firefly-linux-kernel-4.4.55.git] / include / linux / i2c / tca6424.h
1 /******************************************************************/\r
2 /*   Copyright (C) 2008 ROCK-CHIPS FUZHOU . All Rights Reserved.  */\r
3 /*******************************************************************\r
4 File    :  gpio.h\r
5 Desc    :  ¶¨ÒågpioµÄ¼Ä´æÆ÷½á¹¹Ìå\¼Ä´æÆ÷λµÄºê¶¨Òå\½Ó¿Úº¯Êý\r
6 \r
7 Author  : \r
8 Date    : 2008-11-20\r
9 Modified:\r
10 Revision:           1.00\r
11 $Log: gpio.h,v $\r
12 *********************************************************************/\r
13 #ifndef _DRIVER_TCA6424_GPIO_H_\r
14 #define _DRIVER_TCA6424_GPIO_H_\r
15 \r
16 #define TCA6424_PortNum         3\r
17 #define TCA6424_PortPinNum      8\r
18 #define TCA6424_Port0PinNum 8\r
19 #define TCA6424_Port1PinNum 8\r
20 #define TCA6424_Port2PinNum 8\r
21 #define EXTGPIO_OUTPUT  0\r
22 #define EXTGPIO_INPUT   1\r
23 \r
24 #define TCA6424_TotalPortPinNum (TCA6424_Port0PinNum+TCA6424_Port1PinNum+TCA6424_Port2PinNum)\r
25 \r
26 #define TCA6424_InputLevel_Reg  0x0     //r only\r
27 #define TCA6424_OutputLevel_Reg 0x4     // r/w  default ffff\r
28 #define TCA6424_Invert_Reg              0x8     // r/w  default 0\r
29 #define TCA6424_Config_Reg              0x0c    // r/w  default ffff\r
30 \r
31 \r
32 #define TCA6424_Auto_InputLevel_Reg     0x80  \r
33 #define TCA6424_Auto_OutputLevel_Reg    0x84\r
34 #define TCA6424_Auto_Invert_Reg                 0x88\r
35 #define TCA6424_Auto_Config_Reg                 0x8c\r
36 \r
37 #define TCA6424_OUTREGLOCK\r
38 #define TCA6424_INPUTREGLOCK\r
39 #define TCA6424_CONFIGREGLOCK\r
40 \r
41 #define tca6424getbit(a,num) (((a)>>(num))&0x01)\r
42 #define tca6424setbit(a,num) ((a)|(0x01<<(num)))\r
43 #define tca6424clearbit(a,num) ((a)&(~(0x01<<(num))))\r
44 \r
45 #define TCA6424_I2C_RATE 400*1000\r
46 \r
47 #endif\r