/* * Resume */ int s5p_tv_late_resume(struct platform_device *dev) { BASEPRINTK("(hpd_status = %d)++\n", s5ptv_status.hpd_status); mutex_lock(mutex_for_fo); s5ptv_status.suspend_status = false; if(!(s5ptv_status.hpd_status)) { mutex_unlock(mutex_for_fo); return 0; } else { #if 0 #ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_MAX_FREQ_1GHZ // 2010.3.9. s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 3); #else s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 2); #endif #endif #endif #ifdef CONFIG_PM_PWR_GATING /* clk & power on */ s5p_tv_clk_gate( true ); if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB) tv_phy_power( true ); #endif /* tv on */ if ( s5ptv_status.tvout_output_enable ) { _s5p_tv_if_start(); } /* video layer start */ if ( s5ptv_status.vp_layer_enable ) _s5p_vlayer_start(); /* grp0 layer start */ if ( s5ptv_status.grp_layer_enable[0] ) _s5p_grp_start(VM_GPR0_LAYER); /* grp1 layer start */ if ( s5ptv_status.grp_layer_enable[1] ) _s5p_grp_start(VM_GPR1_LAYER); #ifdef CONFIG_TV_FB if ( s5ptv_status.tvout_output_enable ) { s5ptvfb_display_on(&s5ptv_status); s5ptvfb_set_par(s5ptv_status.fb); } #endif } mutex_unlock(mutex_for_fo); BASEPRINTK("()--\n"); return 0; }
/* * Resume */ int s5p_tv_late_resume(struct platform_device *dev) { BASEPRINTK("(hpd_status = %d)++\n", s5ptv_status.hpd_status); mutex_lock(mutex_for_fo); s5ptv_status.suspend_status = false; if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_DVI) s5p_handle_cable(); if(!(s5ptv_status.hpd_status)) { mutex_unlock(mutex_for_fo); return 0; } else { #ifdef CONFIG_CPU_FREQ_S5PV210 s5pv210_set_cpufreq_level(RESTRICT_TABLE); #endif /* CONFIG_CPU_FREQ_S5PV210 */ /* clk & power on */ s5p_tv_clk_gate( true ); if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_DVI) tv_phy_power( true ); /* tv on */ if (s5ptv_status.tvout_output_enable) { _s5p_tv_if_start(); } /* video layer start */ if (s5ptv_status.vp_layer_enable) _s5p_vlayer_start(); /* grp0 layer start */ if (s5ptv_status.grp_layer_enable[0]) _s5p_grp_start(VM_GPR0_LAYER); /* grp1 layer start */ if (s5ptv_status.grp_layer_enable[1]) _s5p_grp_start(VM_GPR1_LAYER); #ifdef CONFIG_TV_FB if (s5ptv_status.tvout_output_enable) { s5ptvfb_display_on(&s5ptv_status); s5ptvfb_set_par(s5ptv_status.fb); } #endif } mutex_unlock(mutex_for_fo); BASEPRINTK("()--\n"); return 0; }
/* * Resume */ void s5p_tv_late_resume(struct early_suspend *h) { BASEPRINTK("%s----------------start \n", __func__); mutex_lock(mutex_for_fo); s5ptv_status.suspend_status = false; if (!(s5ptv_status.hpd_status)) { printk(KERN_INFO "(hpd_status = %d)++\n", \ s5ptv_status.hpd_status); mutex_unlock(mutex_for_fo); return ; } else { #ifdef CONFIG_CPU_FREQ_S5PV210 s5pv210_set_cpufreq_level(RESTRICT_TABLE); #endif /* CONFIG_CPU_FREQ_S5PV210 */ /* clk & power on */ s5p_tv_clk_gate(true); if ((s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI) ||\ (s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)) tv_phy_power(true); /* tv on */ if (s5ptv_status.tvout_output_enable) _s5p_tv_if_start(); /* video layer start */ if (s5ptv_status.vp_layer_enable) _s5p_vlayer_start(); /* grp0 layer start */ if (s5ptv_status.grp_layer_enable[0]) _s5p_grp_start(VM_GPR0_LAYER); /* grp1 layer start */ if (s5ptv_status.grp_layer_enable[1]) _s5p_grp_start(VM_GPR1_LAYER); #ifdef CONFIG_TV_FB if (s5ptv_status.tvout_output_enable) { s5ptvfb_display_on(&s5ptv_status); s5ptvfb_set_par(s5ptv_status.fb); } #endif } mutex_unlock(mutex_for_fo); BASEPRINTK("()--\n"); return ; }
int s5ptvfb_register_framebuffer(void) { int ret; ret = register_framebuffer(g_s5ptv_status.fb); if (ret) { dev_err(g_s5ptv_status.dev_fb, "failed to register " "framebuffer device\n"); return -EINVAL; } #ifndef CONFIG_FRAMEBUFFER_CONSOLE #ifndef CONFIG_USER_ALLOC_TVOUT s5ptvfb_check_var(&g_s5ptv_status.fb->var, g_s5ptv_status.fb); s5ptvfb_set_par(g_s5ptv_status.fb); s5ptvfb_draw_logo(g_s5ptv_status.fb); #endif #endif return 0; }
void s5p_tv_late_resume(struct early_suspend *h) { BASEPRINTK("(hpd_status = %d)++\n", g_s5ptv_status.hpd_status); mutex_lock(g_mutex_for_fo); g_s5ptv_status.suspend_status = false; if (g_s5ptv_status.hpd_status == true) { /* clk & power on */ s5p_tv_base_clk_gate(true); if (g_s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || g_s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB) s5p_tv_base_phy_power(true); /* tv on */ if (g_s5ptv_status.tvout_output_enable) s5p_tv_if_start(); /* video layer start */ if (g_s5ptv_status.vp_layer_enable) s5p_vlayer_start(); /* grp0 layer start */ if (g_s5ptv_status.grp_layer_enable[VM_GPR0_LAYER]) s5p_grp_start(VM_GPR0_LAYER); /* grp1 layer start */ if (g_s5ptv_status.grp_layer_enable[VM_GPR1_LAYER]) s5p_grp_start(VM_GPR1_LAYER); #ifdef CONFIG_TV_FB if (g_s5ptv_status.tvout_output_enable) { s5ptvfb_display_on(&g_s5ptv_status); s5ptvfb_set_par(g_s5ptv_status.fb); } #endif } mutex_unlock(g_mutex_for_fo); BASEPRINTK("()--\n"); return; }
int s5ptvfb_direct_ioctl(int id, unsigned int cmd, unsigned long arg) { struct fb_info *fb = s5ptv_status.fb; struct fb_fix_screeninfo *fix = &fb->fix; struct s5ptvfb_window *win = fb->par; void *argp = (void *) arg; int ret = 0; switch (cmd) { case FBIO_ALLOC: win->path = (enum s5ptvfb_data_path_t) argp; break; case FBIOGET_FSCREENINFO: ret = memcpy(argp, &fb->fix, sizeof(fb->fix)) ? 0 : -EFAULT; break; case FBIOGET_VSCREENINFO: ret = memcpy(argp, &fb->var, sizeof(fb->var)) ? 0 : -EFAULT; break; case FBIOPUT_VSCREENINFO: ret = s5ptvfb_check_var((struct fb_var_screeninfo *) argp, fb); if (ret) { dev_err(s5ptv_status.dev_fb, "invalid vscreeninfo\n"); break; } ret = memcpy(&fb->var, (struct fb_var_screeninfo *) argp, sizeof(fb->var)) ? 0 : -EFAULT; if (ret) { dev_err(s5ptv_status.dev_fb, "failed to put new vscreeninfo\n"); break; } ret = s5ptvfb_set_par(fb); break; case S5PTVFB_SET_WIN_ON: #ifdef CONFIG_USER_ALLOC_TVOUT s5ptvfb_display_on(&s5ptv_status); s5ptvfb_enable_window(0); #endif break; case S5PTVFB_SET_WIN_OFF: #ifdef CONFIG_USER_ALLOC_TVOUT s5ptvfb_display_off(&s5ptv_status); s5ptvfb_disable_window(0); #endif break; case S5PTVFB_POWER_ON: s5p_tv_clk_gate(true); tv_phy_power(true); _s5p_tv_if_init_param(); s5p_tv_v4l2_init_param(); /* s5ptv_status.tvout_param.disp_mode = TVOUT_720P_60; */ s5ptv_status.tvout_param.out_mode = TVOUT_OUTPUT_HDMI; _s5p_tv_if_set_disp(); break; case S5PTVFB_POWER_OFF: _s5p_vlayer_stop(); _s5p_tv_if_stop(); s5p_tv_clk_gate(false); tv_phy_power(false); break; case S5PTVFB_WIN_SET_ADDR: fix->smem_start = (unsigned long)argp; s5ptvfb_set_buffer_address(&s5ptv_status, win->id); break; default: ret = s5ptvfb_ioctl(fb, cmd, arg); break; } return ret; }
static int s5ptvfb_ioctl(struct fb_info *fb, unsigned int cmd, unsigned long arg) { struct fb_var_screeninfo *var = &fb->var; struct s5ptvfb_window *win = fb->par; struct s5ptvfb_lcd *lcd = s5ptv_status.lcd; int ret = 0; void *argp = (void *) arg; union { struct s5ptvfb_user_window user_window; struct s5ptvfb_user_plane_alpha user_alpha; struct s5ptvfb_user_chroma user_chroma; int vsync; } p; switch (cmd) { case FBIO_ALLOC: win->path = (enum s5ptvfb_data_path_t) argp; break; case FBIOGET_FSCREENINFO: ret = memcpy(argp, &fb->fix, sizeof(fb->fix)) ? 0 : -EFAULT; break; case FBIOGET_VSCREENINFO: ret = memcpy(argp, &fb->var, sizeof(fb->var)) ? 0 : -EFAULT; break; case FBIOPUT_VSCREENINFO: ret = s5ptvfb_check_var((struct fb_var_screeninfo *) argp, fb); if (ret) { dev_err(s5ptv_status.dev_fb, "invalid vscreeninfo\n"); break; } ret = memcpy(&fb->var, (struct fb_var_screeninfo *) argp, sizeof(fb->var)) ? 0 : -EFAULT; if (ret) { dev_err(s5ptv_status.dev_fb, "failed to put new vscreeninfo\n"); break; } ret = s5ptvfb_set_par(fb); break; case S5PTVFB_WIN_POSITION: if (copy_from_user(&p.user_window, (struct s5ptvfb_user_window __user *) arg, sizeof(p.user_window))) ret = -EFAULT; else { if (p.user_window.x < 0) p.user_window.x = 0; if (p.user_window.y < 0) p.user_window.y = 0; if (p.user_window.x + var->xres > lcd->width) win->x = lcd->width - var->xres; else win->x = p.user_window.x; if (p.user_window.y + var->yres > lcd->height) win->y = lcd->height - var->yres; else win->y = p.user_window.y; s5ptvfb_set_window_position(&s5ptv_status, win->id); } break; case S5PTVFB_WIN_SET_PLANE_ALPHA: if (copy_from_user(&p.user_alpha, (struct s5ptvfb_user_plane_alpha __user *) arg, sizeof(p.user_alpha))) ret = -EFAULT; else { win->alpha.mode = PLANE_BLENDING; win->alpha.channel = p.user_alpha.channel; win->alpha.value = S5PTVFB_AVALUE(p.user_alpha.red, p.user_alpha.green, p.user_alpha.blue); s5ptvfb_set_alpha_blending(&s5ptv_status, win->id); } break; case S5PTVFB_WIN_SET_CHROMA: if (copy_from_user(&p.user_chroma, (struct s5ptvfb_user_chroma __user *) arg, sizeof(p.user_chroma))) ret = -EFAULT; else { win->chroma.enabled = p.user_chroma.enabled; win->chroma.key = S5PTVFB_CHROMA(p.user_chroma.red, p.user_chroma.green, p.user_chroma.blue); s5ptvfb_set_chroma_key(&s5ptv_status, win->id); } break; case S5PTVFB_WIN_SET_ADDR: fb->fix.smem_start = (unsigned long)argp; s5ptvfb_set_buffer_address(&s5ptv_status, win->id); break; case S5PTVFB_SET_WIN_ON: #ifdef CONFIG_USER_ALLOC_TVOUT s5ptvfb_display_on(&s5ptv_status); s5ptvfb_enable_window(0); #endif break; case S5PTVFB_SET_WIN_OFF: #ifdef CONFIG_USER_ALLOC_TVOUT s5ptvfb_display_off(&s5ptv_status); s5ptvfb_disable_window(0); #endif break; } return 0; }