static void mipi_lcd_set_power(struct plat_lcd_data *pd,
				unsigned int power)
{
	struct regulator *regulator_1_8;
	struct regulator *regulator_2_8;

	regulator_1_8 = regulator_get(NULL, "vcc_1.8v_lcd");
	regulator_2_8 = regulator_get(NULL, "vcc_2.8v_lcd");

	if (IS_ERR(regulator_1_8))
		printk(KERN_ERR "LCD_1_8: Fail to get regulator!\n");
	if (IS_ERR(regulator_2_8))
		printk(KERN_ERR "LCD_2.8: Fail to get regulator!\n");

	if (power) {
		/*mipi 1.8v enable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_HIGH, "GPIO_MIPI_18V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));

		/*panel power enable*/
		regulator_enable(regulator_2_8);

		usleep_range(5000, 8000);
		regulator_enable(regulator_1_8);
		msleep(25);

		/*LCD RESET high*/
		gpio_request_one(EXYNOS5410_GPJ1(0),
		GPIOF_OUT_INIT_HIGH, "GPIO_MLCD_RST");
		usleep_range(5000, 6000);
		gpio_set_value(EXYNOS5410_GPJ1(0), 0);
		usleep_range(5000, 6000);
		gpio_set_value(EXYNOS5410_GPJ1(0), 1);
		gpio_free(EXYNOS5410_GPJ1(0));
		usleep_range(7000, 8000);
	} else {
		/*LCD RESET low*/
		gpio_request_one(EXYNOS5410_GPJ1(0),
				GPIOF_OUT_INIT_LOW, "GPIO_MLCD_RST");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));

		/*lcd 1.8V disable*/
		if (regulator_is_enabled(regulator_1_8))
				regulator_disable(regulator_1_8);
		if (regulator_is_enabled(regulator_2_8))
				regulator_disable(regulator_2_8);

		/*mipi 1.8v disable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_LOW, "GPIO_MIPI_18V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
	}
	regulator_put(regulator_1_8);
	regulator_put(regulator_2_8);

}
static void mipi_lcd_power_control(struct s5p_platform_mipi_dsim *dsim,
				unsigned int power)
{
	struct regulator *regulator;

	regulator = regulator_get(NULL, "touch_1.8v_s");

	if (IS_ERR(regulator))
		printk(KERN_ERR "LCD: Fail to get regulator!\n");

	if (power) {
		/*mipi 1.8v enable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_HIGH, "GPIO_MIPI_18V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));

		/*lcd 1.8V enable*/
		regulator_enable(regulator);
		usleep_range(2000, 3000);

		/*AVDD enable*/
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_HIGH, "GPIO_LCD_22V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));
		usleep_range(2000, 3000);

		/*LCD RESET high*/
		gpio_request_one(EXYNOS5410_GPJ1(0),
		GPIOF_OUT_INIT_HIGH, "GPIO_MLCD_RST");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));
		usleep_range(7000, 8000);
	} else {
		/*LCD RESET low*/
		gpio_request_one(EXYNOS5410_GPJ1(0),
				GPIOF_OUT_INIT_LOW, "GPIO_MLCD_RST");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));

		/*AVDD disable*/
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_LOW, "GPIO_LCD_22V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));

		/*lcd 1.8V disable*/
		if (regulator_is_enabled(regulator))
				regulator_disable(regulator);

		/*mipi 1.8v disable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_LOW, "GPIO_MIPI_18V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
	}
	regulator_put(regulator);
}
static int mipi_power_control(struct mipi_dsim_device *dsim,
				unsigned int power)
{
	if (power) {
		/*mipi 1.8v enable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_HIGH, "GPIO_MIPI_18V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
		usleep_range(12000, 12000);
	} else {
		/*mipi 1.8v disable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_LOW, "GPIO_MIPI_18V_EN");
		gpio_free(EXYNOS5410_GPF1(6));
	}

	return 0;
}
static void mipi_lcd_set_power(struct plat_lcd_data *pd,
				unsigned int power)
{
	/* reset */
	if (power) {
		gpio_request_one(GPIO_MLCD_RST,
				GPIOF_OUT_INIT_HIGH, "GPJ1");
		usleep_range(5000, 6000);
		gpio_set_value(EXYNOS5410_GPJ1(0), 0);
		usleep_range(5000, 6000);
		gpio_set_value(EXYNOS5410_GPJ1(0), 1);
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));
	} else {
		gpio_request_one(EXYNOS5410_GPJ1(0),
				GPIOF_OUT_INIT_LOW, "GPJ1");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));
	}

	/* enable VCC_2.2V_LCD */
	if (power) {
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_HIGH, "GPJ2");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_HIGH, "GPF1");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
	} else {
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_LOW, "GPJ2");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_LOW, "GPF1");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
	}
}
			.count = 0,
		},
		{
			.pin_type = PIN_GPIO,
			.pin = EXYNOS5410_GPF0(5),
			.name = "GPIO_VT_CAM_SCL_18V",
			.value = (0x2<<20),
			.act = GPIO_PULL_NONE,
			.flite_id = FLITE_ID_C,
			.count = 0,
		},
		/* ETC */
		/* Host use spi controller in image subsystem */
		{
			.pin_type = PIN_GPIO,
			.pin = EXYNOS5410_GPF1(0),
			.name = "GPIO_CAM_SPI0_SCLK",
			.value = (0x2<<0),
			.act = GPIO_PULL_NONE,
			.flite_id = FLITE_ID_A,
			.count = 0,
		},
		/* chip select is controlled by gpio output */
		{
			.pin_type = PIN_GPIO,
			.pin = EXYNOS5410_GPF1(1),
			.name = "GPIO_CAM_SPI0_SSN",
			.value = (0x1<<4),
			.act = GPIO_PULL_NONE,
			.flite_id = FLITE_ID_A,
			.count = 0,
static int __devinit fimc_is_spi_probe(struct spi_device *spi)
{
	int ret = 0;
	int gpio;

	dbg_core("%s\n", __func__);

	/* spi->bits_per_word = 16; */
	if (spi_setup(spi)) {
		pr_err("failed to setup spi for fimc_is_spi\n");
		ret = -EINVAL;
		goto exit;
	}

	g_spi = spi;

	gpio = EXYNOS5410_GPF1(0);
	if (gpio_request(gpio, "dout_spi3")) {
		err("gpio_request(dout_spi3) is fail1");
	} else {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
		gpio_free(gpio);
	}

	gpio = EXYNOS5410_GPF1(1);
	if (gpio_request(gpio, "dout_spi3")) {
		err("gpio_request(dout_spi3) is fail2");
	} else {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(1));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
		gpio_free(gpio);
	}

	for (gpio = EXYNOS5410_GPF1(0); gpio < EXYNOS5410_GPF1(4); gpio++)
		s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV3);
exit:
	/* 1. disable A5 */
	writel(0x00000, PMUREG_ISP_ARM_OPTION);

	writel(0x0, PMUREG_CMU_RESET_ISP_SYS_PWR_REG);
	writel(0x0, PMUREG_CMU_SYSCLK_ISP_SYS_PWR_REG);
	writel(0x0, PMUREG_ISP_ARM_SYS_PWR_REG);

#if defined(CONFIG_PM_RUNTIME)
	pm_runtime_put_sync(get_is_dev());
#endif

	/*
	 * spi ch3 is isp spi0, this gpio function should be changed for
	 * flash control after usage(only smdk board)
	 */
	gpio = EXYNOS5410_GPF1(0);
	if (gpio_request(gpio, "dout_spi3")) {
		err("gpio_request(dout_spi3) is fail3");
	} else {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
		gpio_free(gpio);
	}

	gpio = EXYNOS5410_GPF1(1);
	if (gpio_request(gpio, "dout_spi3")) {
		err("gpio_request(dout_spi3) is fail4");
	} else {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
		gpio_free(gpio);
	}

	return ret;
}