rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2005 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | |
| 36 | /***************************************************************************** |
| 37 | * |
| 38 | * Filename: |
| 39 | * --------- |
| 40 | * gpio_setting.c |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * Dragonfly |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * This Module defines the GPIO and GPO settings. |
| 49 | * |
| 50 | * Author: |
| 51 | * ------- |
| 52 | * ------- |
| 53 | * |
| 54 | *============================================================================ |
| 55 | * HISTORY |
| 56 | * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 57 | *------------------------------------------------------------------------------ |
| 58 | * removed! |
| 59 | * removed! |
| 60 | * removed! |
| 61 | * |
| 62 | * removed! |
| 63 | * removed! |
| 64 | * removed! |
| 65 | * |
| 66 | * removed! |
| 67 | * removed! |
| 68 | * removed! |
| 69 | * |
| 70 | * removed! |
| 71 | * removed! |
| 72 | * removed! |
| 73 | * |
| 74 | * removed! |
| 75 | * removed! |
| 76 | * removed! |
| 77 | * |
| 78 | * removed! |
| 79 | * removed! |
| 80 | * removed! |
| 81 | * |
| 82 | * removed! |
| 83 | * removed! |
| 84 | * removed! |
| 85 | * |
| 86 | * removed! |
| 87 | * removed! |
| 88 | * removed! |
| 89 | * |
| 90 | * removed! |
| 91 | * removed! |
| 92 | * removed! |
| 93 | * |
| 94 | * removed! |
| 95 | * removed! |
| 96 | * removed! |
| 97 | * |
| 98 | * removed! |
| 99 | * removed! |
| 100 | * removed! |
| 101 | * |
| 102 | * removed! |
| 103 | * removed! |
| 104 | * removed! |
| 105 | * |
| 106 | * removed! |
| 107 | * removed! |
| 108 | * removed! |
| 109 | * |
| 110 | * removed! |
| 111 | * removed! |
| 112 | * removed! |
| 113 | * |
| 114 | * removed! |
| 115 | * removed! |
| 116 | * removed! |
| 117 | * |
| 118 | * removed! |
| 119 | * removed! |
| 120 | * removed! |
| 121 | * |
| 122 | * removed! |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * |
| 126 | * removed! |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * |
| 130 | * removed! |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * |
| 134 | * removed! |
| 135 | * removed! |
| 136 | * removed! |
| 137 | * |
| 138 | * removed! |
| 139 | * removed! |
| 140 | * removed! |
| 141 | * |
| 142 | * removed! |
| 143 | * removed! |
| 144 | * removed! |
| 145 | * |
| 146 | * removed! |
| 147 | * removed! |
| 148 | * removed! |
| 149 | * |
| 150 | * removed! |
| 151 | * removed! |
| 152 | * removed! |
| 153 | * |
| 154 | * removed! |
| 155 | * removed! |
| 156 | * |
| 157 | * |
| 158 | *------------------------------------------------------------------------------ |
| 159 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 160 | *============================================================================ |
| 161 | ****************************************************************************/ |
| 162 | #ifdef __CUST_NEW__ |
| 163 | #include "gpio_def.h" |
| 164 | #include "drv_comm.h" |
| 165 | #include "reg_base.h" |
| 166 | //#include "gpio_hw.h" |
| 167 | //#include "gpio_sw.h" |
| 168 | #include "gpio_drv.h" |
| 169 | #include "kal_general_types.h" |
| 170 | #include "kal_public_api.h" |
| 171 | |
| 172 | #include "kal_general_types.h" |
| 173 | #include "drv_gpio.h" |
| 174 | #include "drvpdn.h" |
| 175 | |
| 176 | |
| 177 | #define GPIO_PORTNULL_MODE 0 |
| 178 | #define GPO_PORTNULL_MODE 0 |
| 179 | #define GPIO_PORTNULL_DIR 0 |
| 180 | #define GPIO_PORTNULL_PULL 0 |
| 181 | #define GPIO_PORTNULL_INV 0 |
| 182 | #define GPIO_PORTNULL_OUTPUT_LEVEL 0 |
| 183 | #define GPO_PORTNULL_OUTPUT_LEVEL 0 |
| 184 | #define GPIO_PORTNULL_PULL_SEL 0 |
| 185 | |
| 186 | #define MODE0_GPIONULL 0 |
| 187 | #define MODE1_GPIONULL 0 |
| 188 | #define MODE2_GPIONULL 0 |
| 189 | #define MODE3_GPIONULL 0 |
| 190 | #define MODE4_GPIONULL 0 |
| 191 | #define MODE5_GPIONULL 0 |
| 192 | #define MODE6_GPIONULL 0 |
| 193 | #define MODE7_GPIONULL 0 |
| 194 | |
| 195 | #define DIR_OUT_GPIONULL 0 |
| 196 | #define DIR_IN_GPIONULL 0 |
| 197 | |
| 198 | /************************************************************************************/ |
| 199 | /************************************************************************************/ |
| 200 | /************************************************************************************/ |
| 201 | /******** If DRV_GPIO is not off, we will open to use GPIO_DRV_TOOL ****************/ |
| 202 | |
| 203 | #if !defined(DRV_GPIO_OFF) |
| 204 | #if defined(DRV_GPIO_REG_AS_6205B) || defined(DRV_GPIO_REG_AS_6218B) || defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_TK6516) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6270A) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6251) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6253E_1)|| defined(DRV_GPIO_REG_AS_6256)||defined(DRV_GPIO_REG_AS_6290) |
| 205 | #define __CHIP_SUPP_GPIO_DRV_TOOL__ |
| 206 | #else |
| 207 | #error "No support driver customization tool for this chip." |
| 208 | #endif |
| 209 | #endif //#if !defined(DRV_GPIO_OFF) |
| 210 | |
| 211 | |
| 212 | |
| 213 | /************************************************************************************/ |
| 214 | /************************************************************************************/ |
| 215 | /************************************************************************************/ |
| 216 | /***************General macro to calculate GPIO MODE register************************/ |
| 217 | |
| 218 | |
| 219 | #if defined(DRV_GPIO_MODE_4BITS) |
| 220 | #if defined(GPIO_MODE_32BIT_LENGTH) |
| 221 | #define GPIO_MODE_4BITS_REG_VAL(port0, port1, port2, port3, port4, port5, port6, port7) \ |
| 222 | ((GPIO_PORT##port0##_MODE) | (GPIO_PORT##port1##_MODE<<4) | (GPIO_PORT##port2##_MODE<<8) | \ |
| 223 | (GPIO_PORT##port3##_MODE<<12) | (GPIO_PORT##port4##_MODE<<16) | (GPIO_PORT##port5##_MODE<<20) | \ |
| 224 | (GPIO_PORT##port6##_MODE<<24) | (GPIO_PORT##port7##_MODE<<28)) |
| 225 | #else //defined(GPIO_MODE_32BIT_LENGTH) |
| 226 | /* General macro to calculate GPIO MODE (with 4 bits per mode) register. */ |
| 227 | #define GPIO_MODE_4BITS_REG_VAL(port0, port1, port2, port3) \ |
| 228 | ((GPIO_PORT##port0##_MODE) | (GPIO_PORT##port1##_MODE<<4) | (GPIO_PORT##port2##_MODE<<8) | \ |
| 229 | (GPIO_PORT##port3##_MODE<<12)) |
| 230 | #endif // define(GPIO_MODE_32BIT_LENGTH) |
| 231 | #elif defined(DRV_GPIO_MODE_3BITS) |
| 232 | #define GPIO_MODE_3BITS_REG_VAL(port0,port1,port2,port3,port4) \ |
| 233 | ((GPIO_PORT##port0##_MODE) | (GPIO_PORT##port1##_MODE<<3) | (GPIO_PORT##port2##_MODE<<6) | \ |
| 234 | (GPIO_PORT##port3##_MODE<<9) | (GPIO_PORT##port4##_MODE<<12)) |
| 235 | #else //defined(DRV_GPIO_MODE_4BITS) |
| 236 | |
| 237 | #define GPIO_MODE_REG_VAL(port0, port1, port2, port3, port4, port5, port6, port7) \ |
| 238 | ((GPIO_PORT##port0##_MODE) | (GPIO_PORT##port1##_MODE<<2) | (GPIO_PORT##port2##_MODE<<4) | \ |
| 239 | (GPIO_PORT##port3##_MODE<<6) | (GPIO_PORT##port4##_MODE<<8) | (GPIO_PORT##port5##_MODE<<10) | \ |
| 240 | (GPIO_PORT##port6##_MODE<<12) | (GPIO_PORT##port7##_MODE<<14)) |
| 241 | #endif //defined(DRV_GPIO_MODE_4BITS) |
| 242 | |
| 243 | |
| 244 | /************************************************************************************/ |
| 245 | /************************************************************************************/ |
| 246 | /************************************************************************************/ |
| 247 | /****************** General macro to calculate GPO MODE register********************/ |
| 248 | |
| 249 | |
| 250 | #define GPO_MODE_REG_VAL(port0, port1, port2, port3, port4, port5, port6, port7) \ |
| 251 | ((GPO_PORT##port0##_MODE) | (GPO_PORT##port1##_MODE<<2) | (GPO_PORT##port2##_MODE<<4) | \ |
| 252 | (GPO_PORT##port3##_MODE<<6) | (GPO_PORT##port4##_MODE<<8) | (GPO_PORT##port5##_MODE<<10) | \ |
| 253 | (GPO_PORT##port6##_MODE<<12) | (GPO_PORT##port7##_MODE<<14)) |
| 254 | |
| 255 | |
| 256 | |
| 257 | /************************************************************************************/ |
| 258 | /************************************************************************************/ |
| 259 | /************************************************************************************/ |
| 260 | /************* General macro to calculate GPIO register with 1 bit unit**************/ |
| 261 | |
| 262 | #if !defined(DRV_GPIO_REG_AS_6290) |
| 263 | #define GPIO_HWORD_REG_FOR_1BIT(name, port0, port1, port2, port3, port4, port5, port6, port7, port8, port9, \ |
| 264 | port10, port11, port12, port13, port14, port15) \ |
| 265 | ((GPIO_PORT##port0##_##name) | (GPIO_PORT##port1##_##name<<1) | (GPIO_PORT##port2##_##name<<2) | \ |
| 266 | (GPIO_PORT##port3##_##name<<3) | (GPIO_PORT##port4##_##name<<4) | (GPIO_PORT##port5##_##name<<5) | \ |
| 267 | (GPIO_PORT##port6##_##name<<6) | (GPIO_PORT##port7##_##name<<7) | (GPIO_PORT##port8##_##name<<8) | \ |
| 268 | (GPIO_PORT##port9##_##name<<9) | (GPIO_PORT##port10##_##name<<10) | (GPIO_PORT##port11##_##name<<11) | \ |
| 269 | (GPIO_PORT##port12##_##name<<12) | (GPIO_PORT##port13##_##name<<13) | (GPIO_PORT##port14##_##name<<14) | \ |
| 270 | (GPIO_PORT##port15##_##name<<15)) |
| 271 | #else |
| 272 | #define GPIO_HWORD_REG_FOR_1BIT(name, port0, port1, port2, port3, port4, port5, port6, port7, port8, port9, \ |
| 273 | port10, port11, port12, port13, port14, port15, port16, port17, port18, port19,\ |
| 274 | port20,port21, port22, port23, port24, port25, port26, port27, port28, port29, \ |
| 275 | port30, port31) \ |
| 276 | ((GPIO_PORT##port0##_##name) | (GPIO_PORT##port1##_##name<<1) | (GPIO_PORT##port2##_##name<<2) | \ |
| 277 | (GPIO_PORT##port3##_##name<<3) | (GPIO_PORT##port4##_##name<<4) | (GPIO_PORT##port5##_##name<<5) | \ |
| 278 | (GPIO_PORT##port6##_##name<<6) | (GPIO_PORT##port7##_##name<<7) | (GPIO_PORT##port8##_##name<<8) | \ |
| 279 | (GPIO_PORT##port9##_##name<<9) | (GPIO_PORT##port10##_##name<<10) | (GPIO_PORT##port11##_##name<<11) | \ |
| 280 | (GPIO_PORT##port12##_##name<<12) | (GPIO_PORT##port13##_##name<<13) | (GPIO_PORT##port14##_##name<<14) | \ |
| 281 | (GPIO_PORT##port15##_##name<<15) | (GPIO_PORT##port16##_##name<<16) | (GPIO_PORT##port17##_##name<<17) | \ |
| 282 | (GPIO_PORT##port18##_##name<<18) | (GPIO_PORT##port19##_##name<<19) | (GPIO_PORT##port20##_##name<<20) | \ |
| 283 | (GPIO_PORT##port21##_##name<<21) | (GPIO_PORT##port22##_##name<<22) | (GPIO_PORT##port23##_##name<<23) | \ |
| 284 | (GPIO_PORT##port24##_##name<<24) | (GPIO_PORT##port25##_##name<<25) | (GPIO_PORT##port26##_##name<<26) | \ |
| 285 | (GPIO_PORT##port27##_##name<<27) | (GPIO_PORT##port28##_##name<<28) | (GPIO_PORT##port29##_##name<<29) | \ |
| 286 | (GPIO_PORT##port30##_##name<<30) | (GPIO_PORT##port31##_##name<<31)) |
| 287 | #endif |
| 288 | |
| 289 | /************************************************************************************/ |
| 290 | /************************************************************************************/ |
| 291 | /************************************************************************************/ |
| 292 | /***************** General macro to calculate GPO register with 1 bit unit.**********/ |
| 293 | |
| 294 | #define GPO_HWORD_REG_FOR_1BIT(name, port0, port1, port2, port3, port4, port5, port6, port7, port8, port9, \ |
| 295 | port10, port11, port12, port13, port14, port15) \ |
| 296 | ((GPO_PORT##port0##_##name) | (GPO_PORT##port1##_##name<<1) | (GPO_PORT##port2##_##name<<2) | \ |
| 297 | (GPO_PORT##port3##_##name<<3) | (GPO_PORT##port4##_##name<<4) | (GPO_PORT##port5##_##name<<5) | \ |
| 298 | (GPO_PORT##port6##_##name<<6) | (GPO_PORT##port7##_##name<<7) | (GPO_PORT##port8##_##name<<8) | \ |
| 299 | (GPO_PORT##port9##_##name<<9) | (GPO_PORT##port10##_##name<<10) | (GPO_PORT##port11##_##name<<11) | \ |
| 300 | (GPO_PORT##port12##_##name<<12) | (GPO_PORT##port13##_##name<<13) | (GPO_PORT##port14##_##name<<14) | \ |
| 301 | (GPO_PORT##port15##_##name<<15)) |
| 302 | |
| 303 | |
| 304 | /************************************************************************************/ |
| 305 | /************************************************************************************/ |
| 306 | /************************************************************************************/ |
| 307 | /*****General macro to calculate GPIO word-length variable value with 1 bit unit.****/ |
| 308 | |
| 309 | |
| 310 | #define GPIO_WORD_VAR_FOR_1BIT(name, port0, port1, port2, port3, port4, port5, port6, port7, port8, port9, port10, \ |
| 311 | port11, port12, port13, port14, port15, port16, port17, port18, port19, port20, port21, \ |
| 312 | port22, port23, port24, port25, port26, port27, port28, port29, port30, port31) \ |
| 313 | ((name##_GPIO##port0) | (name##_GPIO##port1<<1) | (name##_GPIO##port2<<2) | (name##_GPIO##port3<<3) | (name##_GPIO##port4<<4) | \ |
| 314 | (name##_GPIO##port5<<5) | (name##_GPIO##port6<<6) | (name##_GPIO##port7<<7) | (name##_GPIO##port8<<8) | (name##_GPIO##port9<<9) | \ |
| 315 | (name##_GPIO##port10<<10) | (name##_GPIO##port11<<11) | (name##_GPIO##port12<<12) | (name##_GPIO##port13<<13) | (name##_GPIO##port14<<14) | \ |
| 316 | (name##_GPIO##port15<<15) | (name##_GPIO##port16<<16) | (name##_GPIO##port17<<17) | (name##_GPIO##port18<<18) | (name##_GPIO##port19<<19) | \ |
| 317 | (name##_GPIO##port20<<20) | (name##_GPIO##port21<<21) | (name##_GPIO##port22<<22) | (name##_GPIO##port23<<23) | (name##_GPIO##port24<<24) | \ |
| 318 | (name##_GPIO##port25<<25) | (name##_GPIO##port26<<26) | (name##_GPIO##port27<<27) | (name##_GPIO##port28<<28) | (name##_GPIO##port29<<29) | \ |
| 319 | (name##_GPIO##port30<<30) | (name##_GPIO##port31<<31)) |
| 320 | |
| 321 | |
| 322 | |
| 323 | /****************************************************************************************/ |
| 324 | /****************************************************************************************/ |
| 325 | /****************************************************************************************/ |
| 326 | /*********************************__CHIP_SUPP_GPIO_DRV_TOOL__****************************/ |
| 327 | |
| 328 | #if defined(__CHIP_SUPP_GPIO_DRV_TOOL__) |
| 329 | |
| 330 | /***************************GPIO MODE IS NEITHER 4 BIT NOR 3 BIT**********START*********/ |
| 331 | |
| 332 | #if !defined(DRV_GPIO_MODE_4BITS) && !defined(DRV_GPIO_MODE_3BITS) |
| 333 | /* GPIO mode register values for different platforms. */ |
| 334 | |
| 335 | #if defined(DRV_GPIO_REG_AS_TK6516) |
| 336 | #define GPIO_MODE_REG1 GPIO_MODE_REG_VAL(0, 1, 2, 3, NULL, NULL, NULL, NULL) |
| 337 | #else /* DRV_GPIO_REG_AS_TK6516 */ |
| 338 | #define GPIO_MODE_REG1 GPIO_MODE_REG_VAL(0, 1, 2, 3, 4, 5, 6, 7) |
| 339 | #define GPIO_MODE_REG2 GPIO_MODE_REG_VAL(8, 9, 10, 11, 12, 13, 14, 15) |
| 340 | #if defined(DRV_GPIO_REG_AS_6205B) |
| 341 | #define GPIO_MODE_REG3 GPIO_MODE_REG_VAL(16, 17, 18, 19, 20, 21, NULL, NULL) |
| 342 | #define GPO_MODE_REG GPO_MODE_REG_VAL(0, 1, 2, 3, NULL, NULL, NULL, NULL) |
| 343 | #elif defined(DRV_GPIO_REG_AS_6270A) |
| 344 | #define GPIO_MODE_REG3 GPIO_MODE_REG_VAL(16, 17, 18, 19, 20, 21, 22, 23) |
| 345 | #define GPIO_MODE_REG4 GPIO_MODE_REG_VAL(24, 25, 26, 27, NULL, NULL, NULL, NULL) |
| 346 | #else /* DRV_GPIO_REG_AS_6270A */ |
| 347 | #define GPIO_MODE_REG3 GPIO_MODE_REG_VAL(16, 17, 18, 19, 20, 21, 22, 23) |
| 348 | #define GPIO_MODE_REG4 GPIO_MODE_REG_VAL(24, 25, 26, 27, 28, 29, 30, 31) |
| 349 | #define GPIO_MODE_REG5 GPIO_MODE_REG_VAL(32, 33, 34, 35, 36, 37, 38, 39) |
| 350 | #define GPIO_MODE_REG6 GPIO_MODE_REG_VAL(40, 41, 42, 43, 44, 45, 46, 47) |
| 351 | #if defined(DRV_GPIO_REG_AS_6218B) |
| 352 | #define GPO_MODE_REG GPO_MODE_REG_VAL(0, 1, 2, NULL, NULL, NULL, NULL, NULL) |
| 353 | #elif defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6225) |
| 354 | #define GPIO_MODE_REG7 GPIO_MODE_REG_VAL(48, 49, 50, 51, 52, 53, 54, NULL) |
| 355 | #if defined(DRV_GPIO_REG_AS_6219) |
| 356 | #define GPO_MODE_REG GPO_MODE_REG_VAL(0, 1, 2, 3, 4, NULL, NULL, NULL) |
| 357 | #elif defined(DRV_GPIO_REG_AS_6225) |
| 358 | #define GPO_MODE_REG GPO_MODE_REG_VAL(0, 1, 2, 3, NULL, NULL, NULL, NULL) |
| 359 | #endif |
| 360 | #elif defined(DRV_GPIO_REG_AS_6227) |
| 361 | #define GPIO_MODE_REG7 GPIO_MODE_REG_VAL(48, 49, 50, 51, 52, 53, 54, 55) |
| 362 | #define GPIO_MODE_REG8 GPIO_MODE_REG_VAL(56, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 363 | #define GPO_MODE_REG GPO_MODE_REG_VAL(0, 1, 2, 3, 4, NULL, NULL, NULL) |
| 364 | #elif defined(DRV_GPIO_REG_AS_6228) |
| 365 | #define GPIO_MODE_REG7 GPIO_MODE_REG_VAL(48, 49, 50, 51, 52, 53, 54, 55) |
| 366 | #define GPIO_MODE_REG8 GPIO_MODE_REG_VAL(56, 57, 58, 59, 60, 61, 62, 63) |
| 367 | #define GPIO_MODE_REG9 GPIO_MODE_REG_VAL(64, 65, 66, 67, 68, 69, 70, 71) |
| 368 | #define GPIO_MODE_REG10 GPIO_MODE_REG_VAL(72, 73, 74, NULL, NULL, NULL, NULL, NULL) |
| 369 | #define GPO_MODE_REG GPO_MODE_REG_VAL(0, 1, 2, NULL, NULL, NULL, NULL, NULL) |
| 370 | #elif defined(DRV_GPIO_REG_AS_6223) |
| 371 | #define GPIO_MODE_REG7 GPIO_MODE_REG_VAL(48, 49, 50, 51, 52, NULL, NULL, NULL) |
| 372 | #elif defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E) |
| 373 | #define GPIO_MODE_REG7 GPIO_MODE_REG_VAL(48, 49, 50, 51, 52, 53, 54, 55) |
| 374 | #define GPIO_MODE_REG8 GPIO_MODE_REG_VAL(56, 57, 58, 59, 60, 61, 62, 63) |
| 375 | #if defined(DRV_GPIO_REG_AS_6236) |
| 376 | #define GPIO_MODE_REG9 GPIO_MODE_REG_VAL(64, 65, 66, 67, NULL, NULL, NULL, NULL) |
| 377 | #else // defined(DRV_GPIO_REG_AS_6236) |
| 378 | #define GPIO_MODE_REG9 GPIO_MODE_REG_VAL(64, 65, 66, 67, 68, 69, 70, 71) |
| 379 | #if defined(DRV_GPIO_REG_AS_6238) |
| 380 | #define GPIO_MODE_REGA GPIO_MODE_REG_VAL(72, 73, 74, 75, 76, 77, 78, 79) |
| 381 | #define GPIO_MODE_REGB GPIO_MODE_REG_VAL(80, 81, 82, 83, 84, NULL, NULL, NULL) |
| 382 | #elif defined(DRV_GPIO_REG_AS_6235) |
| 383 | #define GPIO_MODE_REGA GPIO_MODE_REG_VAL(72, 73, 74, 75, 76, 77, 78, NULL) |
| 384 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 385 | #define GPIO_MODE_REGA GPIO_MODE_REG_VAL(72, 73, 74, 75, 76, 77, 78, 79) |
| 386 | #define GPIO_MODE_REGB GPIO_MODE_REG_VAL(80, 81, 82, 83, 84, 85, 86, 87) |
| 387 | #define GPIO_MODE_REGC GPIO_MODE_REG_VAL(88, 89, 90, 91, 92, 93, 94, 95) |
| 388 | #if defined(DRV_GPIO_REG_AS_6268A) |
| 389 | #define GPIO_MODE_REGD GPIO_MODE_REG_VAL(96, 97, 98, 99, 100, NULL, NULL, NULL) |
| 390 | #elif defined(DRV_GPIO_REG_AS_6268) |
| 391 | #define GPIO_MODE_REGD GPIO_MODE_REG_VAL(96, 97, 98, 99, NULL, NULL, NULL, NULL) |
| 392 | #elif defined(DRV_GPIO_REG_AS_6276) |
| 393 | #define GPIO_MODE_REGD GPIO_MODE_REG_VAL(96, 97, 98, 99, 100, 101, 102, 103) |
| 394 | #define GPIO_MODE_REGE GPIO_MODE_REG_VAL(104, 105, 106, 107, 108, NULL, NULL, NULL) |
| 395 | #endif |
| 396 | #elif defined(DRV_GPIO_REG_AS_6253T) |
| 397 | #define GPIO_MODE_REGA GPIO_MODE_REG_VAL(72, 73, 74, 75, 76, 77, 78, 79) |
| 398 | #if defined(DRV_GPIO_6253_MODE11_DEFAULT) |
| 399 | #define GPIO_PORT82FOR6253_MODE MODE_1 //GPIO82 for MT6253 should be fixed to mode1 |
| 400 | #define GPIO_MODE_REGB GPIO_MODE_REG_VAL(80, 81, 82FOR6253, NULL, NULL, NULL, NULL, NULL) |
| 401 | #else //defined(DRV_GPIO_6253_MODE11_DEFAULT) |
| 402 | #define GPIO_MODE_REGB GPIO_MODE_REG_VAL(80, 81, NULL, NULL, NULL, NULL, NULL, NULL) |
| 403 | #endif //defined(DRV_GPIO_6253_MODE11_DEFAULT) |
| 404 | #endif |
| 405 | #endif // defined(DRV_GPIO_REG_AS_6236) |
| 406 | #endif |
| 407 | #endif /* DRV_GPIO_REG_AS_6205B */ |
| 408 | #endif /* DRV_GPIO_REG_AS_TK6516 */ |
| 409 | |
| 410 | |
| 411 | /***************************GPIO MODE IS NEITHER 4 BIT NOR 3 BIT**********END*********/ |
| 412 | |
| 413 | |
| 414 | /***************************GPIO MODE IS 4 BIT ***********************START***********/ |
| 415 | |
| 416 | #elif defined(DRV_GPIO_MODE_4BITS) // DRV_GPIO_MODE_4BITS is defined |
| 417 | #if defined(DRV_GPIO_REG_AS_6253E_1) |
| 418 | #define GPIO_MODE_REG1 GPIO_MODE_4BITS_REG_VAL(0, 1, 2, 3, 4, 5, 6, 7) |
| 419 | #define GPIO_MODE_REG2 GPIO_MODE_4BITS_REG_VAL(8, 9, 10, 11, 12, 13, 14, 15) |
| 420 | #define GPIO_MODE_REG3 GPIO_MODE_4BITS_REG_VAL(16, 17, 18, 19, 20, 21, 22, 23) |
| 421 | #define GPIO_MODE_REG4 GPIO_MODE_4BITS_REG_VAL(24, 25, 26, 27, 28, 29, 30, 31) |
| 422 | #define GPIO_MODE_REG5 GPIO_MODE_4BITS_REG_VAL(32, 33, 34, 35, 36, 37, 38, 39) |
| 423 | #define GPIO_MODE_REG6 GPIO_MODE_4BITS_REG_VAL(40, 41, 42, 43, 44, 45, 46, 47) |
| 424 | #define GPIO_MODE_REG7 GPIO_MODE_4BITS_REG_VAL(48, 49, 50, 51, 52, 53, 54, 55) |
| 425 | #define GPIO_MODE_REG8 GPIO_MODE_4BITS_REG_VAL(56, 57, 58, 59, 60, 61, 62, 63) |
| 426 | #define GPIO_MODE_REG9 GPIO_MODE_4BITS_REG_VAL(64, 65, 66, 67, 68, 69, 70, NULL) |
| 427 | #endif //defined(DRV_GPIO_REG_AS_6253E_1) |
| 428 | #if defined(DRV_GPIO_REG_AS_6255) |
| 429 | #define GPIO_MODE_REG1 GPIO_MODE_4BITS_REG_VAL(0, 1, 2, 3) |
| 430 | #define GPIO_MODE_REG2 GPIO_MODE_4BITS_REG_VAL(4, 5, 6, 7) |
| 431 | #define GPIO_MODE_REG3 GPIO_MODE_4BITS_REG_VAL(8, 9, 10, 11) |
| 432 | #define GPIO_MODE_REG4 GPIO_MODE_4BITS_REG_VAL(12, 13, 14, 15) |
| 433 | #define GPIO_MODE_REG5 GPIO_MODE_4BITS_REG_VAL(16, 17, 18, 19) |
| 434 | #define GPIO_MODE_REG6 GPIO_MODE_4BITS_REG_VAL(20, 21, 22, 23) |
| 435 | #define GPIO_MODE_REG7 GPIO_MODE_4BITS_REG_VAL(24, 25, 26, 27) |
| 436 | #define GPIO_MODE_REG8 GPIO_MODE_4BITS_REG_VAL(28, 29, 30, 31) |
| 437 | #define GPIO_MODE_REG9 GPIO_MODE_4BITS_REG_VAL(32, 33, 34, 35) |
| 438 | #define GPIO_MODE_REG10 GPIO_MODE_4BITS_REG_VAL(36, 37, 38, 39) |
| 439 | #define GPIO_MODE_REG11 GPIO_MODE_4BITS_REG_VAL(40, 41, 42, 43) |
| 440 | #define GPIO_MODE_REG12 GPIO_MODE_4BITS_REG_VAL(44, 45, 46, 47) |
| 441 | #define GPIO_MODE_REG13 GPIO_MODE_4BITS_REG_VAL(48, 49, 50, 51) |
| 442 | #define GPIO_MODE_REG14 GPIO_MODE_4BITS_REG_VAL(52, 53, 54, 55) |
| 443 | #define GPIO_MODE_REG15 GPIO_MODE_4BITS_REG_VAL(56, 57, 58, 59) |
| 444 | #define GPIO_MODE_REG16 GPIO_MODE_4BITS_REG_VAL(60, 61, 62, 63) |
| 445 | #define GPIO_MODE_REG17 GPIO_MODE_4BITS_REG_VAL(64, 65, 66, 67) |
| 446 | #define GPIO_MODE_REG18 GPIO_MODE_4BITS_REG_VAL(68, 69, 70, 71) |
| 447 | #define GPIO_MODE_REG19 GPIO_MODE_4BITS_REG_VAL(72, 73, 74, 75) |
| 448 | #define GPIO_MODE_REG20 GPIO_MODE_4BITS_REG_VAL(76, 77, 78, 79) |
| 449 | #define GPIO_MODE_REG21 GPIO_MODE_4BITS_REG_VAL(80, 81, 82, 83) |
| 450 | #define GPIO_MODE_REG22 GPIO_MODE_4BITS_REG_VAL(84, 85, 86, 87) |
| 451 | #define GPIO_MODE_REG23 GPIO_MODE_4BITS_REG_VAL(88, 89, 90, 91) |
| 452 | #define GPIO_MODE_REG24 GPIO_MODE_4BITS_REG_VAL(92, 93, 94, 95) |
| 453 | #define GPIO_MODE_REG25 GPIO_MODE_4BITS_REG_VAL(96, 97, 98, 99) |
| 454 | #define GPIO_MODE_REG26 GPIO_MODE_4BITS_REG_VAL(100, 101, 102,103) |
| 455 | #define GPIO_MODE_REG27 GPIO_MODE_4BITS_REG_VAL(104, NULL, NULL,NULL) |
| 456 | |
| 457 | #endif |
| 458 | #if defined(DRV_GPIO_REG_AS_6256) |
| 459 | #define GPIO_MODE_REG1 GPIO_MODE_4BITS_REG_VAL(0, 1, 2, 3) |
| 460 | #define GPIO_MODE_REG2 GPIO_MODE_4BITS_REG_VAL(4, 5, 6, 7) |
| 461 | #define GPIO_MODE_REG3 GPIO_MODE_4BITS_REG_VAL(8, 9, 10, 11) |
| 462 | #define GPIO_MODE_REG4 GPIO_MODE_4BITS_REG_VAL(12, 13, 14, 15) |
| 463 | #define GPIO_MODE_REG5 GPIO_MODE_4BITS_REG_VAL(16, 17, 18, 19) |
| 464 | #define GPIO_MODE_REG6 GPIO_MODE_4BITS_REG_VAL(20, 21, 22, 23) |
| 465 | #define GPIO_MODE_REG7 GPIO_MODE_4BITS_REG_VAL(24, 25, 26, 27) |
| 466 | #define GPIO_MODE_REG8 GPIO_MODE_4BITS_REG_VAL(28, 29, 30, 31) |
| 467 | #define GPIO_MODE_REG9 GPIO_MODE_4BITS_REG_VAL(32, 33, 34, 35) |
| 468 | #define GPIO_MODE_REG10 GPIO_MODE_4BITS_REG_VAL(36, 37, 38, 39) |
| 469 | #define GPIO_MODE_REG11 GPIO_MODE_4BITS_REG_VAL(40, 41, 42, 43) |
| 470 | #define GPIO_MODE_REG12 GPIO_MODE_4BITS_REG_VAL(44, 45, 46, 47) |
| 471 | #define GPIO_MODE_REG13 GPIO_MODE_4BITS_REG_VAL(48, 49, 50, 51) |
| 472 | #define GPIO_MODE_REG14 GPIO_MODE_4BITS_REG_VAL(52, 53, 54, 55) |
| 473 | #define GPIO_MODE_REG15 GPIO_MODE_4BITS_REG_VAL(56, 57, 58, 59) |
| 474 | #define GPIO_MODE_REG16 GPIO_MODE_4BITS_REG_VAL(60, 61, 62, 63) |
| 475 | #define GPIO_MODE_REG17 GPIO_MODE_4BITS_REG_VAL(64, 65, 66, 67) |
| 476 | #define GPIO_MODE_REG18 GPIO_MODE_4BITS_REG_VAL(68, 69, 70, 71) |
| 477 | #define GPIO_MODE_REG19 GPIO_MODE_4BITS_REG_VAL(72, 73, 74, 75) |
| 478 | #define GPIO_MODE_REG20 GPIO_MODE_4BITS_REG_VAL(76, 77, 78, 79) |
| 479 | #define GPIO_MODE_REG21 GPIO_MODE_4BITS_REG_VAL(80, 81, 82, 83) |
| 480 | #define GPIO_MODE_REG22 GPIO_MODE_4BITS_REG_VAL(84, 85, 86, 87) |
| 481 | #define GPIO_MODE_REG23 GPIO_MODE_4BITS_REG_VAL(88, 89, 90, 91) |
| 482 | #define GPIO_MODE_REG24 GPIO_MODE_4BITS_REG_VAL(92, 93, 94, 95) |
| 483 | #define GPIO_MODE_REG25 GPIO_MODE_4BITS_REG_VAL(96, 97, 98, 99) |
| 484 | #define GPIO_MODE_REG26 GPIO_MODE_4BITS_REG_VAL(100, 101, 102, 103) |
| 485 | #define GPIO_MODE_REG27 GPIO_MODE_4BITS_REG_VAL(104, NULL, NULL, NULL) |
| 486 | #endif |
| 487 | #if defined(DRV_GPIO_REG_AS_6251) |
| 488 | #define GPIO_MODE_REG1 GPIO_MODE_4BITS_REG_VAL(0, 1, 2, 3) |
| 489 | #define GPIO_MODE_REG2 GPIO_MODE_4BITS_REG_VAL(4, 5, 6, 7) |
| 490 | #define GPIO_MODE_REG3 GPIO_MODE_4BITS_REG_VAL(8, 9, 10, 11) |
| 491 | #define GPIO_MODE_REG4 GPIO_MODE_4BITS_REG_VAL(12, 13, 14, 15) |
| 492 | #define GPIO_MODE_REG5 GPIO_MODE_4BITS_REG_VAL(16, 17, 18, 19) |
| 493 | #define GPIO_MODE_REG6 GPIO_MODE_4BITS_REG_VAL(20, 21, 22, 23) |
| 494 | #define GPIO_MODE_REG7 GPIO_MODE_4BITS_REG_VAL(24, 25, 26, 27) |
| 495 | #define GPIO_MODE_REG8 GPIO_MODE_4BITS_REG_VAL(28, 29, 30, 31) |
| 496 | #endif // defined(DRV_GPIO_REG_AS_6255) |
| 497 | |
| 498 | /***************************GPIO MODE IS NEITHER 4 BIT *********END**********/ |
| 499 | |
| 500 | /***************************GPIO MODE IS 3 BIT******************START********/ |
| 501 | #elif defined(DRV_GPIO_MODE_3BITS) |
| 502 | #if defined(DRV_GPIO_REG_AS_6276) |
| 503 | #define GPIO_MODE_REG0 GPIO_MODE_3BITS_REG_VAL(0, 1, 2, 3, 4) |
| 504 | #define GPIO_MODE_REG1 GPIO_MODE_3BITS_REG_VAL(5, 6, 7, 8, 9) |
| 505 | #define GPIO_MODE_REG2 GPIO_MODE_3BITS_REG_VAL(10, 11, 12, 13, 14) |
| 506 | #define GPIO_MODE_REG3 GPIO_MODE_3BITS_REG_VAL(15, 16, 17, 18, 19) |
| 507 | #define GPIO_MODE_REG4 GPIO_MODE_3BITS_REG_VAL(20, 21, 22, 23, 24) |
| 508 | #define GPIO_MODE_REG5 GPIO_MODE_3BITS_REG_VAL(25, 26, 27, 28, 29) |
| 509 | #define GPIO_MODE_REG6 GPIO_MODE_3BITS_REG_VAL(30, 31, 32, 33, 34) |
| 510 | #define GPIO_MODE_REG7 GPIO_MODE_3BITS_REG_VAL(35, 36, 37, 38, 39) |
| 511 | #define GPIO_MODE_REG8 GPIO_MODE_3BITS_REG_VAL(40, 41, 42, 43, 44) |
| 512 | #define GPIO_MODE_REG9 GPIO_MODE_3BITS_REG_VAL(45, 46, 47, 48, 49) |
| 513 | #define GPIO_MODE_REGA GPIO_MODE_3BITS_REG_VAL(50, 51, 52, 53, 54) |
| 514 | #define GPIO_MODE_REGB GPIO_MODE_3BITS_REG_VAL(55, 56, 57, 58, 59) |
| 515 | #define GPIO_MODE_REGC GPIO_MODE_3BITS_REG_VAL(60, 61, 62, 63, 64) |
| 516 | #define GPIO_MODE_REGD GPIO_MODE_3BITS_REG_VAL(65, 66, 67, 68, 69) |
| 517 | #define GPIO_MODE_REGE GPIO_MODE_3BITS_REG_VAL(70, 71, 72, 73, 74) |
| 518 | #define GPIO_MODE_REGF GPIO_MODE_3BITS_REG_VAL(75, 76, 77, 78, 79) |
| 519 | #define GPIO_MODE_REG10 GPIO_MODE_3BITS_REG_VAL(80, 81, 82, 83, 84) |
| 520 | #define GPIO_MODE_REG11 GPIO_MODE_3BITS_REG_VAL(85, 86, 87, 88, 89) |
| 521 | #define GPIO_MODE_REG12 GPIO_MODE_3BITS_REG_VAL(90, 91, 92, 93, 94) |
| 522 | #define GPIO_MODE_REG13 GPIO_MODE_3BITS_REG_VAL(95, 96, 97, 98, 99) |
| 523 | #define GPIO_MODE_REG14 GPIO_MODE_3BITS_REG_VAL(100, 101, 102, 103, 104) |
| 524 | #define GPIO_MODE_REG15 GPIO_MODE_3BITS_REG_VAL(105, 106, 107, 108, 109) |
| 525 | #endif //defined(DRV_GPIO_REG_AS_6276) |
| 526 | |
| 527 | #endif //!defined(DRV_GPIO_MODE_4BITS) && !defined(DRV_GPIO_MODE_3BITS) |
| 528 | |
| 529 | /****************************************************************************************/ |
| 530 | /*********************************__CHIP_SUPP_GPIO_DRV_TOOL__****************************/ |
| 531 | /*********************************************END****************************************/ |
| 532 | /****************************************************************************************/ |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | /*********************************************************************************************/ |
| 538 | /*********************************************************************************************/ |
| 539 | /* Macros to calulate GPIO related register value of different platforms with 1 bit unit |
| 540 | for different settings, like dirction control pull-up/pull-down enable, inversion control. */ |
| 541 | /*****************************************START***********************************************/ |
| 542 | /*********************************************************************************************/ |
| 543 | |
| 544 | |
| 545 | #if defined(DRV_GPIO_REG_AS_TK6516) |
| 546 | #define GPIO_HWORD_REG1(name) GPIO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 547 | #else /* DRV_GPIO_REG_AS_TK6516 */ |
| 548 | #if !defined(DRV_GPIO_REG_AS_6290) |
| 549 | #define GPIO_HWORD_REG1(name) GPIO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) |
| 550 | #else |
| 551 | #define GPIO_HWORD_REG1(name) GPIO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ,25 ,26 ,27,28, 29 ,30, 31) |
| 552 | #endif |
| 553 | #if defined(DRV_GPIO_REG_AS_6205B) |
| 554 | #define GPO_HWORD_REG1(name) GPO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 555 | #define GPIO_HWORD_REG2(name) GPIO_HWORD_REG_FOR_1BIT(name, 16, 17, 18, 19, 20, 21, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL) |
| 556 | #elif defined(DRV_GPIO_REG_AS_6270A) |
| 557 | #define GPIO_HWORD_REG2(name) GPIO_HWORD_REG_FOR_1BIT(name, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, NULL, NULL, NULL, NULL) |
| 558 | #elif defined(DRV_GPIO_REG_AS_6251) |
| 559 | #define GPIO_HWORD_REG2(name) GPIO_HWORD_REG_FOR_1BIT(name, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) |
| 560 | #define GPIO_HWORD_REG3(name) GPIO_HWORD_REG_FOR_1BIT(name, 32, 33, 34, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 561 | #define GPIO_HWORD_REG3_TO_38(name) GPIO_HWORD_REG_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 562 | #else /* DRV_GPIO_REG_AS_6270A) */ |
| 563 | #if !defined(DRV_GPIO_REG_AS_6290) |
| 564 | #define GPIO_HWORD_REG2(name) GPIO_HWORD_REG_FOR_1BIT(name, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) |
| 565 | #else |
| 566 | #define GPIO_HWORD_REG2(name) GPIO_HWORD_REG_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 ,57 ,58 ,59,60, 61 ,62, 63) |
| 567 | #endif |
| 568 | #define GPIO_HWORD_REG3(name) GPIO_HWORD_REG_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47) |
| 569 | #if defined(DRV_GPIO_REG_AS_6218B) |
| 570 | #define GPO_HWORD_REG1(name) GPO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 571 | #elif defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6225) |
| 572 | #if defined(DRV_GPIO_REG_AS_6219) |
| 573 | #define GPO_HWORD_REG1(name) GPO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, 3, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 574 | #elif defined(DRV_GPIO_REG_AS_6225) |
| 575 | #define GPO_HWORD_REG1(name) GPO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 576 | #endif |
| 577 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 578 | #elif defined(DRV_GPIO_REG_AS_6227) |
| 579 | #define GPO_HWORD_REG1(name) GPO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, 3, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 580 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 581 | #elif defined(DRV_GPIO_REG_AS_6228) |
| 582 | #define GPO_HWORD_REG1(name) GPO_HWORD_REG_FOR_1BIT(name, 0, 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 583 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 584 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, NULL, NULL, NULL, NULL, NULL) |
| 585 | #elif defined(DRV_GPIO_REG_AS_6223) |
| 586 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 587 | #elif defined(DRV_GPIO_REG_AS_6238) |
| 588 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 589 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79) |
| 590 | #define GPIO_HWORD_REG6(name) GPIO_HWORD_REG_FOR_1BIT(name, 80, 81, 82, 83, 84, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 591 | #elif defined(DRV_GPIO_REG_AS_6235) |
| 592 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 593 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, NULL, NULL, NULL, NULL) |
| 594 | #elif defined(DRV_GPIO_REG_AS_6236) |
| 595 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 596 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 597 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 598 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 599 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79) |
| 600 | #define GPIO_HWORD_REG6(name) GPIO_HWORD_REG_FOR_1BIT(name, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95) |
| 601 | #if defined(DRV_GPIO_REG_AS_6268A) |
| 602 | #define GPIO_HWORD_REG7(name) GPIO_HWORD_REG_FOR_1BIT(name, 96, 97, 98, 99, 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 603 | #elif defined(DRV_GPIO_REG_AS_6268) |
| 604 | #define GPIO_HWORD_REG7(name) GPIO_HWORD_REG_FOR_1BIT(name, 96, 97, 98, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 605 | #elif defined(DRV_GPIO_REG_AS_6276) |
| 606 | #define GPIO_HWORD_REG7(name) GPIO_HWORD_REG_FOR_1BIT(name, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, NULL, NULL, NULL) |
| 607 | #endif |
| 608 | #elif defined(DRV_GPIO_REG_AS_6253T) |
| 609 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 610 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79) |
| 611 | #define GPIO_HWORD_REG6(name) GPIO_HWORD_REG_FOR_1BIT(name, 80, 81, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 612 | #elif defined(DRV_GPIO_REG_AS_6255) |
| 613 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 614 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79) |
| 615 | #define GPIO_HWORD_REG6(name) GPIO_HWORD_REG_FOR_1BIT(name, 80, 81, 82, 83, 84, 85, 86, 87, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 616 | #define GPIO_HWORD_REG7(name) GPIO_HWORD_REG_FOR_1BIT(name, 96, 97, 98, 99, 100, 101, 102, 103, 104, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 617 | #elif defined(DRV_GPIO_REG_AS_6253E) |
| 618 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 619 | #elif defined(DRV_GPIO_REG_AS_6253E_1) |
| 620 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 621 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 622 | #elif defined(DRV_GPIO_REG_AS_6256) |
| 623 | #define GPIO_HWORD_REG4(name) GPIO_HWORD_REG_FOR_1BIT(name, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 624 | #define GPIO_HWORD_REG5(name) GPIO_HWORD_REG_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79) |
| 625 | #define GPIO_HWORD_REG6(name) GPIO_HWORD_REG_FOR_1BIT(name, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95) |
| 626 | #define GPIO_HWORD_REG7(name) GPIO_HWORD_REG_FOR_1BIT(name, 96, 97, 98, 99, 100, 101, 102, 103, 104, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 627 | #endif |
| 628 | #endif /* DRV_GPIO_REG_AS_6205B */ |
| 629 | #endif /* DRV_GPIO_REG_AS_TK6516 */ |
| 630 | |
| 631 | /*********************************************************************************************/ |
| 632 | /*********************************************************************************************/ |
| 633 | /* Macros to calulate GPIO related register value of different platforms with 1 bit unit |
| 634 | for different settings, like dirction control pull-up/pull-down enable, inversion control. */ |
| 635 | /*****************************************END***********************************************/ |
| 636 | /*********************************************************************************************/ |
| 637 | |
| 638 | #if defined(DRV_GPIO_REG_AS_6290) |
| 639 | |
| 640 | #define GPIO_OWNERSHIP_REG1 GPIO_HWORD_REG1(OWNERSHIP) |
| 641 | #define GPIO_OWNERSHIP_REG2 GPIO_HWORD_REG2(OWNERSHIP) |
| 642 | |
| 643 | #endif |
| 644 | /*********************************************************************************************/ |
| 645 | /*********************************************************************************************/ |
| 646 | /****************** GPIO direction control register value*************************************/ |
| 647 | /*************************************START************************************************/ |
| 648 | /*********************************************************************************************/ |
| 649 | |
| 650 | #define GPIO_DIR_REG1 GPIO_HWORD_REG1(DIR) |
| 651 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 652 | #define GPIO_DIR_REG2 GPIO_HWORD_REG2(DIR) |
| 653 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_6270A) |
| 654 | #define GPIO_DIR_REG3 GPIO_HWORD_REG3(DIR) |
| 655 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6253E) |
| 656 | #define GPIO_DIR_REG4 GPIO_HWORD_REG4(DIR) |
| 657 | #endif |
| 658 | #if defined(DRV_GPIO_REG_AS_6228) |
| 659 | #define GPIO_DIR_REG5 GPIO_HWORD_REG5(DIR) |
| 660 | #endif |
| 661 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 662 | #define GPIO_DIR_REG4 GPIO_HWORD_REG4(DIR) |
| 663 | #define GPIO_DIR_REG5 GPIO_HWORD_REG5(DIR) |
| 664 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 665 | #define GPIO_DIR_REG6 GPIO_HWORD_REG6(DIR) |
| 666 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 667 | #define GPIO_DIR_REG6 GPIO_HWORD_REG6(DIR) |
| 668 | #define GPIO_DIR_REG7 GPIO_HWORD_REG7(DIR) |
| 669 | #endif |
| 670 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 671 | #define GPIO_DIR_REG4 GPIO_HWORD_REG4(DIR) |
| 672 | #define GPIO_DIR_REG5 GPIO_HWORD_REG5(DIR) |
| 673 | #define GPIO_DIR_REG6 GPIO_HWORD_REG6(DIR) |
| 674 | #define GPIO_DIR_REG7 GPIO_HWORD_REG7(DIR) |
| 675 | #endif |
| 676 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_6270A) */ |
| 677 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 678 | |
| 679 | /*********************************************************************************************/ |
| 680 | /*********************************************************************************************/ |
| 681 | /****************** GPIO direction control register value*************************************/ |
| 682 | /*************************************END*****************************************************/ |
| 683 | /*********************************************************************************************/ |
| 684 | |
| 685 | |
| 686 | /*********************************************************************************************/ |
| 687 | /*********************************************************************************************/ |
| 688 | /****************** GPIO Pull-up/Pull-down enable register value******************************/ |
| 689 | /*************************************START***************************************************/ |
| 690 | /*********************************************************************************************/ |
| 691 | |
| 692 | #define GPIO_PULL_REG1 GPIO_HWORD_REG1(PULL) |
| 693 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 694 | #define GPIO_PULL_REG2 GPIO_HWORD_REG2(PULL) |
| 695 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_6270A) |
| 696 | #if defined(DRV_GPIO_REG_AS_6251) |
| 697 | #define GPIO_PULL_REG3 GPIO_HWORD_REG3_TO_38(PULL) |
| 698 | #else |
| 699 | #define GPIO_PULL_REG3 GPIO_HWORD_REG3(PULL) |
| 700 | #endif |
| 701 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223)|| defined(DRV_GPIO_REG_AS_6253E) |
| 702 | #define GPIO_PULL_REG4 GPIO_HWORD_REG4(PULL) |
| 703 | #endif |
| 704 | #if defined(DRV_GPIO_REG_AS_6228) |
| 705 | #define GPIO_PULL_REG5 GPIO_HWORD_REG5(PULL) |
| 706 | #endif |
| 707 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 708 | #define GPIO_PULL_REG4 GPIO_HWORD_REG4(PULL) |
| 709 | #define GPIO_PULL_REG5 GPIO_HWORD_REG5(PULL) |
| 710 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 711 | #define GPIO_PULL_REG6 GPIO_HWORD_REG6(PULL) |
| 712 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 713 | #define GPIO_PULL_REG6 GPIO_HWORD_REG6(PULL) |
| 714 | #define GPIO_PULL_REG7 GPIO_HWORD_REG7(PULL) |
| 715 | #endif |
| 716 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 717 | #define GPIO_PULL_REG4 GPIO_HWORD_REG4(PULL) |
| 718 | #define GPIO_PULL_REG5 GPIO_HWORD_REG5(PULL) |
| 719 | #define GPIO_PULL_REG6 GPIO_HWORD_REG6(PULL) |
| 720 | #define GPIO_PULL_REG7 GPIO_HWORD_REG7(PULL) |
| 721 | #endif |
| 722 | #endif /* #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_6270A) */ |
| 723 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 724 | |
| 725 | /*********************************************************************************************/ |
| 726 | /*********************************************************************************************/ |
| 727 | /****************** GPIO Pull-up/Pull-down enable register value******************************/ |
| 728 | /*************************************END*****************************************************/ |
| 729 | /*********************************************************************************************/ |
| 730 | |
| 731 | /*********************************************************************************************/ |
| 732 | /*********************************************************************************************/ |
| 733 | /******************GPIO inversion control register value**************************************/ |
| 734 | /************************************START*****************************************************/ |
| 735 | /*********************************************************************************************/ |
| 736 | |
| 737 | #if !defined(DRV_GPIO_REG_AS_6205B) |
| 738 | #define GPIO_INV_REG1 GPIO_HWORD_REG1(INV) |
| 739 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 740 | #define GPIO_INV_REG2 GPIO_HWORD_REG2(INV) |
| 741 | #if !defined(DRV_GPIO_REG_AS_6270A) && !defined(DRV_GPIO_REG_AS_6251) |
| 742 | #define GPIO_INV_REG3 GPIO_HWORD_REG3(INV) |
| 743 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6253E) |
| 744 | #define GPIO_INV_REG4 GPIO_HWORD_REG4(INV) |
| 745 | #endif |
| 746 | #if defined(DRV_GPIO_REG_AS_6228) |
| 747 | #define GPIO_INV_REG5 GPIO_HWORD_REG5(INV) |
| 748 | #endif |
| 749 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 750 | #define GPIO_INV_REG4 GPIO_HWORD_REG4(INV) |
| 751 | #define GPIO_INV_REG5 GPIO_HWORD_REG5(INV) |
| 752 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 753 | #define GPIO_INV_REG6 GPIO_HWORD_REG6(INV) |
| 754 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 755 | #define GPIO_INV_REG6 GPIO_HWORD_REG6(INV) |
| 756 | #define GPIO_INV_REG7 GPIO_HWORD_REG7(INV) |
| 757 | #endif |
| 758 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 759 | #define GPIO_INV_REG4 GPIO_HWORD_REG4(INV) |
| 760 | #define GPIO_INV_REG5 GPIO_HWORD_REG5(INV) |
| 761 | #define GPIO_INV_REG6 GPIO_HWORD_REG6(INV) |
| 762 | #define GPIO_INV_REG7 GPIO_HWORD_REG7(INV) |
| 763 | #endif |
| 764 | #endif /* !defined(DRV_GPIO_REG_AS_6270A) */ |
| 765 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 766 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 767 | |
| 768 | |
| 769 | /*********************************************************************************************/ |
| 770 | /*********************************************************************************************/ |
| 771 | /******************GPIO inversion control register value**************************************/ |
| 772 | /************************************END******************************************************/ |
| 773 | /*********************************************************************************************/ |
| 774 | |
| 775 | /*********************************************************************************************/ |
| 776 | /*********************************************************************************************/ |
| 777 | /*****************************GPIO Output register value**************************************/ |
| 778 | /************************************START*****************************************************/ |
| 779 | /*********************************************************************************************/ |
| 780 | |
| 781 | #define GPIO_OUTPUT_REG1 GPIO_HWORD_REG1(OUTPUT_LEVEL) |
| 782 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 783 | #define GPIO_OUTPUT_REG2 GPIO_HWORD_REG2(OUTPUT_LEVEL) |
| 784 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_6270A) |
| 785 | #define GPIO_OUTPUT_REG3 GPIO_HWORD_REG3(OUTPUT_LEVEL) |
| 786 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6253E) |
| 787 | #define GPIO_OUTPUT_REG4 GPIO_HWORD_REG4(OUTPUT_LEVEL) |
| 788 | #endif |
| 789 | #if defined(DRV_GPIO_REG_AS_6228) |
| 790 | #define GPIO_OUTPUT_REG5 GPIO_HWORD_REG5(OUTPUT_LEVEL) |
| 791 | #endif |
| 792 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 793 | #define GPIO_OUTPUT_REG4 GPIO_HWORD_REG4(OUTPUT_LEVEL) |
| 794 | #define GPIO_OUTPUT_REG5 GPIO_HWORD_REG5(OUTPUT_LEVEL) |
| 795 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) |
| 796 | #define GPIO_OUTPUT_REG6 GPIO_HWORD_REG6(OUTPUT_LEVEL) |
| 797 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 798 | #define GPIO_OUTPUT_REG6 GPIO_HWORD_REG6(OUTPUT_LEVEL) |
| 799 | #define GPIO_OUTPUT_REG7 GPIO_HWORD_REG7(OUTPUT_LEVEL) |
| 800 | #endif |
| 801 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 802 | #define GPIO_OUTPUT_REG4 GPIO_HWORD_REG4(OUTPUT_LEVEL) |
| 803 | #define GPIO_OUTPUT_REG5 GPIO_HWORD_REG5(OUTPUT_LEVEL) |
| 804 | #define GPIO_OUTPUT_REG6 GPIO_HWORD_REG6(OUTPUT_LEVEL) |
| 805 | #define GPIO_OUTPUT_REG7 GPIO_HWORD_REG7(OUTPUT_LEVEL) |
| 806 | #endif |
| 807 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_6270A) */ |
| 808 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 809 | |
| 810 | |
| 811 | /*********************************************************************************************/ |
| 812 | /*********************************************************************************************/ |
| 813 | /*****************************GPIO Output register value**************************************/ |
| 814 | /************************************END*****************************************************/ |
| 815 | /*********************************************************************************************/ |
| 816 | |
| 817 | /*********************************************************************************************/ |
| 818 | /*********************************************************************************************/ |
| 819 | /*****************************GPO Output register value**************************************/ |
| 820 | /************************************START*****************************************************/ |
| 821 | /*********************************************************************************************/ |
| 822 | |
| 823 | #if (!defined(DRV_GPIO_WO_GPO)) |
| 824 | #define GPO_OUTPUT_REG1 GPO_HWORD_REG1(OUTPUT_LEVEL) |
| 825 | #endif |
| 826 | |
| 827 | /*********************************************************************************************/ |
| 828 | /*********************************************************************************************/ |
| 829 | /*****************************GPO Output register value**************************************/ |
| 830 | /************************************END*****************************************************/ |
| 831 | /*********************************************************************************************/ |
| 832 | |
| 833 | |
| 834 | /*********************************************************************************************/ |
| 835 | /*********************************************************************************************/ |
| 836 | /****************************GPIO PULL up/down selection register value***********************/ |
| 837 | /************************************START*****************************************************/ |
| 838 | /*********************************************************************************************/ |
| 839 | |
| 840 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_TK6516) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6270A) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6276)|| defined(DRV_GPIO_REG_AS_6251) || defined(DRV_GPIO_REG_AS_6253E_1) || defined(DRV_GPIO_REG_AS_6290) |
| 841 | #define GPIO_PULLSEL_REG1 GPIO_HWORD_REG1(PULL_SEL) |
| 842 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 843 | #define GPIO_PULLSEL_REG2 GPIO_HWORD_REG2(PULL_SEL) |
| 844 | #if defined(DRV_GPIO_REG_AS_6251) |
| 845 | #define GPIO_PULLSEL_REG3 GPIO_HWORD_REG3_TO_38(PULL_SEL) |
| 846 | #elif !defined(DRV_GPIO_REG_AS_6270A) && !defined(DRV_GPIO_REG_AS_6290) |
| 847 | #define GPIO_PULLSEL_REG3 GPIO_HWORD_REG3(PULL_SEL) |
| 848 | #define GPIO_PULLSEL_REG4 GPIO_HWORD_REG4(PULL_SEL) |
| 849 | #if !defined(DRV_GPIO_REG_AS_6253E) |
| 850 | #define GPIO_PULLSEL_REG5 GPIO_HWORD_REG5(PULL_SEL) |
| 851 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) |
| 852 | #define GPIO_PULLSEL_REG6 GPIO_HWORD_REG6(PULL_SEL) |
| 853 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 854 | #define GPIO_PULLSEL_REG6 GPIO_HWORD_REG6(PULL_SEL) |
| 855 | #define GPIO_PULLSEL_REG7 GPIO_HWORD_REG7(PULL_SEL) |
| 856 | #endif |
| 857 | #endif /* !defined(DRV_GPIO_REG_AS_6253E) */ |
| 858 | #endif /* !defined(DRV_GPIO_REG_AS_6270A) */ |
| 859 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 860 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 861 | #define GPIO_PULLSEL_REG1 GPIO_HWORD_REG1(PULL_SEL) |
| 862 | #define GPIO_PULLSEL_REG2 GPIO_HWORD_REG2(PULL_SEL) |
| 863 | #define GPIO_PULLSEL_REG3 GPIO_HWORD_REG3(PULL_SEL) |
| 864 | #define GPIO_PULLSEL_REG4 GPIO_HWORD_REG4(PULL_SEL) |
| 865 | #define GPIO_PULLSEL_REG5 GPIO_HWORD_REG5(PULL_SEL) |
| 866 | #define GPIO_PULLSEL_REG6 GPIO_HWORD_REG6(PULL_SEL) |
| 867 | #define GPIO_PULLSEL_REG7 GPIO_HWORD_REG7(PULL_SEL) |
| 868 | #endif /* defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) */ |
| 869 | |
| 870 | /*********************************************************************************************/ |
| 871 | /*********************************************************************************************/ |
| 872 | /****************************GPIO PULL up/down selection register value***********************/ |
| 873 | /************************************END*****************************************************/ |
| 874 | /*********************************************************************************************/ |
| 875 | |
| 876 | #if defined(DRV_GPIO_REG_AS_6253E) |
| 877 | #define GPIO_SPMODE_REG ((SP_MODE_BIT0) | (SP_MODE_BIT2<<2) | (SP_MODE_BIT4<<4) | (SP_MODE_BIT6<<6) | (SP_MODE_BIT8<<8)) |
| 878 | #define GPIO_BANK_REG ((BANK0) | (BANK1<<1) | (BANK2<<2) | (BANK3<<3) | (BANK4<<4) | (BANK5<<5) | (BANK6<<6) | (BANK7<<7)) |
| 879 | #endif //defined(DRV_GPIO_REG_AS_6253E) |
| 880 | |
| 881 | //this need to confirm after WS.chen work done!!!! |
| 882 | #if defined(DRV_GPIO_REG_AS_6253E_1) |
| 883 | #define GPIO_SPMODE0_REG ((SP_MODE0_BIT0) | (SP_MODE0_BIT2<<2) | (SP_MODE0_BIT4<<4) | (SP_MODE0_BIT6<<6) | (SP_MODE0_BIT8<<8) |\ |
| 884 | (SP_MODE0_BIT10<<10) | (SP_MODE0_BIT12<<12) | (SP_MODE0_BIT14<<14) | (SP_MODE0_BIT16<<16) | (SP_MODE0_BIT18<<18) |\ |
| 885 | (SP_MODE0_BIT20<<20) | (SP_MODE0_BIT22<<22) | (SP_MODE0_BIT24<<24) | (SP_MODE0_BIT26<<26) | (SP_MODE0_BIT28<<28) |\ |
| 886 | (SP_MODE0_BIT30<<30)) |
| 887 | |
| 888 | #define GPIO_SPMODE1_REG ((SP_MODE1_BIT0) | (SP_MODE1_BIT2<<2) | (SP_MODE1_BIT4<<4) | (SP_MODE1_BIT8<<8) | (SP_MODE1_BIT12<<12) |\ |
| 889 | (SP_MODE1_BIT14<<14)) |
| 890 | // #define GPIO_BANK_REG ((BANK0) | (BANK1<<1) | (BANK2<<2) | (BANK3<<3) | (BANK4<<4) | (BANK5<<5) | (BANK6<<6) | (BANK7<<7)) |
| 891 | #endif //defined(DRV_GPIO_REG_AS_6253E_1) |
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | /*********************************************************************************************/ |
| 898 | /*********************************************************************************************/ |
| 899 | /**************************** General macros to calulate GPIO word-length variable************/ |
| 900 | /**************************value with 1 bit unit for different platform***********************/ |
| 901 | /************************************START*****************************************************/ |
| 902 | /*********************************************************************************************/ |
| 903 | |
| 904 | #if defined(DRV_GPIO_REG_AS_TK6516) |
| 905 | #define GPIO_WORD_VAR0(name) GPIO_WORD_VAR_FOR_1BIT(name, 0, 1, 2, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 906 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 907 | NULL, NULL, NULL, NULL) |
| 908 | #elif defined(DRV_GPIO_REG_AS_6205B) |
| 909 | #define GPIO_WORD_VAR0(name) GPIO_WORD_VAR_FOR_1BIT(name, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \ |
| 910 | 20, 21, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 911 | #elif defined(DRV_GPIO_REG_AS_6270A) |
| 912 | #define GPIO_WORD_VAR0(name) GPIO_WORD_VAR_FOR_1BIT(name, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \ |
| 913 | 20, 21, 22, 23, 24, 25, 26, 27, NULL, NULL, NULL, NULL) |
| 914 | #elif defined(DRV_GPIO_REG_AS_6251) |
| 915 | #define GPIO_WORD_VAR0(name) GPIO_WORD_VAR_FOR_1BIT(name, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \ |
| 916 | 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) |
| 917 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 918 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 919 | #else /* defined(DRV_GPIO_REG_AS_6270A) */ |
| 920 | #define GPIO_WORD_VAR0(name) GPIO_WORD_VAR_FOR_1BIT(name, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \ |
| 921 | 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) |
| 922 | #if defined(DRV_GPIO_REG_AS_6218B) |
| 923 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, NULL, \ |
| 924 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 925 | #elif defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6225) |
| 926 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 927 | 49, 50, 51, 52, 53, 54, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 928 | #elif defined(DRV_GPIO_REG_AS_6227) |
| 929 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 930 | 49, 50, 51, 52, 53, 54, 55, 56, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 931 | #elif defined(DRV_GPIO_REG_AS_6228) |
| 932 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 933 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 934 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, NULL, NULL, NULL, NULL, \ |
| 935 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 936 | NULL, NULL, NULL, NULL) |
| 937 | #elif defined(DRV_GPIO_REG_AS_6223) |
| 938 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 939 | 49, 50, 51, 52, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
| 940 | #elif defined(DRV_GPIO_REG_AS_6238) |
| 941 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 942 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 943 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, \ |
| 944 | 79, 80, 81, 82, 83, 84, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 945 | NULL, NULL, NULL, NULL) |
| 946 | #elif defined(DRV_GPIO_REG_AS_6235) |
| 947 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 948 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 949 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, NULL, NULL, NULL, \ |
| 950 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 951 | NULL, NULL, NULL, NULL) |
| 952 | #elif defined(DRV_GPIO_REG_AS_6236) |
| 953 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 954 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 955 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 956 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 957 | NULL, NULL, NULL, NULL) |
| 958 | #elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 959 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 960 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 961 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, \ |
| 962 | 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95) |
| 963 | #if defined(DRV_GPIO_REG_AS_6268A) |
| 964 | #define GPIO_WORD_VAR3(name) GPIO_WORD_VAR_FOR_1BIT(name, 96, 97, 98, 99, 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 965 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 966 | NULL, NULL, NULL, NULL, NULL) |
| 967 | #elif defined(DRV_GPIO_REG_AS_6268) |
| 968 | #define GPIO_WORD_VAR3(name) GPIO_WORD_VAR_FOR_1BIT(name, 96, 97, 98, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 969 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 970 | NULL, NULL, NULL, NULL, NULL) |
| 971 | #elif defined(DRV_GPIO_REG_AS_6276) |
| 972 | #define GPIO_WORD_VAR3(name) GPIO_WORD_VAR_FOR_1BIT(name, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, \ |
| 973 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 974 | NULL, NULL, NULL, NULL, NULL) |
| 975 | #endif |
| 976 | #elif defined(DRV_GPIO_REG_AS_6253T) |
| 977 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 978 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 979 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, \ |
| 980 | 79, 80, 81, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 981 | NULL, NULL, NULL, NULL) |
| 982 | #elif defined(DRV_GPIO_REG_AS_6255) |
| 983 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 984 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 985 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, \ |
| 986 | 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95) |
| 987 | #define GPIO_WORD_VAR3(name) GPIO_WORD_VAR_FOR_1BIT(name, 96, 97, 98, 99, 100, 101, 102, 103, 104, NULL, NULL, NULL, NULL, \ |
| 988 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 989 | NULL, NULL, NULL, NULL, NULL) |
| 990 | #elif defined(DRV_GPIO_REG_AS_6253E) |
| 991 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 992 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 993 | #elif defined(DRV_GPIO_REG_AS_6253E_1) |
| 994 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 995 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 996 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 997 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 998 | NULL, NULL, NULL, NULL) |
| 999 | #elif defined(DRV_GPIO_REG_AS_6256) |
| 1000 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 1001 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 1002 | #define GPIO_WORD_VAR2(name) GPIO_WORD_VAR_FOR_1BIT(name, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, \ |
| 1003 | 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95) |
| 1004 | #define GPIO_WORD_VAR3(name) GPIO_WORD_VAR_FOR_1BIT(name, 96, 97, 98, 99, 100, 101, 102, 103, 104, NULL, NULL, NULL, NULL, \ |
| 1005 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ |
| 1006 | NULL, NULL, NULL, NULL, NULL) |
| 1007 | #elif defined(DRV_GPIO_REG_AS_6290) |
| 1008 | #define GPIO_WORD_VAR1(name) GPIO_WORD_VAR_FOR_1BIT(name, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \ |
| 1009 | 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63) |
| 1010 | |
| 1011 | #endif |
| 1012 | |
| 1013 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1014 | |
| 1015 | |
| 1016 | /*********************************************************************************************/ |
| 1017 | /*********************************************************************************************/ |
| 1018 | /**************************** General macros to calulate GPIO word-length variable************/ |
| 1019 | /**************************value with 1 bit unit for different platform***********************/ |
| 1020 | /************************************END*****************************************************/ |
| 1021 | /*********************************************************************************************/ |
| 1022 | |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | |
| 1027 | /*********************************************************************************************/ |
| 1028 | /*********************************************************************************************/ |
| 1029 | /**************************** For each GPIO mode, specify if each GPIO pin is allowed to ******/ |
| 1030 | /****************set to this mode with '1' allowed, '0' on the corresponding bit position******/ |
| 1031 | /********** Bit 0 means GPIO0, Bit 1 means GPIO1... etc ****************************************/ |
| 1032 | /**************************************START****************************************************/ |
| 1033 | /************************************************************************************************/ |
| 1034 | |
| 1035 | #define GPIO_MODE0_VAR0 GPIO_WORD_VAR0(MODE0) |
| 1036 | #define GPIO_MODE1_VAR0 GPIO_WORD_VAR0(MODE1) |
| 1037 | #define GPIO_MODE2_VAR0 GPIO_WORD_VAR0(MODE2) |
| 1038 | #define GPIO_MODE3_VAR0 GPIO_WORD_VAR0(MODE3) |
| 1039 | #if defined(DRV_GPIO_MODE_3BITS) |
| 1040 | #define GPIO_MODE4_VAR0 GPIO_WORD_VAR0(MODE4) |
| 1041 | #elif defined(DRV_GPIO_MODE_4BITS) |
| 1042 | #define GPIO_MODE4_VAR0 GPIO_WORD_VAR0(MODE4) |
| 1043 | #define GPIO_MODE5_VAR0 GPIO_WORD_VAR0(MODE5) |
| 1044 | #define GPIO_MODE6_VAR0 GPIO_WORD_VAR0(MODE6) |
| 1045 | #define GPIO_MODE7_VAR0 GPIO_WORD_VAR0(MODE7) |
| 1046 | #endif //defined(DRV_GPIO_MODE_4BITS) |
| 1047 | #define GPIO_DIROUT_VAR0 GPIO_WORD_VAR0(DIR_OUT) |
| 1048 | #define GPIO_DIRIN_VAR0 GPIO_WORD_VAR0(DIR_IN) |
| 1049 | |
| 1050 | #if defined(DRV_GPIO_REG_AS_6251) |
| 1051 | #define GPIO_DIROUT_VAR1 GPIO_WORD_VAR1(DIR_OUT) |
| 1052 | #define GPIO_DIRIN_VAR1 GPIO_WORD_VAR1(DIR_IN) |
| 1053 | #elif !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_TK6516) && !defined(DRV_GPIO_REG_AS_6270A) |
| 1054 | #define GPIO_MODE0_VAR1 GPIO_WORD_VAR1(MODE0) |
| 1055 | #define GPIO_MODE1_VAR1 GPIO_WORD_VAR1(MODE1) |
| 1056 | #define GPIO_MODE2_VAR1 GPIO_WORD_VAR1(MODE2) |
| 1057 | #define GPIO_MODE3_VAR1 GPIO_WORD_VAR1(MODE3) |
| 1058 | #if defined(DRV_GPIO_MODE_3BITS) |
| 1059 | #define GPIO_MODE4_VAR1 GPIO_WORD_VAR1(MODE4) |
| 1060 | #elif defined(DRV_GPIO_MODE_4BITS) |
| 1061 | #define GPIO_MODE4_VAR1 GPIO_WORD_VAR1(MODE4) |
| 1062 | #define GPIO_MODE5_VAR1 GPIO_WORD_VAR1(MODE5) |
| 1063 | #define GPIO_MODE6_VAR1 GPIO_WORD_VAR1(MODE6) |
| 1064 | #define GPIO_MODE7_VAR1 GPIO_WORD_VAR1(MODE7) |
| 1065 | #endif //defined(DRV_GPIO_MODE_4BITS) |
| 1066 | #define GPIO_DIROUT_VAR1 GPIO_WORD_VAR1(DIR_OUT) |
| 1067 | #define GPIO_DIRIN_VAR1 GPIO_WORD_VAR1(DIR_IN) |
| 1068 | |
| 1069 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) || defined(DRV_GPIO_REG_AS_6256) |
| 1070 | #define GPIO_MODE0_VAR2 GPIO_WORD_VAR2(MODE0) |
| 1071 | #define GPIO_MODE1_VAR2 GPIO_WORD_VAR2(MODE1) |
| 1072 | #define GPIO_MODE2_VAR2 GPIO_WORD_VAR2(MODE2) |
| 1073 | #define GPIO_MODE3_VAR2 GPIO_WORD_VAR2(MODE3) |
| 1074 | #if defined(DRV_GPIO_MODE_3BITS) |
| 1075 | #define GPIO_MODE4_VAR2 GPIO_WORD_VAR2(MODE4) |
| 1076 | #elif defined(DRV_GPIO_MODE_4BITS) |
| 1077 | #define GPIO_MODE4_VAR2 GPIO_WORD_VAR2(MODE4) |
| 1078 | #define GPIO_MODE5_VAR2 GPIO_WORD_VAR2(MODE5) |
| 1079 | #define GPIO_MODE6_VAR2 GPIO_WORD_VAR2(MODE6) |
| 1080 | #define GPIO_MODE7_VAR2 GPIO_WORD_VAR2(MODE7) |
| 1081 | #endif //defined(DRV_GPIO_MODE_4BITS) |
| 1082 | #define GPIO_DIROUT_VAR2 GPIO_WORD_VAR2(DIR_OUT) |
| 1083 | #define GPIO_DIRIN_VAR2 GPIO_WORD_VAR2(DIR_IN) |
| 1084 | #endif /* DRV_GPIO_REG_AS_6228 */ |
| 1085 | |
| 1086 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6256)|| defined(DRV_GPIO_REG_AS_6255) |
| 1087 | #define GPIO_MODE0_VAR3 GPIO_WORD_VAR3(MODE0) |
| 1088 | #define GPIO_MODE1_VAR3 GPIO_WORD_VAR3(MODE1) |
| 1089 | #define GPIO_MODE2_VAR3 GPIO_WORD_VAR3(MODE2) |
| 1090 | #define GPIO_MODE3_VAR3 GPIO_WORD_VAR3(MODE3) |
| 1091 | #if defined(DRV_GPIO_MODE_3BITS) |
| 1092 | #define GPIO_MODE4_VAR3 GPIO_WORD_VAR3(MODE4) |
| 1093 | #elif defined(DRV_GPIO_MODE_4BITS) |
| 1094 | #define GPIO_MODE4_VAR3 GPIO_WORD_VAR3(MODE4) |
| 1095 | #define GPIO_MODE5_VAR3 GPIO_WORD_VAR3(MODE5) |
| 1096 | #define GPIO_MODE6_VAR3 GPIO_WORD_VAR3(MODE6) |
| 1097 | #define GPIO_MODE7_VAR3 GPIO_WORD_VAR3(MODE7) |
| 1098 | #endif //defined(DRV_GPIO_MODE_4BITS) |
| 1099 | #define GPIO_DIROUT_VAR3 GPIO_WORD_VAR3(DIR_OUT) |
| 1100 | #define GPIO_DIRIN_VAR3 GPIO_WORD_VAR3(DIR_IN) |
| 1101 | #endif /* DRV_GPIO_REG_AS_6228 */ |
| 1102 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_TK6516) && !defined(DRV_GPIO_REG_AS_6270A) */ |
| 1103 | |
| 1104 | /*********************************************************************************************/ |
| 1105 | /*********************************************************************************************/ |
| 1106 | /**************************** For each GPIO mode, specify if each GPIO pin is allowed to ******/ |
| 1107 | /****************set to this mode with '1' allowed, '0' on the corresponding bit position******/ |
| 1108 | /********** Bit 0 means GPIO0, Bit 1 means GPIO1... etc ****************************************/ |
| 1109 | /**************************************END****************************************************/ |
| 1110 | /************************************************************************************************/ |
| 1111 | |
| 1112 | |
| 1113 | |
| 1114 | /*********************************************************************************************/ |
| 1115 | /*********************************************************************************************/ |
| 1116 | /**************************** For each GPO mode, specify if each GPO pin is allowed to ******/ |
| 1117 | /****************set to this mode with '1' allowed, '0' on the corresponding bit position******/ |
| 1118 | /********** Bit 0 means GPO0, Bit 1 means GPO1... etc ****************************************/ |
| 1119 | /**************************************START****************************************************/ |
| 1120 | /************************************************************************************************/ |
| 1121 | |
| 1122 | #if defined(DRV_GPIO_REG_AS_6205B) || defined(DRV_GPIO_REG_AS_6225) |
| 1123 | #define GPO_MODE0_VAR0 (MODE0_GPO0 | (MODE0_GPO1 << 1) | (MODE0_GPO2 << 2) | (MODE0_GPO3 << 3)) |
| 1124 | #define GPO_MODE1_VAR0 (MODE1_GPO0 | (MODE1_GPO1 << 1) | (MODE1_GPO2 << 2) | (MODE1_GPO3 << 3)) |
| 1125 | #define GPO_MODE2_VAR0 (MODE2_GPO0 | (MODE2_GPO1 << 1) | (MODE2_GPO2 << 2) | (MODE2_GPO3 << 3)) |
| 1126 | #define GPO_MODE3_VAR0 (MODE3_GPO0 | (MODE3_GPO1 << 1) | (MODE3_GPO2 << 2) | (MODE3_GPO3 << 3)) |
| 1127 | #elif defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) |
| 1128 | #define GPO_MODE0_VAR0 (MODE0_GPO0 | (MODE0_GPO1 << 1) | (MODE0_GPO2 << 2) | (MODE0_GPO3 << 3) | (MODE0_GPO4 << 4)) |
| 1129 | #define GPO_MODE1_VAR0 (MODE1_GPO0 | (MODE1_GPO1 << 1) | (MODE1_GPO2 << 2) | (MODE1_GPO3 << 3) | (MODE1_GPO4 << 4)) |
| 1130 | #define GPO_MODE2_VAR0 (MODE2_GPO0 | (MODE2_GPO1 << 1) | (MODE2_GPO2 << 2) | (MODE2_GPO3 << 3) | (MODE2_GPO4 << 4)) |
| 1131 | #define GPO_MODE3_VAR0 (MODE3_GPO0 | (MODE3_GPO1 << 1) | (MODE3_GPO2 << 2) | (MODE3_GPO3 << 3) | (MODE3_GPO4 << 4)) |
| 1132 | #elif defined(DRV_GPIO_REG_AS_6218B) || defined(DRV_GPIO_REG_AS_6228) |
| 1133 | #define GPO_MODE0_VAR0 (MODE0_GPO0 | (MODE0_GPO1 << 1) | (MODE0_GPO2 << 2)) |
| 1134 | #define GPO_MODE1_VAR0 (MODE1_GPO0 | (MODE1_GPO1 << 1) | (MODE1_GPO2 << 2)) |
| 1135 | #define GPO_MODE2_VAR0 (MODE2_GPO0 | (MODE2_GPO1 << 1) | (MODE2_GPO2 << 2)) |
| 1136 | #define GPO_MODE3_VAR0 (MODE3_GPO0 | (MODE3_GPO1 << 1) | (MODE3_GPO2 << 2)) |
| 1137 | #endif |
| 1138 | |
| 1139 | /*********************************************************************************************/ |
| 1140 | /*********************************************************************************************/ |
| 1141 | /**************************** For each GPO mode, specify if each GPO pin is allowed to ******/ |
| 1142 | /****************set to this mode with '1' allowed, '0' on the corresponding bit position******/ |
| 1143 | /********** Bit 0 means GPO0, Bit 1 means GPO1... etc ****************************************/ |
| 1144 | /**************************************END****************************************************/ |
| 1145 | /************************************************************************************************/ |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | /*********************************************************************************************/ |
| 1150 | /*********************************************************************************************/ |
| 1151 | /*** The '1' of the bit in the variables denotes that the mode is allowed to be set for the **/ |
| 1152 | /*** corresponding pin.******************gpio_mode_allowed[][4]*******************************/ |
| 1153 | /**************************************START***************************************************/ |
| 1154 | /**********************************************************************************************/ |
| 1155 | #if !defined(DRV_GPIO_MODE_4BITS) && !defined(DRV_GPIO_MODE_3BITS) && !defined(DRV_GPIO_REG_AS_6290) |
| 1156 | const kal_uint32 gpio_mode_allowed[][4] = { |
| 1157 | {GPIO_MODE0_VAR0, GPIO_MODE1_VAR0, GPIO_MODE2_VAR0, GPIO_MODE3_VAR0} |
| 1158 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_TK6516) && !defined(DRV_GPIO_REG_AS_6270A) |
| 1159 | ,{GPIO_MODE0_VAR1, GPIO_MODE1_VAR1, GPIO_MODE2_VAR1, GPIO_MODE3_VAR1} |
| 1160 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) |
| 1161 | ,{GPIO_MODE0_VAR2, GPIO_MODE1_VAR2, GPIO_MODE2_VAR2, GPIO_MODE3_VAR2} |
| 1162 | #endif |
| 1163 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 1164 | ,{GPIO_MODE0_VAR3, GPIO_MODE1_VAR3, GPIO_MODE2_VAR3, GPIO_MODE3_VAR3} |
| 1165 | #endif |
| 1166 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1167 | }; |
| 1168 | #elif defined(DRV_GPIO_MODE_4BITS)//#if defined(DRV_GPIO_MODE_4BITS) |
| 1169 | const kal_uint32 gpio_mode_allowed[][8] = { |
| 1170 | #if defined(DRV_GPIO_REG_AS_6255) |
| 1171 | {GPIO_MODE0_VAR0, GPIO_MODE1_VAR0, GPIO_MODE2_VAR0, GPIO_MODE3_VAR0, GPIO_MODE4_VAR0, GPIO_MODE5_VAR0, GPIO_MODE6_VAR0, GPIO_MODE7_VAR0} |
| 1172 | ,{GPIO_MODE0_VAR1, GPIO_MODE1_VAR1, GPIO_MODE2_VAR1, GPIO_MODE3_VAR1, GPIO_MODE4_VAR1, GPIO_MODE5_VAR1, GPIO_MODE6_VAR1, GPIO_MODE7_VAR1} |
| 1173 | ,{GPIO_MODE0_VAR2, GPIO_MODE1_VAR2, GPIO_MODE2_VAR2, GPIO_MODE3_VAR2, GPIO_MODE4_VAR2, GPIO_MODE5_VAR2, GPIO_MODE6_VAR2, GPIO_MODE7_VAR2} |
| 1174 | ,{GPIO_MODE0_VAR3, GPIO_MODE1_VAR3, GPIO_MODE2_VAR3, GPIO_MODE3_VAR3, GPIO_MODE4_VAR3, GPIO_MODE5_VAR3, GPIO_MODE6_VAR3, GPIO_MODE7_VAR3} |
| 1175 | #elif defined(DRV_GPIO_REG_AS_6256) |
| 1176 | {GPIO_MODE0_VAR0, GPIO_MODE1_VAR0, GPIO_MODE2_VAR0, GPIO_MODE3_VAR0, GPIO_MODE4_VAR0, GPIO_MODE5_VAR0, GPIO_MODE6_VAR0, GPIO_MODE7_VAR0} |
| 1177 | ,{GPIO_MODE0_VAR1, GPIO_MODE1_VAR1, GPIO_MODE2_VAR1, GPIO_MODE3_VAR1, GPIO_MODE4_VAR1, GPIO_MODE5_VAR1, GPIO_MODE6_VAR1, GPIO_MODE7_VAR1} |
| 1178 | ,{GPIO_MODE0_VAR2, GPIO_MODE1_VAR2, GPIO_MODE2_VAR2, GPIO_MODE3_VAR2, GPIO_MODE4_VAR2, GPIO_MODE5_VAR2, GPIO_MODE6_VAR2, GPIO_MODE7_VAR2} |
| 1179 | ,{GPIO_MODE0_VAR3, GPIO_MODE1_VAR3, GPIO_MODE2_VAR3, GPIO_MODE3_VAR3, GPIO_MODE4_VAR3, GPIO_MODE5_VAR3, GPIO_MODE6_VAR3, GPIO_MODE7_VAR3} |
| 1180 | #elif defined(DRV_GPIO_REG_AS_6253E_1) |
| 1181 | {GPIO_MODE0_VAR0, GPIO_MODE1_VAR0, GPIO_MODE2_VAR0, GPIO_MODE3_VAR0, GPIO_MODE4_VAR0, GPIO_MODE5_VAR0, GPIO_MODE6_VAR0, GPIO_MODE7_VAR0} |
| 1182 | ,{GPIO_MODE0_VAR1, GPIO_MODE1_VAR1, GPIO_MODE2_VAR1, GPIO_MODE3_VAR1, GPIO_MODE4_VAR1, GPIO_MODE5_VAR1, GPIO_MODE6_VAR1, GPIO_MODE7_VAR1} |
| 1183 | #elif defined(DRV_GPIO_REG_AS_6251) |
| 1184 | {GPIO_MODE0_VAR0, GPIO_MODE1_VAR0, GPIO_MODE2_VAR0, GPIO_MODE3_VAR0, GPIO_MODE4_VAR0, GPIO_MODE5_VAR0, GPIO_MODE6_VAR0, GPIO_MODE7_VAR0} |
| 1185 | #endif //defined(DRV_GPIO_REG_AS_6255) |
| 1186 | }; |
| 1187 | #elif defined(DRV_GPIO_MODE_3BITS) |
| 1188 | const kal_uint32 gpio_mode_allowed[][5] = { |
| 1189 | #if defined(DRV_GPIO_REG_AS_6276) |
| 1190 | {GPIO_MODE0_VAR0, GPIO_MODE1_VAR0, GPIO_MODE2_VAR0, GPIO_MODE3_VAR0,GPIO_MODE4_VAR0} |
| 1191 | ,{GPIO_MODE0_VAR1, GPIO_MODE1_VAR1, GPIO_MODE2_VAR1, GPIO_MODE3_VAR1,GPIO_MODE4_VAR1} |
| 1192 | ,{GPIO_MODE0_VAR2, GPIO_MODE1_VAR2, GPIO_MODE2_VAR2, GPIO_MODE3_VAR2,GPIO_MODE4_VAR2} |
| 1193 | ,{GPIO_MODE0_VAR3, GPIO_MODE1_VAR3, GPIO_MODE2_VAR3, GPIO_MODE3_VAR3,GPIO_MODE4_VAR3} |
| 1194 | #endif |
| 1195 | }; |
| 1196 | |
| 1197 | #endif //#if !defined(DRV_GPIO_MODE_4BITS) && !defined(DRV_GPIO_MODE_3BITS) |
| 1198 | |
| 1199 | |
| 1200 | /*********************************************************************************************/ |
| 1201 | /*********************************************************************************************/ |
| 1202 | /*** The '1' of the bit in the variables denotes that the mode is allowed to be set for the **/ |
| 1203 | /*** corresponding pin.***********************************************************************/ |
| 1204 | /*************************************START***************************************************/ |
| 1205 | /**********************************************************************************************/ |
| 1206 | |
| 1207 | kal_uint32 gpio_check_for_write[] = { |
| 1208 | 0xffffffff |
| 1209 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_TK6516) && !defined(DRV_GPIO_REG_AS_6270A) |
| 1210 | #if defined(DRV_GPIO_REG_AS_6251) |
| 1211 | ,0x0 |
| 1212 | #else //defined(DRV_GPIO_REG_AS_6251) |
| 1213 | ,0xffffffff |
| 1214 | #endif //defined(DRV_GPIO_REG_AS_6251) |
| 1215 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) || defined(DRV_GPIO_REG_AS_6256) |
| 1216 | ,0xffffffff |
| 1217 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6256) |
| 1218 | ,0xffffffff |
| 1219 | #endif /* DRV_GPIO_REG_AS_6268A */ |
| 1220 | #endif |
| 1221 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1222 | }; |
| 1223 | |
| 1224 | kal_uint32 gpio_check_for_read[] = { |
| 1225 | 0xffffffff |
| 1226 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_TK6516) && !defined(DRV_GPIO_REG_AS_6270A) |
| 1227 | #if defined(DRV_GPIO_REG_AS_6251) |
| 1228 | ,0x0 |
| 1229 | #else //defined(DRV_GPIO_REG_AS_6251) |
| 1230 | ,0xffffffff |
| 1231 | #endif //defined(DRV_GPIO_REG_AS_6251) |
| 1232 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) || defined(DRV_GPIO_REG_AS_6256) |
| 1233 | ,0xffffffff |
| 1234 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6256) |
| 1235 | ,0xffffffff |
| 1236 | #endif /* DRV_GPIO_REG_AS_6268A */ |
| 1237 | #endif |
| 1238 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1239 | }; |
| 1240 | |
| 1241 | /* The '1' of the bit in the variables denotes that the direction output is allowed to be |
| 1242 | set for the corresponding pin. */ |
| 1243 | const kal_uint32 gpio_dir_out_allowed[] = { |
| 1244 | GPIO_DIROUT_VAR0 |
| 1245 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_TK6516) && !defined(DRV_GPIO_REG_AS_6270A) |
| 1246 | ,GPIO_DIROUT_VAR1 |
| 1247 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) || defined(DRV_GPIO_REG_AS_6256) |
| 1248 | ,GPIO_DIROUT_VAR2 |
| 1249 | #endif |
| 1250 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6256) |
| 1251 | ,GPIO_DIROUT_VAR3 |
| 1252 | #endif |
| 1253 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1254 | }; |
| 1255 | |
| 1256 | /* The '1' of the bit in the variables denotes that the direction input is allowed to be |
| 1257 | set for the corresponding pin. */ |
| 1258 | const kal_uint32 gpio_dir_in_allowed[] = { |
| 1259 | GPIO_DIRIN_VAR0 |
| 1260 | #if !defined(DRV_GPIO_REG_AS_6205B) && !defined(DRV_GPIO_REG_AS_TK6516) && !defined(DRV_GPIO_REG_AS_6270A) |
| 1261 | ,GPIO_DIRIN_VAR1 |
| 1262 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E_1) || defined(DRV_GPIO_REG_AS_6256) |
| 1263 | ,GPIO_DIRIN_VAR2 |
| 1264 | #endif |
| 1265 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6256) |
| 1266 | ,GPIO_DIRIN_VAR3 |
| 1267 | #endif |
| 1268 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1269 | }; |
| 1270 | |
| 1271 | #if (!defined(DRV_GPIO_WO_GPO)) |
| 1272 | const kal_uint16 gpo_mode_allowed[] = { |
| 1273 | GPO_MODE0_VAR0, GPO_MODE1_VAR0, GPO_MODE2_VAR0, GPO_MODE3_VAR0 |
| 1274 | }; |
| 1275 | kal_uint16 gpo_check_for_write[] = { |
| 1276 | 0xffff |
| 1277 | }; |
| 1278 | #endif /*!defined(DRV_GPIO_REG_AS_6223)*/ |
| 1279 | |
| 1280 | |
| 1281 | |
| 1282 | /*********************************************************************************************/ |
| 1283 | /*********************************************************************************************/ |
| 1284 | /*** The '1' of the bit in the variables denotes that the mode is allowed to be set for the **/ |
| 1285 | /*** corresponding pin.***********************************************************************/ |
| 1286 | /*************************************END*****************************************************/ |
| 1287 | /**********************************************************************************************/ |
| 1288 | |
| 1289 | #if defined(MT6276_S01) |
| 1290 | #define CLK_MUX_SEL0_VALUE (CLKSEL1 | (CLKSEL2<<4) | (CLKSEL3<<8)| (CLKSEL4<<12) \ |
| 1291 | |(CLKSEL5<<16)|(CLKSEL6<<20)|(CLKSEL7<<24)|(CLKSEL8<<28)) |
| 1292 | |
| 1293 | #define CLK_MUX_SEL1_VALUE (CLKSEL9 | (CLKSEL10<<4) | (CLKSEL11<<8)| (CLKSEL12<<12) \ |
| 1294 | |(CLKSEL13<<16)) |
| 1295 | const kal_uint32 GPIO_CLK_SEL[13]={CLKSEL1,CLKSEL2,CLKSEL3,CLKSEL4,CLKSEL5,CLKSEL6,CLKSEL7, \ |
| 1296 | CLKSEL8,CLKSEL9,CLKSEL10,CLKSEL11,CLKSEL12,CLKSEL13}; |
| 1297 | #endif |
| 1298 | |
| 1299 | #endif /* __CHIP_SUPP_GPIO_DRV_TOOL__ */ |
| 1300 | |
| 1301 | |
| 1302 | /*********************************************************************************************/ |
| 1303 | /*********************************************************************************************/ |
| 1304 | /************************************** GPIO_Setting_init*************************************/ |
| 1305 | /************************************START***************************************************/ |
| 1306 | /**********************************************************************************************/ |
| 1307 | |
| 1308 | void GPIO_setting_init(void) |
| 1309 | { |
| 1310 | #if !defined(DRV_GPIO_OFF) |
| 1311 | #if defined(__CHIP_SUPP_GPIO_DRV_TOOL__) |
| 1312 | #if defined(DRV_GPIO_6290_SERIES) |
| 1313 | // PDN_CLR(PDN_GPIO); |
| 1314 | #if 0 // !defined(TK6291) |
| 1315 | /* under construction !*/ |
| 1316 | /* under construction !*/ |
| 1317 | #endif |
| 1318 | #endif |
| 1319 | |
| 1320 | #if !defined(DRV_GPIO_MODE_4BITS) && !defined(DRV_GPIO_MODE_3BITS) && !defined(DRV_GPIO_6290_SERIES) |
| 1321 | DRV_GPIO_WriteReg(GPIO_MODE1, GPIO_MODE_REG1); |
| 1322 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 1323 | DRV_GPIO_WriteReg(GPIO_MODE2, GPIO_MODE_REG2); |
| 1324 | DRV_GPIO_WriteReg(GPIO_MODE3, GPIO_MODE_REG3); |
| 1325 | #if defined(DRV_GPIO_REG_AS_6205B) |
| 1326 | /* Note that for MT6205B, GPO mode register is on GPIO_MODE3, not GPO_MODE. */ |
| 1327 | DRV_GPIO_WriteReg(GPIO_MODE4, GPO_MODE_REG); |
| 1328 | #elif defined(DRV_GPIO_REG_AS_6270A) |
| 1329 | DRV_GPIO_WriteReg(GPIO_MODE4, GPIO_MODE_REG4); |
| 1330 | #else /* defined(DRV_GPIO_REG_AS_6270A) */ |
| 1331 | DRV_GPIO_WriteReg(GPIO_MODE4, GPIO_MODE_REG4); |
| 1332 | DRV_GPIO_WriteReg(GPIO_MODE5, GPIO_MODE_REG5); |
| 1333 | DRV_GPIO_WriteReg(GPIO_MODE6, GPIO_MODE_REG6); |
| 1334 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E) |
| 1335 | DRV_GPIO_WriteReg(GPIO_MODE7, GPIO_MODE_REG7); |
| 1336 | #if defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6276) |
| 1337 | DRV_GPIO_WriteReg(GPIO_MODE8, GPIO_MODE_REG8); |
| 1338 | #if defined(DRV_GPIO_REG_AS_6228) |
| 1339 | DRV_GPIO_WriteReg(GPIO_MODE9, GPIO_MODE_REG9); |
| 1340 | DRV_GPIO_WriteReg(GPIO_MODE10, GPIO_MODE_REG10); |
| 1341 | #endif |
| 1342 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) |
| 1343 | DRV_GPIO_WriteReg(GPIO_MODE9, GPIO_MODE_REG9); |
| 1344 | #if !defined(DRV_GPIO_REG_AS_6236) |
| 1345 | DRV_GPIO_WriteReg(GPIO_MODEA, GPIO_MODE_REGA); |
| 1346 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 1347 | DRV_GPIO_WriteReg(GPIO_MODEB, GPIO_MODE_REGB); |
| 1348 | #endif |
| 1349 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 1350 | DRV_GPIO_WriteReg(GPIO_MODEB, GPIO_MODE_REGB); |
| 1351 | DRV_GPIO_WriteReg(GPIO_MODEC, GPIO_MODE_REGC); |
| 1352 | DRV_GPIO_WriteReg(GPIO_MODED, GPIO_MODE_REGD); |
| 1353 | #if defined(DRV_GPIO_REG_AS_6276) |
| 1354 | DRV_GPIO_WriteReg(GPIO_MODEE, GPIO_MODE_REGE); |
| 1355 | #endif // defined(DRV_GPIO_REG_AS_6276) |
| 1356 | #endif |
| 1357 | #endif //!defined(DRV_GPIO_REG_AS_6236) |
| 1358 | #endif |
| 1359 | #endif |
| 1360 | #endif |
| 1361 | #if (!defined(DRV_GPIO_WO_GPO)) |
| 1362 | DRV_GPIO_WriteReg(GPO_MODE, GPO_MODE_REG); |
| 1363 | #endif |
| 1364 | #endif /* defined(DRV_GPIO_REG_AS_6205B) */ |
| 1365 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 1366 | #elif defined(DRV_GPIO_MODE_3BITS) |
| 1367 | #if defined(DRV_GPIO_REG_AS_6276) |
| 1368 | DRV_GPIO_WriteReg(GPIO_MODE0, GPIO_MODE_REG0); |
| 1369 | DRV_GPIO_WriteReg(GPIO_MODE1, GPIO_MODE_REG1); |
| 1370 | DRV_GPIO_WriteReg(GPIO_MODE2, GPIO_MODE_REG2); |
| 1371 | DRV_GPIO_WriteReg(GPIO_MODE3, GPIO_MODE_REG3); |
| 1372 | DRV_GPIO_WriteReg(GPIO_MODE4, GPIO_MODE_REG4); |
| 1373 | DRV_GPIO_WriteReg(GPIO_MODE5, GPIO_MODE_REG5); |
| 1374 | DRV_GPIO_WriteReg(GPIO_MODE6, GPIO_MODE_REG6); |
| 1375 | DRV_GPIO_WriteReg(GPIO_MODE7, GPIO_MODE_REG7); |
| 1376 | DRV_GPIO_WriteReg(GPIO_MODE8, GPIO_MODE_REG8); |
| 1377 | DRV_GPIO_WriteReg(GPIO_MODE9, GPIO_MODE_REG9); |
| 1378 | DRV_GPIO_WriteReg(GPIO_MODEA, GPIO_MODE_REGA); |
| 1379 | DRV_GPIO_WriteReg(GPIO_MODEB, GPIO_MODE_REGB); |
| 1380 | DRV_GPIO_WriteReg(GPIO_MODEC, GPIO_MODE_REGC); |
| 1381 | DRV_GPIO_WriteReg(GPIO_MODED, GPIO_MODE_REGD); |
| 1382 | DRV_GPIO_WriteReg(GPIO_MODEE, GPIO_MODE_REGE); |
| 1383 | DRV_GPIO_WriteReg(GPIO_MODEF, GPIO_MODE_REGF); |
| 1384 | DRV_GPIO_WriteReg(GPIO_MODE10, GPIO_MODE_REG10); |
| 1385 | DRV_GPIO_WriteReg(GPIO_MODE11, GPIO_MODE_REG11); |
| 1386 | DRV_GPIO_WriteReg(GPIO_MODE12, GPIO_MODE_REG12); |
| 1387 | DRV_GPIO_WriteReg(GPIO_MODE13, GPIO_MODE_REG13); |
| 1388 | DRV_GPIO_WriteReg(GPIO_MODE14, GPIO_MODE_REG14); |
| 1389 | DRV_GPIO_WriteReg(GPIO_MODE15, GPIO_MODE_REG15); |
| 1390 | //wait after drv_tool check in, there should modify. |
| 1391 | // DRV_GPIO_WriteReg(GPIO_MODE16, GPIO_MODE_REG16); |
| 1392 | #endif |
| 1393 | #else // DRV_GPIO_MODE_4BITS is not defined |
| 1394 | #if defined(DRV_GPIO_REG_AS_6253E_1) |
| 1395 | DRV_GPIO_WriteReg32(GPIO_MODE1, GPIO_MODE_REG1); |
| 1396 | DRV_GPIO_WriteReg32(GPIO_MODE2, GPIO_MODE_REG2); |
| 1397 | DRV_GPIO_WriteReg32(GPIO_MODE3, GPIO_MODE_REG3); |
| 1398 | DRV_GPIO_WriteReg32(GPIO_MODE4, GPIO_MODE_REG4); |
| 1399 | DRV_GPIO_WriteReg32(GPIO_MODE5, GPIO_MODE_REG5); |
| 1400 | DRV_GPIO_WriteReg32(GPIO_MODE6, GPIO_MODE_REG6); |
| 1401 | DRV_GPIO_WriteReg32(GPIO_MODE7, GPIO_MODE_REG7); |
| 1402 | DRV_GPIO_WriteReg32(GPIO_MODE8, GPIO_MODE_REG8); |
| 1403 | DRV_GPIO_WriteReg32(GPIO_MODE9, GPIO_MODE_REG9); |
| 1404 | #endif |
| 1405 | |
| 1406 | #if defined(DRV_GPIO_REG_AS_6255) |
| 1407 | DRV_GPIO_WriteReg(GPIO_MODE1, GPIO_MODE_REG1); |
| 1408 | DRV_GPIO_WriteReg(GPIO_MODE2, GPIO_MODE_REG2); |
| 1409 | DRV_GPIO_WriteReg(GPIO_MODE3, GPIO_MODE_REG3); |
| 1410 | DRV_GPIO_WriteReg(GPIO_MODE4, GPIO_MODE_REG4); |
| 1411 | DRV_GPIO_WriteReg(GPIO_MODE5, GPIO_MODE_REG5); |
| 1412 | DRV_GPIO_WriteReg(GPIO_MODE6, GPIO_MODE_REG6); |
| 1413 | DRV_GPIO_WriteReg(GPIO_MODE7, GPIO_MODE_REG7); |
| 1414 | DRV_GPIO_WriteReg(GPIO_MODE8, GPIO_MODE_REG8); |
| 1415 | DRV_GPIO_WriteReg(GPIO_MODE9, GPIO_MODE_REG9); |
| 1416 | DRV_GPIO_WriteReg(GPIO_MODE10, GPIO_MODE_REG10); |
| 1417 | DRV_GPIO_WriteReg(GPIO_MODE11, GPIO_MODE_REG11); |
| 1418 | DRV_GPIO_WriteReg(GPIO_MODE12, GPIO_MODE_REG12); |
| 1419 | DRV_GPIO_WriteReg(GPIO_MODE13, GPIO_MODE_REG13); |
| 1420 | DRV_GPIO_WriteReg(GPIO_MODE14, GPIO_MODE_REG14); |
| 1421 | DRV_GPIO_WriteReg(GPIO_MODE15, GPIO_MODE_REG15); |
| 1422 | DRV_GPIO_WriteReg(GPIO_MODE16, GPIO_MODE_REG16); |
| 1423 | DRV_GPIO_WriteReg(GPIO_MODE17, GPIO_MODE_REG17); |
| 1424 | DRV_GPIO_WriteReg(GPIO_MODE18, GPIO_MODE_REG18); |
| 1425 | DRV_GPIO_WriteReg(GPIO_MODE19, GPIO_MODE_REG19); |
| 1426 | DRV_GPIO_WriteReg(GPIO_MODE20, GPIO_MODE_REG20); |
| 1427 | DRV_GPIO_WriteReg(GPIO_MODE21, GPIO_MODE_REG21); |
| 1428 | DRV_GPIO_WriteReg(GPIO_MODE22, GPIO_MODE_REG22); |
| 1429 | DRV_GPIO_WriteReg(GPIO_MODE23, GPIO_MODE_REG23); |
| 1430 | DRV_GPIO_WriteReg(GPIO_MODE24, GPIO_MODE_REG24); |
| 1431 | DRV_GPIO_WriteReg(GPIO_MODE25, GPIO_MODE_REG25); |
| 1432 | DRV_GPIO_WriteReg(GPIO_MODE26, GPIO_MODE_REG26); |
| 1433 | DRV_GPIO_WriteReg(GPIO_MODE27, GPIO_MODE_REG27); |
| 1434 | #elif defined(DRV_GPIO_REG_AS_6251) |
| 1435 | DRV_GPIO_WriteReg(GPIO_MODE1, GPIO_MODE_REG1); |
| 1436 | DRV_GPIO_WriteReg(GPIO_MODE2, GPIO_MODE_REG2); |
| 1437 | DRV_GPIO_WriteReg(GPIO_MODE3, GPIO_MODE_REG3); |
| 1438 | DRV_GPIO_WriteReg(GPIO_MODE4, GPIO_MODE_REG4); |
| 1439 | DRV_GPIO_WriteReg(GPIO_MODE5, GPIO_MODE_REG5); |
| 1440 | DRV_GPIO_WriteReg(GPIO_MODE6, GPIO_MODE_REG6); |
| 1441 | DRV_GPIO_WriteReg(GPIO_MODE7, GPIO_MODE_REG7); |
| 1442 | DRV_GPIO_WriteReg(GPIO_MODE8, GPIO_MODE_REG8); |
| 1443 | #endif //defined(DRV_GPIO_REG_AS_6255) |
| 1444 | #if defined(DRV_GPIO_REG_AS_6256) |
| 1445 | DRV_GPIO_WriteReg(GPIO_MODE1, GPIO_MODE_REG1); |
| 1446 | DRV_GPIO_WriteReg(GPIO_MODE2, GPIO_MODE_REG2); |
| 1447 | DRV_GPIO_WriteReg(GPIO_MODE3, GPIO_MODE_REG3); |
| 1448 | DRV_GPIO_WriteReg(GPIO_MODE4, GPIO_MODE_REG4); |
| 1449 | DRV_GPIO_WriteReg(GPIO_MODE5, GPIO_MODE_REG5); |
| 1450 | DRV_GPIO_WriteReg(GPIO_MODE6, GPIO_MODE_REG6); |
| 1451 | DRV_GPIO_WriteReg(GPIO_MODE7, GPIO_MODE_REG7); |
| 1452 | DRV_GPIO_WriteReg(GPIO_MODE8, GPIO_MODE_REG8); |
| 1453 | DRV_GPIO_WriteReg(GPIO_MODE9, GPIO_MODE_REG9); |
| 1454 | DRV_GPIO_WriteReg(GPIO_MODE10, GPIO_MODE_REG10); |
| 1455 | DRV_GPIO_WriteReg(GPIO_MODE11, GPIO_MODE_REG11); |
| 1456 | DRV_GPIO_WriteReg(GPIO_MODE12, GPIO_MODE_REG12); |
| 1457 | DRV_GPIO_WriteReg(GPIO_MODE13, GPIO_MODE_REG13); |
| 1458 | DRV_GPIO_WriteReg(GPIO_MODE14, GPIO_MODE_REG14); |
| 1459 | DRV_GPIO_WriteReg(GPIO_MODE15, GPIO_MODE_REG15); |
| 1460 | DRV_GPIO_WriteReg(GPIO_MODE16, GPIO_MODE_REG16); |
| 1461 | DRV_GPIO_WriteReg(GPIO_MODE17, GPIO_MODE_REG17); |
| 1462 | DRV_GPIO_WriteReg(GPIO_MODE18, GPIO_MODE_REG18); |
| 1463 | DRV_GPIO_WriteReg(GPIO_MODE19, GPIO_MODE_REG19); |
| 1464 | DRV_GPIO_WriteReg(GPIO_MODE20, GPIO_MODE_REG20); |
| 1465 | DRV_GPIO_WriteReg(GPIO_MODE21, GPIO_MODE_REG21); |
| 1466 | DRV_GPIO_WriteReg(GPIO_MODE22, GPIO_MODE_REG22); |
| 1467 | DRV_GPIO_WriteReg(GPIO_MODE23, GPIO_MODE_REG23); |
| 1468 | DRV_GPIO_WriteReg(GPIO_MODE24, GPIO_MODE_REG24); |
| 1469 | DRV_GPIO_WriteReg(GPIO_MODE25, GPIO_MODE_REG25); |
| 1470 | DRV_GPIO_WriteReg(GPIO_MODE26, GPIO_MODE_REG26); |
| 1471 | DRV_GPIO_WriteReg(GPIO_MODE27, GPIO_MODE_REG27); |
| 1472 | #endif //defined(DRV_GPIO_REG_AS_6256) |
| 1473 | #endif //defined(DRV_GPIO_MODE_4BITS) |
| 1474 | |
| 1475 | #if defined(DRV_GPIO_REG_AS_6205B) |
| 1476 | DRV_GPIO_WriteReg(GPIO_DIR, GPIO_DIR_REG1); |
| 1477 | DRV_GPIO_WriteReg(GPIO_DIR2, GPIO_DIR_REG2); |
| 1478 | #elif defined(DRV_GPIO_REG_AS_TK6516) |
| 1479 | DRV_GPIO_WriteReg(GPIO_DIR1, GPIO_DIR_REG1); |
| 1480 | #elif defined(DRV_GPIO_REG_AS_6270A) |
| 1481 | DRV_GPIO_WriteReg(GPIO_DIR1, GPIO_DIR_REG1); |
| 1482 | DRV_GPIO_WriteReg(GPIO_DIR2, GPIO_DIR_REG2); |
| 1483 | #else /* defined(DRV_GPIO_REG_AS_6270A) */ |
| 1484 | |
| 1485 | DRV_GPIO_WriteReg(GPIO_DIR1, GPIO_DIR_REG1); |
| 1486 | DRV_GPIO_WriteReg(GPIO_DIR2, GPIO_DIR_REG2); |
| 1487 | #if !defined(DRV_GPIO_REG_AS_6290) |
| 1488 | DRV_GPIO_WriteReg(GPIO_DIR3, GPIO_DIR_REG3); |
| 1489 | #endif |
| 1490 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E)|| defined(DRV_GPIO_REG_AS_6253E_1) |
| 1491 | DRV_GPIO_WriteReg(GPIO_DIR4, GPIO_DIR_REG4); |
| 1492 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 1493 | DRV_GPIO_WriteReg(GPIO_DIR5, GPIO_DIR_REG5); |
| 1494 | #endif |
| 1495 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 1496 | DRV_GPIO_WriteReg(GPIO_DIR5, GPIO_DIR_REG5); |
| 1497 | DRV_GPIO_WriteReg(GPIO_DIR6, GPIO_DIR_REG6); |
| 1498 | #endif |
| 1499 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 1500 | DRV_GPIO_WriteReg(GPIO_DIR5, GPIO_DIR_REG5); |
| 1501 | DRV_GPIO_WriteReg(GPIO_DIR6, GPIO_DIR_REG6); |
| 1502 | DRV_GPIO_WriteReg(GPIO_DIR7, GPIO_DIR_REG7); |
| 1503 | #endif |
| 1504 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 1505 | DRV_GPIO_WriteReg(GPIO_DIR4, GPIO_DIR_REG4); |
| 1506 | DRV_GPIO_WriteReg(GPIO_DIR5, GPIO_DIR_REG5); |
| 1507 | DRV_GPIO_WriteReg(GPIO_DIR6, GPIO_DIR_REG6); |
| 1508 | DRV_GPIO_WriteReg(GPIO_DIR7, GPIO_DIR_REG7); |
| 1509 | #endif |
| 1510 | #endif |
| 1511 | |
| 1512 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_TK6516) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6270A) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6251) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6253E_1) || defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6290) |
| 1513 | DRV_GPIO_WriteReg(GPIO_PULLSEL1, GPIO_PULLSEL_REG1); |
| 1514 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 1515 | DRV_GPIO_WriteReg(GPIO_PULLSEL2, GPIO_PULLSEL_REG2); |
| 1516 | #if !defined(DRV_GPIO_REG_AS_6270A) && !defined(DRV_GPIO_REG_AS_6290) |
| 1517 | DRV_GPIO_WriteReg(GPIO_PULLSEL3, GPIO_PULLSEL_REG3); |
| 1518 | #if !defined(DRV_GPIO_REG_AS_6251) |
| 1519 | DRV_GPIO_WriteReg(GPIO_PULLSEL4, GPIO_PULLSEL_REG4); |
| 1520 | #if !defined(DRV_GPIO_REG_AS_6253E) |
| 1521 | DRV_GPIO_WriteReg(GPIO_PULLSEL5, GPIO_PULLSEL_REG5); |
| 1522 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 1523 | DRV_GPIO_WriteReg(GPIO_PULLSEL6, GPIO_PULLSEL_REG6); |
| 1524 | #endif |
| 1525 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 1526 | DRV_GPIO_WriteReg(GPIO_PULLSEL6, GPIO_PULLSEL_REG6); |
| 1527 | DRV_GPIO_WriteReg(GPIO_PULLSEL7, GPIO_PULLSEL_REG7); |
| 1528 | #endif |
| 1529 | #endif //!defined(DRV_GPIO_REG_AS_6253E) |
| 1530 | #endif //!defined(DRV_GPIO_REG_AS_6251) |
| 1531 | #endif //!defined(DRV_GPIO_REG_AS_6270A) |
| 1532 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 1533 | #endif |
| 1534 | |
| 1535 | #if defined(DRV_GPIO_REG_AS_6205B) |
| 1536 | DRV_GPIO_WriteReg(GPIO_PULLEN, GPIO_PULL_REG1); |
| 1537 | DRV_GPIO_WriteReg(GPIO_PULLEN2, GPIO_PULL_REG2); |
| 1538 | #elif defined(DRV_GPIO_REG_AS_TK6516) |
| 1539 | DRV_GPIO_WriteReg(GPIO_PULLEN1, GPIO_PULL_REG1); |
| 1540 | #elif defined(DRV_GPIO_REG_AS_6270A) |
| 1541 | DRV_GPIO_WriteReg(GPIO_PULLEN1, GPIO_PULL_REG1); |
| 1542 | DRV_GPIO_WriteReg(GPIO_PULLEN2, GPIO_PULL_REG2); |
| 1543 | #else /* defined(DRV_GPIO_REG_AS_6270A) */ |
| 1544 | DRV_GPIO_WriteReg(GPIO_PULLEN1, GPIO_PULL_REG1); |
| 1545 | DRV_GPIO_WriteReg(GPIO_PULLEN2, GPIO_PULL_REG2); |
| 1546 | #if !defined(DRV_GPIO_REG_AS_6290) |
| 1547 | DRV_GPIO_WriteReg(GPIO_PULLEN3, GPIO_PULL_REG3); |
| 1548 | #endif |
| 1549 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 1550 | DRV_GPIO_WriteReg(GPIO_PULLEN4, GPIO_PULL_REG4); |
| 1551 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 1552 | DRV_GPIO_WriteReg(GPIO_PULLEN5, GPIO_PULL_REG5); |
| 1553 | #endif |
| 1554 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 1555 | DRV_GPIO_WriteReg(GPIO_PULLEN5, GPIO_PULL_REG5); |
| 1556 | DRV_GPIO_WriteReg(GPIO_PULLEN6, GPIO_PULL_REG6); |
| 1557 | #endif |
| 1558 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 1559 | DRV_GPIO_WriteReg(GPIO_PULLEN5, GPIO_PULL_REG5); |
| 1560 | DRV_GPIO_WriteReg(GPIO_PULLEN6, GPIO_PULL_REG6); |
| 1561 | DRV_GPIO_WriteReg(GPIO_PULLEN7, GPIO_PULL_REG7); |
| 1562 | #endif |
| 1563 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 1564 | DRV_GPIO_WriteReg(GPIO_PULLEN4, GPIO_PULL_REG4); |
| 1565 | DRV_GPIO_WriteReg(GPIO_PULLEN5, GPIO_PULL_REG5); |
| 1566 | DRV_GPIO_WriteReg(GPIO_PULLEN6, GPIO_PULL_REG6); |
| 1567 | DRV_GPIO_WriteReg(GPIO_PULLEN7, GPIO_PULL_REG7); |
| 1568 | #endif |
| 1569 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1570 | |
| 1571 | #if !defined(DRV_GPIO_REG_AS_6205B) |
| 1572 | DRV_GPIO_WriteReg(GPIO_DINV1, GPIO_INV_REG1); |
| 1573 | #if !defined(DRV_GPIO_REG_AS_TK6516) |
| 1574 | DRV_GPIO_WriteReg(GPIO_DINV2, GPIO_INV_REG2); |
| 1575 | #if !defined(DRV_GPIO_REG_AS_6270A) && !defined(DRV_GPIO_REG_AS_6251) && !defined(DRV_GPIO_REG_AS_6290) |
| 1576 | DRV_GPIO_WriteReg(GPIO_DINV3, GPIO_INV_REG3); |
| 1577 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 1578 | DRV_GPIO_WriteReg(GPIO_DINV4, GPIO_INV_REG4); |
| 1579 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 1580 | DRV_GPIO_WriteReg(GPIO_DINV5, GPIO_INV_REG5); |
| 1581 | #endif |
| 1582 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) |
| 1583 | DRV_GPIO_WriteReg(GPIO_DINV5, GPIO_INV_REG5); |
| 1584 | DRV_GPIO_WriteReg(GPIO_DINV6, GPIO_INV_REG6); |
| 1585 | #endif |
| 1586 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 1587 | DRV_GPIO_WriteReg(GPIO_DINV5, GPIO_INV_REG5); |
| 1588 | DRV_GPIO_WriteReg(GPIO_DINV6, GPIO_INV_REG6); |
| 1589 | DRV_GPIO_WriteReg(GPIO_DINV7, GPIO_INV_REG7); |
| 1590 | #endif |
| 1591 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 1592 | DRV_GPIO_WriteReg(GPIO_DINV4, GPIO_INV_REG4); |
| 1593 | DRV_GPIO_WriteReg(GPIO_DINV5, GPIO_INV_REG5); |
| 1594 | DRV_GPIO_WriteReg(GPIO_DINV6, GPIO_INV_REG6); |
| 1595 | DRV_GPIO_WriteReg(GPIO_DINV7, GPIO_INV_REG7); |
| 1596 | #endif |
| 1597 | #endif //!defined(DRV_GPIO_REG_AS_6270A) |
| 1598 | #endif /* !defined(DRV_GPIO_REG_AS_TK6516) */ |
| 1599 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1600 | |
| 1601 | #if defined(DRV_GPIO_REG_AS_6205B) |
| 1602 | DRV_GPIO_WriteReg(GPIO_DOUT, GPIO_OUTPUT_REG1); |
| 1603 | DRV_GPIO_WriteReg(GPIO_DOUT2, GPIO_OUTPUT_REG2); |
| 1604 | #elif defined(DRV_GPIO_REG_AS_TK6516) |
| 1605 | DRV_GPIO_WriteReg(GPIO_DOUT1, GPIO_OUTPUT_REG1); |
| 1606 | #elif defined(DRV_GPIO_REG_AS_6270A) |
| 1607 | DRV_GPIO_WriteReg(GPIO_DOUT1, GPIO_OUTPUT_REG1); |
| 1608 | DRV_GPIO_WriteReg(GPIO_DOUT2, GPIO_OUTPUT_REG2); |
| 1609 | #else /* defined(DRV_GPIO_REG_AS_6270A) */ |
| 1610 | DRV_GPIO_WriteReg(GPIO_DOUT1, GPIO_OUTPUT_REG1); |
| 1611 | DRV_GPIO_WriteReg(GPIO_DOUT2, GPIO_OUTPUT_REG2); |
| 1612 | #if !defined(DRV_GPIO_REG_AS_6290) |
| 1613 | DRV_GPIO_WriteReg(GPIO_DOUT3, GPIO_OUTPUT_REG3); |
| 1614 | #endif |
| 1615 | #if defined(DRV_GPIO_REG_AS_6219) || defined(DRV_GPIO_REG_AS_6227) || defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6225) || defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) || defined(DRV_GPIO_REG_AS_6276) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 1616 | DRV_GPIO_WriteReg(GPIO_DOUT4, GPIO_OUTPUT_REG4); |
| 1617 | #if defined(DRV_GPIO_REG_AS_6228) || defined(DRV_GPIO_REG_AS_6235) || defined(DRV_GPIO_REG_AS_6236) || defined(DRV_GPIO_REG_AS_6253E_1) |
| 1618 | DRV_GPIO_WriteReg(GPIO_DOUT5, GPIO_OUTPUT_REG5); |
| 1619 | #endif |
| 1620 | #if defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6255) |
| 1621 | DRV_GPIO_WriteReg(GPIO_DOUT5, GPIO_OUTPUT_REG5); |
| 1622 | DRV_GPIO_WriteReg(GPIO_DOUT6, GPIO_OUTPUT_REG6); |
| 1623 | #endif |
| 1624 | #if defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6276) |
| 1625 | DRV_GPIO_WriteReg(GPIO_DOUT5, GPIO_OUTPUT_REG5); |
| 1626 | DRV_GPIO_WriteReg(GPIO_DOUT6, GPIO_OUTPUT_REG6); |
| 1627 | DRV_GPIO_WriteReg(GPIO_DOUT7, GPIO_OUTPUT_REG7); |
| 1628 | #endif |
| 1629 | #elif defined(DRV_GPIO_REG_AS_6256) || defined(DRV_GPIO_REG_AS_6255) |
| 1630 | DRV_GPIO_WriteReg(GPIO_DOUT4, GPIO_OUTPUT_REG4); |
| 1631 | DRV_GPIO_WriteReg(GPIO_DOUT5, GPIO_OUTPUT_REG5); |
| 1632 | DRV_GPIO_WriteReg(GPIO_DOUT6, GPIO_OUTPUT_REG6); |
| 1633 | DRV_GPIO_WriteReg(GPIO_DOUT7, GPIO_OUTPUT_REG7); |
| 1634 | #endif |
| 1635 | #endif /* !defined(DRV_GPIO_REG_AS_6205B) */ |
| 1636 | #if (!defined(DRV_GPIO_WO_GPO)) |
| 1637 | DRV_GPIO_WriteReg(GPO_DOUT, GPO_OUTPUT_REG1); |
| 1638 | #endif |
| 1639 | |
| 1640 | #if defined(DRV_GPIO_REG_AS_6253E) |
| 1641 | DRV_GPIO_WriteReg(GPIO_SPMODE, GPIO_SPMODE_REG); |
| 1642 | DRV_GPIO_WriteReg(GPIO_BANK, GPIO_BANK_REG); |
| 1643 | #elif defined(DRV_GPIO_REG_AS_6253E_1) |
| 1644 | DRV_GPIO_WriteReg32(GPIO_SPMODE0, GPIO_SPMODE0_REG); |
| 1645 | DRV_GPIO_WriteReg32(GPIO_SPMODE1, GPIO_SPMODE1_REG); |
| 1646 | #endif //defined(DRV_GPIO_REG_AS_6253E) |
| 1647 | |
| 1648 | #if defined(MT6276_S01) |
| 1649 | DRV_GPIO_WriteReg32(CLK_MUX_SEL0, CLK_MUX_SEL0_VALUE); |
| 1650 | DRV_GPIO_WriteReg32(CLK_MUX_SEL1, CLK_MUX_SEL1_VALUE); |
| 1651 | #endif |
| 1652 | |
| 1653 | #endif /* __CHIP_SUPP_GPIO_DRV_TOOL__*/ |
| 1654 | #endif /*!defined(DRV_GPIO_OFF)*/ |
| 1655 | } |
| 1656 | |
| 1657 | #endif /* __CUST_NEW__ */ |
| 1658 | |
| 1659 | /*********************************************************************************************/ |
| 1660 | /*********************************************************************************************/ |
| 1661 | /************************************** GPIO_Setting_init*************************************/ |
| 1662 | /************************************END******************************************************/ |