aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Deak <imre.deak@solidboot.com>2007-03-06 11:20:00 -0500
committerTony Lindgren <tony@atomide.com>2007-09-20 21:42:48 -0400
commit06767fb2ba5af5542e2ec91e00e292ff93ab58ce (patch)
treeb33bdbb0e5d65c2ffee42d01bf4be45e0c3a730d
parent4dcc6d242ea576aaead9b5fe4b79cf941294855b (diff)
ARM: OMAP: N770: add missing LCD, LCD controller, touchscreen device registration
These were left out from the board file when merging these drivers, add them here. Call GPIO init from the board file as well, since the platform device init code uses the GPIO API. Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Removed hwa742 init for now as it needs some clock updates. Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 8ea0cef8bdb1..22db19a53647 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -33,9 +33,13 @@
33#include <asm/arch/dsp_common.h> 33#include <asm/arch/dsp_common.h>
34#include <asm/arch/aic23.h> 34#include <asm/arch/aic23.h>
35#include <asm/arch/gpio.h> 35#include <asm/arch/gpio.h>
36#include <asm/arch/omapfb.h>
37#include <asm/arch/lcd_mipid.h>
36 38
37#include "../plat-omap/dsp/dsp_common.h" 39#include "../plat-omap/dsp/dsp_common.h"
38 40
41#define ADS7846_PENDOWN_GPIO 15
42
39static void __init omap_nokia770_init_irq(void) 43static void __init omap_nokia770_init_irq(void)
40{ 44{
41 /* On Nokia 770, the SleepX signal is masked with an 45 /* On Nokia 770, the SleepX signal is masked with an
@@ -96,6 +100,41 @@ static struct platform_device *nokia770_devices[] __initdata = {
96 &nokia770_kp_device, 100 &nokia770_kp_device,
97}; 101};
98 102
103static void mipid_shutdown(struct mipid_platform_data *pdata)
104{
105 if (pdata->nreset_gpio != -1) {
106 printk(KERN_INFO "shutdown LCD\n");
107 omap_set_gpio_dataout(pdata->nreset_gpio, 0);
108 msleep(120);
109 }
110}
111
112static struct mipid_platform_data nokia770_mipid_platform_data = {
113 .shutdown = mipid_shutdown,
114};
115
116static void mipid_dev_init(void)
117{
118 const struct omap_lcd_config *conf;
119
120 conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
121 if (conf != NULL) {
122 nokia770_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
123 nokia770_mipid_platform_data.data_lines = conf->data_lines;
124 }
125}
126
127static void ads7846_dev_init(void)
128{
129 if (omap_request_gpio(ADS7846_PENDOWN_GPIO) < 0)
130 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
131}
132
133static int ads7846_get_pendown_state(void)
134{
135 return !omap_get_gpio_datain(ADS7846_PENDOWN_GPIO);
136}
137
99static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { 138static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
100 .x_max = 0x0fff, 139 .x_max = 0x0fff,
101 .y_max = 0x0fff, 140 .y_max = 0x0fff,
@@ -103,6 +142,8 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata =
103 .pressure_max = 255, 142 .pressure_max = 255,
104 .debounce_max = 10, 143 .debounce_max = 10,
105 .debounce_tol = 3, 144 .debounce_tol = 3,
145 .debounce_rep = 1,
146 .get_pendown_state = ads7846_get_pendown_state,
106}; 147};
107 148
108static struct spi_board_info nokia770_spi_board_info[] __initdata = { 149static struct spi_board_info nokia770_spi_board_info[] __initdata = {
@@ -111,6 +152,7 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
111 .bus_num = 2, 152 .bus_num = 2,
112 .chip_select = 3, 153 .chip_select = 3,
113 .max_speed_hz = 12000000, 154 .max_speed_hz = 12000000,
155 .platform_data = &nokia770_mipid_platform_data,
114 }, 156 },
115 [1] = { 157 [1] = {
116 .modalias = "ads7846", 158 .modalias = "ads7846",
@@ -287,8 +329,11 @@ static void __init omap_nokia770_init(void)
287 ARRAY_SIZE(nokia770_spi_board_info)); 329 ARRAY_SIZE(nokia770_spi_board_info));
288 omap_board_config = nokia770_config; 330 omap_board_config = nokia770_config;
289 omap_board_config_size = ARRAY_SIZE(nokia770_config); 331 omap_board_config_size = ARRAY_SIZE(nokia770_config);
332 omap_gpio_init();
290 omap_serial_init(); 333 omap_serial_init();
291 omap_dsp_init(); 334 omap_dsp_init();
335 ads7846_dev_init();
336 mipid_dev_init();
292} 337}
293 338
294static void __init omap_nokia770_map_io(void) 339static void __init omap_nokia770_map_io(void)