Exemple #1
0
static void battery_pump_express_charger_check(void)
{
	if (KAL_TRUE == ta_check_chr_type &&
	  STANDARD_CHARGER == BMT_status.charger_type &&
	  BMT_status.SOC >= TA_START_BATTERY_SOC &&
	  BMT_status.SOC < TA_STOP_BATTERY_SOC)
	{
		mutex_lock(&ta_mutex);
		wake_lock(&TA_charger_suspend_lock);

		mtk_ta_reset_vchr();

		mtk_ta_init();
		mtk_ta_detector();

		/* need to re-check if the charger plug out during ta detector */
		if(KAL_TRUE == ta_cable_out_occur)
			ta_check_chr_type = KAL_TRUE;
		else
			ta_check_chr_type = KAL_FALSE;

		wake_unlock(&TA_charger_suspend_lock);
		mutex_unlock(&ta_mutex);
	}
	else
	{
		battery_xlog_printk(BAT_LOG_CRTI,
		"Stop battery_pump_express_charger_check, SOC=%d, ta_check_chr_type = %d, charger_type = %d \n",
		BMT_status.SOC, ta_check_chr_type, BMT_status.charger_type);
	}
}
static void battery_pump_express_charger_check(void)
{
	if (ta_check_chr_type == KAL_TRUE && BMT_status.charger_type == STANDARD_CHARGER) {
		mutex_lock(&ta_mutex);
		wake_lock(&TA_charger_suspend_lock);
		
		mtk_ta_reset_vchr();
		mtk_ta_init();
		mtk_ta_detector();

		first_vchr_det = KAL_TRUE;

		if(ta_cable_out_occur == KAL_FALSE) {
			ta_check_chr_type = KAL_FALSE;
		} else {
			/* need to re-check if the charger plug out during ta detector */
			ta_check_chr_type = KAL_TRUE;
		}

		wake_unlock(&TA_charger_suspend_lock);
		mutex_unlock(&ta_mutex);
 	}

}