int s3cfb_enable_window(struct s3cfb_global *fbdev, int id)
{
	struct s3cfb_window *win = fbdev->fb[id]->par;
#ifdef FEATURE_BUSFREQ_LOCK
	int enabled_win = 0;
#endif
#if defined(CONFIG_CPU_EXYNOS4212) || defined(CONFIG_CPU_EXYNOS4412)
#ifdef CONFIG_BUSFREQ_OPP
	if (id != CONFIG_FB_S5P_DEFAULT_WINDOW)
		dev_lock(fbdev->bus_dev, fbdev->dev, 133133);
#endif
#endif

	if (!win->enabled)
		atomic_inc(&fbdev->enabled_win);

#ifdef FEATURE_BUSFREQ_LOCK
	enabled_win = atomic_read(&fbdev->enabled_win);
	if (enabled_win >= 2)
		s3cfb_busfreq_lock(fbdev, 1);
#endif

	if (s3cfb_window_on(fbdev, id)) {
		win->enabled = 0;
		return -EFAULT;
	} else {
		win->enabled = 1;
		return 0;
	}
}
예제 #2
0
static void s3cfb_set_window(struct s3cfb_global *ctrl, int id, int enable)
{
	struct s3cfb_window *win = ctrl->fb[id]->par;

	if (enable) {
		s3cfb_window_on(ctrl, id);
		win->enabled = 1;
	} else {
		s3cfb_window_off(ctrl, id);
		win->enabled = 0;
	}
}
예제 #3
0
static int s3cfb_enable_window(int id)
{
	struct s3cfb_window *win = ctrl->fb[id]->par;

	if (s3cfb_window_on(ctrl, id)) {
		win->enabled = 0;
		return -EFAULT;
	} else {
		win->enabled = 1;
		return 0;
	}
}
예제 #4
0
int s3c_ielcd_init_global(struct s3cfb_global *ctrl)
{
    unsigned int cfg;

    *ielcd_fbdev = *ctrl;
    ielcd_fbdev->regs = s3c_ielcd_base;

#ifdef CONFIG_FB_S3C_MIPI_LCD
    s3cfb_set_polarity_only(ielcd_fbdev);
#else
    s3cfb_set_polarity(ielcd_fbdev);
#endif
    s3cfb_set_timing(ielcd_fbdev);
    s3cfb_set_lcd_size(ielcd_fbdev);

    /* dithmode */

    s3c_ielcd_writel(0x0, S3C_IELCD_DITHMODE);

    /* clk mode and mode
     * read from lcd vid con
     */
    cfg = readl(ctrl->regs + S3C_VIDCON0);
    cfg &= ~((7 << 26) | (1 << 5) | (1 << 0));
#ifdef CONFIG_FB_S3C_MIPI_LCD
    cfg |= (0 << 26 | 0 << 5);
#else
    cfg |= (0 << 26 | 1 << 5);
#endif

    s3c_ielcd_writel(cfg, S3C_IELCD_VIDCON0);

    s3c_ielcd_writel(1<<5, S3C_IELCD_VIDINTCON0);

    s3cfb_set_vsync_interrupt(ielcd_fbdev, 0);
    s3cfb_set_global_interrupt(ielcd_fbdev, 0);

    /*s3cfb_display_on(ielcd_fbdev);*/

    s3c_ielcd_writel(0, S3C_IELCD_VIDOSD0A);
    s3c_ielcd_writel((ctrl->lcd->width - 1) << 11 | (ctrl->lcd->height - 1), S3C_IELCD_VIDOSD0B);
    s3c_ielcd_writel((ctrl->lcd->width * ctrl->lcd->height), S3C_IELCD_VIDOSD0C);

    cfg = S3C_WINCON_DATAPATH_LOCAL | S3C_WINCON_BPPMODE_32BPP;
    cfg |= S3C_WINCON_INRGB_RGB;

    s3c_ielcd_writel(cfg, S3C_IELCD_WINCON0);

    s3cfb_window_on(ielcd_fbdev, 0);

    return 0;
}
예제 #5
0
int s3cfb_enable_window(struct s3cfb_global *fbdev, int id)
{
	struct s3cfb_window *win = fbdev->fb[id]->par;

	if (!win->enabled)
		atomic_inc(&fbdev->enabled_win);

	if (s3cfb_window_on(fbdev, id)) {
		win->enabled = 0;
		return -EFAULT;
	} else {
		win->enabled = 1;
		return 0;
	}
}
예제 #6
0
파일: s3cfb_ops.c 프로젝트: gcrisis/m040
int s3cfb_enable_window(struct s3cfb_global *fbdev, int id)
{
	struct s3cfb_window *win = fbdev->fb[id]->par;

#ifdef CONFIG_BUSFREQ_OPP
	if (soc_is_exynos4212() || soc_is_exynos4412()) {
		if (id != CONFIG_FB_S5P_DEFAULT_WINDOW)
			dev_lock(fbdev->bus_dev, fbdev->dev, 133133);
	}
#endif

	if (!win->enabled)
		atomic_inc(&fbdev->enabled_win);

	if (s3cfb_window_on(fbdev, id)) {
		win->enabled = 0;
		return -EFAULT;
	} else {
		win->enabled = 1;
		return 0;
	}
}