int pm_prepare_console(void) { orig_loglevel = console_loglevel; console_loglevel = new_loglevel; #ifdef SUSPEND_CONSOLE acquire_console_sem(); orig_fgconsole = fg_console; if (vc_allocate(SUSPEND_CONSOLE)) { /* we can't have a free VC for now. Too bad, * we don't want to mess the screen for now. */ release_console_sem(); return 1; } set_console(SUSPEND_CONSOLE); release_console_sem(); if (vt_waitactive(SUSPEND_CONSOLE)) { pr_debug("Suspend: Can't switch VCs."); return 1; } orig_kmsg = kmsg_redirect; kmsg_redirect = SUSPEND_CONSOLE; #endif return 0; }
static void console_early_suspend(struct early_suspend *h) { #ifdef CONFIG_SHLCDC_BOARD char ev[128]; #endif acquire_console_sem(); orig_fgconsole = fg_console; if (vc_allocate(EARLY_SUSPEND_CONSOLE)) goto err; if (set_console(EARLY_SUSPEND_CONSOLE)) goto err; #ifdef CONFIG_SHLCDC_BOARD vt_waitactive_queue((void *)ev); #endif release_console_sem(); #ifdef CONFIG_SHLCDC_BOARD if (vt_waitactive_wait_dequeue((void *)ev, EARLY_SUSPEND_CONSOLE + 1)) #else if (vt_waitactive(EARLY_SUSPEND_CONSOLE + 1)) #endif pr_warning("console_early_suspend: Can't switch VCs.\n"); return; err: pr_warning("console_early_suspend: Can't set console\n"); release_console_sem(); }
static void console_early_suspend(struct early_suspend *h) { acquire_console_sem(); orig_fgconsole = fg_console; if (vc_allocate(EARLY_SUSPEND_CONSOLE)) goto err; if (set_console(EARLY_SUSPEND_CONSOLE)) goto err; release_console_sem(); if (vt_waitactive(EARLY_SUSPEND_CONSOLE)) pr_warning("console_early_suspend: Can't switch VCs.\n"); return; err: pr_warning("console_early_suspend: Can't set console\n"); release_console_sem(); }
static void console_early_suspend(struct early_suspend *h) { printk("[KENEL] %s, %d \n", __FUNCTION__, __LINE__); acquire_console_sem(); orig_fgconsole = fg_console; if (vc_allocate(EARLY_SUSPEND_CONSOLE)) goto err; if (set_console(EARLY_SUSPEND_CONSOLE)) goto err; release_console_sem(); if (vt_waitactive(EARLY_SUSPEND_CONSOLE + 1)) pr_warning("console_early_suspend: Can't switch VCs.\n"); return; err: pr_warning("console_early_suspend: Can't set console\n"); release_console_sem(); }
int pm_prepare_console(void) { acquire_console_sem(); if (disable_vt_switch) { release_console_sem(); return 0; } orig_fgconsole = fg_console; if (vc_allocate(SUSPEND_CONSOLE)) { /* we can't have a free VC for now. Too bad, * we don't want to mess the screen for now. */ release_console_sem(); return 1; } if (set_console(SUSPEND_CONSOLE)) { /* * We're unable to switch to the SUSPEND_CONSOLE. * Let the calling function know so it can decide * what to do. */ release_console_sem(); return 1; } release_console_sem(); if (vt_waitactive(SUSPEND_CONSOLE)) { pr_debug("Suspend: Can't switch VCs."); return 1; } orig_kmsg = kmsg_redirect; kmsg_redirect = SUSPEND_CONSOLE; return 0; }
static void console_early_suspend(struct early_suspend *h) { printk("%s / acquire_console_sem\n", __func__); acquire_console_sem(); orig_fgconsole = fg_console; printk("%s / alloc\n", __func__); if (vc_allocate(EARLY_SUSPEND_CONSOLE)) goto err; printk("%s / set_console\n", __func__); if (set_console(EARLY_SUSPEND_CONSOLE)) goto err; printk("%s / release_console_sem\n", __func__); release_console_sem(); printk("%s / vt_waitactive\n", __func__); if (vt_waitactive(EARLY_SUSPEND_CONSOLE + 1)) pr_warning("console_early_suspend: Can't switch VCs.\n"); printk("%s / end\n", __func__); return; err: pr_warning("console_early_suspend: Can't set console\n"); release_console_sem(); }