static void handle_power_key_state(unsigned int code, int value)
{
	int ret = 0;
	if (code == KEY_POWER && value == 1) {
		KEY_LOGI("[PWR][STATE]try to schedule power key pressed due\n");
		ret = schedule_delayed_work(&power_key_state_disable_work, PWRKEY_PRESS_DUE);
		if (!ret) {
			KEY_LOGI("[PWR][STATE]Schedule power key pressed due failed, seems already have one, try to cancel...\n");
			ret = __cancel_delayed_work(&power_key_state_disable_work);
			if (!ret) {
				setPowerKeyState(1);
				if (schedule_delayed_work(&power_key_state_disable_work, PWRKEY_PRESS_DUE)) {
					KEY_LOGI("[PWR][STATE]Re-schedule power key pressed due SCCUESS.\n");
					KEY_LOGI("[PWR][STATE] start count for power key pressed due\n");
					setPowerKeyState(1);
				} else
					KEY_LOGI("[PWR][STATE]Re-schedule power key pressed due FAILED, reason unknown, give up.\n");
			} else {
				KEY_LOGI("[PWR][STATE]Cancel scheduled power key due success, now re-schedule.\n");
				if (schedule_delayed_work(&power_key_state_disable_work, PWRKEY_PRESS_DUE)) {
					KEY_LOGI("[PWR][STATE]Re-schedule power key pressed due SCCUESS.\n");
					KEY_LOGI("[PWR][STATE] start count for power key pressed due\n");
					setPowerKeyState(1);
				} else
					KEY_LOGI("[PWR][STATE]Re-schedule power key pressed due FAILED, reason unknown, give up.\n");
			}
		} else {
			KEY_LOGI("[PWR][STATE] start count for power key pressed due\n");
			setPowerKeyState(1);
		}
	}
}
Beispiel #2
0
static void power_key_state_disable_work_func(struct work_struct *dummy)
{
	setPowerKeyState(0);
#ifdef CONFIG_CIR_ALWAYS
	power_key_pressed = 0;
#endif
	KEY_LOGI("[PWR][STATE]power key pressed outdated\n");
}
static void power_key_state_disable_work_func(struct work_struct *dummy)
{
    setPowerKeyState(0);

    KEY_LOGI("[PWR][STATE]power key pressed outdated\n");
}
Beispiel #4
0
static void power_key_state_disable_work_func(struct work_struct *dummy)
{
	setPowerKeyState(0);
	printk(KERN_INFO "[KEY][PWR][STATE]power key pressed outdated\n");
}