Exemple #1
0
void exynos5_fimc_is_cfg_gpio(struct platform_device *pdev)
{
	int ret;

	/* 1. UART setting for FIMC-IS */
	ret = gpio_request(GPIO_5M_nRST, "GPIO_5M_nRST");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_5M_nRST ####\n");
	s3c_gpio_cfgpin(GPIO_5M_nRST, (0x2<<0));
	s3c_gpio_setpull(GPIO_5M_nRST, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_5M_nRST);

#if defined(CONFIG_MACH_P11) || defined(CONFIG_MACH_P10)
#else
	ret = gpio_request(EXYNOS5_GPE0(1), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_1 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(1), (0x2<<4));
	s3c_gpio_setpull(EXYNOS5_GPE0(1), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(1));

	ret = gpio_request(EXYNOS5_GPE0(2), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_2 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(2), (0x3<<8));
	s3c_gpio_setpull(EXYNOS5_GPE0(2), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(2));

	ret = gpio_request(EXYNOS5_GPE0(3), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_3 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(3), (0x3<<12));
	s3c_gpio_setpull(EXYNOS5_GPE0(3), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(3));

	ret = gpio_request(EXYNOS5_GPE0(4), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_4 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(4), (0x3<<16));
	s3c_gpio_setpull(EXYNOS5_GPE0(4), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(4));

	ret = gpio_request(EXYNOS5_GPE0(5), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_5 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(5), (0x3<<20));
	s3c_gpio_setpull(EXYNOS5_GPE0(5), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(5));

	ret = gpio_request(EXYNOS5_GPE0(6), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_6 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(6), (0x3<<24));
	s3c_gpio_setpull(EXYNOS5_GPE0(6), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(6));
#endif

	ret = gpio_request(GPIO_ISP_TXD, "GPIO_ISP_TXD");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_ISP_TXD ####\n");
	s3c_gpio_cfgpin(GPIO_ISP_TXD, (0x3<<28));
	s3c_gpio_setpull(GPIO_ISP_TXD, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_ISP_TXD);

#if defined(CONFIG_MACH_P11) || defined(CONFIG_MACH_P10)
#else
	ret = gpio_request(EXYNOS5_GPE1(0), "GPE1");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE1_0 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE1(0), (0x3<<0));
	s3c_gpio_setpull(EXYNOS5_GPE1(0), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE1(0));
#endif

	ret = gpio_request(GPIO_ISP_RXD, "GPIO_ISP_RXD");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_ISP_RXD ####\n");
	s3c_gpio_cfgpin(GPIO_ISP_RXD, (0x3<<4));
	s3c_gpio_setpull(GPIO_ISP_RXD, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_ISP_RXD);

	/* 2. GPIO setting for FIMC-IS */
	ret = gpio_request(GPIO_5M_CAM_SDA_18V, "GPIO_5M_CAM_SDA_18V");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_5M_CAM_SDA_18V ####\n");
	s3c_gpio_cfgpin(GPIO_5M_CAM_SDA_18V, (0x2<<0));
	s3c_gpio_setpull(GPIO_5M_CAM_SDA_18V, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_5M_CAM_SDA_18V);

	ret = gpio_request(GPIO_5M_CAM_SCL_18V, "GPIO_5M_CAM_SCL_18V");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_5M_CAM_SCL_18V ####\n");
	s3c_gpio_cfgpin(GPIO_5M_CAM_SCL_18V, (0x2<<4));
	s3c_gpio_setpull(GPIO_5M_CAM_SCL_18V, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_5M_CAM_SCL_18V);

	ret = gpio_request(GPIO_VT_CAM_SDA_18V, "GPIO_VT_CAM_SDA_18V");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_VT_CAM_SDA_18V ####\n");
	s3c_gpio_cfgpin(GPIO_VT_CAM_SDA_18V, (0x2<<8));
	s3c_gpio_setpull(GPIO_VT_CAM_SDA_18V, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_VT_CAM_SDA_18V);

	ret = gpio_request(GPIO_VT_CAM_SCL_18V, "GPIO_VT_CAM_SCL_18V");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_5M_CAM_SDA_18V ####\n");
	s3c_gpio_cfgpin(GPIO_VT_CAM_SCL_18V, (0x2<<12));
	s3c_gpio_setpull(GPIO_VT_CAM_SCL_18V, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_VT_CAM_SCL_18V);

	ret = gpio_request(GPIO_CMC_CLK_18V, "GPIO_CMC_CLK_18V");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_CMC_CLK_18V ####\n");
	s3c_gpio_cfgpin(GPIO_CMC_CLK_18V, (0x3<<0));
	s3c_gpio_setpull(GPIO_CMC_CLK_18V, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_CMC_CLK_18V);

	ret = gpio_request(GPIO_CMC_CS_18V, "GPIO_CMC_CS_18V");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_CMC_CS_18V ####\n");
	s3c_gpio_cfgpin(GPIO_CMC_CS_18V, (0x3<<4));
	s3c_gpio_setpull(GPIO_CMC_CS_18V, S3C_GPIO_PULL_NONE);
	gpio_free(GPIO_CMC_CS_18V);

	/* CAM A port(b0010) : CLK_OUT */
	s3c_gpio_cfgrange_nopull(GPIO_CAM_MCLK, 1, S3C_GPIO_SFN(2));

