BOOL kernel_power_off_charging_detection(void)
{
    int off_mode_status = 1;
    /* */
    if(is_force_boot()) {
        upmu_set_rg_chrind_on(0);
		printf("[%s] Turn off HW Led\n", __func__);
        return FALSE;
    }

    off_mode_status = get_off_mode_charge_status();
    printf("[%s] off_mode_status %d\n", __func__, off_mode_status);
    if(upmu_is_chr_det() == KAL_TRUE) {
        if (off_mode_status) {
            g_boot_mode = KERNEL_POWER_OFF_CHARGING_BOOT;
        } else {
            g_boot_mode = NORMAL_BOOT;
            upmu_set_rg_chrind_on(0);
            return FALSE;
        }
		return TRUE;
    }
    else {
        /* power off */
        #ifndef NO_POWER_OFF
        printf("[kernel_power_off_charging_detection] power off\n");
        mt6575_power_off();        
        #endif
		return FALSE;	
    }
    /* */
}
Пример #2
0
static void register_off_mode_charge_var(void)
{
	//INIT VALUE
	char str_buf[2][2] = {"0","1"};
	char *value_buf;
	unsigned n;

	value_buf = malloc(5);
	n = get_off_mode_charge_status();
	sprintf(value_buf,"%s",str_buf[n]);
	fastboot_publish("off-mode-charge", value_buf);
}