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 | * i2c_dual_sw.h |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * Maui_Software |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * This file is intended for I2C DUAL driver. |
| 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 | * removed! |
| 66 | * removed! |
| 67 | * removed! |
| 68 | * removed! |
| 69 | * removed! |
| 70 | * removed! |
| 71 | * removed! |
| 72 | * removed! |
| 73 | * removed! |
| 74 | * removed! |
| 75 | * removed! |
| 76 | * removed! |
| 77 | * removed! |
| 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 | * removed! |
| 114 | * |
| 115 | * removed! |
| 116 | * removed! |
| 117 | * removed! |
| 118 | * |
| 119 | * removed! |
| 120 | * removed! |
| 121 | * removed! |
| 122 | * |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * removed! |
| 126 | * |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * removed! |
| 130 | * |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * removed! |
| 134 | * |
| 135 | * removed! |
| 136 | * removed! |
| 137 | * removed! |
| 138 | * |
| 139 | * removed! |
| 140 | * removed! |
| 141 | * removed! |
| 142 | * |
| 143 | * removed! |
| 144 | * removed! |
| 145 | * removed! |
| 146 | * |
| 147 | * removed! |
| 148 | * removed! |
| 149 | * removed! |
| 150 | * |
| 151 | * removed! |
| 152 | * removed! |
| 153 | * removed! |
| 154 | * |
| 155 | * removed! |
| 156 | * removed! |
| 157 | * removed! |
| 158 | * |
| 159 | *------------------------------------------------------------------------------ |
| 160 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 161 | *============================================================================ |
| 162 | ****************************************************************************/ |
| 163 | |
| 164 | #ifndef __I2C_PMIC_SW_H__ |
| 165 | #define __I2C_PMIC_SW_H__ |
| 166 | |
| 167 | #define I2C_PMIC_DBG_LOG_ENABLE |
| 168 | #define I2C_PMIC_DBG_PATTERN_ENABLE |
| 169 | //#define I2C_PMIC_DISABLE_DCM |
| 170 | |
| 171 | #if defined(I2C_PMIC_DBG_LOG_ENABLE) |
| 172 | #define I2C_PMIC_LOG i2c_pmic_log |
| 173 | #else |
| 174 | #define I2C_PMIC_LOG(...) |
| 175 | #endif |
| 176 | |
| 177 | typedef enum |
| 178 | { |
| 179 | I2C_PMIC_READY_STATE = 0, |
| 180 | I2C_PMIC_READ_STATE, |
| 181 | I2C_PMIC_WRITE_STATE |
| 182 | }I2C_PMIC_STATE; |
| 183 | |
| 184 | typedef enum |
| 185 | { |
| 186 | I2C_PMIC_QUERY = 0, |
| 187 | I2C_PMIC_READ, |
| 188 | I2C_PMIC_WRITE |
| 189 | }I2C_PMIC_POLLING_TYPE; |
| 190 | |
| 191 | |
| 192 | /* GCC porting related */ |
| 193 | #if defined(__UBL__) || defined(__FUE__) |
| 194 | #ifdef __MTK_TARGET__ |
| 195 | |
| 196 | #define __i2csection(S) __attribute__ ((section (#S))) |
| 197 | /* Tag variables with this */ |
| 198 | #define __emiinitrw __i2csection(EMIINITRW) |
| 199 | #define __emiinitzi __i2csection(EMIINITZI) |
| 200 | /* Tag constants with this */ |
| 201 | #define __emiinitconst __i2csection(EMIINITCONST) |
| 202 | /* Tag function with this */ |
| 203 | #define __emiinitcode __i2csection(EMIINITCODE) |
| 204 | |
| 205 | #endif /* __MTK_TARGET__ */ |
| 206 | #else //#if defined(__UBL__) || defined(__FUE__) |
| 207 | |
| 208 | #define __emiinitrw |
| 209 | #define __emiinitzi |
| 210 | #define __emiinitconst |
| 211 | #define __emiinitcode |
| 212 | |
| 213 | #endif //#if defined(__UBL__) || defined(__FUE__) |
| 214 | |
| 215 | typedef enum |
| 216 | { |
| 217 | I2C_byte_return, |
| 218 | I2C_byte_write, |
| 219 | I2C_field_write, |
| 220 | I2C_read_sw_end, |
| 221 | I2C_write_sw_end, |
| 222 | I2C_polling_finish_reading, |
| 223 | I2C_polling_finish_writing, |
| 224 | I2C_polling_finish_reading_error, |
| 225 | I2C_polling_finish_writing_error, |
| 226 | I2C_polling_other_reading, |
| 227 | I2C_polling_other_writing, |
| 228 | I2C_polling_finish_other_reading, |
| 229 | I2C_polling_finish_other_writing, |
| 230 | I2C_polling_finish_other_reading_error, |
| 231 | I2C_polling_finish_other_writing_error, |
| 232 | I2C_polling_rdy_query, |
| 233 | I2C_polling_rdy_read, |
| 234 | I2C_polling_rdy_write, |
| 235 | I2C_polling_other_finish_mine |
| 236 | }I2C_PMIC_DBG_INFO; |
| 237 | |
| 238 | typedef struct |
| 239 | { |
| 240 | I2C_PMIC_DBG_INFO type; |
| 241 | kal_uint32 qbit; |
| 242 | kal_uint32 time; |
| 243 | kal_uint32 irqmask; |
| 244 | kal_uint32 token; |
| 245 | kal_uint32 hwowner; |
| 246 | kal_uint32 PDNStatus; |
| 247 | }I2C_PMIC_DBG_LOG; |
| 248 | |
| 249 | extern void i2c_pmic_log(I2C_PMIC_DBG_INFO type,kal_uint32 var); |
| 250 | |
| 251 | |
| 252 | #endif // #ifndef __I2C_PMIC_SW_H__ |
| 253 | |