diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c index e8338a3..d5a7831 100644 --- a/arch/arm/boards/karo-tx28/tx28-stk5.c +++ b/arch/arm/boards/karo-tx28/tx28-stk5.c @@ -186,20 +186,39 @@ #define MAX_FB_SIZE SZ_2M -static struct imx_fb_videomode imxfb_mode = { +#define GPIO_LCD_RESET 126 /* 1 -> Reset */ +#define GPIO_BACKLIGHT 112 /* 0 -> backlight active */ +#define GPIO_LCD_ENABLE 63 /* 1 -> LCD enabled */ + +static void tx28_fb_enable(int enable) +{ + gpio_direction_output(GPIO_LCD_RESET, enable); + gpio_direction_output(GPIO_LCD_ENABLE, enable); + + /* Give the display a chance to sync before we enable + * the backlight to avoid flickering + */ + if (enable) + mdelay(100); + + gpio_direction_output(GPIO_BACKLIGHT, !enable); +} + +static struct imx_fb_platformdata tx28_fb_pdata = { .mode_list = tx28evk_vmodes, .mode_cnt = ARRAY_SIZE(tx28evk_vmodes), .dotclk_delay = 0, /* no adaption required */ .ld_intf_width = STMLCDIF_24BIT, /* full 24 bit */ .fixed_screen = (void *)(0x40000000 + SZ_128M - MAX_FB_SIZE), .fixed_screen_size = MAX_FB_SIZE, + .enable = tx28_fb_enable, }; static struct device_d ldcif_dev = { .name = "stmfb", .map_base = IMX_FB_BASE, .size = 4096, - .platform_data = &imxfb_mode, + .platform_data = &tx28_fb_pdata, }; static const uint32_t tx28_starterkit_pad_setup[] = { @@ -360,9 +379,9 @@ register_device(&mci_socket); - if (imxfb_mode.fixed_screen < (void *)&_end) { + if (tx28_fb_pdata.fixed_screen < (void *)&_end) { printf("Warning: fixed_screen overlaps barebox\n"); - imxfb_mode.fixed_screen = NULL; + tx28_fb_pdata.fixed_screen = NULL; } register_device(&ldcif_dev);