Example #1
0
static int pmic_restart_charging(void)
{
	pmic_set_chg_misc(BAT_TH_CHECK_DIS, 1);
	pmic_set_chg_misc(AUTO_CHG_DIS, 0);
	pmic_set_chg_misc(VI_PROGRAM_EN, 1);
	pmic_set_chg_current(0x8);
	pmic_set_chg_misc(RESTART_CHG_STAT, 1);
	return 0;
}
Example #2
0
//////
///close the charger led when battery voltage > 4.18v
/////
static int pmic_close_charger_led(void)
{
	if(bNeedReset){
	     ///first,changes to the Software controlled charging
	     pmic_set_chg_misc(AUTO_CHG_DIS, 1);

	       ////close the led
	       pmic_set_chg_misc(CHG_LED_EN, 0);
	  }
   
   return 0;

}
Example #3
0
static int pmic_restart_charging(void)
{
	pmic_set_chg_misc(BAT_TH_CHECK_DIS, 1);

	pmic_set_chg_misc(PLIM_DIS, 3);

	//0 = Standalone charging
	///1 = Software controlled charging
	///default is 0
	////charger state from CHG_DISCHARGING_WITH_CHARGER to
	////  CHG_RESTART,we need make sure the LED is close.
	if(bProcessSign){
	   pmic_close_charger_led();
	}else{
	   pmic_set_chg_misc(AUTO_CHG_DIS, 0);
	}

	//pmic_set_chg_misc(RESTART_CHG_STAT, 1);

	///To override the charging current, we execute these 2 statements
	//////////////////////////////////////////////////////
	///in order to solve the question: when the device don't solder the 
	///battery and connect to USB or charger,the device can't bootup,
	///we need set the CHGAUTOVIB as 0. after power up,we set 1 again
	////////////////////////////////////////////////////////
#if defined(PMIC_MC13892_BATTERY_WORK)	
	if(bNeedReset){
		pmic_set_chg_misc(VI_PROGRAM_EN, 1);
		//bNeedReset = false;
	}else{
		pmic_set_chg_misc(VI_PROGRAM_EN, 0);
	}
#else
	pmic_set_chg_misc(VI_PROGRAM_EN, 1);
#endif		
	//pmic_set_chg_current(PMIC_SET_REG_CHARGE);

	pmic_set_chg_misc(RESTART_CHG_STAT, 1);

	//pmic_set_chg_misc(PLIM_DIS, 3); //Bug?

	return 0;
}
Example #4
0
static void reset_charger_timer(void)
{
	if(!charger_timeout())
		pmic_set_chg_misc(CHGTMRRST, 1);
}
Example #5
0
static void init_charger_timer(void)
{
	pmic_set_chg_misc(CHGTMRRST, 1);
	expire = jiffies + ((BAT_CAP_MAH*BAT_CAP_UL*HZ)/CHG_CUR_MA);
	pr_notice("%s,%s\n", __FILE__,__func__);
}