static void msm_panic_restart(char mode, const char *cmd) { arm_machine_flush_console(); local_irq_disable(); local_fiq_disable(); flush_cache_all(); cpu_proc_fin(); flush_cache_all(); msm_restart(mode, cmd); mdelay(1000); printk(KERN_ERR "Reboot failed -- System halted\n"); while (1) ; }
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); } }