static int mali_driver_suspend_scheduler(struct device *dev) { mali_pm_os_suspend(); /* MALI_SEC */ mali_platform_power_mode_change(MALI_POWER_MODE_DEEP_SLEEP); return 0; }
void mali_dev_pause(void) { /* * Deactive all groups to prevent hardware being touched * during the period of mali device pausing */ mali_pm_os_suspend(MALI_FALSE); }
static void mali_early_suspend_handler(struct early_suspend *h) { mali_pm_os_suspend(); MALI_DEBUG_PRINT(1, ("[%s] disable_clock\n", __FUNCTION__)); disable_clock(MT_CG_MFG_G3D, "MFG"); disable_clock(MT_CG_DISP0_SMI_COMMON, "MFG"); }
static ssize_t power_power_events_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos) { if (!strncmp(ubuf, mali_power_events[_MALI_DEVICE_SUSPEND], strlen(mali_power_events[_MALI_DEVICE_SUSPEND]) - 1)) { mali_pm_os_suspend(MALI_TRUE); } else if (!strncmp(ubuf, mali_power_events[_MALI_DEVICE_RESUME], strlen(mali_power_events[_MALI_DEVICE_RESUME]) - 1)) { mali_pm_os_resume(); } else if (!strncmp(ubuf, mali_power_events[_MALI_DEVICE_DVFS_PAUSE], strlen(mali_power_events[_MALI_DEVICE_DVFS_PAUSE]) - 1)) { mali_dev_pause(); } else if (!strncmp(ubuf, mali_power_events[_MALI_DEVICE_DVFS_RESUME], strlen(mali_power_events[_MALI_DEVICE_DVFS_RESUME]) - 1)) { mali_dev_resume(); } *ppos += cnt; return cnt; }
static void mali_early_suspend_handler(struct early_suspend *h) { mali_pm_os_suspend(); #if 1 MALI_DEBUG_PRINT(1, ("[%s] disable_clock\n", __FUNCTION__)); trace_printk("[GPU power] MFG OFF\n"); disable_clock(MT_CG_MFG_G3D, "MFG"); disable_clock(MT_CG_DISP0_SMI_COMMON, "MFG"); #else if (clock_is_on(MT_CG_MFG_PDN_BG3D_SW_CG)) { disable_clock(MT_CG_MFG_PDN_BG3D_SW_CG, "G3D_DRV"); MALI_DEBUG_PRINT(1, ("[%s] disable_clock\n", __FUNCTION__)); } #endif }
static int mali_pwr_suspend_notifier(struct notifier_block *nb,unsigned long event,void* dummy) { switch (event) { case PM_SUSPEND_PREPARE: MALI_DEBUG_PRINT(2, ("mali_pwr_suspend_notifier(PM_SUSPEND_PREPARE) called\n")); mali_pm_os_suspend(); break; case PM_POST_SUSPEND: MALI_DEBUG_PRINT(2, ("mali_pwr_suspend_notifier(PM_SUSPEND_PREPARE) called\n")); mali_pm_os_resume(); break; default: break; } return 0; }
static ssize_t power_events_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos) { memset(pwr_buf,0,POWER_BUFFER_SIZE); virtual_power_status_register = 0; if (!strncmp(ubuf,mali_power_events[_MALI_DEVICE_SUSPEND],strlen(mali_power_events[_MALI_DEVICE_SUSPEND]))) { mali_pm_os_suspend(); /* @@@@ assuming currently suspend is successful later on to tune as per previous*/ virtual_power_status_register =1; } else if (!strncmp(ubuf,mali_power_events[_MALI_DEVICE_RESUME],strlen(mali_power_events[_MALI_DEVICE_RESUME]))) { mali_pm_os_resume(); /* @@@@ assuming currently resume is successful later on to tune as per previous */ virtual_power_status_register = 1; } else if (!strncmp(ubuf,mali_power_events[_MALI_DEVICE_DVFS_PAUSE],strlen(mali_power_events[_MALI_DEVICE_DVFS_PAUSE]))) { mali_bool power_on; mali_dev_pause(&power_on); if (!power_on) { virtual_power_status_register = 2; mali_dev_resume(); } else { /* @@@@ assuming currently resume is successful later on to tune as per previous */ virtual_power_status_register =1; } } else if (!strncmp(ubuf,mali_power_events[_MALI_DEVICE_DVFS_RESUME],strlen(mali_power_events[_MALI_DEVICE_DVFS_RESUME]))) { mali_dev_resume(); /* @@@@ assuming currently resume is successful later on to tune as per previous */ virtual_power_status_register = 1; } *ppos += cnt; sprintf(pwr_buf, "%d",virtual_power_status_register); return cnt; }
static int mali_pwr_suspend_notifier(struct notifier_block *nb,unsigned long event,void* dummy) { int err = 0; switch (event) { case PM_SUSPEND_PREPARE: mali_pm_os_suspend(); err = mali_os_suspend(&(mali_platform_device->dev)); break; case PM_POST_SUSPEND: err = mali_os_resume(&(mali_platform_device->dev)); mali_pm_os_resume(); break; default: break; } return err; }
static int mali_driver_suspend_scheduler(struct device *dev) { mali_pm_os_suspend(); return 0; }
static int mali_os_suspend(struct device *dev) { MALI_DEBUG_PRINT(3, ("mali_os_suspend(new) called\n")); mali_pm_os_suspend(); return 0; /* all ok */ }
static int mali_os_suspend(struct platform_device *pdev, pm_message_t state) { MALI_DEBUG_PRINT(3, ("mali_os_suspend(old) called\n")); mali_pm_os_suspend(); return 0; /* all ok */ }