void s3c64xx_fb_gpio_setup_24bpp(void) { s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2)); s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2)); }
} static struct s3c_gpio_chip gpio_2bit[] = { { .base = S3C64XX_GPF_BASE, .config = &gpio_2bit_cfg_eint11, .chip = { .base = S3C64XX_GPF(0), .ngpio = S3C64XX_GPIO_F_NR, .label = "GPF", }, }, { .base = S3C64XX_GPI_BASE, .config = &gpio_2bit_cfg_noint, .chip = { .base = S3C64XX_GPI(0), .ngpio = S3C64XX_GPIO_I_NR, .label = "GPI", }, }, { .base = S3C64XX_GPJ_BASE, .config = &gpio_2bit_cfg_noint, .chip = { .base = S3C64XX_GPJ(0), .ngpio = S3C64XX_GPIO_J_NR, .label = "GPJ", }, }, { .base = S3C64XX_GPN_BASE, .config = &gpio_2bit_cfg_eint10, .chip = {
int s3cfb_set_gpio(void) { unsigned long val; int i, err; #if 0 /* See mach-smdk6410.c:smdk6410_map_io() - S3C64XX_MODEM_MIFPCON */ /* Must be '0' for Normal-path instead of By-pass */ writel(0x0, S3C_HOSTIFB_MIFPCON); #endif /* enable clock to LCD */ val = readl(S3C_HCLK_GATE); val |= S3C_CLKCON_HCLK_LCD; writel(val, S3C_HCLK_GATE); /* select TFT LCD type (RGB I/F) */ val = readl(S3C64XX_SPCON); val &= ~0x3; val |= (1 << 0); writel(val, S3C64XX_SPCON); /* VD */ for (i = 0; i < 16; i++) s3c_gpio_cfgpin(S3C64XX_GPI(i), S3C_GPIO_SFN(2)); for (i = 0; i < 12; i++) s3c_gpio_cfgpin(S3C64XX_GPJ(i), S3C_GPIO_SFN(2)); /* backlight ON */ //printk("oPEN LCD BACKLIGHT1.\n"); if (gpio_is_valid(S3C64XX_GPF(14))) { //NOTE: orign GPF15 here err = gpio_request(S3C64XX_GPF(14), "GPF"); if (err) { printk(KERN_ERR "failed to request GPF for " "lcd backlight control\n"); return err; } gpio_direction_output(S3C64XX_GPF(14), 1); gpio_set_value(S3C64XX_GPF(14), 1); } //printk("oPEN LCD BACKLIGHT2.\n"); if (gpio_is_valid(S3C64XX_GPE(0))) { err = gpio_request(S3C64XX_GPE(0), "GPE"); if (err) { printk(KERN_ERR "failed to request GPE for " "lcd reset control\n"); return err; } gpio_direction_output(S3C64XX_GPE(0), 1); } gpio_set_value(S3C64XX_GPE(0), 1); gpio_free(S3C64XX_GPE(0)); /* module reset */ /*if (gpio_is_valid(S3C64XX_GPN(5))) { err = gpio_request(S3C64XX_GPN(5), "GPN"); if (err) { printk(KERN_ERR "failed to request GPN for " "lcd reset control\n"); return err; } gpio_direction_output(S3C64XX_GPN(5), 1); } mdelay(100); gpio_set_value(S3C64XX_GPN(5), 0); mdelay(10); gpio_set_value(S3C64XX_GPN(5), 1); mdelay(10); */ #ifndef CONFIG_BACKLIGHT_PWM gpio_free(S3C64XX_GPF(14)); #endif //gpio_free(S3C64XX_GPN(5)); return 0; }