rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | |
| 2 | |
| 3 | |
| 4 | #ifndef __DCL_PMU6253_SW_H_STRUCT__ |
| 5 | #define __DCL_PMU6253_SW_H_STRUCT__ |
| 6 | |
| 7 | #include "dcl_pmic_features.h" |
| 8 | |
| 9 | #if defined(PMIC_6253_REG_API) |
| 10 | |
| 11 | /* Charger external interrupt is fixed. */ |
| 12 | |
| 13 | #define PMU_CHR_EINT_PIN 7 |
| 14 | |
| 15 | |
| 16 | /* adc number for measuring VBAT/VISENSE/VCHARGER is fixed internally. */ |
| 17 | #if defined(PMIC_6253_REG_API) |
| 18 | #if defined(DRV_MISC_PMU_ADC_CHANNEL_FROM_0) |
| 19 | #define PMU_ADC_VBAT_CH_NUM 0 |
| 20 | #define PMU_ADC_VISENSE_CH_NUM 1 |
| 21 | #define PMU_ADC_VCHARGER_CH_NUM 2 |
| 22 | #else // #if defined(DRV_MISC_PMU_ADC_CHANNEL_FROM_0) |
| 23 | #define PMU_ADC_VBAT_CH_NUM 3 |
| 24 | #define PMU_ADC_VISENSE_CH_NUM 4 |
| 25 | #define PMU_ADC_VCHARGER_CH_NUM 5 |
| 26 | #endif // #if defined(DRV_MISC_PMU_ADC_CHANNEL_FROM_0) |
| 27 | #endif // #elif defined(PMIC_6253_REG_API) |
| 28 | |
| 29 | /* adc factor for VBAT/VISENSE/VCHARGER */ |
| 30 | #define PMU_ADC_FACTOR_VBAT 100 |
| 31 | #define PMU_ADC_FACTOR_VISENSE 100 |
| 32 | #define PMU_ADC_FACTOR_VCHARGER 250 |
| 33 | |
| 34 | |
| 35 | // Define to enable PMU6253 charger watch dog timer kick |
| 36 | // When enable charger, PMU6253 will enable a watch dog timer |
| 37 | // We need to kick the timer periodically, to ontify PMU6253 that BB is alive |
| 38 | // If timeout, PMU6253 will disable charge automatically |
| 39 | // #### If this is NOT enabled, we will disable the watch dog timer function at boot time |
| 40 | // This should be defined when PMU driver need to perform WDT clear |
| 41 | // BMT already support charge WDT, so this should be comment |
| 42 | //#define PMU6253_ENABLE_DRIVER_CHARGE_WDT |
| 43 | |
| 44 | |
| 45 | // Define to disable charge WDT of PMU6253 |
| 46 | // Define only for debug purpose |
| 47 | //#define DEBUG_DISABLE_CHARGE_WDT |
| 48 | |
| 49 | |
| 50 | |
| 51 | // (0x800) VRF CON |
| 52 | typedef enum{ |
| 53 | VRF_ON_SEL_SRCLKENA=0, |
| 54 | VRF_ON_SEL_VRF_EN |
| 55 | }pmu6253_vrf_on_sel_enum; |
| 56 | |
| 57 | typedef enum{ |
| 58 | VD_SENSE_FROM_LOCAL_VOLTAGE=0, |
| 59 | VD_SENSE_FROM_REMOTE_VOLTAGE |
| 60 | }pmu6253_vd_sense_enum; |
| 61 | |
| 62 | // (0x810) VTCXO CON |
| 63 | typedef enum{ |
| 64 | VTCXO_ON_SEL_SRCLKENA=0, |
| 65 | VTCXO_ON_SEL_VTCXO_EN |
| 66 | }pmu6253_vtcxo_on_sel_enum; |
| 67 | |
| 68 | // (0x814) VA CON |
| 69 | typedef enum{ |
| 70 | VA_ON_SEL_ALWAYS_ON = 0, |
| 71 | VA_ON_SEL_SRCLKENA |
| 72 | }pmu6253_va_on_sel_enum; |
| 73 | |
| 74 | // (0x818) VSIM CON |
| 75 | typedef enum{ |
| 76 | PMU6253_VSIM_1_8V = 0, |
| 77 | PMU6253_VSIM_3_0V |
| 78 | }pmu6253_vsim_sel_enum; |
| 79 | |
| 80 | #if defined(__DRV_PMU53_SPEC_V1__) |
| 81 | |
| 82 | // (0x824) VBT CON ==> VBT move to 0x890 |
| 83 | typedef enum{ |
| 84 | VBT_SEL_2_8V = 0, |
| 85 | VBT_SEL_3_0V |
| 86 | }pmu6253_vbt_sel_enum; |
| 87 | |
| 88 | #else // #if defined(__DRV_PMU53_SPEC_V1__) |
| 89 | |
| 90 | // (0x890) VBT CON |
| 91 | typedef enum{ |
| 92 | VBT_SEL_1_5V = 0, |
| 93 | VBT_SEL_1_8V, |
| 94 | VBT_SEL_2_5V, |
| 95 | VBT_SEL_3_0V |
| 96 | }pmu6253_vbt_sel_enum; |
| 97 | |
| 98 | #endif // #if defined(__DRV_PMU53_SPEC_V1__) |
| 99 | |
| 100 | // (0x828) VCAMD CON |
| 101 | typedef enum{ |
| 102 | VCAMD_SEL_1_3V = 0, |
| 103 | VCAMD_SEL_1_5V, |
| 104 | VCAMD_SEL_1_8V, |
| 105 | VCAMD_SEL_2_8V |
| 106 | }pmu6253_vcamd_sel_enum; |
| 107 | |
| 108 | // (0x82C) VCAMA CON |
| 109 | typedef enum{ |
| 110 | VCAMA_SEL_1_5V = 0, |
| 111 | VCAMA_SEL_1_8V, |
| 112 | VCAMA_SEL_2_5V, |
| 113 | VCAMA_SEL_2_8V |
| 114 | }pmu6253_vcama_sel_enum; |
| 115 | |
| 116 | // (0x834) GPIO CON |
| 117 | typedef enum{ |
| 118 | GPIO_DRV_8_MA=0, |
| 119 | GPIO_DRV_4_MA |
| 120 | }pmu6253_gpio_drv_sel_enum; |
| 121 | |
| 122 | // (0x844) VCORE CON1 |
| 123 | typedef enum{ |
| 124 | VCORE_MODESET_PWM = 0, |
| 125 | VCORE_MODESET_PFM |
| 126 | }pmu6253_vcore_modeset_enum; |
| 127 | |
| 128 | typedef enum{ |
| 129 | VCORE_ADC_IN_NEGATIVE_EDGE = 0, |
| 130 | VCORE_ADC_IN_POSITIVE_EDGE |
| 131 | }pmu6253_vcore_adc_in_enum; |
| 132 | |
| 133 | typedef enum{ |
| 134 | VCORE_26MHZ_DIVIDED_BY_32 = 0, |
| 135 | VCORE_26MHZ_DIVIDED_BY_16 |
| 136 | }pmu6253_vcore_fast_slow_enum; |
| 137 | |
| 138 | typedef enum{ |
| 139 | VCORE_PWMB_3_BITS = 0, |
| 140 | VCORE_PWMB_4_BITS |
| 141 | }pmu_6253_vcore_pwmb_enum; |
| 142 | |
| 143 | // (0x848) VCORE CON2 |
| 144 | typedef enum{ |
| 145 | VCORE_VOLSEL_1_4V_TO_2_2V = 0, |
| 146 | VCORE_VOLSEL_0_8V_TO_1_6V |
| 147 | }pmu6253_vcore_volsel_enum; |
| 148 | |
| 149 | // (0x84C) VCORE CON3 |
| 150 | typedef enum{ |
| 151 | VCORE_VFBADJ_0_85V = 0, |
| 152 | VCORE_VFBADJ_0_90V, |
| 153 | VCORE_VFBADJ_0_95V, |
| 154 | VCORE_VFBADJ_1_00V, |
| 155 | VCORE_VFBADJ_1_05V, |
| 156 | VCORE_VFBADJ_1_10V, |
| 157 | VCORE_VFBADJ_1_15V, |
| 158 | VCORE_VFBADJ_1_20V, |
| 159 | VCORE_VFBADJ_1_25V, |
| 160 | VCORE_VFBADJ_1_30V, |
| 161 | VCORE_VFBADJ_1_35V, |
| 162 | VCORE_VFBADJ_1_40V, |
| 163 | VCORE_VFBADJ_1_45V, |
| 164 | VCORE_VFBADJ_1_50V, |
| 165 | VCORE_VFBADJ_1_55V, |
| 166 | VCORE_VFBADJ_1_60V |
| 167 | }pmu6253_vcore_vfbadj_enum; |
| 168 | |
| 169 | typedef enum{ |
| 170 | VCORE_DIRECT_CTRL_DVFS = 0, |
| 171 | VCORE_DIRECT_CTRL_DIRECT_FEED_THROUGH |
| 172 | }pmu6253_vcore_direct_ctrl_enum; |
| 173 | |
| 174 | typedef enum{ |
| 175 | VCORE_DCVCLKSEL_INTERNAL = 0, |
| 176 | VCORE_DCVCLKSEL_EXTERNAL |
| 177 | }pmu6253_vcore_dcvclksel_enum; |
| 178 | |
| 179 | typedef enum{ |
| 180 | VCORE_MODEEN_MANUAL_CHANGE_MODE = 0, |
| 181 | VCORE_MODEEN_MANUAL_AUTO_CHANGE_MODE, |
| 182 | VCORE_MODEEN_MANUAL_SW_CHANGE_MODE |
| 183 | }pmu6253_vcore_modeen_enum; |
| 184 | |
| 185 | typedef enum{ |
| 186 | VCORE_MODECMP_LOW_OFFSET = 0, |
| 187 | VCORE_MODECMP_AUTO_ZERO |
| 188 | }pmu6253_vcore_modecmp_enum; |
| 189 | |
| 190 | typedef enum{ |
| 191 | VCORE_MODESEL1A_NCD_MODE = 0, |
| 192 | VCORE_MODESEL1A_AVG_CURRENT_MODE |
| 193 | }pmu6253_vcore_modesel1a_enum; |
| 194 | |
| 195 | typedef enum{ |
| 196 | VCORE_CLK_SOURCE_FROM_CLKSQ = 0, |
| 197 | VCORE_CLK_SOURCE_FROM_TCXO26M_CK |
| 198 | }pmu6253_vcore_clk_source_enum; |
| 199 | |
| 200 | // (0x860) STARTUP CON0 |
| 201 | typedef enum{ |
| 202 | UV_SEL_2_90V = 0, |
| 203 | UV_SEL_2_75V, |
| 204 | UV_SEL_2_60V, |
| 205 | UL_SEL_FOLLOW_DDLO |
| 206 | }pmu6253_uv_sel_enum; |
| 207 | |
| 208 | typedef enum{ |
| 209 | PWRKEY_LOW = 0, |
| 210 | PWRKEY_HIGH |
| 211 | }pmu6253_pwrkey_signal_enum; |
| 212 | |
| 213 | // (0x864) STARTUP CON1 |
| 214 | typedef enum{ |
| 215 | THR_INIT_SETTING = 0, |
| 216 | THR_PLUS_10_DEGREE_C, |
| 217 | THR_MINUS_20_DEGREE_C, |
| 218 | THR_MINUS_10_DEGREE_C |
| 219 | }pmu6253_thr_sel_num; |
| 220 | |
| 221 | // (0x870) CHR CON0 |
| 222 | typedef enum{ |
| 223 | CHOFST_PLUS_0_STEP = 0, |
| 224 | CHOFST_PLUS_1_STEP = 1, |
| 225 | CHOFST_PLUS_2_STEP = 2, |
| 226 | CHOFST_MINUS_2_STEP = 6, |
| 227 | CHOFST_MINUS_1_STEP = 7 |
| 228 | }pmu6253_chofst_enum; |
| 229 | |
| 230 | typedef enum{ |
| 231 | CHR_CURR_50_0MA = 0, |
| 232 | CHR_CURR_87_5MA, |
| 233 | CHR_CURR_150_0MA, |
| 234 | CHR_CURR_225_0MA, |
| 235 | CHR_CURR_300_0MA, |
| 236 | CHR_CURR_450_0MA, |
| 237 | CHR_CURR_650_0MA, |
| 238 | CHR_CURR_800_0MA |
| 239 | }pmu6253_chr_current_enum; |
| 240 | |
| 241 | typedef enum{ |
| 242 | CV_TUNE_1_200V = 0, |
| 243 | CV_TUNE_1_205V, |
| 244 | CV_TUNE_1_210V, |
| 245 | CV_TUNE_1_215V, |
| 246 | CV_TUNE_1_180V, |
| 247 | CV_TUNE_1_185V, |
| 248 | CV_TUNE_1_190V, |
| 249 | CV_TUNE_1_195V |
| 250 | }pmu6253_cv_tune_enum; |
| 251 | |
| 252 | // (0x874) CHR CON1 |
| 253 | typedef enum{ |
| 254 | CAL_PRECC_50_0MA = 0, |
| 255 | CAL_PRECC_87_5_MA, |
| 256 | CAL_PRECC_150_0MA, |
| 257 | CAL_PRECC_225_0MA |
| 258 | }pmu6253_cal_precc_enum; |
| 259 | |
| 260 | typedef enum{ |
| 261 | SYSTEM_PWR_SRC_DEFAULT = 0, |
| 262 | SYSTEM_PWR_SRC_REFER_PS_SET |
| 263 | }pmu6253_ps_sel_enum; |
| 264 | |
| 265 | typedef enum{ |
| 266 | SYSTEM_PWR_SRC_VBAT = 0, |
| 267 | SYSTEM_PWR_SRC_AC |
| 268 | }pmu6253_ps_set_enum; |
| 269 | |
| 270 | typedef enum{ |
| 271 | CHR_OV_5_5V = 0, |
| 272 | CHR_OV_6_0V, |
| 273 | CHR_OV_6_5V, |
| 274 | CHR_OV_7_0V |
| 275 | }pmu6253_chr_ov_enum; |
| 276 | |
| 277 | // (0x87C) CHR CON3 |
| 278 | typedef enum{ |
| 279 | CHR_WDT_4_SEC = 0, |
| 280 | CHR_WDT_8_SEC, |
| 281 | CHR_WDT_16_SEC, |
| 282 | CHR_WDT_32_SEC |
| 283 | }pmu6253_chr_wdt_td_enum; |
| 284 | |
| 285 | // (0x880) DRIVER CON0 |
| 286 | typedef enum{ |
| 287 | KPLED_WLED = 0, |
| 288 | KPLED_RLED |
| 289 | }pmu6253_kpled_type_enum; |
| 290 | |
| 291 | |
| 292 | typedef enum{ |
| 293 | LED_1_SET = 1, |
| 294 | LED_4_WLED_4_RLED = 3, |
| 295 | LED_4_WLED_8_RLED = 7 |
| 296 | }pmu6253_kpled_sel_enum; |
| 297 | |
| 298 | typedef enum{ |
| 299 | ISINK1_TURN_ON = 1, // Bit 0 |
| 300 | ISINK2_TURN_ON = 2, // Bit 1 |
| 301 | ISINK3_TURN_ON = 4, // Bit 2 |
| 302 | ISINK4_TURN_ON = 8, // Bit 3 |
| 303 | ISINKALL_TURN_ON = 0xF // 0xF (Bit[3..0]) |
| 304 | }pmu6253_isinks_chsel_enum; |
| 305 | |
| 306 | // (0x888) DRIVER CON2 |
| 307 | typedef enum{ |
| 308 | ISINKS_VLED_STEP_5_MA = 0, |
| 309 | ISINKS_VLED_STEP_10_MA, |
| 310 | ISINKS_VLED_STEP_15_MA, |
| 311 | ISINKS_VLED_STEP_20_MA |
| 312 | }pmu6253_isinks_vled_enum; |
| 313 | |
| 314 | #if defined(__DRV_PMU53_SPEC_V1__) |
| 315 | |
| 316 | // (0x890) DRIVER CON4 |
| 317 | typedef enum{ |
| 318 | VIBR_SEL_1_5V = 0, |
| 319 | VIBR_SEL_1_8V, |
| 320 | VIBR_SEL_2_5V, |
| 321 | VIBR_SEL_3_0V |
| 322 | }pmu6253_vibr_sel_enum; |
| 323 | |
| 324 | #else // #if defined(__DRV_PMU53_SPEC_V1__) |
| 325 | |
| 326 | // (0x824) DRIVER CON4 |
| 327 | typedef enum{ |
| 328 | VIBR_SEL_2_8V = 0, |
| 329 | VIBR_SEL_3_0V |
| 330 | }pmu6253_vibr_sel_enum; |
| 331 | |
| 332 | #endif // #if defined(__DRV_PMU53_SPEC_V1__) |
| 333 | |
| 334 | typedef enum{ |
| 335 | VBOOST_SS_SPEED_NORMAL = 0, |
| 336 | VBOOST_SS_SPEED_2_OVER_3 |
| 337 | }pmu6253_vboost_ss_speed_enum; |
| 338 | |
| 339 | // (0x8B0) CLASSD CON0 |
| 340 | typedef enum{ |
| 341 | SPK_EMODE_NO_EXTENSION = 1, |
| 342 | SPK_EMODE_LEAD_EXTENSION, |
| 343 | SPK_EMODE_LAG_EXTENSION |
| 344 | }pmu6253_spk_emode_enum; |
| 345 | |
| 346 | typedef enum{ |
| 347 | PMU6253_SPK_CLASS_D_MODE = 0, |
| 348 | PMU6253_SPK_CLASS_AB_MODE |
| 349 | }pmu6253_spk_mode_enum; |
| 350 | |
| 351 | typedef enum{ |
| 352 | SPK_AB_BIAS_3_225MA = 0, |
| 353 | SPK_AB_BIAS_6_381MA, |
| 354 | SPK_AB_BIAS_9_533MA, |
| 355 | SPK_AB_BIAS_12_684MA |
| 356 | }pmu6253_spkab_obias_enum; |
| 357 | |
| 358 | // (0x8B8) CLASSD CON2 |
| 359 | typedef enum{ |
| 360 | SPK_DMODE_FB_FORCED = 0, |
| 361 | SPK_DMODE_FB_AUTO, |
| 362 | SPK_DMODE_FF_FORCED, |
| 363 | SPK_DMODE_FF_AUTO |
| 364 | }pmu6253_spk_dmode_enum; |
| 365 | |
| 366 | typedef enum{ |
| 367 | SPK_PCHG_103_0NS = 0, |
| 368 | SPK_PCHG_55_67NS, |
| 369 | SPK_PCHG_39_09NS, |
| 370 | SPK_PCHG_30_47NS |
| 371 | }pmu6253_spk_pchg_enum; |
| 372 | |
| 373 | typedef enum{ |
| 374 | SPK_SPK_CCODE = 1, |
| 375 | SPK_TRIANGLE_WAVE = 2, |
| 376 | SPK_PRNG_WAVE = 3 |
| 377 | }pmu6253_spk_freq_ctrl_enum; |
| 378 | |
| 379 | typedef enum{ |
| 380 | SPK_SLEW_2_OVER_4 = 0, |
| 381 | SPK_SLEW_1_OVER_4, |
| 382 | SPK_SLEW_4_OVER_4, |
| 383 | SPK_SLEW_3_OVER_4 |
| 384 | }pmu6253_spk_slew_enum; |
| 385 | |
| 386 | // (0x8D0) OC CON0 |
| 387 | typedef enum{ |
| 388 | OC_GEAR_100_US = 0, |
| 389 | OC_GEAR_200_US, |
| 390 | OC_GEAR_400_US, |
| 391 | OC_GEAR_800_US |
| 392 | }pmu6253_gear_enum; |
| 393 | |
| 394 | // (0x8E0) OC CON4 |
| 395 | typedef enum{ |
| 396 | SS_DELAY_200US = 0, |
| 397 | SS_DELAY_400US, |
| 398 | SS_DELAY_600US, |
| 399 | SS_DELAY_800US |
| 400 | }pmu6253_soft_start_delay; |
| 401 | |
| 402 | |
| 403 | // (0x8E4) OC CON5 |
| 404 | typedef enum{ |
| 405 | SPK_OC_FLAG = 0x0001, |
| 406 | VIBR_OC_FLAG = 0x0002, |
| 407 | VBOOST_OC_FLAG = 0x0004, |
| 408 | VSIM_OC_FLAG = 0x0008, |
| 409 | VBT_OC_FLAG = 0x0010, |
| 410 | VUSB_OC_FLAG = 0x0020, |
| 411 | VCAMD_OC_FLAG = 0x0040, |
| 412 | VCAMA_OC_FLAG = 0x0080, |
| 413 | VTCXO_OC_FLAG = 0x0800, |
| 414 | VRF_OC_FLAG = 0x1000, |
| 415 | VIO_OC_FLAG = 0x2000, |
| 416 | VM_OC_FLAG = 0x4000, |
| 417 | VA_OC_FLAG = 0x8000 |
| 418 | }pmu6253_oc_bit_enum; |
| 419 | |
| 420 | |
| 421 | // ===================================================================================== |
| 422 | // (0x800) VRF CON |
| 423 | extern void dcl_pmu6253_vrf_enable(kal_bool enable); |
| 424 | extern void dcl_pmu6253_vrf_cal(kal_uint8 val); |
| 425 | extern void dcl_pmu6253_vrf_on_sel(pmu6253_vrf_on_sel_enum sel); |
| 426 | extern void dcl_pmu6253_vrf_ocfb_enable(kal_bool enable); |
| 427 | extern kal_bool dcl_pmu6253_vrf_status(void); |
| 428 | |
| 429 | // (0x804) VIO CON |
| 430 | extern void dcl_pmu6253_vio_cal(kal_uint8 val); |
| 431 | extern void dcl_pmu6253_vio_vd_sense(pmu6253_vd_sense_enum sel); |
| 432 | extern void dcl_pmu6253_vio_ocfb_enable(kal_bool enable); |
| 433 | extern kal_bool dcl_pmu6253_vio_status(void); |
| 434 | |
| 435 | // (0x808) VM CON |
| 436 | extern void dcl_pmu6253_vm_cal(kal_uint8 val); |
| 437 | extern void dcl_pmu6253_vm_vd_sense(pmu6253_vd_sense_enum sel); |
| 438 | extern void dcl_pmu6253_vm_ocfb_enable(kal_bool enable); |
| 439 | extern kal_bool dcl_pmu6253_vm_status(void); |
| 440 | |
| 441 | // (0x80C) VRTC CON |
| 442 | extern void dcl_pmu6253_vrtc_cal(kal_uint8 val); |
| 443 | extern kal_bool dcl_pmu6253_vrtc_status(void); |
| 444 | |
| 445 | // (0x810) VTCXO CON |
| 446 | extern void dcl_pmu6253_vtcxo_enable(kal_bool enable); |
| 447 | extern void dcl_pmu6253_vtcxo_cal(kal_uint8 val); |
| 448 | extern void dcl_pmu6253_vtcxo_on_sel(pmu6253_vtcxo_on_sel_enum sel); |
| 449 | extern void dcl_pmu6253_vtcxo_srclken(kal_bool enable); |
| 450 | extern void dcl_pmu6253_vtcxo_ocfb_enable(kal_bool enable); |
| 451 | extern kal_bool dcl_pmu6253_vtcxo_status(void); |
| 452 | |
| 453 | // (0x814) VA CON |
| 454 | extern void dcl_pmu6253_va_cal(kal_uint8 val); |
| 455 | extern void dcl_pmu6253_va_vd_sense(pmu6253_vd_sense_enum sel); |
| 456 | extern void dcl_pmu6253_va_on_sel(pmu6253_va_on_sel_enum sel); |
| 457 | extern void dcl_pmu6253_va_ocfb_enable(kal_bool enable); |
| 458 | extern kal_bool dcl_pmu6253_va_status(void); |
| 459 | |
| 460 | // (0x818) VSIM CON |
| 461 | extern void dcl_pmu6253_vsim_enable(kal_bool enable); |
| 462 | extern void dcl_pmu6253_vsim_cal(kal_uint8 val); |
| 463 | extern void dcl_pmu6253_vsim_datal(kal_bool pull_low); |
| 464 | extern void dcl_pmu6253_vsim_sel(pmu6253_vsim_sel_enum sel); |
| 465 | extern void dcl_pmu6253_vsim_pwr_saving(kal_bool enable); |
| 466 | extern void dcl_pmu6253_vsim_ocfb_enable(kal_bool enable); |
| 467 | extern kal_bool dcl_pmu6253_vsim_status(void); |
| 468 | |
| 469 | // (0x81C) VSIM2 CON |
| 470 | extern void dcl_pmu6253_vsim2_enable(kal_bool enable); |
| 471 | extern void dcl_pmu6253_vsim2_cal(kal_uint8 val); |
| 472 | extern void dcl_pmu6253_vsim2_datal(kal_bool pull_low); |
| 473 | extern void dcl_pmu6253_vsim2_sel(pmu6253_vsim_sel_enum sel); |
| 474 | extern kal_bool dcl_pmu6253_vsim2_status(void); |
| 475 | |
| 476 | // (0x820) VUSB CON |
| 477 | extern void dcl_pmu6253_vusb_enable(kal_bool enable); |
| 478 | extern void dcl_pmu6253_vusb_cal(kal_uint8 val); |
| 479 | extern void dcl_pmu6253_vusb_ocfb_enable(kal_bool enable); |
| 480 | extern kal_bool dcl_pmu6253_vusb_status(void); |
| 481 | |
| 482 | // (0x824) VBT CON |
| 483 | extern void dcl_pmu6253_vbt_enable(kal_bool enable); |
| 484 | extern void dcl_pmu6253_vbt_cal(kal_uint8 val); |
| 485 | extern void dcl_pmu6253_vbt_sel(pmu6253_vbt_sel_enum sel); |
| 486 | extern void dcl_pmu6253_vbt_ocfb_enable(kal_bool enable); |
| 487 | extern kal_bool dcl_pmu6253_vbt_status(void); |
| 488 | |
| 489 | // (0x828) VCAMD CON |
| 490 | extern void dcl_pmu6253_vcamd_enable(kal_bool enable); |
| 491 | extern void dcl_pmu6253_vcamd_cal(kal_uint8 val); |
| 492 | extern void dcl_pmu6253_vcamd_sel(pmu6253_vcamd_sel_enum sel); |
| 493 | extern void dcl_pmu6253_vcamd_ocfb_enable(kal_bool enable); |
| 494 | extern kal_bool dcl_pmu6253_vcamd_status(void); |
| 495 | |
| 496 | // (0x82C) VCAMA CON |
| 497 | extern void dcl_pmu6253_vcama_enable(kal_bool enable); |
| 498 | extern void dcl_pmu6253_vcama_cal(kal_uint8 val); |
| 499 | extern void dcl_pmu6253_vcama_sel(pmu6253_vcama_sel_enum sel); |
| 500 | extern void dcl_pmu6253_vcama_ocfb_enable(kal_bool enable); |
| 501 | extern kal_bool dcl_pmu6253_vcama_status(void); |
| 502 | |
| 503 | // (0x834) GPIO CON |
| 504 | extern void dcl_pmu6253_gpio_drv(pmu6253_gpio_drv_sel_enum sel); |
| 505 | extern void dcl_pmu6253_mtv_enable(kal_bool enable); |
| 506 | |
| 507 | // (0x840) VCORE CON |
| 508 | extern void dcl_pmu6253_vcore_en_force(kal_bool enable); |
| 509 | extern void dcl_pmu6253_vcore_cal(kal_uint8 val); |
| 510 | extern void dcl_pmu6253_vcore_vd_sense(pmu6253_vd_sense_enum sel); |
| 511 | extern kal_bool dcl_pmu6253_vcore_status(void); |
| 512 | |
| 513 | // (0x844) VCORE CON1 |
| 514 | extern void dcl_pmu6253_vcore_modeset(pmu6253_vcore_modeset_enum mode); |
| 515 | extern void dcl_pmu6253_vcore_adc_in_edge(pmu6253_vcore_adc_in_enum edge); |
| 516 | extern void dcl_pmu6253_vcore_fast_slow(pmu6253_vcore_fast_slow_enum sel); |
| 517 | extern void dcl_pmu6253_vcore_pwmb(pmu_6253_vcore_pwmb_enum sel); |
| 518 | extern void dcl_pmu6253_vcore_acc_out_init(kal_uint8 val); |
| 519 | |
| 520 | // (0x848) VCORE CON2 |
| 521 | extern void dcl_pmu6253_vcore_volsel(pmu6253_vcore_volsel_enum sel); |
| 522 | extern void dcl_pmu6253_vcore_fben(kal_bool enable); |
| 523 | |
| 524 | // (0x84C) VCORE CON3 |
| 525 | extern void dcl_pmu6253_vcore_vfbadj(pmu6253_vcore_vfbadj_enum sel); |
| 526 | extern void dcl_pmu6253_vcore_direct_ctrl_en(pmu6253_vcore_direct_ctrl_enum sel); |
| 527 | extern void dcl_pmu6253_vcore_dcvclksel(pmu6253_vcore_dcvclksel_enum sel); |
| 528 | extern void dcl_pmu6253_vcore_modeen(pmu6253_vcore_modeen_enum sel); |
| 529 | extern void dcl_pmu6253_vcore_modecmp(pmu6253_vcore_modecmp_enum sel); |
| 530 | extern void dcl_pmu6253_vcore_modesel1A(pmu6253_vcore_modesel1a_enum sel); |
| 531 | |
| 532 | // (0x854) VCORE CON5 |
| 533 | extern void dcl_pmu6253_vcore_vfbadj_slp(pmu6253_vcore_vfbadj_enum sel); |
| 534 | extern void dcl_pmu6253_vcore_clk_source_sel(pmu6253_vcore_clk_source_enum sel); |
| 535 | |
| 536 | // (0x860) STARTUP CON0 |
| 537 | extern void dcl_pmu6253_uv_sel(pmu6253_uv_sel_enum sel); |
| 538 | extern void dcl_pmu6253_pwrkey_vcore(pmu6253_pwrkey_signal_enum sel); |
| 539 | extern void dcl_pmu6253_pwrkey_deb(pmu6253_pwrkey_signal_enum sel); |
| 540 | |
| 541 | // (0x864) STARTUP CON1 |
| 542 | extern void dcl_pmu6253_thr_sel(pmu6253_thr_sel_num sel); |
| 543 | |
| 544 | // (0x870) CHR CON0 |
| 545 | extern void dcl_pmu6253_chr_enable(kal_bool enable); |
| 546 | extern void dcl_pmu6253_chofst(pmu6253_chofst_enum sel); |
| 547 | extern void dcl_pmu6253_chr_current(pmu6253_chr_current_enum sel); |
| 548 | extern pmu6253_chr_current_enum pmu6253_chr_get_current(void); |
| 549 | extern void dcl_pmu6253_chr_force_enable(kal_bool enable); |
| 550 | extern void dcl_pmu6253_cv_rt(kal_uint8 val); |
| 551 | extern void dcl_pmu6253_cv_tune(pmu6253_cv_tune_enum sel); |
| 552 | |
| 553 | // (0x874) CHR CON1 |
| 554 | extern void dcl_pmu6253_cal_precc(pmu6253_cal_precc_enum sel); |
| 555 | extern void dcl_pmu6253_ps_sel(pmu6253_ps_sel_enum sel); |
| 556 | extern void dcl_pmu6253_ps_set(pmu6253_ps_set_enum sel); |
| 557 | extern void dcl_pmu6253_chr_ov_sel(pmu6253_chr_ov_enum sel); |
| 558 | |
| 559 | // (0x878) CHR CON2 |
| 560 | extern kal_bool dcl_pmu6253_chrdet(void); |
| 561 | extern kal_bool dcl_pmu6253_ovp(void); |
| 562 | extern kal_bool dcl_pmu6253_bat_on(void); |
| 563 | extern kal_bool dcl_pmu6253_bad_bat(void); |
| 564 | extern kal_bool dcl_pmu6253_cv_mode(void); |
| 565 | |
| 566 | // (0x87C) CHR CON3 |
| 567 | extern void dcl_pmu6253_chr_wdt_td(pmu6253_chr_wdt_td_enum sel); |
| 568 | extern void dcl_pmu6253_chr_wdt_enable(kal_bool enable); |
| 569 | |
| 570 | // (0x8F0) CHR CON4 |
| 571 | extern void dcl_pmu6253_chr_wdt_intr_enable(kal_bool enable); |
| 572 | extern kal_bool dcl_pmu6253_chr_wdt_status(void); |
| 573 | extern void dcl_pmu6253_chr_wdt_clear(void); |
| 574 | |
| 575 | // (0x8F4) CHR CON5 |
| 576 | //extern void dcl_pmu6253_chr_wdt_cnt(kal_uint32 val32); |
| 577 | |
| 578 | // (0x880) DRIVER CON0 |
| 579 | extern void dcl_pmu6253_isinks_enable(kal_bool enable); |
| 580 | extern void dcl_pmu6253_isinks_force_off(kal_bool off); |
| 581 | extern void dcl_pmu6253_kpled_type(pmu6253_kpled_type_enum sel); |
| 582 | extern void dcl_pmu6253_kpled_enable(kal_bool enable); |
| 583 | extern void dcl_pmu6253_kpled_force_off(kal_bool off); |
| 584 | extern void dcl_pmu6253_kpled_sel(pmu6253_kpled_sel_enum sel); |
| 585 | extern kal_bool dcl_pmu6253_isink1_status(void); |
| 586 | extern kal_bool dcl_pmu6253_isink2_status(void); |
| 587 | extern kal_bool dcl_pmu6253_isink3_status(void); |
| 588 | extern kal_bool dcl_pmu6253_isink4_status(void); |
| 589 | extern kal_bool dcl_pmu6253_kpled_status(void); |
| 590 | |
| 591 | // (0x884) DRIVER CON1 |
| 592 | extern void dcl_pmu6253_isinks_dimm(kal_uint8 sel); |
| 593 | extern void dcl_pmu6253_isinks_chsel(pmu6253_isinks_chsel_enum sel); |
| 594 | |
| 595 | // (0x888) DRIVER CON2 |
| 596 | extern void dcl_pmu6253_sinks_irset_cal(kal_uint8 val); |
| 597 | extern void dcl_pmu6253_isinks_vled_step(pmu6253_isinks_vled_enum sel); |
| 598 | |
| 599 | // (0x88C) DRIVER CON3 |
| 600 | extern void dcl_pmu6253_bl_enable(kal_bool enable); |
| 601 | extern void dcl_pmu6253_vboost_enable(kal_bool enable); |
| 602 | extern void dcl_pmu6253_bl_vgen_forceon(kal_bool on); |
| 603 | extern void dcl_pmu6253_bl_mode(kal_uint8 val); |
| 604 | extern void dcl_pmu6253_dimm_duty(kal_uint8 val); |
| 605 | |
| 606 | // (0x890) DRIVER CON4 |
| 607 | extern void dcl_pmu6253_vibr_enable(kal_bool enable); |
| 608 | extern void dcl_pmu6253_vibr_sel(pmu6253_vibr_sel_enum sel); |
| 609 | extern void dcl_pmu6253_vibr_cal(kal_uint8 val); |
| 610 | extern void dcl_pmu6253_vibr_ocfb_enable(kal_bool enable); |
| 611 | extern kal_bool dcl_pmu6253_vibr_status(void); |
| 612 | |
| 613 | // (0x8A0) BOOST CON0 |
| 614 | extern void dcl_pmu6253_vboost_sync_enable(kal_bool enable); |
| 615 | extern void dcl_pmu6253_vboost_ss_speed(pmu6253_vboost_ss_speed_enum sel); |
| 616 | extern void dcl_pmu6253_vboost_tune(kal_uint8 val); |
| 617 | extern void dcl_pmu6253_vboost_cal(kal_uint8 val); |
| 618 | extern kal_bool dcl_pmu6253_vboost_trk_status(void); |
| 619 | extern kal_bool dcl_pmu6253_vboost_status(void); |
| 620 | |
| 621 | // (0x8A4) BOOST CON1 |
| 622 | extern void dcl_pmu6253_isns_cal(kal_uint8 val); |
| 623 | |
| 624 | // (0x8A8) BOOST CON2 |
| 625 | extern void dcl_pmu6253_vboost_forceon_clk(kal_bool forceon); |
| 626 | extern void dcl_pmu6253_vboost_disclk(kal_bool forceoff); |
| 627 | |
| 628 | // (0x8B0) CLASSD CON0 |
| 629 | extern void dcl_pmu6253_spk_enable(kal_bool enable); |
| 630 | extern void dcl_pmu6253_spk_reset(kal_bool reset); |
| 631 | extern void dcl_pmu6253_spk_emode(pmu6253_spk_emode_enum sel); |
| 632 | extern void dcl_pmu6253_spk_mode(pmu6253_spk_mode_enum sel); |
| 633 | extern void dcl_pmu6253_spkab_float(kal_bool enable); |
| 634 | extern void dcl_pmu6253_spkab_sended(kal_bool enable); |
| 635 | extern void dcl_pmu6253_spkab_oc_enable(kal_bool enable); |
| 636 | extern void dcl_pmu6253_spkab_depop_enable(kal_bool enable); |
| 637 | extern void dcl_pmu6253_spkab_obias(pmu6253_spkab_obias_enum sel); |
| 638 | |
| 639 | // (0x8B4) CLASSD CON1 |
| 640 | extern void dcl_pmu6253_spk_dtin(kal_uint8 val); |
| 641 | extern void dcl_pmu6253_spk_dtip(kal_uint8 val); |
| 642 | extern void dcl_pmu6253_spk_dtcn(kal_uint8 val); |
| 643 | extern void dcl_pmu6253_spk_dtcp(kal_uint8 val); |
| 644 | |
| 645 | // (0x8B8) CLASSD CON2 |
| 646 | extern void dcl_pmu6253_spk_dmode(pmu6253_spk_dmode_enum sel); |
| 647 | extern void dcl_pmu6253_spk_pchg(pmu6253_spk_pchg_enum sel); |
| 648 | extern void dcl_pmu6253_spk_dtcal(kal_bool enable); |
| 649 | extern void dcl_pmu6253_spk_pmode_enable(kal_bool enable); |
| 650 | extern void dcl_pmu6253_spk_cmode(pmu6253_spk_freq_ctrl_enum sel); |
| 651 | extern void dcl_pmu6253_spk_ccode(kal_uint8 val); |
| 652 | |
| 653 | // (0x8BC) CLASSD CON3 |
| 654 | extern void dcl_pmu6253_spk_enable_view_clk(kal_bool enable); |
| 655 | extern void dcl_pmu6253_spk_enable_view_vref(kal_bool enable); |
| 656 | extern void dcl_pmu6253_spk_slew(pmu6253_spk_slew_enum sel); |
| 657 | extern void dcl_pmu6253_spk_oc_enable(kal_bool enable); |
| 658 | extern void dcl_pmu6253_spk_oscisel_half(kal_bool half); |
| 659 | extern void dcl_pmu6253_spk_vol(kal_uint8 val); |
| 660 | extern kal_uint8 pmu6253_spk_get_vol(void); |
| 661 | |
| 662 | // (0x8C8) TEST CON2 |
| 663 | extern void dcl_pmu6253_adc_vol_divided_by_2(kal_bool enable); |
| 664 | extern void dcl_pmu6253_adc_meas_on(kal_bool enable); |
| 665 | |
| 666 | // (0x8D0) OC CON0 |
| 667 | extern void dcl_pmu6253_vrf_oc_gear(pmu6253_gear_enum sel); |
| 668 | extern void dcl_pmu6253_vrf_oc_auto_off(kal_bool enable); |
| 669 | extern void dcl_pmu6253_vrf_oc_int_enable(kal_bool enable); |
| 670 | extern void dcl_pmu6253_vio_oc_gear(pmu6253_gear_enum sel); |
| 671 | extern void dcl_pmu6253_vio_oc_auto_off(kal_bool enable); |
| 672 | extern void dcl_pmu6253_vio_oc_int_enable(kal_bool enable); |
| 673 | extern void dcl_pmu6253_vm_oc_gear(pmu6253_gear_enum sel); |
| 674 | extern void dcl_pmu6253_vm_oc_auto_off(kal_bool enable); |
| 675 | extern void dcl_pmu6253_vm_oc_int_enable(kal_bool enable); |
| 676 | extern void dcl_pmu6253_va_oc_gear(pmu6253_gear_enum sel); |
| 677 | extern void dcl_pmu6253_va_oc_auto_off(kal_bool enable); |
| 678 | extern void dcl_pmu6253_va_oc_int_enable(kal_bool enable); |
| 679 | |
| 680 | // (0x8D4) OC CON1 |
| 681 | extern void dcl_pmu6253_vtcxo_oc_gear(pmu6253_gear_enum sel); |
| 682 | extern void dcl_pmu6253_vtcxo_oc_auto_off(kal_bool enable); |
| 683 | extern void dcl_pmu6253_vtcxo_oc_int_enable(kal_bool enable); |
| 684 | |
| 685 | // (0x8D8) OC CON2 |
| 686 | extern void dcl_pmu6253_vbt_oc_gear(pmu6253_gear_enum sel); |
| 687 | extern void dcl_pmu6253_vbt_oc_auto_off(kal_bool enable); |
| 688 | extern void dcl_pmu6253_vbt_oc_int_enable(kal_bool enable); |
| 689 | extern void dcl_pmu6253_vusb_oc_gear(pmu6253_gear_enum sel); |
| 690 | extern void dcl_pmu6253_vusb_oc_auto_off(kal_bool enable); |
| 691 | extern void dcl_pmu6253_vusb_oc_int_enable(kal_bool enable); |
| 692 | extern void dcl_pmu6253_vcamd_oc_gear(pmu6253_gear_enum sel); |
| 693 | extern void dcl_pmu6253_vcamd_oc_auto_off(kal_bool enable); |
| 694 | extern void dcl_pmu6253_vcamd_oc_int_enable(kal_bool enable); |
| 695 | extern void dcl_pmu6253_vcama_oc_gear(pmu6253_gear_enum sel); |
| 696 | extern void dcl_pmu6253_vcama_oc_auto_off(kal_bool enable); |
| 697 | extern void dcl_pmu6253_vcama_oc_int_enable(kal_bool enable); |
| 698 | |
| 699 | // (0x8DC) OC CON3 |
| 700 | extern void dcl_pmu6253_spk_oc_gear(pmu6253_gear_enum sel); |
| 701 | extern void dcl_pmu6253_spk_oc_auto_off(kal_bool enable); |
| 702 | extern void dcl_pmu6253_spk_oc_int_enable(kal_bool enable); |
| 703 | extern void dcl_pmu6253_vibr_oc_gear(pmu6253_gear_enum sel); |
| 704 | extern void dcl_pmu6253_vibr_oc_auto_off(kal_bool enable); |
| 705 | extern void dcl_pmu6253_vibr_oc_int_enable(kal_bool enable); |
| 706 | extern void dcl_pmu6253_vboost_oc_gear(pmu6253_gear_enum sel); |
| 707 | extern void dcl_pmu6253_vboost_oc_auto_off(kal_bool enable); |
| 708 | extern void dcl_pmu6253_vboost_oc_int_enable(kal_bool enable); |
| 709 | extern void dcl_pmu6253_vsim_oc_gear(pmu6253_gear_enum sel); |
| 710 | extern void dcl_pmu6253_vsim_oc_auto_off(kal_bool enable); |
| 711 | extern void dcl_pmu6253_vsim_oc_int_enable(kal_bool enable); |
| 712 | |
| 713 | // (0x8E0) OC CON4 |
| 714 | extern void dcl_pmu6253_vibr_stbtd(pmu6253_soft_start_delay sel); |
| 715 | extern void dcl_pmu6253_vsim_stbtd(pmu6253_soft_start_delay sel); |
| 716 | extern void dcl_pmu6253_vbt_stbtd(pmu6253_soft_start_delay sel); |
| 717 | extern void dcl_pmu6253_vusb_stbtd(pmu6253_soft_start_delay sel); |
| 718 | extern void dcl_pmu6253_vcamd_stbtd(pmu6253_soft_start_delay sel); |
| 719 | extern void dcl_pmu6253_vcama_stbtd(pmu6253_soft_start_delay sel); |
| 720 | |
| 721 | // (0x8E4) OC CON5 |
| 722 | extern kal_bool dcl_pmu6253_oc_flag(pmu6253_oc_bit_enum sel); |
| 723 | extern void dcl_pmu6253_clear_oc_flag(pmu6253_oc_bit_enum sel); |
| 724 | extern void dcl_pmu6253_clear_all_oc_flag(void); |
| 725 | |
| 726 | |
| 727 | // ====== Other exported APIs ============= |
| 728 | extern pmu6253_chr_current_enum pmu6253_ret_chr_current(void); |
| 729 | extern pmu6253_chr_current_enum pmu6253_ret_usb_current(void); |
| 730 | extern void dcl_pmu6253_init(void); |
| 731 | |
| 732 | |
| 733 | |
| 734 | /* |
| 735 | typedef enum |
| 736 | { |
| 737 | PMU_FAKE_LDO_BUCK_MAX |
| 738 | }PMU_FAKE_LDO_BUCK_LIST_ENUM; |
| 739 | |
| 740 | typedef enum |
| 741 | { |
| 742 | VRF, |
| 743 | VIO, |
| 744 | VM, |
| 745 | VRTC, |
| 746 | VTCXO, |
| 747 | VA, |
| 748 | VSIM, |
| 749 | VSIM2, |
| 750 | VUSB, |
| 751 | VBT, |
| 752 | VCAMA, |
| 753 | VCAMD, |
| 754 | VCORE, |
| 755 | VIBR, |
| 756 | PMU_LDO_BUCK_MAX, |
| 757 | VRF18, |
| 758 | VFM, |
| 759 | VMC |
| 760 | }PMU_LDO_BUCK_LIST_ENUM; |
| 761 | |
| 762 | typedef enum |
| 763 | { |
| 764 | VPA1, |
| 765 | PMU_VPA_MAX |
| 766 | }PMU_VPA_LIST_ENUM; |
| 767 | |
| 768 | typedef enum |
| 769 | { |
| 770 | CHR, |
| 771 | PMU_CHR_MAX |
| 772 | }PMU_CHR_LIST_ENUM; |
| 773 | |
| 774 | typedef enum |
| 775 | { |
| 776 | SPK, |
| 777 | SPKL, |
| 778 | SPKR, |
| 779 | PMU_SPK_MAX |
| 780 | }PMU_SPK_LIST_ENUM; |
| 781 | |
| 782 | typedef enum |
| 783 | { |
| 784 | PMU_ISINK_MAX |
| 785 | }PMU_ISINK_LIST_ENUM; |
| 786 | |
| 787 | typedef enum |
| 788 | { |
| 789 | PMU_BOOST_MAX |
| 790 | }PMU_BOOST_LIST_ENUM; |
| 791 | */ |
| 792 | |
| 793 | |
| 794 | #endif // #ifdef PMIC_6253_REG_API |
| 795 | #endif // #ifndef __DCL_PMU6253_SW_H_STRUCT__ |
| 796 | |
| 797 | |
| 798 | |