diff mbox

davinci: Add platform support for da850/omap-l138 GLCD

Message ID 1250027882-29269-1-git-send-email-sudhakar.raj@ti.com (mailing list archive)
State Superseded
Headers show

Commit Message

Rajashekhara, Sudhakar Aug. 11, 2009, 9:58 p.m. UTC
This patch adds platform support for the graphic display
(Sharp LK043T1DG01) found on DA850/OMAP-L138 based EVM.

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
---
 arch/arm/mach-davinci/board-da850-evm.c    |   71 ++++++++++++++++++++++++++++
 arch/arm/mach-davinci/da850.c              |   42 ++++++++++++++++
 arch/arm/mach-davinci/devices-da8xx.c      |   59 +++++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/da8xx.h |    3 +
 arch/arm/mach-davinci/include/mach/mux.h   |   26 ++++++++++
 5 files changed, 201 insertions(+), 0 deletions(-)

Comments

Sekhar Nori Aug. 11, 2009, 1:38 p.m. UTC | #1
Sudhakar,

On Wed, Aug 12, 2009 at 03:28:02, Rajashekhara, Sudhakar wrote:
> This patch adds platform support for the graphic display
> (Sharp LK043T1DG01) found on DA850/OMAP-L138 based EVM.
>
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> ---
>  arch/arm/mach-davinci/board-da850-evm.c    |   71 ++++++++++++++++++++++++++++
>  arch/arm/mach-davinci/da850.c              |   42 ++++++++++++++++
>  arch/arm/mach-davinci/devices-da8xx.c      |   59 +++++++++++++++++++++++
>  arch/arm/mach-davinci/include/mach/da8xx.h |    3 +
>  arch/arm/mach-davinci/include/mach/mux.h   |   26 ++++++++++
>  5 files changed, 201 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index d989346..45575e5 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
> @@ -17,6 +17,8 @@
>  #include <linux/console.h>
>  #include <linux/i2c.h>
>  #include <linux/i2c/at24.h>
> +#include <linux/gpio.h>
> +#include <linux/delay.h>
>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -25,6 +27,7 @@
>  #include <mach/irqs.h>
>  #include <mach/cp_intc.h>
>  #include <mach/da8xx.h>
> +#include <mach/psc.h>
>
>  #define DA850_EVM_PHY_MASK           0x1
>  #define DA850_EVM_MDIO_FREQUENCY     2200000 /* PHY bus frequency */
> @@ -38,6 +41,59 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = {
>       .enabled_uarts = 0x7,
>  };
>
> +int da850_lcd_hw_init(void)

This should be static?

> +{
> +     /* GPIO 2[15] is used for LCD back light - 16 * 2 + 15 = 47 */
> +     int bl_gpio_num = 47;
> +
> +     /* GPIO 8[10] is used for LCD power - 16 * 8 + 10 = 138 */
> +     int pwr_gpio_num = 138;

These could probably be #defines instead of
variables.

> +     int status;
> +
> +     status = gpio_request(bl_gpio_num, "lcd bl\n");
> +     if (status < 0)
> +             return status;
> +
> +     status = gpio_request(pwr_gpio_num, "lcd pwr\n");
> +     if (status < 0)
> +             return status;

We are missing gpio_free of back light GPIO
here.

> +
> +     gpio_direction_output(bl_gpio_num, 0);
> +     gpio_direction_output(pwr_gpio_num, 0);
> +
> +     /* disable lcd backlight */
> +     gpio_set_value(bl_gpio_num, 0);
> +
> +     /* disable lcd power */
> +     gpio_set_value(pwr_gpio_num, 0);
> +
> +     /* wait for sometime */
> +     mdelay(3);

Can you explain the reasoning behind
the delay in the comment?

> +
> +     /* disable lcdc */
> +     davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, 1, DA8XX_LPSC1_LCDC, 0);

Hmm, why is this needed? Hopefully the LCD clock has
not been enabled by this time.

