static ssize_t attr_orise_lcdon(struct device *dev, struct device_attribute *attr, char *buf) { if(!flag_lcd_node_onoff) return 0; flag_lcd_node_onoff = false; prevent_suspend(); mipi_dsi_on(g_mdp_dev); allow_suspend(); return 0; }
static ssize_t attr_orise_reinit(struct device *dev, struct device_attribute *attr, char *buf) { if(flag_lcd_off) { printk("%s: system is suspending, don't do this!\n",__func__); return 0; } prevent_suspend(); flag_lcd_resume = true; mipi_dsi_off(g_mdp_dev); mdelay(100); mipi_dsi_on(g_mdp_dev); allow_suspend(); return 0; }
void resume_prevent_suspend(void) { prevent_suspend(); MM_INFO("chenjun:patch:resume_prevent_suspend\n"); }
int msm_adsp_get(const char *name, struct msm_adsp_module **out, struct msm_adsp_ops *ops, void *driver_data) { struct msm_adsp_module *module; int rc = 0; #if CONFIG_MSM_AMSS_VERSION >= 6350 static uint32_t init_info_cmd_sent; if (!init_info_cmd_sent) { msm_get_init_info(); init_waitqueue_head(&adsp_info.init_info_wait); rc = wait_event_timeout(adsp_info.init_info_wait, adsp_info.init_info_state == ADSP_STATE_INIT_INFO, 5 * HZ); if (!rc) { pr_info("adsp: INIT_INFO failed\n"); return -ETIMEDOUT; } init_info_cmd_sent++; } #endif module = find_adsp_module_by_name(&adsp_info, name); if (!module) return -ENODEV; mutex_lock(&module->lock); pr_info("adsp: opening module %s\n", module->name); if (module->open_count++ == 0 && module->clk) clk_enable(module->clk); mutex_lock(&adsp_open_lock); if (adsp_open_count++ == 0) { enable_irq(INT_ADSP); prevent_suspend(); } mutex_unlock(&adsp_open_lock); if (module->ops) { rc = -EBUSY; goto done; } rc = adsp_rpc_init(module); if (rc) goto done; module->ops = ops; module->driver_data = driver_data; *out = module; rc = rpc_adsp_rtos_app_to_modem(RPC_ADSP_RTOS_CMD_REGISTER_APP, module->id, module); if (rc) { module->ops = NULL; module->driver_data = NULL; *out = NULL; pr_err("adsp: REGISTER_APP failed\n"); goto done; } pr_info("adsp: module %s has been registered\n", module->name); done: mutex_lock(&adsp_open_lock); if (rc && --adsp_open_count == 0) { disable_irq(INT_ADSP); allow_suspend(); } if (rc && --module->open_count == 0 && module->clk) clk_disable(module->clk); mutex_unlock(&adsp_open_lock); mutex_unlock(&module->lock); return rc; }
void resume_prevent_suspend(void) { prevent_suspend(); }