#if defined(CONFIG_MACH_P11) || defined(CONFIG_MACH_P10)
	/* power_on */
	cam_power_on();

	/* CAM A port : POWER */
	s3c_gpio_cfgpin(GPIO_CAM_IO_EN, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_CAM_IO_EN, S3C_GPIO_PULL_NONE);
	gpio_set_value(GPIO_CAM_IO_EN, 1);

	/* CAM A reset*/
	ret = gpio_request(GPIO_5M_nRST, "GPIO_5M_nRST");
	if (ret)
		printk(KERN_ERR "#### failed to request GPIO_5M_nRST ####\n");

	s3c_gpio_setpull(GPIO_5M_nRST, S3C_GPIO_PULL_NONE);
	gpio_direction_output(GPIO_5M_nRST, 0);
	gpio_direction_output(GPIO_5M_nRST, 1);
	gpio_free(GPIO_5M_nRST);
#else
	/* CAM A port(b0010) : DATA[0-7] */
	/* s3c_gpio_cfgrange_nopull(EXYNOS5_GPH1(0), 8, S3C_GPIO_SFN(2)); */

	/* Camera A */
	ret = gpio_request(EXYNOS5_GPX1(2), "GPX1");
	if (ret)
		printk(KERN_ERR "#### failed to request GPX1_2 ####\n");

	s3c_gpio_setpull(EXYNOS5_GPX1(2), S3C_GPIO_PULL_NONE);
	gpio_direction_output(EXYNOS5_GPX1(2), 0);
	gpio_direction_output(EXYNOS5_GPX1(2), 1);
	gpio_free(EXYNOS5_GPX1(2));