> +
> +     /* wait for sometime */
> +     mdelay(1);

Some explanation required here too.

> +
> +     /* enable lcd power */
> +     gpio_set_value(pwr_gpio_num, 1);
> +
> +     /* enable lcdc */
> +     davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, 1, DA8XX_LPSC1_LCDC, 1);
> +
> +     /* wait for sometime */
> +     mdelay(3);
> +
> +     /* enable lcd backlight */
> +     gpio_set_value(bl_gpio_num, 1);
> +
> +     gpio_free(bl_gpio_num);
> +     gpio_free(pwr_gpio_num);
> +
> +     return 0;
> +}
> +
>  static __init void da850_evm_init(void)
>  {
>       struct davinci_soc_info *soc_info = &davinci_soc_info;
> @@ -86,6 +142,21 @@ static __init void da850_evm_init(void)
>        */
>       __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
>       __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
> +
> +     ret = da8xx_pinmux_setup(da850_lcdcntl_pins);
> +     if (ret)
> +             pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
> +                             ret);
> +
> +     ret = da850_lcd_hw_init();
> +     if (ret)
> +             pr_warning("da850_evm_init: lcd initialization failed: %d\n",
> +                             ret);
> +
> +     ret = da8xx_register_lcdc();
> +     if (ret)
> +             pr_warning("da850_evm_init: lcdc registration failed: %d\n",
> +                             ret);
>  }
>
>  #ifdef CONFIG_SERIAL_8250_CONSOLE
> diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
> index c5efc51..69acb6e 100644
> --- a/arch/arm/mach-davinci/da850.c
> +++ b/arch/arm/mach-davinci/da850.c
> @@ -290,6 +290,13 @@ static struct clk emac_clk = {
>       .psc_ctlr       = 1,
>  };
>
> +static struct clk lcdc_clk = {
> +     .name           = "lcdc",
> +     .parent         = &pll0_sysclk2,
> +     .lpsc           = DA8XX_LPSC1_LCDC,
> +     .psc_ctlr       = 1,
> +};
> +
>  static struct davinci_clk da850_clks[] = {
>       CLK(NULL,               "ref",          &ref_clk),
>       CLK(NULL,               "pll0",         &pll0_clk),
> @@ -327,6 +334,7 @@ static struct davinci_clk da850_clks[] = {
>       CLK(NULL,               "arm",          &arm_clk),
>       CLK(NULL,               "rmii",         &rmii_clk),
>       CLK("davinci_emac.1",   NULL,           &emac_clk),
> +     CLK("da8xx_lcdc.0",     NULL,           &lcdc_clk),
>       CLK(NULL,               NULL,           NULL),
>  };
>
> @@ -373,6 +381,30 @@ static const struct mux_config da850_pins[] = {
>       MUX_CFG(DA850, MII_RXD_0,       3,      28,     15,     8,      false)
>       MUX_CFG(DA850, MDIO_CLK,        4,      0,      15,     8,      false)
>       MUX_CFG(DA850, MDIO_D,          4,      4,      15,     8,      false)
> +     /* LCD function */
> +     MUX_CFG(DA850, LCD_D_7,         16,     8,      15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_6,         16,     12,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_5,         16,     16,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_4,         16,     20,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_3,         16,     24,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_2,         16,     28,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_1,         17,     0,      15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_0,         17,     4,      15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_15,        17,     8,      15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_14,        17,     12,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_13,        17,     16,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_12,        17,     20,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_11,        17,     24,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_10,        17,     28,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_9,         18,     0,      15,     2,      false)
> +     MUX_CFG(DA850, LCD_D_8,         18,     4,      15,     2,      false)
> +     MUX_CFG(DA850, LCD_PCLK,        18,     24,     15,     2,      false)
> +     MUX_CFG(DA850, LCD_HSYNC,       19,     0,      15,     2,      false)
> +     MUX_CFG(DA850, LCD_VSYNC,       19,     4,      15,     2,      false)
> +     MUX_CFG(DA850, NLCD_AC_ENB_CS,  19,     24,     15,     2,      false)
> +     /* GPIO function */
> +     MUX_CFG(DA850, GPIO2_15,        5,      0,      15,     8,      false)
> +     MUX_CFG(DA850, GPIO8_10,        18,     28,     15,     8,      false)
>  #endif
>  };
>
> @@ -410,6 +442,16 @@ const short da850_cpgmac_pins[] __initdata = {
>       -1
>  };
>
> +const short da850_lcdcntl_pins[] __initdata = {
> +     DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3, DA850_LCD_D_4,
> +     DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7, DA850_LCD_D_8,
> +     DA850_LCD_D_9, DA850_LCD_D_10, DA850_LCD_D_11, DA850_LCD_D_12,
> +     DA850_LCD_D_13, DA850_LCD_D_14, DA850_LCD_D_15, DA850_LCD_PCLK,
> +     DA850_LCD_HSYNC, DA850_LCD_VSYNC, DA850_NLCD_AC_ENB_CS, DA850_GPIO2_15,
> +     DA850_GPIO8_10,
> +     -1
> +};
> +
>  /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
>  static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {
>       [IRQ_DA8XX_COMMTX]              = 7,
> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
> index 11c0971..ef7db41 100644
> --- a/arch/arm/mach-davinci/devices-da8xx.c
> +++ b/arch/arm/mach-davinci/devices-da8xx.c
> @@ -21,6 +21,7 @@
>  #include <mach/common.h>
>  #include <mach/time.h>
>  #include <mach/da8xx.h>
> +#include <video/da8xx-fb.h>
>
>  #include "clock.h"
>
> @@ -285,3 +286,61 @@ int __init da8xx_register_emac(void)
>  {
>       return platform_device_register(&da8xx_emac_device);
>  }
> +
> +static const struct display_panel disp_panel = {
> +     QVGA,
> +     16,
> +     16,
> +     COLOR_ACTIVE,
> +};
> +
> +static struct lcd_ctrl_config lcd_cfg = {
> +     &disp_panel,                    /* p_disp_panel   */
> +     .ac_bias                = 255,  /* ac bias        */
> +     .ac_bias_intrpt         = 0,    /* ac bias intrpt */
> +     .dma_burst_sz           = 16,   /* dma_burst_sz   */
> +     .bpp                    = 16,   /* bpp            */
> +     .fdd                    = 255,  /* fdd            */
> +     .tft_alt_mode           = 0,    /* tft_alt_mode   */
> +     .stn_565_mode           = 0,    /* stn_565_mode   */
> +     .mono_8bit_mode         = 0,    /* mono_8bit_mode    */
> +     .invert_line_clock      = 1,    /* invert_line_clock */
> +     .invert_frm_clock       = 1,    /* invert_frm_clock  */
> +     .sync_edge              = 0,    /* sync_edge         */
> +     .sync_ctrl              = 1,    /* sync_ctrl         */
> +     .raster_order           = 0,    /* raster_order      */
> +};

Comments at end of each line are not required.

Thanks,
Sekhar
Rajashekhara, Sudhakar Aug. 12, 2009, 9:50 a.m. UTC | #2
On Tue, Aug 11, 2009 at 19:08:24, Nori, Sekhar wrote:
> Sudhakar,
> 
> On Wed, Aug 12, 2009 at 03:28:02, Rajashekhara, Sudhakar wrote:
> > This patch adds platform support for the graphic display
> > (Sharp LK043T1DG01) found on DA850/OMAP-L138 based EVM.
> >
> > Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> > ---
> >  arch/arm/mach-davinci/board-da850-evm.c    |   71 ++++++++++++++++++++++++++++
> >  arch/arm/mach-davinci/da850.c              |   42 ++++++++++++++++
> >  arch/arm/mach-davinci/devices-da8xx.c      |   59 +++++++++++++++++++++++
> >  arch/arm/mach-davinci/include/mach/da8xx.h |    3 +
> >  arch/arm/mach-davinci/include/mach/mux.h   |   26 ++++++++++
> >  5 files changed, 201 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> > index d989346..45575e5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> > @@ -17,6 +17,8 @@
> >  #include <linux/console.h>
> >  #include <linux/i2c.h>
> >  #include <linux/i2c/at24.h>
> > +#include <linux/gpio.h>
> > +#include <linux/delay.h>
> >
> >  #include <asm/mach-types.h>
> >  #include <asm/mach/arch.h>
> > @@ -25,6 +27,7 @@
> >  #include <mach/irqs.h>
> >  #include <mach/cp_intc.h>
> >  #include <mach/da8xx.h>
> > +#include <mach/psc.h>
> >
> >  #define DA850_EVM_PHY_MASK           0x1
> >  #define DA850_EVM_MDIO_FREQUENCY     2200000 /* PHY bus frequency */
> > @@ -38,6 +41,59 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = {
> >       .enabled_uarts = 0x7,
> >  };
> >
> > +int da850_lcd_hw_init(void)
> 
> This should be static?
> 

Yes, this function can be static.

> > +{
> > +     /* GPIO 2[15] is used for LCD back light - 16 * 2 + 15 = 47 */
> > +     int bl_gpio_num = 47;
> > +
> > +     /* GPIO 8[10] is used for LCD power - 16 * 8 + 10 = 138 */
> > +     int pwr_gpio_num = 138;
> 
> These could probably be #defines instead of
> variables.
> 

I'll define the GPIO pin numbers as macros.

> > +     int status;
> > +
> > +     status = gpio_request(bl_gpio_num, "lcd bl\n");
> > +     if (status < 0)
> > +             return status;
> > +
> > +     status = gpio_request(pwr_gpio_num, "lcd pwr\n");
> > +     if (status < 0)
> > +             return status;
> 
> We are missing gpio_free of back light GPIO
> here.
> 

I'll take care of this.

> > +
> > +     gpio_direction_output(bl_gpio_num, 0);
> > +     gpio_direction_output(pwr_gpio_num, 0);
> > +
> > +     /* disable lcd backlight */
> > +     gpio_set_value(bl_gpio_num, 0);
> > +
> > +     /* disable lcd power */
> > +     gpio_set_value(pwr_gpio_num, 0);
> > +
> > +     /* wait for sometime */
> > +     mdelay(3);
> 
> Can you explain the reasoning behind
> the delay in the comment?
> 

I found out during testing that these delays are not required.
I'll remove them in my next version.

> > +
> > +     /* disable lcdc */
> > +     davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, 1, DA8XX_LPSC1_LCDC, 0);
> 
> Hmm, why is this needed? Hopefully the LCD clock has
> not been enabled by this time.
> 

Same as previous.

> > +
> > +     /* wait for sometime */
> > +     mdelay(1);
> 
> Some explanation required here too.
> 

Same here..

[....]

> > +static struct lcd_ctrl_config lcd_cfg = {
> > +     &disp_panel,                    /* p_disp_panel   */
> > +     .ac_bias                = 255,  /* ac bias        */
> > +     .ac_bias_intrpt         = 0,    /* ac bias intrpt */
> > +     .dma_burst_sz           = 16,   /* dma_burst_sz   */
> > +     .bpp                    = 16,   /* bpp            */
> > +     .fdd                    = 255,  /* fdd            */
> > +     .tft_alt_mode           = 0,    /* tft_alt_mode   */
> > +     .stn_565_mode           = 0,    /* stn_565_mode   */
> > +     .mono_8bit_mode         = 0,    /* mono_8bit_mode    */
> > +     .invert_line_clock      = 1,    /* invert_line_clock */
> > +     .invert_frm_clock       = 1,    /* invert_frm_clock  */
> > +     .sync_edge              = 0,    /* sync_edge         */
> > +     .sync_ctrl              = 1,    /* sync_ctrl         */
> > +     .raster_order           = 0,    /* raster_order      */
> > +};
> 
> Comments at end of each line are not required.
> 

I'll remove these comments.

Thanks for your review. I'll re-submit the patch after addressing
the comments.

Regards, Sudhakar
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index d989346..45575e5 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -17,6 +17,8 @@ 
 #include <linux/console.h>
 #include <linux/i2c.h>
 #include <linux/i2c/at24.h>
+#include <linux/gpio.h>
+#include <linux/delay.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -25,6 +27,7 @@ 
 #include <mach/irqs.h>
 #include <mach/cp_intc.h>
 #include <mach/da8xx.h>
+#include <mach/psc.h>
 
 #define DA850_EVM_PHY_MASK		0x1
 #define DA850_EVM_MDIO_FREQUENCY	2200000 /* PHY bus frequency */
@@ -38,6 +41,59 @@  static struct davinci_uart_config da850_evm_uart_config __initdata = {
 	.enabled_uarts = 0x7,
 };
 
+int da850_lcd_hw_init(void)
+{
+	/* GPIO 2[15] is used for LCD back light - 16 * 2 + 15 = 47 */
+	int bl_gpio_num = 47;
+
+	/* GPIO 8[10] is used for LCD power - 16 * 8 + 10 = 138 */
+	int pwr_gpio_num = 138;
+	int status;
+
+	status = gpio_request(bl_gpio_num, "lcd bl\n");
+	if (status < 0)
+		return status;
+
+	status = gpio_request(pwr_gpio_num, "lcd pwr\n");
+	if (status < 0)
+		return status;
+
+	gpio_direction_output(bl_gpio_num, 0);
+	gpio_direction_output(pwr_gpio_num, 0);
+
+	/* disable lcd backlight */
+	gpio_set_value(bl_gpio_num, 0);
+
+	/* disable lcd power */
+	gpio_set_value(pwr_gpio_num, 0);
+
+	/* wait for sometime */
+	mdelay(3);
+
+	/* disable lcdc */
+	davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, 1, DA8XX_LPSC1_LCDC, 0);
+
+	/* wait for sometime */
+	mdelay(1);
+
+	/* enable lcd power */
+	gpio_set_value(pwr_gpio_num, 1);
+
+	/* enable lcdc */
+	davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, 1, DA8XX_LPSC1_LCDC, 1);
+
+	/* wait for sometime */
+	mdelay(3);
+
+	/* enable lcd backlight */
+	gpio_set_value(bl_gpio_num, 1);
+
+	gpio_free(bl_gpio_num);
+	gpio_free(pwr_gpio_num);
+
+	return 0;
+}
+
 static __init void da850_evm_init(void)
 {
 	struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -86,6 +142,21 @@  static __init void da850_evm_init(void)
 	 */
 	__raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
 	__raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
+
+	ret = da8xx_pinmux_setup(da850_lcdcntl_pins);
+	if (ret)
+		pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
+				ret);
+
+	ret = da850_lcd_hw_init();
+	if (ret)
+		pr_warning("da850_evm_init: lcd initialization failed: %d\n",
+				ret);
+
+	ret = da8xx_register_lcdc();
+	if (ret)
+		pr_warning("da850_evm_init: lcdc registration failed: %d\n",
+				ret);
 }
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index c5efc51..69acb6e 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -290,6 +290,13 @@  static struct clk emac_clk = {
 	.psc_ctlr	= 1,
 };
 
