diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap1/board-nokia770.c | 45 |
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 | |||
39 | static void __init omap_nokia770_init_irq(void) | 43 | static 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 | ||
103 | static 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 | |||
112 | static struct mipid_platform_data nokia770_mipid_platform_data = { | ||
113 | .shutdown = mipid_shutdown, | ||
114 | }; | ||
115 | |||
116 | static 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 | |||
127 | static 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 | |||
133 | static int ads7846_get_pendown_state(void) | ||
134 | { | ||
135 | return !omap_get_gpio_datain(ADS7846_PENDOWN_GPIO); | ||
136 | } | ||
137 | |||
99 | static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { | 138 | static 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 | ||
108 | static struct spi_board_info nokia770_spi_board_info[] __initdata = { | 149 | static 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 | ||
294 | static void __init omap_nokia770_map_io(void) | 339 | static void __init omap_nokia770_map_io(void) |