diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-omap2/board-cm-t35.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-omap2/board-cm-t35.c')
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t35.c | 336 |
1 files changed, 84 insertions, 252 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index e10bc109415c..77456dec93ea 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/i2c/at24.h> | 31 | #include <linux/i2c/at24.h> |
32 | #include <linux/i2c/twl.h> | 32 | #include <linux/i2c/twl.h> |
33 | #include <linux/regulator/machine.h> | 33 | #include <linux/regulator/machine.h> |
34 | #include <linux/mmc/host.h> | ||
34 | 35 | ||
35 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
36 | #include <linux/spi/tdo24m.h> | 37 | #include <linux/spi/tdo24m.h> |
@@ -44,7 +45,8 @@ | |||
44 | #include <plat/nand.h> | 45 | #include <plat/nand.h> |
45 | #include <plat/gpmc.h> | 46 | #include <plat/gpmc.h> |
46 | #include <plat/usb.h> | 47 | #include <plat/usb.h> |
47 | #include <plat/display.h> | 48 | #include <video/omapdss.h> |
49 | #include <video/omap-panel-generic-dpi.h> | ||
48 | #include <plat/mcspi.h> | 50 | #include <plat/mcspi.h> |
49 | 51 | ||
50 | #include <mach/hardware.h> | 52 | #include <mach/hardware.h> |
@@ -52,6 +54,7 @@ | |||
52 | #include "mux.h" | 54 | #include "mux.h" |
53 | #include "sdram-micron-mt46h32m32lf-6.h" | 55 | #include "sdram-micron-mt46h32m32lf-6.h" |
54 | #include "hsmmc.h" | 56 | #include "hsmmc.h" |
57 | #include "common-board-devices.h" | ||
55 | 58 | ||
56 | #define CM_T35_GPIO_PENDOWN 57 | 59 | #define CM_T35_GPIO_PENDOWN 57 |
57 | 60 | ||
@@ -60,90 +63,30 @@ | |||
60 | #define SB_T35_SMSC911X_CS 4 | 63 | #define SB_T35_SMSC911X_CS 4 |
61 | #define SB_T35_SMSC911X_GPIO 65 | 64 | #define SB_T35_SMSC911X_GPIO 65 |
62 | 65 | ||
63 | #define NAND_BLOCK_SIZE SZ_128K | ||
64 | |||
65 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 66 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
66 | #include <linux/smsc911x.h> | 67 | #include <linux/smsc911x.h> |
68 | #include <plat/gpmc-smsc911x.h> | ||
67 | 69 | ||
68 | static struct smsc911x_platform_config cm_t35_smsc911x_config = { | 70 | static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = { |
69 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
70 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
71 | .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, | ||
72 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
73 | }; | ||
74 | |||
75 | static struct resource cm_t35_smsc911x_resources[] = { | ||
76 | { | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, | ||
79 | { | ||
80 | .start = OMAP_GPIO_IRQ(CM_T35_SMSC911X_GPIO), | ||
81 | .end = OMAP_GPIO_IRQ(CM_T35_SMSC911X_GPIO), | ||
82 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
83 | }, | ||
84 | }; | ||
85 | |||
86 | static struct platform_device cm_t35_smsc911x_device = { | ||
87 | .name = "smsc911x", | ||
88 | .id = 0, | 71 | .id = 0, |
89 | .num_resources = ARRAY_SIZE(cm_t35_smsc911x_resources), | 72 | .cs = CM_T35_SMSC911X_CS, |
90 | .resource = cm_t35_smsc911x_resources, | 73 | .gpio_irq = CM_T35_SMSC911X_GPIO, |
91 | .dev = { | 74 | .gpio_reset = -EINVAL, |
92 | .platform_data = &cm_t35_smsc911x_config, | 75 | .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, |
93 | }, | ||
94 | }; | ||
95 | |||
96 | static struct resource sb_t35_smsc911x_resources[] = { | ||
97 | { | ||
98 | .flags = IORESOURCE_MEM, | ||
99 | }, | ||
100 | { | ||
101 | .start = OMAP_GPIO_IRQ(SB_T35_SMSC911X_GPIO), | ||
102 | .end = OMAP_GPIO_IRQ(SB_T35_SMSC911X_GPIO), | ||
103 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
104 | }, | ||
105 | }; | 76 | }; |
106 | 77 | ||
107 | static struct platform_device sb_t35_smsc911x_device = { | 78 | static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = { |
108 | .name = "smsc911x", | ||
109 | .id = 1, | 79 | .id = 1, |
110 | .num_resources = ARRAY_SIZE(sb_t35_smsc911x_resources), | 80 | .cs = SB_T35_SMSC911X_CS, |
111 | .resource = sb_t35_smsc911x_resources, | 81 | .gpio_irq = SB_T35_SMSC911X_GPIO, |
112 | .dev = { | 82 | .gpio_reset = -EINVAL, |
113 | .platform_data = &cm_t35_smsc911x_config, | 83 | .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, |
114 | }, | ||
115 | }; | 84 | }; |
116 | 85 | ||
117 | static void __init cm_t35_init_smsc911x(struct platform_device *dev, | ||
118 | int cs, int irq_gpio) | ||
119 | { | ||
120 | unsigned long cs_mem_base; | ||
121 | |||
122 | if (gpmc_cs_request(cs, SZ_16M, &cs_mem_base) < 0) { | ||
123 | pr_err("CM-T35: Failed request for GPMC mem for smsc911x\n"); | ||
124 | return; | ||
125 | } | ||
126 | |||
127 | dev->resource[0].start = cs_mem_base + 0x0; | ||
128 | dev->resource[0].end = cs_mem_base + 0xff; | ||
129 | |||
130 | if ((gpio_request(irq_gpio, "ETH IRQ") == 0) && | ||
131 | (gpio_direction_input(irq_gpio) == 0)) { | ||
132 | gpio_export(irq_gpio, 0); | ||
133 | } else { | ||
134 | pr_err("CM-T35: could not obtain gpio for SMSC911X IRQ\n"); | ||
135 | return; | ||
136 | } | ||
137 | |||
138 | platform_device_register(dev); | ||
139 | } | ||
140 | |||
141 | static void __init cm_t35_init_ethernet(void) | 86 | static void __init cm_t35_init_ethernet(void) |
142 | { | 87 | { |
143 | cm_t35_init_smsc911x(&cm_t35_smsc911x_device, | 88 | gpmc_smsc911x_init(&cm_t35_smsc911x_cfg); |
144 | CM_T35_SMSC911X_CS, CM_T35_SMSC911X_GPIO); | 89 | gpmc_smsc911x_init(&sb_t35_smsc911x_cfg); |
145 | cm_t35_init_smsc911x(&sb_t35_smsc911x_device, | ||
146 | SB_T35_SMSC911X_CS, SB_T35_SMSC911X_GPIO); | ||
147 | } | 90 | } |
148 | #else | 91 | #else |
149 | static inline void __init cm_t35_init_ethernet(void) { return; } | 92 | static inline void __init cm_t35_init_ethernet(void) { return; } |
@@ -233,71 +176,10 @@ static void __init cm_t35_init_nand(void) | |||
233 | static inline void cm_t35_init_nand(void) {} | 176 | static inline void cm_t35_init_nand(void) {} |
234 | #endif | 177 | #endif |
235 | 178 | ||
236 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | ||
237 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
238 | #include <linux/spi/ads7846.h> | ||
239 | |||
240 | #include <plat/mcspi.h> | ||
241 | |||
242 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { | ||
243 | .turbo_mode = 0, | ||
244 | .single_channel = 1, /* 0: slave, 1: master */ | ||
245 | }; | ||
246 | |||
247 | static int ads7846_get_pendown_state(void) | ||
248 | { | ||
249 | return !gpio_get_value(CM_T35_GPIO_PENDOWN); | ||
250 | } | ||
251 | |||
252 | static struct ads7846_platform_data ads7846_config = { | ||
253 | .x_max = 0x0fff, | ||
254 | .y_max = 0x0fff, | ||
255 | .x_plate_ohms = 180, | ||
256 | .pressure_max = 255, | ||
257 | .debounce_max = 10, | ||
258 | .debounce_tol = 3, | ||
259 | .debounce_rep = 1, | ||
260 | .get_pendown_state = ads7846_get_pendown_state, | ||
261 | .keep_vref_on = 1, | ||
262 | }; | ||
263 | |||
264 | static struct spi_board_info cm_t35_spi_board_info[] __initdata = { | ||
265 | { | ||
266 | .modalias = "ads7846", | ||
267 | .bus_num = 1, | ||
268 | .chip_select = 0, | ||
269 | .max_speed_hz = 1500000, | ||
270 | .controller_data = &ads7846_mcspi_config, | ||
271 | .irq = OMAP_GPIO_IRQ(CM_T35_GPIO_PENDOWN), | ||
272 | .platform_data = &ads7846_config, | ||
273 | }, | ||
274 | }; | ||
275 | |||
276 | static void __init cm_t35_init_ads7846(void) | ||
277 | { | ||
278 | if ((gpio_request(CM_T35_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && | ||
279 | (gpio_direction_input(CM_T35_GPIO_PENDOWN) == 0)) { | ||
280 | gpio_export(CM_T35_GPIO_PENDOWN, 0); | ||
281 | } else { | ||
282 | pr_err("CM-T35: could not obtain gpio for ADS7846_PENDOWN\n"); | ||
283 | return; | ||
284 | } | ||
285 | |||
286 | spi_register_board_info(cm_t35_spi_board_info, | ||
287 | ARRAY_SIZE(cm_t35_spi_board_info)); | ||
288 | } | ||
289 | #else | ||
290 | static inline void cm_t35_init_ads7846(void) {} | ||
291 | #endif | ||
292 | |||
293 | #define CM_T35_LCD_EN_GPIO 157 | 179 | #define CM_T35_LCD_EN_GPIO 157 |
294 | #define CM_T35_LCD_BL_GPIO 58 | 180 | #define CM_T35_LCD_BL_GPIO 58 |
295 | #define CM_T35_DVI_EN_GPIO 54 | 181 | #define CM_T35_DVI_EN_GPIO 54 |
296 | 182 | ||
297 | static int lcd_bl_gpio; | ||
298 | static int lcd_en_gpio; | ||
299 | static int dvi_en_gpio; | ||
300 | |||
301 | static int lcd_enabled; | 183 | static int lcd_enabled; |
302 | static int dvi_enabled; | 184 | static int dvi_enabled; |
303 | 185 | ||
@@ -308,8 +190,8 @@ static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev) | |||
308 | return -EINVAL; | 190 | return -EINVAL; |
309 | } | 191 | } |
310 | 192 | ||
311 | gpio_set_value(lcd_en_gpio, 1); | 193 | gpio_set_value(CM_T35_LCD_EN_GPIO, 1); |
312 | gpio_set_value(lcd_bl_gpio, 1); | 194 | gpio_set_value(CM_T35_LCD_BL_GPIO, 1); |
313 | 195 | ||
314 | lcd_enabled = 1; | 196 | lcd_enabled = 1; |
315 | 197 | ||
@@ -320,8 +202,8 @@ static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev) | |||
320 | { | 202 | { |
321 | lcd_enabled = 0; | 203 | lcd_enabled = 0; |
322 | 204 | ||
323 | gpio_set_value(lcd_bl_gpio, 0); | 205 | gpio_set_value(CM_T35_LCD_BL_GPIO, 0); |
324 | gpio_set_value(lcd_en_gpio, 0); | 206 | gpio_set_value(CM_T35_LCD_EN_GPIO, 0); |
325 | } | 207 | } |
326 | 208 | ||
327 | static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev) | 209 | static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev) |
@@ -331,7 +213,7 @@ static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev) | |||
331 | return -EINVAL; | 213 | return -EINVAL; |
332 | } | 214 | } |
333 | 215 | ||
334 | gpio_set_value(dvi_en_gpio, 0); | 216 | gpio_set_value(CM_T35_DVI_EN_GPIO, 0); |
335 | dvi_enabled = 1; | 217 | dvi_enabled = 1; |
336 | 218 | ||
337 | return 0; | 219 | return 0; |
@@ -339,7 +221,7 @@ static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev) | |||
339 | 221 | ||
340 | static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev) | 222 | static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev) |
341 | { | 223 | { |
342 | gpio_set_value(dvi_en_gpio, 1); | 224 | gpio_set_value(CM_T35_DVI_EN_GPIO, 1); |
343 | dvi_enabled = 0; | 225 | dvi_enabled = 0; |
344 | } | 226 | } |
345 | 227 | ||
@@ -352,22 +234,32 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) | |||
352 | { | 234 | { |
353 | } | 235 | } |
354 | 236 | ||
237 | static struct panel_generic_dpi_data lcd_panel = { | ||
238 | .name = "toppoly_tdo35s", | ||
239 | .platform_enable = cm_t35_panel_enable_lcd, | ||
240 | .platform_disable = cm_t35_panel_disable_lcd, | ||
241 | }; | ||
242 | |||
355 | static struct omap_dss_device cm_t35_lcd_device = { | 243 | static struct omap_dss_device cm_t35_lcd_device = { |
356 | .name = "lcd", | 244 | .name = "lcd", |
357 | .driver_name = "toppoly_tdo35s_panel", | ||
358 | .type = OMAP_DISPLAY_TYPE_DPI, | 245 | .type = OMAP_DISPLAY_TYPE_DPI, |
246 | .driver_name = "generic_dpi_panel", | ||
247 | .data = &lcd_panel, | ||
359 | .phy.dpi.data_lines = 18, | 248 | .phy.dpi.data_lines = 18, |
360 | .platform_enable = cm_t35_panel_enable_lcd, | 249 | }; |
361 | .platform_disable = cm_t35_panel_disable_lcd, | 250 | |
251 | static struct panel_generic_dpi_data dvi_panel = { | ||
252 | .name = "generic", | ||
253 | .platform_enable = cm_t35_panel_enable_dvi, | ||
254 | .platform_disable = cm_t35_panel_disable_dvi, | ||
362 | }; | 255 | }; |
363 | 256 | ||
364 | static struct omap_dss_device cm_t35_dvi_device = { | 257 | static struct omap_dss_device cm_t35_dvi_device = { |
365 | .name = "dvi", | 258 | .name = "dvi", |
366 | .driver_name = "generic_panel", | ||
367 | .type = OMAP_DISPLAY_TYPE_DPI, | 259 | .type = OMAP_DISPLAY_TYPE_DPI, |
260 | .driver_name = "generic_dpi_panel", | ||
261 | .data = &dvi_panel, | ||
368 | .phy.dpi.data_lines = 24, | 262 | .phy.dpi.data_lines = 24, |
369 | .platform_enable = cm_t35_panel_enable_dvi, | ||
370 | .platform_disable = cm_t35_panel_disable_dvi, | ||
371 | }; | 263 | }; |
372 | 264 | ||
373 | static struct omap_dss_device cm_t35_tv_device = { | 265 | static struct omap_dss_device cm_t35_tv_device = { |
@@ -391,14 +283,6 @@ static struct omap_dss_board_info cm_t35_dss_data = { | |||
391 | .default_device = &cm_t35_dvi_device, | 283 | .default_device = &cm_t35_dvi_device, |
392 | }; | 284 | }; |
393 | 285 | ||
394 | static struct platform_device cm_t35_dss_device = { | ||
395 | .name = "omapdss", | ||
396 | .id = -1, | ||
397 | .dev = { | ||
398 | .platform_data = &cm_t35_dss_data, | ||
399 | }, | ||
400 | }; | ||
401 | |||
402 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { | 286 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { |
403 | .turbo_mode = 0, | 287 | .turbo_mode = 0, |
404 | .single_channel = 1, /* 0: slave, 1: master */ | 288 | .single_channel = 1, /* 0: slave, 1: master */ |
@@ -419,62 +303,38 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = { | |||
419 | }, | 303 | }, |
420 | }; | 304 | }; |
421 | 305 | ||
306 | static struct gpio cm_t35_dss_gpios[] __initdata = { | ||
307 | { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" }, | ||
308 | { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" }, | ||
309 | { CM_T35_DVI_EN_GPIO, GPIOF_OUT_INIT_HIGH, "dvi enable" }, | ||
310 | }; | ||
311 | |||
422 | static void __init cm_t35_init_display(void) | 312 | static void __init cm_t35_init_display(void) |
423 | { | 313 | { |
424 | int err; | 314 | int err; |
425 | 315 | ||
426 | lcd_en_gpio = CM_T35_LCD_EN_GPIO; | ||
427 | lcd_bl_gpio = CM_T35_LCD_BL_GPIO; | ||
428 | dvi_en_gpio = CM_T35_DVI_EN_GPIO; | ||
429 | |||
430 | spi_register_board_info(cm_t35_lcd_spi_board_info, | 316 | spi_register_board_info(cm_t35_lcd_spi_board_info, |
431 | ARRAY_SIZE(cm_t35_lcd_spi_board_info)); | 317 | ARRAY_SIZE(cm_t35_lcd_spi_board_info)); |
432 | 318 | ||
433 | err = gpio_request(lcd_en_gpio, "LCD RST"); | 319 | err = gpio_request_array(cm_t35_dss_gpios, |
434 | if (err) { | 320 | ARRAY_SIZE(cm_t35_dss_gpios)); |
435 | pr_err("CM-T35: failed to get LCD reset GPIO\n"); | ||
436 | goto out; | ||
437 | } | ||
438 | |||
439 | err = gpio_request(lcd_bl_gpio, "LCD BL"); | ||
440 | if (err) { | 321 | if (err) { |
441 | pr_err("CM-T35: failed to get LCD backlight control GPIO\n"); | 322 | pr_err("CM-T35: failed to request DSS control GPIOs\n"); |
442 | goto err_lcd_bl; | 323 | return; |
443 | } | ||
444 | |||
445 | err = gpio_request(dvi_en_gpio, "DVI EN"); | ||
446 | if (err) { | ||
447 | pr_err("CM-T35: failed to get DVI reset GPIO\n"); | ||
448 | goto err_dvi_en; | ||
449 | } | 324 | } |
450 | 325 | ||
451 | gpio_export(lcd_en_gpio, 0); | 326 | gpio_export(CM_T35_LCD_EN_GPIO, 0); |
452 | gpio_export(lcd_bl_gpio, 0); | 327 | gpio_export(CM_T35_LCD_BL_GPIO, 0); |
453 | gpio_export(dvi_en_gpio, 0); | 328 | gpio_export(CM_T35_DVI_EN_GPIO, 0); |
454 | gpio_direction_output(lcd_en_gpio, 0); | ||
455 | gpio_direction_output(lcd_bl_gpio, 0); | ||
456 | gpio_direction_output(dvi_en_gpio, 1); | ||
457 | 329 | ||
458 | msleep(50); | 330 | msleep(50); |
459 | gpio_set_value(lcd_en_gpio, 1); | 331 | gpio_set_value(CM_T35_LCD_EN_GPIO, 1); |
460 | 332 | ||
461 | err = platform_device_register(&cm_t35_dss_device); | 333 | err = omap_display_init(&cm_t35_dss_data); |
462 | if (err) { | 334 | if (err) { |
463 | pr_err("CM-T35: failed to register DSS device\n"); | 335 | pr_err("CM-T35: failed to register DSS device\n"); |
464 | goto err_dev_reg; | 336 | gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios)); |
465 | } | 337 | } |
466 | |||
467 | return; | ||
468 | |||
469 | err_dev_reg: | ||
470 | gpio_free(dvi_en_gpio); | ||
471 | err_dvi_en: | ||
472 | gpio_free(lcd_bl_gpio); | ||
473 | err_lcd_bl: | ||
474 | gpio_free(lcd_en_gpio); | ||
475 | out: | ||
476 | |||
477 | return; | ||
478 | } | 338 | } |
479 | 339 | ||
480 | static struct regulator_consumer_supply cm_t35_vmmc1_supply = { | 340 | static struct regulator_consumer_supply cm_t35_vmmc1_supply = { |
@@ -485,15 +345,11 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = { | |||
485 | .supply = "vmmc_aux", | 345 | .supply = "vmmc_aux", |
486 | }; | 346 | }; |
487 | 347 | ||
488 | static struct regulator_consumer_supply cm_t35_vdac_supply = { | 348 | static struct regulator_consumer_supply cm_t35_vdac_supply = |
489 | .supply = "vdda_dac", | 349 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); |
490 | .dev = &cm_t35_dss_device.dev, | ||
491 | }; | ||
492 | 350 | ||
493 | static struct regulator_consumer_supply cm_t35_vdvi_supply = { | 351 | static struct regulator_consumer_supply cm_t35_vdvi_supply = |
494 | .supply = "vdvi", | 352 | REGULATOR_SUPPLY("vdvi", "omapdss"); |
495 | .dev = &cm_t35_dss_device.dev, | ||
496 | }; | ||
497 | 353 | ||
498 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 354 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
499 | static struct regulator_init_data cm_t35_vmmc1 = { | 355 | static struct regulator_init_data cm_t35_vmmc1 = { |
@@ -558,7 +414,7 @@ static struct twl4030_usb_data cm_t35_usb_data = { | |||
558 | .usb_mode = T2_USB_MODE_ULPI, | 414 | .usb_mode = T2_USB_MODE_ULPI, |
559 | }; | 415 | }; |
560 | 416 | ||
561 | static int cm_t35_keymap[] = { | 417 | static uint32_t cm_t35_keymap[] = { |
562 | KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT), | 418 | KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT), |
563 | KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN), | 419 | KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN), |
564 | KEY(2, 0, KEY_RIGHT), KEY(2, 1, KEY_C), KEY(2, 2, KEY_D), | 420 | KEY(2, 0, KEY_RIGHT), KEY(2, 1, KEY_C), KEY(2, 2, KEY_D), |
@@ -579,14 +435,14 @@ static struct twl4030_keypad_data cm_t35_kp_data = { | |||
579 | static struct omap2_hsmmc_info mmc[] = { | 435 | static struct omap2_hsmmc_info mmc[] = { |
580 | { | 436 | { |
581 | .mmc = 1, | 437 | .mmc = 1, |
582 | .wires = 4, | 438 | .caps = MMC_CAP_4_BIT_DATA, |
583 | .gpio_cd = -EINVAL, | 439 | .gpio_cd = -EINVAL, |
584 | .gpio_wp = -EINVAL, | 440 | .gpio_wp = -EINVAL, |
585 | 441 | ||
586 | }, | 442 | }, |
587 | { | 443 | { |
588 | .mmc = 2, | 444 | .mmc = 2, |
589 | .wires = 4, | 445 | .caps = MMC_CAP_4_BIT_DATA, |
590 | .transceiver = 1, | 446 | .transceiver = 1, |
591 | .gpio_cd = -EINVAL, | 447 | .gpio_cd = -EINVAL, |
592 | .gpio_wp = -EINVAL, | 448 | .gpio_wp = -EINVAL, |
@@ -595,14 +451,14 @@ static struct omap2_hsmmc_info mmc[] = { | |||
595 | {} /* Terminator */ | 451 | {} /* Terminator */ |
596 | }; | 452 | }; |
597 | 453 | ||
598 | static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { | 454 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { |
599 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, | 455 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
600 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, | 456 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
601 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | 457 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, |
602 | 458 | ||
603 | .phy_reset = true, | 459 | .phy_reset = true, |
604 | .reset_gpio_port[0] = -EINVAL, | 460 | .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6, |
605 | .reset_gpio_port[1] = -EINVAL, | 461 | .reset_gpio_port[1] = OMAP_MAX_GPIO_LINES + 7, |
606 | .reset_gpio_port[2] = -EINVAL | 462 | .reset_gpio_port[2] = -EINVAL |
607 | }; | 463 | }; |
608 | 464 | ||
@@ -611,10 +467,8 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, | |||
611 | { | 467 | { |
612 | int wlan_rst = gpio + 2; | 468 | int wlan_rst = gpio + 2; |
613 | 469 | ||
614 | if ((gpio_request(wlan_rst, "WLAN RST") == 0) && | 470 | if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) { |
615 | (gpio_direction_output(wlan_rst, 1) == 0)) { | ||
616 | gpio_export(wlan_rst, 0); | 471 | gpio_export(wlan_rst, 0); |
617 | |||
618 | udelay(10); | 472 | udelay(10); |
619 | gpio_set_value(wlan_rst, 0); | 473 | gpio_set_value(wlan_rst, 0); |
620 | udelay(10); | 474 | udelay(10); |
@@ -631,12 +485,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, | |||
631 | cm_t35_vmmc1_supply.dev = mmc[0].dev; | 485 | cm_t35_vmmc1_supply.dev = mmc[0].dev; |
632 | cm_t35_vsim_supply.dev = mmc[0].dev; | 486 | cm_t35_vsim_supply.dev = mmc[0].dev; |
633 | 487 | ||
634 | /* setup USB with proper PHY reset GPIOs */ | ||
635 | ehci_pdata.reset_gpio_port[0] = gpio + 6; | ||
636 | ehci_pdata.reset_gpio_port[1] = gpio + 7; | ||
637 | |||
638 | usb_ehci_init(&ehci_pdata); | ||
639 | |||
640 | return 0; | 488 | return 0; |
641 | } | 489 | } |
642 | 490 | ||
@@ -661,35 +509,19 @@ static struct twl4030_platform_data cm_t35_twldata = { | |||
661 | .vpll2 = &cm_t35_vpll2, | 509 | .vpll2 = &cm_t35_vpll2, |
662 | }; | 510 | }; |
663 | 511 | ||
664 | static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = { | ||
665 | { | ||
666 | I2C_BOARD_INFO("tps65930", 0x48), | ||
667 | .flags = I2C_CLIENT_WAKE, | ||
668 | .irq = INT_34XX_SYS_NIRQ, | ||
669 | .platform_data = &cm_t35_twldata, | ||
670 | }, | ||
671 | }; | ||
672 | |||
673 | static void __init cm_t35_init_i2c(void) | 512 | static void __init cm_t35_init_i2c(void) |
674 | { | 513 | { |
675 | omap_register_i2c_bus(1, 2600, cm_t35_i2c_boardinfo, | 514 | omap3_pmic_init("tps65930", &cm_t35_twldata); |
676 | ARRAY_SIZE(cm_t35_i2c_boardinfo)); | ||
677 | } | 515 | } |
678 | 516 | ||
679 | static struct omap_board_config_kernel cm_t35_config[] __initdata = { | 517 | static void __init cm_t35_init_early(void) |
680 | }; | ||
681 | |||
682 | static void __init cm_t35_init_irq(void) | ||
683 | { | 518 | { |
684 | omap_board_config = cm_t35_config; | 519 | omap2_init_common_infrastructure(); |
685 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | 520 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
686 | |||
687 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, | ||
688 | mt46h32m32lf6_sdrc_params); | 521 | mt46h32m32lf6_sdrc_params); |
689 | omap_init_irq(); | ||
690 | omap_gpio_init(); | ||
691 | } | 522 | } |
692 | 523 | ||
524 | #ifdef CONFIG_OMAP_MUX | ||
693 | static struct omap_board_mux board_mux[] __initdata = { | 525 | static struct omap_board_mux board_mux[] __initdata = { |
694 | /* nCS and IRQ for CM-T35 ethernet */ | 526 | /* nCS and IRQ for CM-T35 ethernet */ |
695 | OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0), | 527 | OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0), |
@@ -787,34 +619,34 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
787 | 619 | ||
788 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 620 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
789 | }; | 621 | }; |
622 | #endif | ||
790 | 623 | ||
791 | static struct omap_musb_board_data musb_board_data = { | 624 | static struct omap_board_config_kernel cm_t35_config[] __initdata = { |
792 | .interface_type = MUSB_INTERFACE_ULPI, | ||
793 | .mode = MUSB_OTG, | ||
794 | .power = 100, | ||
795 | }; | 625 | }; |
796 | 626 | ||
797 | static void __init cm_t35_init(void) | 627 | static void __init cm_t35_init(void) |
798 | { | 628 | { |
629 | omap_board_config = cm_t35_config; | ||
630 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | ||
799 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 631 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
800 | omap_serial_init(); | 632 | omap_serial_init(); |
801 | cm_t35_init_i2c(); | 633 | cm_t35_init_i2c(); |
802 | cm_t35_init_nand(); | 634 | cm_t35_init_nand(); |
803 | cm_t35_init_ads7846(); | 635 | omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL); |
804 | cm_t35_init_ethernet(); | 636 | cm_t35_init_ethernet(); |
805 | cm_t35_init_led(); | 637 | cm_t35_init_led(); |
806 | cm_t35_init_display(); | 638 | cm_t35_init_display(); |
807 | 639 | ||
808 | usb_musb_init(&musb_board_data); | 640 | usb_musb_init(NULL); |
641 | usbhs_init(&usbhs_bdata); | ||
809 | } | 642 | } |
810 | 643 | ||
811 | MACHINE_START(CM_T35, "Compulab CM-T35") | 644 | MACHINE_START(CM_T35, "Compulab CM-T35") |
812 | .phys_io = 0x48000000, | ||
813 | .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, | ||
814 | .boot_params = 0x80000100, | 645 | .boot_params = 0x80000100, |
815 | .map_io = omap3_map_io, | ||
816 | .reserve = omap_reserve, | 646 | .reserve = omap_reserve, |
817 | .init_irq = cm_t35_init_irq, | 647 | .map_io = omap3_map_io, |
648 | .init_early = cm_t35_init_early, | ||
649 | .init_irq = omap_init_irq, | ||
818 | .init_machine = cm_t35_init, | 650 | .init_machine = cm_t35_init, |
819 | .timer = &omap_timer, | 651 | .timer = &omap_timer, |
820 | MACHINE_END | 652 | MACHINE_END |