Merge branch 'next' into for-linus-3.0
[pandora-kernel.git] / arch / arm / mach-omap2 / board-4430sdp.c
1 /*
2  * Board support file for OMAP4430 SDP.
3  *
4  * Copyright (C) 2009 Texas Instruments
5  *
6  * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
7  *
8  * Based on mach-omap2/board-3430sdp.c
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  */
14
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/io.h>
19 #include <linux/gpio.h>
20 #include <linux/usb/otg.h>
21 #include <linux/spi/spi.h>
22 #include <linux/i2c/twl.h>
23 #include <linux/gpio_keys.h>
24 #include <linux/regulator/machine.h>
25 #include <linux/leds.h>
26 #include <linux/leds_pwm.h>
27
28 #include <mach/hardware.h>
29 #include <mach/omap4-common.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/map.h>
33
34 #include <plat/board.h>
35 #include <plat/common.h>
36 #include <plat/usb.h>
37 #include <plat/mmc.h>
38 #include <plat/omap4-keypad.h>
39 #include <video/omapdss.h>
40
41 #include "mux.h"
42 #include "hsmmc.h"
43 #include "timer-gp.h"
44 #include "control.h"
45 #include "common-board-devices.h"
46
47 #define ETH_KS8851_IRQ                  34
48 #define ETH_KS8851_POWER_ON             48
49 #define ETH_KS8851_QUART                138
50 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO        184
51 #define OMAP4_SFH7741_ENABLE_GPIO               188
52 #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
53 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
54
55 static const int sdp4430_keymap[] = {
56         KEY(0, 0, KEY_E),
57         KEY(0, 1, KEY_R),
58         KEY(0, 2, KEY_T),
59         KEY(0, 3, KEY_HOME),
60         KEY(0, 4, KEY_F5),
61         KEY(0, 5, KEY_UNKNOWN),
62         KEY(0, 6, KEY_I),
63         KEY(0, 7, KEY_LEFTSHIFT),
64
65         KEY(1, 0, KEY_D),
66         KEY(1, 1, KEY_F),
67         KEY(1, 2, KEY_G),
68         KEY(1, 3, KEY_SEND),
69         KEY(1, 4, KEY_F6),
70         KEY(1, 5, KEY_UNKNOWN),
71         KEY(1, 6, KEY_K),
72         KEY(1, 7, KEY_ENTER),
73
74         KEY(2, 0, KEY_X),
75         KEY(2, 1, KEY_C),
76         KEY(2, 2, KEY_V),
77         KEY(2, 3, KEY_END),
78         KEY(2, 4, KEY_F7),
79         KEY(2, 5, KEY_UNKNOWN),
80         KEY(2, 6, KEY_DOT),
81         KEY(2, 7, KEY_CAPSLOCK),
82
83         KEY(3, 0, KEY_Z),
84         KEY(3, 1, KEY_KPPLUS),
85         KEY(3, 2, KEY_B),
86         KEY(3, 3, KEY_F1),
87         KEY(3, 4, KEY_F8),
88         KEY(3, 5, KEY_UNKNOWN),
89         KEY(3, 6, KEY_O),
90         KEY(3, 7, KEY_SPACE),
91
92         KEY(4, 0, KEY_W),
93         KEY(4, 1, KEY_Y),
94         KEY(4, 2, KEY_U),
95         KEY(4, 3, KEY_F2),
96         KEY(4, 4, KEY_VOLUMEUP),
97         KEY(4, 5, KEY_UNKNOWN),
98         KEY(4, 6, KEY_L),
99         KEY(4, 7, KEY_LEFT),
100
101         KEY(5, 0, KEY_S),
102         KEY(5, 1, KEY_H),
103         KEY(5, 2, KEY_J),
104         KEY(5, 3, KEY_F3),
105         KEY(5, 4, KEY_F9),
106         KEY(5, 5, KEY_VOLUMEDOWN),
107         KEY(5, 6, KEY_M),
108         KEY(5, 7, KEY_RIGHT),
109
110         KEY(6, 0, KEY_Q),
111         KEY(6, 1, KEY_A),
112         KEY(6, 2, KEY_N),
113         KEY(6, 3, KEY_BACK),
114         KEY(6, 4, KEY_BACKSPACE),
115         KEY(6, 5, KEY_UNKNOWN),
116         KEY(6, 6, KEY_P),
117         KEY(6, 7, KEY_UP),
118
119         KEY(7, 0, KEY_PROG1),
120         KEY(7, 1, KEY_PROG2),
121         KEY(7, 2, KEY_PROG3),
122         KEY(7, 3, KEY_PROG4),
123         KEY(7, 4, KEY_F4),
124         KEY(7, 5, KEY_UNKNOWN),
125         KEY(7, 6, KEY_OK),
126         KEY(7, 7, KEY_DOWN),
127 };
128
129 static struct matrix_keymap_data sdp4430_keymap_data = {
130         .keymap                 = sdp4430_keymap,
131         .keymap_size            = ARRAY_SIZE(sdp4430_keymap),
132 };
133
134 static struct omap4_keypad_platform_data sdp4430_keypad_data = {
135         .keymap_data            = &sdp4430_keymap_data,
136         .rows                   = 8,
137         .cols                   = 8,
138 };
139 static struct gpio_led sdp4430_gpio_leds[] = {
140         {
141                 .name   = "omap4:green:debug0",
142                 .gpio   = 61,
143         },
144         {
145                 .name   = "omap4:green:debug1",
146                 .gpio   = 30,
147         },
148         {
149                 .name   = "omap4:green:debug2",
150                 .gpio   = 7,
151         },
152         {
153                 .name   = "omap4:green:debug3",
154                 .gpio   = 8,
155         },
156         {
157                 .name   = "omap4:green:debug4",
158                 .gpio   = 50,
159         },
160         {
161                 .name   = "omap4:blue:user",
162                 .gpio   = 169,
163         },
164         {
165                 .name   = "omap4:red:user",
166                 .gpio   = 170,
167         },
168         {
169                 .name   = "omap4:green:user",
170                 .gpio   = 139,
171         },
172
173 };
174
175 static struct gpio_keys_button sdp4430_gpio_keys[] = {
176         {
177                 .desc                   = "Proximity Sensor",
178                 .type                   = EV_SW,
179                 .code                   = SW_FRONT_PROXIMITY,
180                 .gpio                   = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
181                 .active_low             = 0,
182         }
183 };
184
185 static struct gpio_led_platform_data sdp4430_led_data = {
186         .leds   = sdp4430_gpio_leds,
187         .num_leds       = ARRAY_SIZE(sdp4430_gpio_leds),
188 };
189
190 static struct led_pwm sdp4430_pwm_leds[] = {
191         {
192                 .name           = "omap4:green:chrg",
193                 .pwm_id         = 1,
194                 .max_brightness = 255,
195                 .pwm_period_ns  = 7812500,
196         },
197 };
198
199 static struct led_pwm_platform_data sdp4430_pwm_data = {
200         .num_leds       = ARRAY_SIZE(sdp4430_pwm_leds),
201         .leds           = sdp4430_pwm_leds,
202 };
203
204 static struct platform_device sdp4430_leds_pwm = {
205         .name   = "leds_pwm",
206         .id     = -1,
207         .dev    = {
208                 .platform_data = &sdp4430_pwm_data,
209         },
210 };
211
212 static int omap_prox_activate(struct device *dev)
213 {
214         gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
215         return 0;
216 }
217
218 static void omap_prox_deactivate(struct device *dev)
219 {
220         gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
221 }
222
223 static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
224         .buttons        = sdp4430_gpio_keys,
225         .nbuttons       = ARRAY_SIZE(sdp4430_gpio_keys),
226         .enable         = omap_prox_activate,
227         .disable        = omap_prox_deactivate,
228 };
229
230 static struct platform_device sdp4430_gpio_keys_device = {
231         .name   = "gpio-keys",
232         .id     = -1,
233         .dev    = {
234                 .platform_data  = &sdp4430_gpio_keys_data,
235         },
236 };
237
238 static struct platform_device sdp4430_leds_gpio = {
239         .name   = "leds-gpio",
240         .id     = -1,
241         .dev    = {
242                 .platform_data = &sdp4430_led_data,
243         },
244 };
245 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
246         {
247                 .modalias               = "ks8851",
248                 .bus_num                = 1,
249                 .chip_select            = 0,
250                 .max_speed_hz           = 24000000,
251                 .irq                    = ETH_KS8851_IRQ,
252         },
253 };
254
255 static struct gpio sdp4430_eth_gpios[] __initdata = {
256         { ETH_KS8851_POWER_ON,  GPIOF_OUT_INIT_HIGH,    "eth_power"     },
257         { ETH_KS8851_QUART,     GPIOF_OUT_INIT_HIGH,    "quart"         },
258         { ETH_KS8851_IRQ,       GPIOF_IN,               "eth_irq"       },
259 };
260
261 static int __init omap_ethernet_init(void)
262 {
263         int status;
264
265         /* Request of GPIO lines */
266         status = gpio_request_array(sdp4430_eth_gpios,
267                                     ARRAY_SIZE(sdp4430_eth_gpios));
268         if (status)
269                 pr_err("Cannot request ETH GPIOs\n");
270
271         return status;
272 }
273
274 static struct platform_device sdp4430_lcd_device = {
275         .name           = "sdp4430_lcd",
276         .id             = -1,
277 };
278
279 static struct platform_device *sdp4430_devices[] __initdata = {
280         &sdp4430_lcd_device,
281         &sdp4430_gpio_keys_device,
282         &sdp4430_leds_gpio,
283         &sdp4430_leds_pwm,
284 };
285
286 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
287         .ctrl_name      = "internal",
288 };
289
290 static struct omap_board_config_kernel sdp4430_config[] __initdata = {
291         { OMAP_TAG_LCD,         &sdp4430_lcd_config },
292 };
293
294 static void __init omap_4430sdp_init_early(void)
295 {
296         omap2_init_common_infrastructure();
297         omap2_init_common_devices(NULL, NULL);
298 #ifdef CONFIG_OMAP_32K_TIMER
299         omap2_gp_clockevent_set_gptimer(1);
300 #endif
301 }
302
303 static struct omap_musb_board_data musb_board_data = {
304         .interface_type         = MUSB_INTERFACE_UTMI,
305         .mode                   = MUSB_OTG,
306         .power                  = 100,
307 };
308
309 static struct twl4030_usb_data omap4_usbphy_data = {
310         .phy_init       = omap4430_phy_init,
311         .phy_exit       = omap4430_phy_exit,
312         .phy_power      = omap4430_phy_power,
313         .phy_set_clock  = omap4430_phy_set_clk,
314         .phy_suspend    = omap4430_phy_suspend,
315 };
316
317 static struct omap2_hsmmc_info mmc[] = {
318         {
319                 .mmc            = 2,
320                 .caps           =  MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
321                 .gpio_cd        = -EINVAL,
322                 .gpio_wp        = -EINVAL,
323                 .nonremovable   = true,
324                 .ocr_mask       = MMC_VDD_29_30,
325                 .no_off_init    = true,
326         },
327         {
328                 .mmc            = 1,
329                 .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
330                 .gpio_wp        = -EINVAL,
331         },
332         {}      /* Terminator */
333 };
334
335 static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
336         {
337                 .supply = "vmmc",
338                 .dev_name = "omap_hsmmc.1",
339         },
340 };
341 static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
342         {
343                 .supply = "vmmc",
344                 .dev_name = "omap_hsmmc.0",
345         },
346 };
347
348 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
349 {
350         int ret = 0;
351         struct platform_device *pdev = container_of(dev,
352                                 struct platform_device, dev);
353         struct omap_mmc_platform_data *pdata = dev->platform_data;
354
355         /* Setting MMC1 Card detect Irq */
356         if (pdev->id == 0) {
357                 ret = twl6030_mmc_card_detect_config();
358                 if (ret)
359                         pr_err("Failed configuring MMC1 card detect\n");
360                 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
361                                                 MMCDETECT_INTR_OFFSET;
362                 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
363         }
364         return ret;
365 }
366
367 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
368 {
369         struct omap_mmc_platform_data *pdata;
370
371         /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
372         if (!dev) {
373                 pr_err("Failed %s\n", __func__);
374                 return;
375         }
376         pdata = dev->platform_data;
377         pdata->init =   omap4_twl6030_hsmmc_late_init;
378 }
379
380 static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
381 {
382         struct omap2_hsmmc_info *c;
383
384         omap2_hsmmc_init(controllers);
385         for (c = controllers; c->mmc; c++)
386                 omap4_twl6030_hsmmc_set_late_init(c->dev);
387
388         return 0;
389 }
390
391 static struct regulator_init_data sdp4430_vaux1 = {
392         .constraints = {
393                 .min_uV                 = 1000000,
394                 .max_uV                 = 3000000,
395                 .apply_uV               = true,
396                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
397                                         | REGULATOR_MODE_STANDBY,
398                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
399                                         | REGULATOR_CHANGE_MODE
400                                         | REGULATOR_CHANGE_STATUS,
401         },
402         .num_consumer_supplies  = 1,
403         .consumer_supplies      = sdp4430_vaux_supply,
404 };
405
406 static struct regulator_init_data sdp4430_vaux2 = {
407         .constraints = {
408                 .min_uV                 = 1200000,
409                 .max_uV                 = 2800000,
410                 .apply_uV               = true,
411                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
412                                         | REGULATOR_MODE_STANDBY,
413                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
414                                         | REGULATOR_CHANGE_MODE
415                                         | REGULATOR_CHANGE_STATUS,
416         },
417 };
418
419 static struct regulator_init_data sdp4430_vaux3 = {
420         .constraints = {
421                 .min_uV                 = 1000000,
422                 .max_uV                 = 3000000,
423                 .apply_uV               = true,
424                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
425                                         | REGULATOR_MODE_STANDBY,
426                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
427                                         | REGULATOR_CHANGE_MODE
428                                         | REGULATOR_CHANGE_STATUS,
429         },
430 };
431
432 /* VMMC1 for MMC1 card */
433 static struct regulator_init_data sdp4430_vmmc = {
434         .constraints = {
435                 .min_uV                 = 1200000,
436                 .max_uV                 = 3000000,
437                 .apply_uV               = true,
438                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
439                                         | REGULATOR_MODE_STANDBY,
440                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
441                                         | REGULATOR_CHANGE_MODE
442                                         | REGULATOR_CHANGE_STATUS,
443         },
444         .num_consumer_supplies  = 1,
445         .consumer_supplies      = sdp4430_vmmc_supply,
446 };
447
448 static struct regulator_init_data sdp4430_vpp = {
449         .constraints = {
450                 .min_uV                 = 1800000,
451                 .max_uV                 = 2500000,
452                 .apply_uV               = true,
453                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
454                                         | REGULATOR_MODE_STANDBY,
455                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
456                                         | REGULATOR_CHANGE_MODE
457                                         | REGULATOR_CHANGE_STATUS,
458         },
459 };
460
461 static struct regulator_init_data sdp4430_vusim = {
462         .constraints = {
463                 .min_uV                 = 1200000,
464                 .max_uV                 = 2900000,
465                 .apply_uV               = true,
466                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
467                                         | REGULATOR_MODE_STANDBY,
468                 .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
469                                         | REGULATOR_CHANGE_MODE
470                                         | REGULATOR_CHANGE_STATUS,
471         },
472 };
473
474 static struct regulator_init_data sdp4430_vana = {
475         .constraints = {
476                 .min_uV                 = 2100000,
477                 .max_uV                 = 2100000,
478                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
479                                         | REGULATOR_MODE_STANDBY,
480                 .valid_ops_mask  = REGULATOR_CHANGE_MODE
481                                         | REGULATOR_CHANGE_STATUS,
482         },
483 };
484
485 static struct regulator_init_data sdp4430_vcxio = {
486         .constraints = {
487                 .min_uV                 = 1800000,
488                 .max_uV                 = 1800000,
489                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
490                                         | REGULATOR_MODE_STANDBY,
491                 .valid_ops_mask  = REGULATOR_CHANGE_MODE
492                                         | REGULATOR_CHANGE_STATUS,
493         },
494 };
495
496 static struct regulator_init_data sdp4430_vdac = {
497         .constraints = {
498                 .min_uV                 = 1800000,
499                 .max_uV                 = 1800000,
500                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
501                                         | REGULATOR_MODE_STANDBY,
502                 .valid_ops_mask  = REGULATOR_CHANGE_MODE
503                                         | REGULATOR_CHANGE_STATUS,
504         },
505 };
506
507 static struct regulator_init_data sdp4430_vusb = {
508         .constraints = {
509                 .min_uV                 = 3300000,
510                 .max_uV                 = 3300000,
511                 .apply_uV               = true,
512                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
513                                         | REGULATOR_MODE_STANDBY,
514                 .valid_ops_mask  =      REGULATOR_CHANGE_MODE
515                                         | REGULATOR_CHANGE_STATUS,
516         },
517 };
518
519 static struct regulator_init_data sdp4430_clk32kg = {
520         .constraints = {
521                 .valid_ops_mask         = REGULATOR_CHANGE_STATUS,
522         },
523 };
524
525 static struct twl4030_platform_data sdp4430_twldata = {
526         .irq_base       = TWL6030_IRQ_BASE,
527         .irq_end        = TWL6030_IRQ_END,
528
529         /* Regulators */
530         .vmmc           = &sdp4430_vmmc,
531         .vpp            = &sdp4430_vpp,
532         .vusim          = &sdp4430_vusim,
533         .vana           = &sdp4430_vana,
534         .vcxio          = &sdp4430_vcxio,
535         .vdac           = &sdp4430_vdac,
536         .vusb           = &sdp4430_vusb,
537         .vaux1          = &sdp4430_vaux1,
538         .vaux2          = &sdp4430_vaux2,
539         .vaux3          = &sdp4430_vaux3,
540         .clk32kg        = &sdp4430_clk32kg,
541         .usb            = &omap4_usbphy_data
542 };
543
544 static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
545         {
546                 I2C_BOARD_INFO("tmp105", 0x48),
547         },
548         {
549                 I2C_BOARD_INFO("bh1780", 0x29),
550         },
551 };
552 static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
553         {
554                 I2C_BOARD_INFO("hmc5843", 0x1e),
555         },
556 };
557 static int __init omap4_i2c_init(void)
558 {
559         omap4_pmic_init("twl6030", &sdp4430_twldata);
560         omap_register_i2c_bus(2, 400, NULL, 0);
561         omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
562                                 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
563         omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo,
564                                 ARRAY_SIZE(sdp4430_i2c_4_boardinfo));
565         return 0;
566 }
567
568 static void __init omap_sfh7741prox_init(void)
569 {
570         int error;
571
572         error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO,
573                                  GPIOF_OUT_INIT_LOW, "sfh7741");
574         if (error < 0)
575                 pr_err("%s:failed to request GPIO %d, error %d\n",
576                         __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
577 }
578
579 static void sdp4430_hdmi_mux_init(void)
580 {
581         /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
582         omap_mux_init_signal("hdmi_hpd",
583                         OMAP_PIN_INPUT_PULLUP);
584         omap_mux_init_signal("hdmi_cec",
585                         OMAP_PIN_INPUT_PULLUP);
586         /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
587         omap_mux_init_signal("hdmi_ddc_scl",
588                         OMAP_PIN_INPUT_PULLUP);
589         omap_mux_init_signal("hdmi_ddc_sda",
590                         OMAP_PIN_INPUT_PULLUP);
591 }
592
593 static struct gpio sdp4430_hdmi_gpios[] = {
594         { HDMI_GPIO_HPD,        GPIOF_OUT_INIT_HIGH,    "hdmi_gpio_hpd"   },
595         { HDMI_GPIO_LS_OE,      GPIOF_OUT_INIT_HIGH,    "hdmi_gpio_ls_oe" },
596 };
597
598 static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
599 {
600         int status;
601
602         status = gpio_request_array(sdp4430_hdmi_gpios,
603                                     ARRAY_SIZE(sdp4430_hdmi_gpios));
604         if (status)
605                 pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
606
607         return status;
608 }
609
610 static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
611 {
612         gpio_free(HDMI_GPIO_LS_OE);
613         gpio_free(HDMI_GPIO_HPD);
614 }
615
616 static struct omap_dss_device sdp4430_hdmi_device = {
617         .name = "hdmi",
618         .driver_name = "hdmi_panel",
619         .type = OMAP_DISPLAY_TYPE_HDMI,
620         .clocks = {
621                 .dispc  = {
622                         .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
623                 },
624                 .hdmi   = {
625                         .regn   = 15,
626                         .regm2  = 1,
627                 },
628         },
629         .platform_enable = sdp4430_panel_enable_hdmi,
630         .platform_disable = sdp4430_panel_disable_hdmi,
631         .channel = OMAP_DSS_CHANNEL_DIGIT,
632 };
633
634 static struct omap_dss_device *sdp4430_dss_devices[] = {
635         &sdp4430_hdmi_device,
636 };
637
638 static struct omap_dss_board_info sdp4430_dss_data = {
639         .num_devices    = ARRAY_SIZE(sdp4430_dss_devices),
640         .devices        = sdp4430_dss_devices,
641         .default_device = &sdp4430_hdmi_device,
642 };
643
644 void omap_4430sdp_display_init(void)
645 {
646         sdp4430_hdmi_mux_init();
647         omap_display_init(&sdp4430_dss_data);
648 }
649
650 #ifdef CONFIG_OMAP_MUX
651 static struct omap_board_mux board_mux[] __initdata = {
652         OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
653         { .reg_offset = OMAP_MUX_TERMINATOR },
654 };
655
656 static struct omap_device_pad serial2_pads[] __initdata = {
657         OMAP_MUX_STATIC("uart2_cts.uart2_cts",
658                          OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
659         OMAP_MUX_STATIC("uart2_rts.uart2_rts",
660                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
661         OMAP_MUX_STATIC("uart2_rx.uart2_rx",
662                          OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
663         OMAP_MUX_STATIC("uart2_tx.uart2_tx",
664                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
665 };
666
667 static struct omap_device_pad serial3_pads[] __initdata = {
668         OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
669                          OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
670         OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
671                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
672         OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
673                          OMAP_PIN_INPUT | OMAP_MUX_MODE0),
674         OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
675                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
676 };
677
678 static struct omap_device_pad serial4_pads[] __initdata = {
679         OMAP_MUX_STATIC("uart4_rx.uart4_rx",
680                          OMAP_PIN_INPUT | OMAP_MUX_MODE0),
681         OMAP_MUX_STATIC("uart4_tx.uart4_tx",
682                          OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
683 };
684
685 static struct omap_board_data serial2_data __initdata = {
686         .id             = 1,
687         .pads           = serial2_pads,
688         .pads_cnt       = ARRAY_SIZE(serial2_pads),
689 };
690
691 static struct omap_board_data serial3_data __initdata = {
692         .id             = 2,
693         .pads           = serial3_pads,
694         .pads_cnt       = ARRAY_SIZE(serial3_pads),
695 };
696
697 static struct omap_board_data serial4_data __initdata = {
698         .id             = 3,
699         .pads           = serial4_pads,
700         .pads_cnt       = ARRAY_SIZE(serial4_pads),
701 };
702
703 static inline void board_serial_init(void)
704 {
705         struct omap_board_data bdata;
706         bdata.flags     = 0;
707         bdata.pads      = NULL;
708         bdata.pads_cnt  = 0;
709         bdata.id        = 0;
710         /* pass dummy data for UART1 */
711         omap_serial_init_port(&bdata);
712
713         omap_serial_init_port(&serial2_data);
714         omap_serial_init_port(&serial3_data);
715         omap_serial_init_port(&serial4_data);
716 }
717 #else
718 #define board_mux       NULL
719
720 static inline void board_serial_init(void)
721 {
722         omap_serial_init();
723 }
724  #endif
725
726 static void __init omap_4430sdp_init(void)
727 {
728         int status;
729         int package = OMAP_PACKAGE_CBS;
730
731         if (omap_rev() == OMAP4430_REV_ES1_0)
732                 package = OMAP_PACKAGE_CBL;
733         omap4_mux_init(board_mux, NULL, package);
734
735         omap_board_config = sdp4430_config;
736         omap_board_config_size = ARRAY_SIZE(sdp4430_config);
737
738         omap4_i2c_init();
739         omap_sfh7741prox_init();
740         platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
741         board_serial_init();
742         omap4_twl6030_hsmmc_init(mmc);
743
744         usb_musb_init(&musb_board_data);
745
746         status = omap_ethernet_init();
747         if (status) {
748                 pr_err("Ethernet initialization failed: %d\n", status);
749         } else {
750                 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
751                 spi_register_board_info(sdp4430_spi_board_info,
752                                 ARRAY_SIZE(sdp4430_spi_board_info));
753         }
754
755         status = omap4_keyboard_init(&sdp4430_keypad_data);
756         if (status)
757                 pr_err("Keypad initialization failed: %d\n", status);
758
759         omap_4430sdp_display_init();
760 }
761
762 static void __init omap_4430sdp_map_io(void)
763 {
764         omap2_set_globals_443x();
765         omap44xx_map_common_io();
766 }
767
768 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
769         /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
770         .boot_params    = 0x80000100,
771         .reserve        = omap_reserve,
772         .map_io         = omap_4430sdp_map_io,
773         .init_early     = omap_4430sdp_init_early,
774         .init_irq       = gic_init_irq,
775         .init_machine   = omap_4430sdp_init,
776         .timer          = &omap_timer,
777 MACHINE_END