Example #1
0
void s3cfb_early_suspend(struct early_suspend *h)
{
	struct s3cfb_global *fbdev =
		container_of(h, struct s3cfb_global, early_suspend);

	pr_debug("s3cfb_early_suspend is called\n");
#ifdef CONFIG_FB_S3C_MDNIE
	writel(0,fbdev->regs + 0x27c);
	msleep(20);
	writel(0x2, S5P_MDNIE_SEL);
	s3c_mdnie_stop();
#endif

	s3cfb_display_off(fbdev);
#ifdef CONFIG_FB_S3C_MDNIE
	s3c_mdnie_off();
#endif
	clk_disable(fbdev->clock);
#if defined(CONFIG_FB_S3C_TL2796)
	lcd_cfg_gpio_early_suspend();
#endif
	regulator_disable(fbdev->vlcd);
	regulator_disable(fbdev->vcc_lcd);
	regulator_disable(fbdev->regulator);

	return ;
}
static int s3cfb_sysfs_store_mdnie_power(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t len)
{
	u32 reg, i, enable;
	struct s3cfb_global *fbdev[2];

	sscanf(buf, "%d", &enable);

	if (enable) {
		for (i = 0; i < FIMD_MAX; i++) {
			fbdev[i] = fbfimd->fbdev[i];
			reg = readl(S3C_VA_SYS + 0x0210);
			reg &= ~(1<<13);
			reg &= ~(1<<12);
			reg &= ~(3<<10);
			reg |= (1<<0);
			reg &= ~(1<<1);
			writel(reg, S3C_VA_SYS + 0x0210);
			writel(3, fbdev[i]->regs + 0x27c);
			s3c_mdnie_init_global(fbdev[i]);
			s3c_mdnie_start(fbdev[i]);
		}
		printk("s3cfb_sysfs_store_mdnie_power() is called : mDNIE is ON \n");
	}
	else {
		for (i = 0; i < FIMD_MAX; i++) {
			fbdev[i] = fbfimd->fbdev[i];
			writel(0, fbdev[i]->regs + 0x27c);
			msleep(20);
			reg = readl(S3C_VA_SYS + 0x0210);
			reg |= (1<<1);
			writel(reg, S3C_VA_SYS + 0x0210);
			s3c_mdnie_stop();
			s3c_mdnie_off();
		}
		printk("s3cfb_sysfs_store_mdnie_power() is called : mDNIE is OFF \n");
	}

	return len;
}