#endif
}
/*------------------------------------------------------*/
void exynos5_fimc_is_cfg_gpio(struct platform_device *pdev)
{
	int ret;

	/* 1. UART setting for FIMC-IS */
	ret = gpio_request(EXYNOS5_GPE0(0), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_0 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(0), (0x2<<0));
	s3c_gpio_setpull(EXYNOS5_GPE0(0), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(0));

	ret = gpio_request(EXYNOS5_GPE0(1), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_1 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(1), (0x2<<4));
	s3c_gpio_setpull(EXYNOS5_GPE0(1), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(1));

	ret = gpio_request(EXYNOS5_GPE0(2), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_2 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(2), (0x3<<8));
	s3c_gpio_setpull(EXYNOS5_GPE0(2), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(2));

	ret = gpio_request(EXYNOS5_GPE0(3), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_3 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(3), (0x3<<12));
	s3c_gpio_setpull(EXYNOS5_GPE0(3), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(3));

	ret = gpio_request(EXYNOS5_GPE0(4), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_4 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(4), (0x3<<16));
	s3c_gpio_setpull(EXYNOS5_GPE0(4), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(4));

	ret = gpio_request(EXYNOS5_GPE0(5), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_5 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(5), (0x3<<20));
	s3c_gpio_setpull(EXYNOS5_GPE0(5), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(5));

	ret = gpio_request(EXYNOS5_GPE0(6), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_6 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(6), (0x3<<24));
	s3c_gpio_setpull(EXYNOS5_GPE0(6), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(6));

	ret = gpio_request(EXYNOS5_GPE0(7), "GPE0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE0_7 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE0(7), (0x3<<28));
	s3c_gpio_setpull(EXYNOS5_GPE0(7), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE0(7));

	ret = gpio_request(EXYNOS5_GPE1(0), "GPE1");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE1_0 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE1(0), (0x3<<0));
	s3c_gpio_setpull(EXYNOS5_GPE1(0), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE1(0));

	ret = gpio_request(EXYNOS5_GPE1(1), "GPE1");
	if (ret)
		printk(KERN_ERR "#### failed to request GPE1_1 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPE1(1), (0x3<<4));
	s3c_gpio_setpull(EXYNOS5_GPE1(1), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPE1(1));

	/* 2. GPIO setting for FIMC-IS */
	ret = gpio_request(EXYNOS5_GPF0(0), "GPF0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPF0_0 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPF0(0), (0x2<<0));
	s3c_gpio_setpull(EXYNOS5_GPF0(0), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPF0(0));

	ret = gpio_request(EXYNOS5_GPF0(1), "GPF0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPF0_1 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPF0(1), (0x2<<4));
	s3c_gpio_setpull(EXYNOS5_GPF0(1), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPF0(1));

	ret = gpio_request(EXYNOS5_GPF0(2), "GPF0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPF0_2 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPF0(2), (0x2<<8));
	s3c_gpio_setpull(EXYNOS5_GPF0(2), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPF0(2));

	ret = gpio_request(EXYNOS5_GPF0(0), "GPF0");
	if (ret)
		printk(KERN_ERR "#### failed to request GPF0_3 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPF0(3), (0x2<<12));
	s3c_gpio_setpull(EXYNOS5_GPF0(3), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPF0(3));

	ret = gpio_request(EXYNOS5_GPF1(0), "GPF1");
	if (ret)
		printk(KERN_ERR "#### failed to request GPF1_0 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPF1(0), (0x3<<0));
	s3c_gpio_setpull(EXYNOS5_GPF1(0), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPF1(0));

	ret = gpio_request(EXYNOS5_GPF1(1), "GPF1");
	if (ret)
		printk(KERN_ERR "#### failed to request GPF1_0 ####\n");
	s3c_gpio_cfgpin(EXYNOS5_GPF1(1), (0x3<<4));
	s3c_gpio_setpull(EXYNOS5_GPF1(1), S3C_GPIO_PULL_NONE);
	gpio_free(EXYNOS5_GPF1(1));

	/* CAM A port(b0010) : PCLK, VSYNC, HREF, CLK_OUT */
	s3c_gpio_cfgrange_nopull(EXYNOS5_GPH0(3), 1, S3C_GPIO_SFN(2));

	/* Camera A */
	ret = gpio_request(EXYNOS5_GPX1(2), "GPX1");
	if (ret)
		printk(KERN_ERR "#### failed to request GPX1_2 ####\n");

	s3c_gpio_setpull(EXYNOS5_GPX1(2), S3C_GPIO_PULL_NONE);
	gpio_direction_output(EXYNOS5_GPX1(2), 0);
	gpio_direction_output(EXYNOS5_GPX1(2), 1);
	gpio_free(EXYNOS5_GPX1(2));
}
Exemple #3
0
	{EXYNOS5_GPE0(1),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_NONE},	/* CHG_SDA_1.8V */
	{EXYNOS5_GPE0(2),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_NONE},	/* CHG_SCL_1.8V */
	{EXYNOS5_GPE0(3),  S3C_GPIO_SLP_OUT0,
		S3C_GPIO_PULL_NONE},	/* PDA_ACTIVE */
	{EXYNOS5_GPE0(4),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_DOWN},	/* ACCESSORY_CHECK */
	{EXYNOS5_GPE0(5),  S3C_GPIO_SLP_PREV,
		S3C_GPIO_PULL_NONE},	/* UART_SEL */
	{EXYNOS5_GPE0(6),  S3C_GPIO_SLP_PREV,
		S3C_GPIO_PULL_NONE},	/* GPS_nRST */
	{EXYNOS5_GPE0(7),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_DOWN},	/* ISP_TXD */

	{EXYNOS5_GPE1(0),  S3C_GPIO_SLP_PREV,
		S3C_GPIO_PULL_NONE},	/* GPS_EN */
	{EXYNOS5_GPE1(1),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_DOWN},	/* ISP_RXD */

	{EXYNOS5_GPF0(0),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_NONE},	/* 5M_CAM_SDA_1.8V */
	{EXYNOS5_GPF0(1),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_NONE},	/* 5M_CAM_SCL_1.8V */
	{EXYNOS5_GPF0(2),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_NONE},	/* VT_CAM_SDA_1.8V */
	{EXYNOS5_GPF0(3),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_NONE},	/* VT_CAM_SCL_1.8V */

	{EXYNOS5_GPF1(0),  S3C_GPIO_SLP_INPUT,
		S3C_GPIO_PULL_DOWN},	/* NC */
	.mipi_align = 24,
	.sensor_power = {
		.cam_core = "5m_core_1.5v",
		.cam_io_myself = "cam_io_1.8v",
		.cam_io_peer = "vt_cam_1.8v",
		.cam_af = "cam_af_2.8v",
	},
	.sensor_gpio = {
		.cfg[0] = { /* ISP_TXD */
			.pin = EXYNOS5_GPE0(7),
			.name = "GPE0",
			.value = (3<<28),
			.act = GPIO_PULL_NONE,
		},
		.cfg[1] = { /* ISP_RXD */
			.pin = EXYNOS5_GPE1(1),
			.name = "GPE1",
			.value = (3<<4),
			.act = GPIO_PULL_NONE,
		},
		.cfg[2] = { /* 5M_CAM_SDA_18V */
			.pin = EXYNOS5_GPF0(0),
			.name = "GPF0",
			.value = (2<<0),
			.act = GPIO_PULL_NONE,
		},
		.cfg[3] = { /* 5M_CAM_SCL_18V */
			.pin = EXYNOS5_GPF0(1),
			.name = "GPF0",
			.value = (2<<4),
			.act = GPIO_PULL_NONE,