+static struct clk lcdc_clk = {
+	.name		= "lcdc",
+	.parent		= &pll0_sysclk2,
+	.lpsc		= DA8XX_LPSC1_LCDC,
+	.psc_ctlr	= 1,
+};
+
 static struct davinci_clk da850_clks[] = {
 	CLK(NULL,		"ref",		&ref_clk),
 	CLK(NULL,		"pll0",		&pll0_clk),
@@ -327,6 +334,7 @@  static struct davinci_clk da850_clks[] = {
 	CLK(NULL,		"arm",		&arm_clk),
 	CLK(NULL,		"rmii",		&rmii_clk),
 	CLK("davinci_emac.1",	NULL,		&emac_clk),
+	CLK("da8xx_lcdc.0",	NULL,		&lcdc_clk),
 	CLK(NULL,		NULL,		NULL),
 };
 
@@ -373,6 +381,30 @@  static const struct mux_config da850_pins[] = {
 	MUX_CFG(DA850, MII_RXD_0,	3,	28,	15,	8,	false)
 	MUX_CFG(DA850, MDIO_CLK,	4,	0,	15,	8,	false)
 	MUX_CFG(DA850, MDIO_D,		4,	4,	15,	8,	false)
+	/* LCD function */
+	MUX_CFG(DA850, LCD_D_7,		16,	8,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_6,		16,	12,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_5,		16,	16,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_4,		16,	20,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_3,		16,	24,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_2,		16,	28,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_1,		17,	0,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_0,		17,	4,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_15,	17,	8,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_14,	17,	12,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_13,	17,	16,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_12,	17,	20,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_11,	17,	24,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_10,	17,	28,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_9,		18,	0,	15,	2,	false)
+	MUX_CFG(DA850, LCD_D_8,		18,	4,	15,	2,	false)
+	MUX_CFG(DA850, LCD_PCLK,	18,	24,	15,	2,	false)
+	MUX_CFG(DA850, LCD_HSYNC,	19,	0,	15,	2,	false)
+	MUX_CFG(DA850, LCD_VSYNC,	19,	4,	15,	2,	false)
+	MUX_CFG(DA850, NLCD_AC_ENB_CS,	19,	24,	15,	2,	false)
+	/* GPIO function */
+	MUX_CFG(DA850, GPIO2_15,	5,	0,	15,	8,	false)
+	MUX_CFG(DA850, GPIO8_10,	18,	28,	15,	8,	false)
 #endif
 };
 
@@ -410,6 +442,16 @@  const short da850_cpgmac_pins[] __initdata = {
 	-1
 };
 
+const short da850_lcdcntl_pins[] __initdata = {
+	DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3, DA850_LCD_D_4,
+	DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7, DA850_LCD_D_8,
+	DA850_LCD_D_9, DA850_LCD_D_10, DA850_LCD_D_11, DA850_LCD_D_12,
+	DA850_LCD_D_13, DA850_LCD_D_14, DA850_LCD_D_15, DA850_LCD_PCLK,
+	DA850_LCD_HSYNC, DA850_LCD_VSYNC, DA850_NLCD_AC_ENB_CS, DA850_GPIO2_15,
+	DA850_GPIO8_10,
+	-1
+};
+
 /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
 static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {
 	[IRQ_DA8XX_COMMTX]		= 7,
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 11c0971..ef7db41 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -21,6 +21,7 @@ 
 #include <mach/common.h>
 #include <mach/time.h>
 #include <mach/da8xx.h>
+#include <video/da8xx-fb.h>
 
 #include "clock.h"
 
@@ -285,3 +286,61 @@  int __init da8xx_register_emac(void)
 {
 	return platform_device_register(&da8xx_emac_device);
 }
+
+static const struct display_panel disp_panel = {
+	QVGA,
+	16,
+	16,
+	COLOR_ACTIVE,
+};
+
+static struct lcd_ctrl_config lcd_cfg = {
+	&disp_panel,			/* p_disp_panel   */
+	.ac_bias		= 255,	/* ac bias        */
+	.ac_bias_intrpt		= 0,	/* ac bias intrpt */
+	.dma_burst_sz		= 16,	/* dma_burst_sz   */
+	.bpp			= 16,	/* bpp            */
+	.fdd			= 255,	/* fdd            */
+	.tft_alt_mode		= 0,	/* tft_alt_mode   */
+	.stn_565_mode		= 0,	/* stn_565_mode   */
+	.mono_8bit_mode		= 0,	/* mono_8bit_mode    */
+	.invert_line_clock	= 1,	/* invert_line_clock */
+	.invert_frm_clock	= 1,	/* invert_frm_clock  */
+	.sync_edge		= 0,	/* sync_edge         */
+	.sync_ctrl		= 1,	/* sync_ctrl         */
+	.raster_order		= 0,	/* raster_order      */
+};
+
+static struct da8xx_lcdc_platform_data da850_evm_lcdc_pdata = {
+	.manu_name = "sharp",
+	.controller_data = &lcd_cfg,
+	.type = "Sharp_LK043T1DG01",
+};
+
+static struct resource da8xx_lcdc_resources[] = {
+	[0] = { /* registers */
+		.start  = DA8XX_LCD_CNTRL_BASE,
+		.end    = DA8XX_LCD_CNTRL_BASE + SZ_4K - 1,
+		.flags  = IORESOURCE_MEM,
+	},
+	[1] = { /* interrupt */
+		.start  = IRQ_DA8XX_LCDINT,
+		.end    = IRQ_DA8XX_LCDINT,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device da850_lcdc_device = {
+	.name		= "da8xx_lcdc",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(da8xx_lcdc_resources),
+	.resource	= da8xx_lcdc_resources,
+	.dev = {
+		.platform_data = &da850_evm_lcdc_pdata,
+	}
+};
+
+int __init da8xx_register_lcdc(void)
+{
+	return platform_device_register(&da850_lcdc_device);
+}
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index a8cb570..951e091 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -36,6 +36,7 @@ 
 #define DA8XX_TIMER64P1_BASE	0x01c21000
 #define DA8XX_GPIO_BASE		0x01e26000
 #define DA8XX_PSC1_BASE		0x01e27000
+#define DA8XX_LCD_CNTRL_BASE	0x01e13000
 
 #define PINMUX0			0x00
 #define PINMUX1			0x04
@@ -65,6 +66,7 @@  int da8xx_register_edma(void);
 int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
 int da8xx_register_watchdog(void);
 int da8xx_register_emac(void);
+int da8xx_register_lcdc(void);
 
 extern struct platform_device da8xx_serial_device;
 extern struct emac_platform_data da8xx_emac_pdata;
@@ -100,6 +102,7 @@  extern const short da850_uart2_pins[];
 extern const short da850_i2c0_pins[];
 extern const short da850_i2c1_pins[];
 extern const short da850_cpgmac_pins[];
+extern const short da850_lcdcntl_pins[];
 
 int da8xx_pinmux_setup(const short pins[]);
 
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index 8676680..6aab1be 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -750,6 +750,32 @@  enum davinci_da850_index {
 	DA850_MII_RXD_0,
 	DA850_MDIO_CLK,
 	DA850_MDIO_D,
+
+	/* LCD function */
+	DA850_LCD_D_7,
+	DA850_LCD_D_6,
+	DA850_LCD_D_5,
+	DA850_LCD_D_4,
+	DA850_LCD_D_3,
+	DA850_LCD_D_2,
+	DA850_LCD_D_1,
+	DA850_LCD_D_0,
+	DA850_LCD_D_15,
+	DA850_LCD_D_14,
+	DA850_LCD_D_13,
+	DA850_LCD_D_12,
+	DA850_LCD_D_11,
+	DA850_LCD_D_10,
+	DA850_LCD_D_9,
+	DA850_LCD_D_8,
+	DA850_LCD_PCLK,
+	DA850_LCD_HSYNC,
+	DA850_LCD_VSYNC,
+	DA850_NLCD_AC_ENB_CS,
+
+	/* GPIO function */
+	DA850_GPIO2_15,
+	DA850_GPIO8_10,
 };
 
 #ifdef CONFIG_DAVINCI_MUX