static void power_key_led_off_work_func(struct work_struct *dummy) { if (power_key_led_requested) { if (cancel_delayed_work_sync(&power_key_led_on_work)) { KEY_LOGI("[PWR] cancel power key led work successfully(%x)\n", power_key_led_requested); } else KEY_LOGI("[PWR] cancel power key led work unsuccessfully (%x)\n", power_key_led_requested); power_key_led_requested = 0; } if (pre_power_key_led_status == 1) { #ifdef CONFIG_POWER_KEY_CLR_RESET cancel_delayed_work_sync(&power_key_restart_work); #endif KEY_LOGI("[PWR] change power key led off\n"); #ifdef CONFIG_QPNP_PWM #ifdef CONFIG_VK_LED qpnp_led_set_for_key(0); #endif #else pm8xxx_led_current_set_for_key(0); #endif pre_power_key_led_status = 0; #ifdef CONFIG_POWER_KEY_CLR_RESET if(!is_rrm1_mode()) #endif set_hw_reason(0); } }
static void power_key_led_on_work_func(struct work_struct *dummy) { KEY_LOGI("[PWR] %s in (%x)\n", __func__, power_key_led_requested); if (power_key_led_requested == 1) { pre_power_key_led_status = 1; KEY_LOGI("[PWR] change power key led on\n"); pm8xxx_led_current_set_for_key(1); set_hw_reason(HW_RESET_REASON); } }
static void power_key_led_on_work_func(struct work_struct *dummy) { KEY_LOGI("[PWR] %s in (%x)\n", __func__, power_key_led_requested); if (power_key_led_requested == 1) { pre_power_key_led_status = 1; KEY_LOGI("[PWR] change power key led on\n"); button_backlight_flash(1); set_hw_reason(HW_RESET_REASON); } }
static void power_key_led_on_work_func(struct work_struct *dummy) { KEY_LOGI("[PWR] %s in (%x)\n", __func__, power_key_led_requested); if (power_key_led_requested == 1) { pre_power_key_led_status = 1; KEY_LOGI("[PWR] change power key led on\n"); pm8xxx_led_current_set_for_key(1); set_hw_reason(HW_RESET_REASON); KEY_LOGI("[PWR] Show Blocked State -- long press power key\n"); show_state_filter(TASK_UNINTERRUPTIBLE); } }
static void power_key_led_off_work_func(struct work_struct *dummy) { if (power_key_led_requested) { if (cancel_delayed_work_sync(&power_key_led_on_work)) { KEY_LOGI("[PWR] cancel power key led work successfully(%x)\n", power_key_led_requested); } else KEY_LOGI("[PWR] cancel power key led work unsuccessfully (%x)\n", power_key_led_requested); power_key_led_requested = 0; } if (pre_power_key_led_status == 1) { KEY_LOGI("[PWR] change power key led off\n"); pm8xxx_led_current_set_for_key(0); pre_power_key_led_status = 0; set_hw_reason(0); } }
static void power_key_restart_work_func(struct work_struct *dummy) { #ifndef CONFIG_POWER_VOLUP_RESET int pocket_mode = (board_mfg_mode() == MFG_MODE_NORMAL) ? power_key_check_in_pocket() : 0; KEY_LOGI( "%s: power_key_check_in_pocket = %d\n", __func__, pocket_mode); if (!pocket_mode && pre_power_key_led_status == 1 && !is_rrm1_mode()) { #else uint8_t gpio_val = 0, i, idx_pwr = 9, idx_vup = 9; struct gpio_event_input_info *local = gis; for (i = 0; i < local->keymap_size; i++) { if (local->keymap[i].code == KEY_POWER) { idx_pwr = i; continue; } if (local->keymap[i].code == KEY_VOLUMEUP) idx_vup = i; } gpio_val = !(gpio_get_value(local->keymap[idx_pwr].gpio) | gpio_get_value(local->keymap[idx_vup].gpio)); if (gpio_val && pre_power_key_led_status == 1 && !is_rrm1_mode()) { KEY_LOGI("%s, (PWR+VOL_UP) reset", __func__); #endif set_hw_reason(0); #if defined(CONFIG_PM8921_BMS) && (CONFIG_HTC_BATT_8960) pm8921_store_hw_reset_reason(1); #endif clear_hw_reset(); set_restart_to_ramdump("Powerkey Hard Reset - SW"); msm_restart(0, NULL); } } static DECLARE_DELAYED_WORK(power_key_restart_work, power_key_restart_work_func); #endif static void power_key_led_on_work_func(struct work_struct *dummy) { KEY_LOGI("[PWR] %s in (%x)\n", __func__, power_key_led_requested); if (power_key_led_requested == 1) { pre_power_key_led_status = 1; #ifdef CONFIG_POWER_KEY_CLR_RESET schedule_delayed_work(&power_key_restart_work, PWRKEYKP_DELAY); #endif KEY_LOGI("[PWR] change power key led on\n"); #ifdef CONFIG_QPNP_PWM #ifdef CONFIG_VK_LED qpnp_led_set_for_key(1); #endif #else pm8xxx_led_current_set_for_key(1); #endif #ifdef CONFIG_POWER_KEY_CLR_RESET if(!is_rrm1_mode()) #endif set_hw_reason(HW_RESET_REASON); KEY_LOGI("[PWR] Show Blocked State -- long press power key\n"); show_state_filter(TASK_UNINTERRUPTIBLE); } }