rk3026: i2s add several attempts to double confirm i2s frac effect
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk3026 / board-rk3026-86v-sdmmc-config.c
1 /*****************************************************************************************
2  * arch/arm/mach-rkxx/baord-xxx-sdmmc-config.c
3  *
4  * Copyright (C) 2013 ROCKCHIP, Inc.
5  *
6  * Description: 
7  *     define the gpio for SD-MMC-SDIO-Wifi functions  according to your own projects.
8  *
9  * Author: Michael Xie
10  *         15 Jan,2013
11  * E-mail: xbw@rock-chips.com
12  *
13  ******************************************************************************************/
14
15 /*
16 ** If you select the macro of CONFIG_SDMMC0_RK29_WRITE_PROTECT, You must define the following values.
17 ** Otherwise, there is no need to define the following values¡£
18 */
19 //#define SDMMC0_WRITE_PROTECT_PIN                  RK30_PIN3_PB2       //According to your own project to set the value of write-protect-pin.
20 //#define SDMMC0_WRITE_PROTECT_ENABLE_VALUE     GPIO_HIGH
21
22 /*
23 ** If you select the macro of CONFIG_SDMMC1_RK29_WRITE_PROTECT, You must define the following values.
24 ** Otherwise, there is no need to define the following values¡£
25 */
26 //#define SDMMC1_WRITE_PROTECT_PIN                  RK30_PIN3_PB3       //According to your own project to set the value of write-protect-pin.
27 //#define SDMMC1_WRITE_PROTECT_ENABLE_VALUE     GPIO_HIGH
28     
29 /*
30 ** If you select the macro of CONFIG_RK29_SDIO_IRQ_FROM_GPIO, You must define the following values.
31 ** Otherwise, there is no need to define the following values¡£
32 */
33 //#define RK29SDK_WIFI_SDIO_CARD_INT         RK30_PIN3_PD2
34
35
36 /*
37 * define sdcard PowerEn-pin
38 */
39 #define RK29SDK_SD_CARD_PWR_EN                  INVALID_GPIO
40 #define RK29SDK_SD_CARD_PWR_EN_LEVEL            GPIO_LOW 
41 int rk31sdk_get_sdmmc0_pin_io_voltage(void)
42 {
43     int voltage;
44 #define RK31SDK_SET_SDMMC0_PIN_VOLTAGE
45
46     /**************************************************************************************
47     **  Please tell me how much voltage of your SDMMC0-pin in your project. 
48     **
49     **     ÀýÈç: ÓеÄÏîÄ¿£¬ËüµÄSDMMC0ËùÔÚµÄRKÖ÷¿ØµÄIO×飬ÏëÓÃ1.8V, ¶ø¿¨±¾ÉíÓÃ3.3V, 
50     **  ¶øÖмäͨ¹ý¸öµçƽת»».ÄÇô£¬Äú´Ëʱ£¬Ó¦¸ÃÉèÖÃÏÂÃæµÄvoltageֵΪ 1.8V(¼´1800mv)
51     ***************************************************************************************/
52     voltage = 3300;  //default the voltage 3300mv. 
53
54     return voltage;
55 }
56
57 /*
58 * define the card-detect-pin.
59 */
60 #define RK29SDK_SD_CARD_DETECT_N                RK30_PIN2_PA7  //According to your own project to set the value of card-detect-pin.
61 #define RK29SDK_SD_CARD_INSERT_LEVEL            GPIO_LOW       // set the voltage of insert-card. Please pay attention to the default setting.
62
63 /*
64 * Define wifi module's power and reset gpio, and gpio sensitive level.
65 * Please set the value according to your own project.
66 *
67 * Well, you just own engineering module to set the value in the corresponding module branch.
68 * Otherwise, you do not define this macro, eliminate it.
69 *
70 */          
71 #if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU) || defined(CONFIG_RTL8723AU) || defined(CONFIG_MT7601)
72     //#define CONFIG_USB_WIFI_POWER_CONTROLED_BY_GPIO
73     #define RK30SDK_WIFI_GPIO_POWER_N               RK30_PIN0_PD3           
74     #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE    GPIO_LOW//GPIO_HIGH        
75     
76 #elif defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RKWIFI) || defined(CONFIG_RTL8189ES)
77     #define RK30SDK_WIFI_GPIO_POWER_N               RK30_PIN3_PD3                 
78     #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE    GPIO_HIGH
79
80     #define RK30SDK_WIFI_GPIO_RESET_N             RK30_PIN0_PC2 // RK30_PIN2_PA7
81     #define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE    GPIO_HIGH 
82
83 #elif defined(CONFIG_MT5931_MT6622) || defined(CONFIG_MT5931)
84
85         #ifdef  CONFIG_MACH_RK3168_LR097 
86         #define RK30SDK_WIFI_GPIO_POWER_N               RK30_PIN3_PD0 
87         #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE    GPIO_HIGH
88
89         //#define RK30SDK_WIFI_GPIO_RESET_N                 RK30_PIN3_PD1
90         //#define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE    GPIO_HIGH
91
92         #else
93         #define RK30SDK_WIFI_GPIO_POWER_N               RK30_PIN0_PA5
94         #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE    GPIO_HIGH
95
96         #define RK30SDK_WIFI_GPIO_RESET_N               RK30_PIN3_PD1
97         #define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE    GPIO_HIGH       
98         #endif
99
100 #elif defined(CONFIG_MT6620)
101     #define COMBO_MODULE_MT6620_CDT    0  // to control antsel2,antsel3 and gps_lan foot when using AcSip or Cdtech chip. 
102                                               //- 1--use Cdtech chip; 0--unuse CDT chip
103
104     //power, PMU_EN//hjc test
105     #define RK30SDK_WIFI_GPIO_POWER_N                   RK30_PIN0_PB5          
106     #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE        GPIO_HIGH        
107     //reset, DAIRST,SYSRST_B
108     #define RK30SDK_WIFI_GPIO_RESET_N                   RK30_PIN3_PD0
109     #define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE        GPIO_HIGH 
110     //VDDIO
111     //#define RK30SDK_WIFI_GPIO_VCCIO_WL                  RK30_PIN0_PD2 //You do not get control of the foot, and you do not need to define the macro 
112     //#define RK30SDK_WIFI_GPIO_VCCIO_WL_ENABLE_VALUE     GPIO_HIGH
113     //WIFI_INT_B
114     #define RK30SDK_WIFI_GPIO_WIFI_INT_B                RK30_PIN3_PD2
115     #define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE   GPIO_HIGH 
116     //BGF_INT_B
117     #define RK30SDK_WIFI_GPIO_BGF_INT_B                 RK30_PIN0_PA5
118     #define RK30SDK_WIFI_GPIO_BGF_INT_B_ENABLE_VALUE    GPIO_HIGH 
119     //GPS_SYNC
120     #define RK30SDK_WIFI_GPIO_GPS_SYNC                  RK30_PIN3_PD1
121     #define RK30SDK_WIFI_GPIO_GPS_SYNC_ENABLE_VALUE     GPIO_HIGH 
122
123     #if COMBO_MODULE_MT6620_CDT
124     //ANTSEL2
125     #define RK30SDK_WIFI_GPIO_ANTSEL2                   RK30_PIN4_PD4
126     #define RK30SDK_WIFI_GPIO_ANTSEL2_ENABLE_VALUE      GPIO_LOW    //use 6620 in CDT chip, LOW--work; High--no work.
127     //ANTSEL3
128     #define RK30SDK_WIFI_GPIO_ANTSEL3                   RK30_PIN4_PD3
129     #define RK30SDK_WIFI_GPIO_ANTSEL3_ENABLE_VALUE      GPIO_HIGH    //use 6620 in CDT chip, High--work; Low--no work..
130     //GPS_LAN
131     #define RK30SDK_WIFI_GPIO_GPS_LAN                   RK30_PIN4_PD6
132     #define RK30SDK_WIFI_GPIO_GPS_LAN_ENABLE_VALUE      GPIO_HIGH    //use 6620 in CDT chip, High--work; Low--no work..
133     #endif // #if COMBO_MODULE_MT6620_CDT--#endif
134 #endif 
135
136 #ifndef RK30SDK_WIFI_GPIO_WIFI_INT_B
137 #define RK30SDK_WIFI_GPIO_WIFI_INT_B              INVALID_GPIO
138 #define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE   GPIO_HIGH 
139 #endif
140
141 int rk31sdk_get_sdio_wifi_voltage(void)
142 {
143     int voltage;
144     
145     /******************************************************************************
146     **  Please tell me how much wifi-module uses voltage in your project.  
147     ******************************************************************************/
148 #if defined(CONFIG_BCM4329) || defined(CONFIG_BCM4319) || defined(CONFIG_RKWIFI)
149     voltage = 1800 ; //power 1800mV
150     
151 #elif defined(CONFIG_MT5931_MT6622)||defined(CONFIG_MT5931)
152     voltage = 1800 ; //power 1800V
153 #elif defined(CONFIG_MT6620) 
154     voltage = 1800 ; //power 2800V
155 #elif defined(CONFIG_RDA5990)||defined(CONFIG_RTL8723AS)  
156     voltage = 3300 ; //power 3300V
157 #else
158     //default, sdio use 3.0V
159     voltage = 3000 ; //power 3000V
160 #endif
161
162     return voltage;
163 }
164
165
166