/* en: 1 enable, en: 0 disable */ static void hib_hotplug_mode(int en) { static int g_hp_disable = 0; if (en) { if (1 == g_hp_disable) { hib_warn("enable hotplug\n"); #if defined(CONFIG_CPU_FREQ_DEFAULT_GOV_HOTPLUG) || defined(CONFIG_CPU_FREQ_DEFAULT_GOV_BALANCE) hp_set_dynamic_cpu_hotplug_enable(1); #else hps_set_enabled(1); #endif g_hp_disable = 0; } } else if (!en) { if (0 == g_hp_disable) { hib_warn("disable hotplug\n"); #if defined(CONFIG_CPU_FREQ_DEFAULT_GOV_HOTPLUG) || defined(CONFIG_CPU_FREQ_DEFAULT_GOV_BALANCE) hp_set_dynamic_cpu_hotplug_enable(0); #else hps_set_enabled(0); #endif hib_unplug_cores(); g_hp_disable = 1; } } }
/* en: 1 enable, en: 0 disable */ static void hib_hotplug_mode(int en) { static int g_hp_disable; if (en) { if (1 == g_hp_disable) { hib_warn("enable hotplug\n"); hp_set_dynamic_cpu_hotplug_enable(1); g_hp_disable = 0; } } else if (!en) { if (0 == g_hp_disable) { hib_warn("disable hotplug\n"); hp_set_dynamic_cpu_hotplug_enable(0); hib_unplug_cores(); g_hp_disable = 1; } } }
/******************************* * resume callback function ********************************/ static int mt_hotplug_mechanism_resume(struct platform_device *pdev) { HOTPLUG_INFO("mt_hotplug_mechanism_resume\n"); if (!g_enable) return 0; if (!g_enable_dynamic_cpu_hotplug_at_suspend) { #ifdef CONFIG_CPU_FREQ_GOV_HOTPLUG hp_set_dynamic_cpu_hotplug_enable(g_prev_dynamic_cpu_hotplug_enable); #endif //#ifdef CONFIG_CPU_FREQ_GOV_HOTPLUG } return 0; }
/******************************* * suspend callback function ********************************/ static int mt_hotplug_mechanism_suspend(struct platform_device *pdev, pm_message_t state) { HOTPLUG_INFO("mt_hotplug_mechanism_suspend\n"); if (!g_enable) return 0; if (!g_enable_dynamic_cpu_hotplug_at_suspend) { #ifdef CONFIG_CPU_FREQ_GOV_HOTPLUG g_prev_dynamic_cpu_hotplug_enable = hp_get_dynamic_cpu_hotplug_enable(); hp_set_dynamic_cpu_hotplug_enable(0); #endif //#ifdef CONFIG_CPU_FREQ_GOV_HOTPLUG } return 0; }