static kal_uint32 charging_hw_init(void *data) { kal_uint32 status = STATUS_OK; upmu_set_rg_chrwdt_td(0x0); // CHRWDT_TD, 4s upmu_set_rg_chrwdt_int_en(1); // CHRWDT_INT_EN upmu_set_rg_chrwdt_en(1); // CHRWDT_EN upmu_set_rg_chrwdt_wr(1); // CHRWDT_WR upmu_set_rg_vcdt_mode(0); //VCDT_MODE upmu_set_rg_vcdt_hv_en(1); //VCDT_HV_EN upmu_set_rg_usbdl_rst(1); //force leave USBDL mode upmu_set_rg_bc11_bb_ctrl(1); //BC11_BB_CTRL upmu_set_rg_bc11_rst(1); //BC11_RST upmu_set_rg_csdac_mode(1); //CSDAC_MODE upmu_set_rg_vbat_ov_en(1); //VBAT_OV_EN #ifdef HIGH_BATTERY_VOLTAGE_SUPPORT upmu_set_rg_vbat_ov_vth(0x2); //VBAT_OV_VTH, 4.4V, #else upmu_set_rg_vbat_ov_vth(0x1); //VBAT_OV_VTH, 4.3V, #endif upmu_set_rg_baton_en(1); //BATON_EN //Tim, for TBAT //upmu_set_rg_buf_pwd_b(1); //RG_BUF_PWD_B upmu_set_rg_baton_ht_en(0); //BATON_HT_EN upmu_set_rg_ulc_det_en(1); // RG_ULC_DET_EN=1 upmu_set_rg_low_ich_db(1); // RG_LOW_ICH_DB=000001'b return status; }
static kal_uint32 charging_enable(void *data) { kal_uint32 status = STATUS_OK; kal_uint32 enable = *(kal_uint32*)(data); if(KAL_TRUE == enable) { upmu_set_rg_csdac_dly(0x4); // CSDAC_DLY upmu_set_rg_csdac_stp(0x1); // CSDAC_STP upmu_set_rg_csdac_stp_inc(0x1); // CSDAC_STP_INC upmu_set_rg_csdac_stp_dec(0x2); // CSDAC_STP_DEC upmu_set_rg_cs_en(1); // CS_EN, check me upmu_set_rg_hwcv_en(1); upmu_set_rg_vbat_cv_en(1); // CV_EN upmu_set_rg_csdac_en(1); // CSDAC_EN upmu_set_rg_chr_en(1); // CHR_EN if(Enable_BATDRV_LOG == BAT_LOG_FULL) charging_dump_register(NULL); } else { upmu_set_rg_chrwdt_int_en(0); // CHRWDT_INT_EN upmu_set_rg_chrwdt_en(0); // CHRWDT_EN upmu_set_rg_chrwdt_flag_wr(0); // CHRWDT_FLAG upmu_set_rg_csdac_en(0); // CSDAC_EN upmu_set_rg_chr_en(0); // CHR_EN upmu_set_rg_hwcv_en(0); // RG_HWCV_EN } return status; }
void kick_charger_wdt(void) { upmu_set_rg_chrwdt_td(0x0); // CHRWDT_TD, 4s upmu_set_rg_chrwdt_wr(1); // CHRWDT_WR upmu_set_rg_chrwdt_int_en(1); // CHRWDT_INT_EN upmu_set_rg_chrwdt_en(1); // CHRWDT_EN upmu_set_rg_chrwdt_flag_wr(1); // CHRWDT_WR }
void kick_charger_wdt(void) { //kick pmic wdt? upmu_set_rg_chrwdt_td(0x0); // CHRWDT_TD, 4s upmu_set_rg_chrwdt_int_en(1); // CHRWDT_INT_EN upmu_set_rg_chrwdt_en(1); // CHRWDT_EN upmu_set_rg_chrwdt_wr(1); // CHRWDT_WR ncp1854_set_wdto_dis(0x1); ncp1854_set_wdto_dis(0x0); }
static kal_uint32 charging_reset_watch_dog_timer(void *data) { kal_uint32 status = STATUS_OK; upmu_set_rg_chrwdt_td(0x0); // CHRWDT_TD, 4s upmu_set_rg_chrwdt_wr(1); // CHRWDT_WR upmu_set_rg_chrwdt_int_en(1); // CHRWDT_INT_EN upmu_set_rg_chrwdt_en(1); // CHRWDT_EN upmu_set_rg_chrwdt_flag_wr(1); // CHRWDT_WR return status; }