summaryrefslogtreecommitdiffstats
path: root/drivers/video/stm.c
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@free-electrons.com>2011-01-21 12:37:51 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-21 15:22:45 +0100
commit286117d9379acc694367e9ca37c759ee06997237 (patch)
treedd1a8a261932b983bfaac556c4ac7e46a7f69de3 /drivers/video/stm.c
parentbd56e41d1912dcedd36549ee032b2dd7631fa6af (diff)
downloadbarebox-286117d9379acc694367e9ca37c759ee06997237.tar.gz
barebox-286117d9379acc694367e9ca37c759ee06997237.tar.xz
fb i.MX23/28: Add the reset control of LCD
Video controller of STM allow to control the reset bit of an external LCD controller. When reset_lcd is set, CTRL1_RESET bit is used to enable and disable LCD. Handle USE_LCD_RESET as a flag in imx_fb_platformdata. Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/video/stm.c')
-rw-r--r--drivers/video/stm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/video/stm.c b/drivers/video/stm.c
index 205cad15bf..ee2f0268bd 100644
--- a/drivers/video/stm.c
+++ b/drivers/video/stm.c
@@ -48,6 +48,7 @@
# define CTRL1_FIFO_CLEAR (1 << 21)
# define SET_BYTE_PACKAGING(x) (((x) & 0xf) << 16)
# define GET_BYTE_PACKAGING(x) (((x) >> 16) & 0xf)
+# define CTRL1_RESET (1 << 0)
#ifdef CONFIG_ARCH_IMX28
# define HW_LCDIF_CTRL2 0x20
@@ -253,6 +254,11 @@ static void stmfb_enable_controller(struct fb_info *fb_info)
/* stop FIFO reset */
writel(CTRL1_FIFO_CLEAR, fbi->base + HW_LCDIF_CTRL1 + BIT_CLR);
+
+ /* enable LCD using LCD_RESET signal*/
+ if (fbi->pdata->flags & USE_LCD_RESET)
+ writel(CTRL1_RESET, fbi->base + HW_LCDIF_CTRL1 + BIT_SET);
+
/* start the engine right now */
writel(CTRL_RUN, fbi->base + HW_LCDIF_CTRL + BIT_SET);
@@ -266,6 +272,11 @@ static void stmfb_disable_controller(struct fb_info *fb_info)
unsigned loop;
uint32_t reg;
+
+ /* disable LCD using LCD_RESET signal*/
+ if (fbi->pdata->flags & USE_LCD_RESET)
+ writel(CTRL1_RESET, fbi->base + HW_LCDIF_CTRL1 + BIT_CLR);
+
if (fbi->pdata->enable)
fbi->pdata->enable(0);