diff options
Diffstat (limited to 'arch/arm/mach-exynos/midas-lcd.c')
-rw-r--r-- | arch/arm/mach-exynos/midas-lcd.c | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/midas-lcd.c b/arch/arm/mach-exynos/midas-lcd.c index f28c196..abbc51e 100644 --- a/arch/arm/mach-exynos/midas-lcd.c +++ b/arch/arm/mach-exynos/midas-lcd.c @@ -44,11 +44,16 @@ #include <linux/mdnie.h> #endif +#ifdef CONFIG_BACKLIGHT_LP855X +#include <linux/platform_data/lp855x.h> +#endif + struct s3c_platform_fb fb_platform_data; unsigned int lcdtype; static int __init lcdtype_setup(char *str) { get_option(&str, &lcdtype); + return 1; } __setup("lcdtype=", lcdtype_setup); @@ -798,6 +803,49 @@ static struct s3cfb_lcd lms501xx = { }, }; #endif + +#ifdef CONFIG_FB_S5P_NT71391 +/* for Geminus based on MIPI-DSI interface */ +static struct s3cfb_lcd nt71391 = { + .name = "nt71391", + .width = 1280, + .height = 800, + .p_width = 172, + .p_height = 108, + .bpp = 24, + .freq = 60, + + /* minumun value is 0 except for wr_act time. */ + .cpu_timing = { + .cs_setup = 0, + .wr_setup = 0, + .wr_act = 1, + .wr_hold = 0, + }, + + .timing = { + .h_fp = 25, + .h_bp = 25, + .h_sw = 41, + .v_fp = 8, /* spec = 3 */ + .v_fpe = 1, + .v_bp = 3, + .v_bpe = 1, + .v_sw = 6, + /* v_fp=stable_vfp + cmd_allow_len + mask_len*/ + .cmd_allow_len = 7, + .stable_vfp = 1, + }, + + .polarity = { + .rise_vclk = 1, + .inv_hsync = 0, + .inv_vsync = 0, + .inv_vden = 0, + }, +}; +#endif + static int reset_lcd(void) { #if defined(GPIO_MLCD_RST) @@ -896,6 +944,69 @@ out: return 0; } +#elif defined(CONFIG_FB_S5P_NT71391) +static int lcd_power_on(void *ld, int enable) +{ + int err; + + printk(KERN_INFO "NT71391 %s : enable=%d\n", __func__, enable); + + err = gpio_request(GPIO_LCD_EN, "LCD_EN"); + if (err) { + printk(KERN_ERR "failed to request LCD_EN control\n"); + return -EPERM; + } + + if (enable) + gpio_set_value(GPIO_LCD_EN, GPIO_LEVEL_HIGH); + else + gpio_set_value(GPIO_LCD_EN, GPIO_LEVEL_LOW); + + gpio_free(GPIO_LCD_EN); + + return 0; +} + +#ifdef CONFIG_BACKLIGHT_LP855X +#define EPROM_CFG5_ADDR 0xA5 +#define EPROM_A5_VAL 0xA0 /* PWM_DIRECT(7)=1, PS_MODE(6:4)=4drivers*/ +#define EPROM_A5_MASK 0x0F /* PWM_FREQ(3:0) : mask */ + +static struct lp855x_rom_data lp8556_eprom_arr[] = { + {EPROM_CFG5_ADDR, EPROM_A5_VAL, EPROM_A5_MASK}, +}; + +static struct lp855x_platform_data lp8856_bl_pdata = { + .mode = PWM_BASED, + .device_control = PWM_CONFIG(LP8556), + .load_new_rom_data = 1, + .size_program = ARRAY_SIZE(lp8556_eprom_arr), + .rom_data = lp8556_eprom_arr, + .use_gpio_en = 1, + .gpio_en = GPIO_LED_BACKLIGHT_RESET, + .power_on_udelay = 1000, +}; + +static struct i2c_board_info i2c_devs24_emul[] __initdata = { + { + I2C_BOARD_INFO("lp8556", (0x58 >> 1)), + .platform_data = &lp8856_bl_pdata, + }, +}; +static int lcd_bl_init(void) +{ + i2c_register_board_info(24, i2c_devs24_emul, + ARRAY_SIZE(i2c_devs24_emul)); + + return 0; +} +#endif + +#ifdef CONFIG_FB_S5P_MDNIE +static struct lcd_platform_data nt71391_platform_data = { +}; +#endif + #else static int lcd_power_on(void *ld, int enable) { @@ -1068,6 +1179,10 @@ void __init mipi_fb_init(void) #if defined(CONFIG_FB_S5P_S6D6AA1) dsim_lcd_info->lcd_panel_info = (void *)&s6d6aa1; #endif + +#if defined(CONFIG_FB_S5P_NT71391) + dsim_lcd_info->lcd_panel_info = (void *)&nt71391; +#endif #if defined(CONFIG_MACH_T0) && defined(CONFIG_FB_S5P_S6EVR02) && defined(GPIO_OLED_ID) if (!gpio_get_value(GPIO_OLED_ID)) { /* for EA8061 DDI */ @@ -1090,6 +1205,11 @@ void __init mipi_fb_init(void) dsim_pd->dsim_info->p = 3; dsim_pd->dsim_info->m = 110; dsim_pd->dsim_info->s = 1; +#elif defined(CONFIG_FB_S5P_NT71391) + /* 230Mbps */ + dsim_pd->dsim_info->p = 3; + dsim_pd->dsim_info->m = 115; + dsim_pd->dsim_info->s = 1; #else /* 500Mbps */ dsim_pd->dsim_info->p = 3; @@ -1105,6 +1225,11 @@ void __init mipi_fb_init(void) platform_device_register(&s5p_device_dsim); /*s3cfb_set_platdata(&fb_platform_data);*/ + +#if defined(CONFIG_FB_S5P_NT71391) + lcd_bl_init(); +#endif + } #endif @@ -1145,6 +1270,9 @@ struct s3c_platform_fb fb_platform_data __initdata = { #if defined(CONFIG_FB_S5P_LMS501XX) .lcd = &lms501xx #endif +#if defined(CONFIG_FB_S5P_NT71391) + .lcd = &nt71391 +#endif }; #endif @@ -1154,6 +1282,9 @@ static struct platform_mdnie_data mdnie_data = { #if defined(CONFIG_FB_S5P_S6C1372) .lcd_pd = &s6c1372_platform_data, #endif +#if defined(CONFIG_FB_S5P_NT71391) + .lcd_pd = &nt71391_platform_data, +#endif }; #endif |