aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-da850-evm.c
diff options
context:
space:
mode:
authorSudhakar Rajashekhara <sudhakar.raj@ti.com>2009-08-13 14:33:14 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-08-26 04:55:54 -0400
commit5cbdf276bd9d9cd3cb9616f8253390096c1a237f (patch)
treed351c6e24902e1b6600b1559fedb40c7a0edddbb /arch/arm/mach-davinci/board-da850-evm.c
parentb1466376b22e1ec6395ccda7580deb72d3a809ad (diff)
davinci: Add platform support for da850/omap-l138 GLCD
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> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-da850-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 52bfe4cba25c..b1df784ed702 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -17,6 +17,7 @@
17#include <linux/console.h> 17#include <linux/console.h>
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/i2c/at24.h> 19#include <linux/i2c/at24.h>
20#include <linux/gpio.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
@@ -29,6 +30,9 @@
29#define DA850_EVM_PHY_MASK 0x1 30#define DA850_EVM_PHY_MASK 0x1
30#define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ 31#define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
31 32
33#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
34#define DA850_LCD_PWR_PIN GPIO_TO_PIN(8, 10)
35
32static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { 36static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
33 .bus_freq = 100, /* kHz */ 37 .bus_freq = 100, /* kHz */
34 .bus_delay = 0, /* usec */ 38 .bus_delay = 0, /* usec */
@@ -59,6 +63,37 @@ static struct snd_platform_data da850_evm_snd_data = {
59 .rxnumevt = 1, 63 .rxnumevt = 1,
60}; 64};
61 65
66static int da850_lcd_hw_init(void)
67{
68 int status;
69
70 status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
71 if (status < 0)
72 return status;
73
74 status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
75 if (status < 0) {
76 gpio_free(DA850_LCD_BL_PIN);
77 return status;
78 }
79
80 gpio_direction_output(DA850_LCD_BL_PIN, 0);
81 gpio_direction_output(DA850_LCD_PWR_PIN, 0);
82
83 /* disable lcd backlight */
84 gpio_set_value(DA850_LCD_BL_PIN, 0);
85
86 /* disable lcd power */
87 gpio_set_value(DA850_LCD_PWR_PIN, 0);
88
89 /* enable lcd power */
90 gpio_set_value(DA850_LCD_PWR_PIN, 1);
91
92 /* enable lcd backlight */
93 gpio_set_value(DA850_LCD_BL_PIN, 1);
94
95 return 0;
96}
62 97
63static __init void da850_evm_init(void) 98static __init void da850_evm_init(void)
64{ 99{
@@ -115,6 +150,21 @@ static __init void da850_evm_init(void)
115 ret); 150 ret);
116 151
117 da8xx_init_mcasp(0, &da850_evm_snd_data); 152 da8xx_init_mcasp(0, &da850_evm_snd_data);
153
154 ret = da8xx_pinmux_setup(da850_lcdcntl_pins);
155 if (ret)
156 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
157 ret);
158
159 ret = da850_lcd_hw_init();
160 if (ret)
161 pr_warning("da850_evm_init: lcd initialization failed: %d\n",
162 ret);
163
164 ret = da8xx_register_lcdc();
165 if (ret)
166 pr_warning("da850_evm_init: lcdc registration failed: %d\n",
167 ret);
118} 168}
119 169
120#ifdef CONFIG_SERIAL_8250_CONSOLE 170#ifdef CONFIG_SERIAL_8250_CONSOLE