6abe505a5e253fc84f6d00c96de7a9fe3ca39bda
[profile/mobile/platform/kernel/u-boot-tm1.git] / drivers / i2c / sc8830_i2c_cfg.h
1 /******************************************************************************
2  ** File Name:      sc8810_i2c_cfg.h                                                 *
3  ** Author:         liuhao                                                   *
4  ** DATE:           06/28/2010                                                *
5  ** Copyright:      2010 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:    This file define the basic hw interfaces of I2C device.      *
7  ******************************************************************************
8
9  ******************************************************************************
10  **                        Edit History                                       *
11  ** ------------------------------------------------------------------------- *
12  ** DATE           NAME             DESCRIPTION                               *
13  ** 06/28/2010     liuhao     Create.                                   *
14  ******************************************************************************/
15
16 #ifndef _SC8810_I2C_CFG_H_
17 #define _SC8810_I2C_CFG_H_
18 /*----------------------------------------------------------------------------*
19  **                         Dependencies                                      *
20  **------------------------------------------------------------------------- */
21 #include "asm/arch/sci_types.h"
22
23 #include "i2c_phy.h"
24
25 /**---------------------------------------------------------------------------*
26  **                             Compiler Flag                                 *
27  **--------------------------------------------------------------------------*/
28 #ifdef   __cplusplus
29 extern   "C"
30 {
31 #endif
32
33 /**---------------------------------------------------------------------------*
34  **                         Debugging Flag                                    *
35  **---------------------------------------------------------------------------*/
36 //#define DEBUG_IIC
37 //#ifdef DEBUG_IIC
38 //#define IIC_PRINT   SCI_TRACE_LOW
39 //#else
40 #define IIC_PRINT
41 //#endif
42
43 /**---------------------------------------------------------------------------*
44 **                               Micro Define                                **
45 **---------------------------------------------------------------------------*/
46 #ifndef I2C_DEV_MAX
47 #define I2C_DEV_MAX 8
48 #endif
49
50 #define I2C_BUS_MAX 6
51 #define I2C_ID_MAX 6
52
53 #define I2C_PORT_NUM 0
54
55 typedef struct
56 {
57     uint32 phy_id;
58     uint32 base_addr;
59 } I2C_BASE_INFO;
60
61 typedef struct
62 {
63     uint32 phy_id;
64     uint32 sda_pin;
65     uint32 scl_pin;
66 } I2C_GPIO_INFO;
67
68 typedef struct
69 {
70     uint32 logic_id;
71     uint32 phy_id;
72     uint32 port_id;
73     I2C_PHY_FUN *phy_fun;
74 } I2C_PHY_CFG;
75 /**----------------------------------------------------------------------------*
76 **                         Local Function Prototype                           **
77 **----------------------------------------------------------------------------*/
78
79
80 /**----------------------------------------------------------------------------*
81 **                           Function Prototype                               **
82 **----------------------------------------------------------------------------*/
83
84 /**----------------------------------------------------------------------------*
85 **                         Compiler Flag                                      **
86 **----------------------------------------------------------------------------*/
87 #ifdef   __cplusplus
88 }
89 #endif
90 /**---------------------------------------------------------------------------*/
91 #endif
92 // End