/*------------------------------------------------------*/ 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)); }
/* this is sample code for p10 board */ static struct gpio_init_data p10_init_gpios[] = { /* BT_UART_RXD */ {EXYNOS5_GPA0(0), S3C_GPIO_SFN(2), 2, S3C_GPIO_PULL_UP}, /* BT_UART_TXD */ {EXYNOS5_GPA0(1), S3C_GPIO_SFN(2), 2, S3C_GPIO_PULL_NONE}, /* BT_UART_CTS */ {EXYNOS5_GPA0(2), S3C_GPIO_SFN(2), 2, S3C_GPIO_PULL_NONE}, /* BT_UART_RTS */ {EXYNOS5_GPA0(3), S3C_GPIO_SFN(2), 2, S3C_GPIO_PULL_NONE}, /* UART switch: configure as output */ {EXYNOS5_GPE0(5), S3C_GPIO_OUTPUT, 2, S3C_GPIO_PULL_NONE}, /* USB switch: configure as output */ {EXYNOS5_GPH0(1), S3C_GPIO_OUTPUT, 2, S3C_GPIO_PULL_NONE}, {EXYNOS5_GPB2(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* CODEC_SDA_1.8V */ {EXYNOS5_GPB2(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* CODEC_SCL_1.8V */ {EXYNOS5_GPX0(1), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* DET_3.5 */ {EXYNOS5_GPX0(2), S3C_GPIO_SFN(0xF), S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* AP_PMIC_IRQ */ {EXYNOS5_GPX2(0), S3C_GPIO_SFN(2), S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* VOL_UP */ {EXYNOS5_GPX2(1), S3C_GPIO_SFN(2), S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* VOL_DOWN */
.act = GPIO_PULL_NONE, }, .cfg[4] = { /* CAM_FLASH_EN */ .pin = EXYNOS5_GPE0(1), .name = "GPE0", .value = (2<<4), .act = GPIO_PULL_NONE, }, .cfg[5] = { /* CAM_FLASH_SET */ .pin = EXYNOS5_GPE0(2), .name = "GPE0", .value = (2<<8), .act = GPIO_PULL_NONE, }, .cfg[6] = { /* CAM_MCLK */ .pin = EXYNOS5_GPH0(3), .name = "GPH0", .value = (2<<12), .act = GPIO_PULL_NONE, }, .power = { /* CAM_IO_EN - VDDA_2.8V*/ .pin = EXYNOS5_GPV0(3), .name = "GPV0", .value = 1, .act = GPIO_OUTPUT, }, .reset_myself = { /* 5M_CAM_RESET */ .pin = EXYNOS5_GPE0(0), .name = "GPE0", .value = 0, .act = GPIO_RESET,