diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-27 08:57:00 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-02-07 22:08:16 +0100 |
commit | f5660396eb902d1c1a2a928c1cfbbd261dd55475 (patch) | |
tree | ddc4ab006940e8746740cd8e8048c97f7a982a64 | |
parent | dd18f45e0f992acea57e081c29856ce38aab16b9 (diff) | |
download | barebox-f5660396eb902d1c1a2a928c1cfbbd261dd55475.tar.gz barebox-f5660396eb902d1c1a2a928c1cfbbd261dd55475.tar.xz |
ARM tx28: Add hook for enabling the display
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/boards/karo-tx28/tx28-stk5.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c index e8338a3aa9..d5a7831cd0 100644 --- a/arch/arm/boards/karo-tx28/tx28-stk5.c +++ b/arch/arm/boards/karo-tx28/tx28-stk5.c @@ -186,20 +186,39 @@ static struct fb_videomode tx28evk_vmodes[] = { #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 @@ void base_board_init(void) 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); |