2 * Board support file for OMAP4430 SDP.
4 * Copyright (C) 2009 Texas Instruments
6 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
8 * Based on mach-omap2/board-3430sdp.c
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.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.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/mfd/twl6040.h>
24 #include <linux/gpio_keys.h>
25 #include <linux/regulator/machine.h>
26 #include <linux/regulator/fixed.h>
27 #include <linux/leds.h>
28 #include <linux/leds_pwm.h>
29 #include <linux/platform_data/omap4-keypad.h>
31 #include <mach/hardware.h>
32 #include <asm/hardware/gic.h>
33 #include <asm/mach-types.h>
34 #include <asm/mach/arch.h>
35 #include <asm/mach/map.h>
37 #include <plat/board.h>
41 #include <plat/omap4-keypad.h>
42 #include <video/omapdss.h>
43 #include <video/omap-panel-nokia-dsi.h>
44 #include <video/omap-panel-picodlp.h>
45 #include <linux/wl12xx.h>
46 #include <linux/platform_data/omap-abe-twl6040.h>
51 #include "common-board-devices.h"
53 #define ETH_KS8851_IRQ 34
54 #define ETH_KS8851_POWER_ON 48
55 #define ETH_KS8851_QUART 138
56 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
57 #define OMAP4_SFH7741_ENABLE_GPIO 188
58 #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
59 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
60 #define HDMI_GPIO_HPD 63 /* Hotplug detect */
61 #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
62 #define DLP_POWER_ON_GPIO 40
64 #define GPIO_WIFI_PMENA 54
65 #define GPIO_WIFI_IRQ 53
67 static const int sdp4430_keymap
[] = {
73 KEY(0, 5, KEY_UNKNOWN
),
75 KEY(0, 7, KEY_LEFTSHIFT
),
82 KEY(1, 5, KEY_UNKNOWN
),
91 KEY(2, 5, KEY_UNKNOWN
),
93 KEY(2, 7, KEY_CAPSLOCK
),
96 KEY(3, 1, KEY_KPPLUS
),
100 KEY(3, 5, KEY_UNKNOWN
),
102 KEY(3, 7, KEY_SPACE
),
108 KEY(4, 4, KEY_VOLUMEUP
),
109 KEY(4, 5, KEY_UNKNOWN
),
118 KEY(5, 5, KEY_VOLUMEDOWN
),
120 KEY(5, 7, KEY_RIGHT
),
126 KEY(6, 4, KEY_BACKSPACE
),
127 KEY(6, 5, KEY_UNKNOWN
),
131 KEY(7, 0, KEY_PROG1
),
132 KEY(7, 1, KEY_PROG2
),
133 KEY(7, 2, KEY_PROG3
),
134 KEY(7, 3, KEY_PROG4
),
136 KEY(7, 5, KEY_UNKNOWN
),
140 static struct omap_device_pad keypad_pads
[] = {
141 { .name
= "kpd_col1.kpd_col1",
142 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
144 { .name
= "kpd_col1.kpd_col1",
145 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
147 { .name
= "kpd_col2.kpd_col2",
148 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
150 { .name
= "kpd_col3.kpd_col3",
151 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
153 { .name
= "kpd_col4.kpd_col4",
154 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
156 { .name
= "kpd_col5.kpd_col5",
157 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
159 { .name
= "gpmc_a23.kpd_col7",
160 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
162 { .name
= "gpmc_a22.kpd_col6",
163 .enable
= OMAP_WAKEUP_EN
| OMAP_MUX_MODE1
,
165 { .name
= "kpd_row0.kpd_row0",
166 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
167 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
169 { .name
= "kpd_row1.kpd_row1",
170 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
171 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
173 { .name
= "kpd_row2.kpd_row2",
174 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
175 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
177 { .name
= "kpd_row3.kpd_row3",
178 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
179 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
181 { .name
= "kpd_row4.kpd_row4",
182 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
183 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
185 { .name
= "kpd_row5.kpd_row5",
186 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
187 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
189 { .name
= "gpmc_a18.kpd_row6",
190 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
191 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
193 { .name
= "gpmc_a19.kpd_row7",
194 .enable
= OMAP_PULL_ENA
| OMAP_PULL_UP
| OMAP_WAKEUP_EN
|
195 OMAP_MUX_MODE1
| OMAP_INPUT_EN
,
199 static struct matrix_keymap_data sdp4430_keymap_data
= {
200 .keymap
= sdp4430_keymap
,
201 .keymap_size
= ARRAY_SIZE(sdp4430_keymap
),
204 static struct omap4_keypad_platform_data sdp4430_keypad_data
= {
205 .keymap_data
= &sdp4430_keymap_data
,
210 static struct omap_board_data keypad_data
= {
213 .pads_cnt
= ARRAY_SIZE(keypad_pads
),
216 static struct gpio_led sdp4430_gpio_leds
[] = {
218 .name
= "omap4:green:debug0",
222 .name
= "omap4:green:debug1",
226 .name
= "omap4:green:debug2",
230 .name
= "omap4:green:debug3",
234 .name
= "omap4:green:debug4",
238 .name
= "omap4:blue:user",
242 .name
= "omap4:red:user",
246 .name
= "omap4:green:user",
252 static struct gpio_keys_button sdp4430_gpio_keys
[] = {
254 .desc
= "Proximity Sensor",
256 .code
= SW_FRONT_PROXIMITY
,
257 .gpio
= OMAP4_SFH7741_SENSOR_OUTPUT_GPIO
,
262 static struct gpio_led_platform_data sdp4430_led_data
= {
263 .leds
= sdp4430_gpio_leds
,
264 .num_leds
= ARRAY_SIZE(sdp4430_gpio_leds
),
267 static struct led_pwm sdp4430_pwm_leds
[] = {
269 .name
= "omap4:green:chrg",
271 .max_brightness
= 255,
272 .pwm_period_ns
= 7812500,
276 static struct led_pwm_platform_data sdp4430_pwm_data
= {
277 .num_leds
= ARRAY_SIZE(sdp4430_pwm_leds
),
278 .leds
= sdp4430_pwm_leds
,
281 static struct platform_device sdp4430_leds_pwm
= {
285 .platform_data
= &sdp4430_pwm_data
,
289 static int omap_prox_activate(struct device
*dev
)
291 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO
, 1);
295 static void omap_prox_deactivate(struct device
*dev
)
297 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO
, 0);
300 static struct gpio_keys_platform_data sdp4430_gpio_keys_data
= {
301 .buttons
= sdp4430_gpio_keys
,
302 .nbuttons
= ARRAY_SIZE(sdp4430_gpio_keys
),
303 .enable
= omap_prox_activate
,
304 .disable
= omap_prox_deactivate
,
307 static struct platform_device sdp4430_gpio_keys_device
= {
311 .platform_data
= &sdp4430_gpio_keys_data
,
315 static struct platform_device sdp4430_leds_gpio
= {
319 .platform_data
= &sdp4430_led_data
,
322 static struct spi_board_info sdp4430_spi_board_info
[] __initdata
= {
324 .modalias
= "ks8851",
327 .max_speed_hz
= 24000000,
329 * .irq is set to gpio_to_irq(ETH_KS8851_IRQ)
330 * in omap_4430sdp_init
335 static struct gpio sdp4430_eth_gpios
[] __initdata
= {
336 { ETH_KS8851_POWER_ON
, GPIOF_OUT_INIT_HIGH
, "eth_power" },
337 { ETH_KS8851_QUART
, GPIOF_OUT_INIT_HIGH
, "quart" },
338 { ETH_KS8851_IRQ
, GPIOF_IN
, "eth_irq" },
341 static int __init
omap_ethernet_init(void)
345 /* Request of GPIO lines */
346 status
= gpio_request_array(sdp4430_eth_gpios
,
347 ARRAY_SIZE(sdp4430_eth_gpios
));
349 pr_err("Cannot request ETH GPIOs\n");
354 static struct regulator_consumer_supply sdp4430_vbat_supply
[] = {
355 REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"),
356 REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"),
359 static struct regulator_init_data sdp4430_vbat_data
= {
363 .num_consumer_supplies
= ARRAY_SIZE(sdp4430_vbat_supply
),
364 .consumer_supplies
= sdp4430_vbat_supply
,
367 static struct fixed_voltage_config sdp4430_vbat_pdata
= {
368 .supply_name
= "VBAT",
369 .microvolts
= 3750000,
370 .init_data
= &sdp4430_vbat_data
,
374 static struct platform_device sdp4430_vbat
= {
375 .name
= "reg-fixed-voltage",
378 .platform_data
= &sdp4430_vbat_pdata
,
382 static struct platform_device sdp4430_dmic_codec
= {
383 .name
= "dmic-codec",
387 static struct platform_device sdp4430_hdmi_audio_codec
= {
388 .name
= "hdmi-audio-codec",
392 static struct omap_abe_twl6040_data sdp4430_abe_audio_data
= {
393 .card_name
= "SDP4430",
394 .has_hs
= ABE_TWL6040_LEFT
| ABE_TWL6040_RIGHT
,
395 .has_hf
= ABE_TWL6040_LEFT
| ABE_TWL6040_RIGHT
,
397 .has_aux
= ABE_TWL6040_LEFT
| ABE_TWL6040_RIGHT
,
398 .has_vibra
= ABE_TWL6040_LEFT
| ABE_TWL6040_RIGHT
,
404 .has_afm
= ABE_TWL6040_LEFT
| ABE_TWL6040_RIGHT
,
407 /* MCLK input is 38.4MHz */
408 .mclk_freq
= 38400000,
411 static struct platform_device sdp4430_abe_audio
= {
412 .name
= "omap-abe-twl6040",
415 .platform_data
= &sdp4430_abe_audio_data
,
419 static struct platform_device
*sdp4430_devices
[] __initdata
= {
420 &sdp4430_gpio_keys_device
,
426 &sdp4430_hdmi_audio_codec
,
429 static struct omap_musb_board_data musb_board_data
= {
430 .interface_type
= MUSB_INTERFACE_UTMI
,
435 static struct omap2_hsmmc_info mmc
[] = {
438 .caps
= MMC_CAP_4_BIT_DATA
| MMC_CAP_8_BIT_DATA
,
441 .nonremovable
= true,
442 .ocr_mask
= MMC_VDD_29_30
,
447 .caps
= MMC_CAP_4_BIT_DATA
| MMC_CAP_8_BIT_DATA
,
453 .caps
= MMC_CAP_4_BIT_DATA
| MMC_CAP_POWER_OFF_CARD
,
454 .pm_caps
= MMC_PM_KEEP_POWER
,
457 .ocr_mask
= MMC_VDD_165_195
,
458 .nonremovable
= true,
463 static struct regulator_consumer_supply sdp4430_vaux_supply
[] = {
464 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
467 static struct regulator_consumer_supply omap4_sdp4430_vmmc5_supply
= {
469 .dev_name
= "omap_hsmmc.4",
472 static struct regulator_init_data sdp4430_vmmc5
= {
474 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
476 .num_consumer_supplies
= 1,
477 .consumer_supplies
= &omap4_sdp4430_vmmc5_supply
,
480 static struct fixed_voltage_config sdp4430_vwlan
= {
481 .supply_name
= "vwl1271",
482 .microvolts
= 1800000, /* 1.8V */
483 .gpio
= GPIO_WIFI_PMENA
,
484 .startup_delay
= 70000, /* 70msec */
486 .enabled_at_boot
= 0,
487 .init_data
= &sdp4430_vmmc5
,
490 static struct platform_device omap_vwlan_device
= {
491 .name
= "reg-fixed-voltage",
494 .platform_data
= &sdp4430_vwlan
,
498 static struct regulator_init_data sdp4430_vaux1
= {
503 .valid_modes_mask
= REGULATOR_MODE_NORMAL
504 | REGULATOR_MODE_STANDBY
,
505 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
506 | REGULATOR_CHANGE_MODE
507 | REGULATOR_CHANGE_STATUS
,
509 .num_consumer_supplies
= ARRAY_SIZE(sdp4430_vaux_supply
),
510 .consumer_supplies
= sdp4430_vaux_supply
,
513 static struct regulator_init_data sdp4430_vusim
= {
518 .valid_modes_mask
= REGULATOR_MODE_NORMAL
519 | REGULATOR_MODE_STANDBY
,
520 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
521 | REGULATOR_CHANGE_MODE
522 | REGULATOR_CHANGE_STATUS
,
526 static struct twl6040_codec_data twl6040_codec
= {
527 /* single-step ramp for headset and handsfree */
528 .hs_left_step
= 0x0f,
529 .hs_right_step
= 0x0f,
530 .hf_left_step
= 0x1d,
531 .hf_right_step
= 0x1d,
534 static struct twl6040_vibra_data twl6040_vibra
= {
539 .vddvibl_uV
= 0, /* fixed volt supply - VBAT */
540 .vddvibr_uV
= 0, /* fixed volt supply - VBAT */
543 static struct twl6040_platform_data twl6040_data
= {
544 .codec
= &twl6040_codec
,
545 .vibra
= &twl6040_vibra
,
546 .audpwron_gpio
= 127,
547 .irq_base
= TWL6040_CODEC_IRQ_BASE
,
550 static struct twl4030_platform_data sdp4430_twldata
= {
552 .vusim
= &sdp4430_vusim
,
553 .vaux1
= &sdp4430_vaux1
,
556 static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo
[] = {
558 I2C_BOARD_INFO("tmp105", 0x48),
561 I2C_BOARD_INFO("bh1780", 0x29),
564 static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo
[] = {
566 I2C_BOARD_INFO("hmc5843", 0x1e),
569 static int __init
omap4_i2c_init(void)
571 omap4_pmic_get_config(&sdp4430_twldata
, TWL_COMMON_PDATA_USB
,
572 TWL_COMMON_REGULATOR_VDAC
|
573 TWL_COMMON_REGULATOR_VAUX2
|
574 TWL_COMMON_REGULATOR_VAUX3
|
575 TWL_COMMON_REGULATOR_VMMC
|
576 TWL_COMMON_REGULATOR_VPP
|
577 TWL_COMMON_REGULATOR_VANA
|
578 TWL_COMMON_REGULATOR_VCXIO
|
579 TWL_COMMON_REGULATOR_VUSB
|
580 TWL_COMMON_REGULATOR_CLK32KG
|
581 TWL_COMMON_REGULATOR_V1V8
|
582 TWL_COMMON_REGULATOR_V2V1
);
583 omap4_pmic_init("twl6030", &sdp4430_twldata
,
584 &twl6040_data
, OMAP44XX_IRQ_SYS_2N
);
585 omap_register_i2c_bus(2, 400, NULL
, 0);
586 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo
,
587 ARRAY_SIZE(sdp4430_i2c_3_boardinfo
));
588 omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo
,
589 ARRAY_SIZE(sdp4430_i2c_4_boardinfo
));
593 static void __init
omap_sfh7741prox_init(void)
597 error
= gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO
,
598 GPIOF_OUT_INIT_LOW
, "sfh7741");
600 pr_err("%s:failed to request GPIO %d, error %d\n",
601 __func__
, OMAP4_SFH7741_ENABLE_GPIO
, error
);
604 static struct gpio sdp4430_hdmi_gpios
[] = {
605 { HDMI_GPIO_CT_CP_HPD
, GPIOF_OUT_INIT_HIGH
, "hdmi_gpio_ct_cp_hpd" },
606 { HDMI_GPIO_LS_OE
, GPIOF_OUT_INIT_HIGH
, "hdmi_gpio_ls_oe" },
607 { HDMI_GPIO_HPD
, GPIOF_DIR_IN
, "hdmi_gpio_hpd" },
610 static int sdp4430_panel_enable_hdmi(struct omap_dss_device
*dssdev
)
614 status
= gpio_request_array(sdp4430_hdmi_gpios
,
615 ARRAY_SIZE(sdp4430_hdmi_gpios
));
617 pr_err("%s: Cannot request HDMI GPIOs\n", __func__
);
622 static void sdp4430_panel_disable_hdmi(struct omap_dss_device
*dssdev
)
624 gpio_free_array(sdp4430_hdmi_gpios
, ARRAY_SIZE(sdp4430_hdmi_gpios
));
627 static struct nokia_dsi_panel_data dsi1_panel
= {
635 .pins
= { 0, 1, 2, 3, 4, 5 },
639 static struct omap_dss_device sdp4430_lcd_device
= {
641 .driver_name
= "taal",
642 .type
= OMAP_DISPLAY_TYPE_DSI
,
651 /* Logic Clock = 172.8 MHz */
653 /* Pixel Clock = 34.56 MHz */
655 .lcd_clk_src
= OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC
,
657 .dispc_fclk_src
= OMAP_DSS_CLK_SRC_FCK
,
661 .regn
= 16, /* Fint = 2.4 MHz */
662 .regm
= 180, /* DDR Clock = 216 MHz */
663 .regm_dispc
= 5, /* PLL1_CLK1 = 172.8 MHz */
664 .regm_dsi
= 5, /* PLL1_CLK2 = 172.8 MHz */
666 .lp_clk_div
= 10, /* LP Clock = 8.64 MHz */
667 .dsi_fclk_src
= OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI
,
670 .channel
= OMAP_DSS_CHANNEL_LCD
,
673 static struct nokia_dsi_panel_data dsi2_panel
= {
681 .pins
= { 0, 1, 2, 3, 4, 5 },
685 static struct omap_dss_device sdp4430_lcd2_device
= {
687 .driver_name
= "taal",
688 .type
= OMAP_DISPLAY_TYPE_DSI
,
698 /* Logic Clock = 172.8 MHz */
700 /* Pixel Clock = 34.56 MHz */
702 .lcd_clk_src
= OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC
,
704 .dispc_fclk_src
= OMAP_DSS_CLK_SRC_FCK
,
708 .regn
= 16, /* Fint = 2.4 MHz */
709 .regm
= 180, /* DDR Clock = 216 MHz */
710 .regm_dispc
= 5, /* PLL1_CLK1 = 172.8 MHz */
711 .regm_dsi
= 5, /* PLL1_CLK2 = 172.8 MHz */
713 .lp_clk_div
= 10, /* LP Clock = 8.64 MHz */
714 .dsi_fclk_src
= OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI
,
717 .channel
= OMAP_DSS_CHANNEL_LCD2
,
720 static struct omap_dss_hdmi_data sdp4430_hdmi_data
= {
721 .hpd_gpio
= HDMI_GPIO_HPD
,
724 static struct omap_dss_device sdp4430_hdmi_device
= {
726 .driver_name
= "hdmi_panel",
727 .type
= OMAP_DISPLAY_TYPE_HDMI
,
728 .platform_enable
= sdp4430_panel_enable_hdmi
,
729 .platform_disable
= sdp4430_panel_disable_hdmi
,
730 .channel
= OMAP_DSS_CHANNEL_DIGIT
,
731 .data
= &sdp4430_hdmi_data
,
734 static struct picodlp_panel_data sdp4430_picodlp_pdata
= {
735 .picodlp_adapter_id
= 2,
740 static void sdp4430_picodlp_init(void)
743 const struct gpio picodlp_gpios
[] = {
744 {DLP_POWER_ON_GPIO
, GPIOF_OUT_INIT_LOW
,
746 {sdp4430_picodlp_pdata
.emu_done_gpio
, GPIOF_IN
,
748 {sdp4430_picodlp_pdata
.pwrgood_gpio
, GPIOF_OUT_INIT_LOW
,
752 r
= gpio_request_array(picodlp_gpios
, ARRAY_SIZE(picodlp_gpios
));
754 pr_err("Cannot request PicoDLP GPIOs, error %d\n", r
);
757 static int sdp4430_panel_enable_picodlp(struct omap_dss_device
*dssdev
)
759 gpio_set_value(DISPLAY_SEL_GPIO
, 0);
760 gpio_set_value(DLP_POWER_ON_GPIO
, 1);
765 static void sdp4430_panel_disable_picodlp(struct omap_dss_device
*dssdev
)
767 gpio_set_value(DLP_POWER_ON_GPIO
, 0);
768 gpio_set_value(DISPLAY_SEL_GPIO
, 1);
771 static struct omap_dss_device sdp4430_picodlp_device
= {
773 .driver_name
= "picodlp_panel",
774 .type
= OMAP_DISPLAY_TYPE_DPI
,
775 .phy
.dpi
.data_lines
= 24,
776 .channel
= OMAP_DSS_CHANNEL_LCD2
,
777 .platform_enable
= sdp4430_panel_enable_picodlp
,
778 .platform_disable
= sdp4430_panel_disable_picodlp
,
779 .data
= &sdp4430_picodlp_pdata
,
782 static struct omap_dss_device
*sdp4430_dss_devices
[] = {
784 &sdp4430_lcd2_device
,
785 &sdp4430_hdmi_device
,
786 &sdp4430_picodlp_device
,
789 static struct omap_dss_board_info sdp4430_dss_data
= {
790 .num_devices
= ARRAY_SIZE(sdp4430_dss_devices
),
791 .devices
= sdp4430_dss_devices
,
792 .default_device
= &sdp4430_lcd_device
,
795 static void __init
omap_4430sdp_display_init(void)
799 /* Enable LCD2 by default (instead of Pico DLP) */
800 r
= gpio_request_one(DISPLAY_SEL_GPIO
, GPIOF_OUT_INIT_HIGH
,
803 pr_err("%s: Could not get display_sel GPIO\n", __func__
);
805 sdp4430_picodlp_init();
806 omap_display_init(&sdp4430_dss_data
);
808 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
809 * later have external pull up on the HDMI I2C lines
811 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2
)
812 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP
);
816 omap_mux_init_gpio(HDMI_GPIO_LS_OE
, OMAP_PIN_OUTPUT
);
817 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD
, OMAP_PIN_OUTPUT
);
818 omap_mux_init_gpio(HDMI_GPIO_HPD
, OMAP_PIN_INPUT_PULLDOWN
);
821 #ifdef CONFIG_OMAP_MUX
822 static struct omap_board_mux board_mux
[] __initdata
= {
823 OMAP4_MUX(USBB2_ULPITLL_CLK
, OMAP_MUX_MODE4
| OMAP_PIN_OUTPUT
),
824 /* NIRQ2 for twl6040 */
825 OMAP4_MUX(SYS_NIRQ2
, OMAP_MUX_MODE0
|
826 OMAP_PIN_INPUT_PULLUP
| OMAP_PIN_OFF_WAKEUPENABLE
),
827 { .reg_offset
= OMAP_MUX_TERMINATOR
},
831 #define board_mux NULL
834 static void __init
omap4_sdp4430_wifi_mux_init(void)
836 omap_mux_init_gpio(GPIO_WIFI_IRQ
, OMAP_PIN_INPUT
|
837 OMAP_PIN_OFF_WAKEUPENABLE
);
838 omap_mux_init_gpio(GPIO_WIFI_PMENA
, OMAP_PIN_OUTPUT
);
840 omap_mux_init_signal("sdmmc5_cmd.sdmmc5_cmd",
841 OMAP_MUX_MODE0
| OMAP_PIN_INPUT_PULLUP
);
842 omap_mux_init_signal("sdmmc5_clk.sdmmc5_clk",
843 OMAP_MUX_MODE0
| OMAP_PIN_INPUT_PULLUP
);
844 omap_mux_init_signal("sdmmc5_dat0.sdmmc5_dat0",
845 OMAP_MUX_MODE0
| OMAP_PIN_INPUT_PULLUP
);
846 omap_mux_init_signal("sdmmc5_dat1.sdmmc5_dat1",
847 OMAP_MUX_MODE0
| OMAP_PIN_INPUT_PULLUP
);
848 omap_mux_init_signal("sdmmc5_dat2.sdmmc5_dat2",
849 OMAP_MUX_MODE0
| OMAP_PIN_INPUT_PULLUP
);
850 omap_mux_init_signal("sdmmc5_dat3.sdmmc5_dat3",
851 OMAP_MUX_MODE0
| OMAP_PIN_INPUT_PULLUP
);
855 static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata
= {
856 .board_ref_clock
= WL12XX_REFCLOCK_26
,
857 .board_tcxo_clock
= WL12XX_TCXOCLOCK_26
,
860 static void __init
omap4_sdp4430_wifi_init(void)
864 omap4_sdp4430_wifi_mux_init();
865 omap4_sdp4430_wlan_data
.irq
= gpio_to_irq(GPIO_WIFI_IRQ
);
866 ret
= wl12xx_set_platform_data(&omap4_sdp4430_wlan_data
);
868 pr_err("Error setting wl12xx data: %d\n", ret
);
869 ret
= platform_device_register(&omap_vwlan_device
);
871 pr_err("Error registering wl12xx device: %d\n", ret
);
874 static void __init
omap_4430sdp_init(void)
877 int package
= OMAP_PACKAGE_CBS
;
879 if (omap_rev() == OMAP4430_REV_ES1_0
)
880 package
= OMAP_PACKAGE_CBL
;
881 omap4_mux_init(board_mux
, NULL
, package
);
884 omap_sfh7741prox_init();
885 platform_add_devices(sdp4430_devices
, ARRAY_SIZE(sdp4430_devices
));
887 omap_sdrc_init(NULL
, NULL
);
888 omap4_sdp4430_wifi_init();
889 omap4_twl6030_hsmmc_init(mmc
);
891 usb_musb_init(&musb_board_data
);
893 status
= omap_ethernet_init();
895 pr_err("Ethernet initialization failed: %d\n", status
);
897 sdp4430_spi_board_info
[0].irq
= gpio_to_irq(ETH_KS8851_IRQ
);
898 spi_register_board_info(sdp4430_spi_board_info
,
899 ARRAY_SIZE(sdp4430_spi_board_info
));
902 status
= omap4_keyboard_init(&sdp4430_keypad_data
, &keypad_data
);
904 pr_err("Keypad initialization failed: %d\n", status
);
906 omap_4430sdp_display_init();
909 MACHINE_START(OMAP_4430SDP
, "OMAP4430 4430SDP board")
910 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
911 .atag_offset
= 0x100,
912 .reserve
= omap_reserve
,
913 .map_io
= omap4_map_io
,
914 .init_early
= omap4430_init_early
,
915 .init_irq
= gic_init_irq
,
916 .handle_irq
= gic_handle_irq
,
917 .init_machine
= omap_4430sdp_init
,
918 .init_late
= omap4430_init_late
,
919 .timer
= &omap4_timer
,
920 .restart
= omap_prcm_restart
,