diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 148 |
1 files changed, 147 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 933b25bb10de..a7c0b31fd084 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/i2c/twl.h> | 22 | #include <linux/i2c/twl.h> |
23 | #include <linux/gpio_keys.h> | 23 | #include <linux/gpio_keys.h> |
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/regulator/fixed.h> | ||
25 | #include <linux/leds.h> | 26 | #include <linux/leds.h> |
26 | #include <linux/leds_pwm.h> | 27 | #include <linux/leds_pwm.h> |
27 | 28 | ||
@@ -37,6 +38,7 @@ | |||
37 | #include <plat/mmc.h> | 38 | #include <plat/mmc.h> |
38 | #include <plat/omap4-keypad.h> | 39 | #include <plat/omap4-keypad.h> |
39 | #include <video/omapdss.h> | 40 | #include <video/omapdss.h> |
41 | #include <linux/wl12xx.h> | ||
40 | 42 | ||
41 | #include "mux.h" | 43 | #include "mux.h" |
42 | #include "hsmmc.h" | 44 | #include "hsmmc.h" |
@@ -51,6 +53,9 @@ | |||
51 | #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ | 53 | #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ |
52 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ | 54 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ |
53 | 55 | ||
56 | #define GPIO_WIFI_PMENA 54 | ||
57 | #define GPIO_WIFI_IRQ 53 | ||
58 | |||
54 | static const int sdp4430_keymap[] = { | 59 | static const int sdp4430_keymap[] = { |
55 | KEY(0, 0, KEY_E), | 60 | KEY(0, 0, KEY_E), |
56 | KEY(0, 1, KEY_R), | 61 | KEY(0, 1, KEY_R), |
@@ -124,6 +129,64 @@ static const int sdp4430_keymap[] = { | |||
124 | KEY(7, 6, KEY_OK), | 129 | KEY(7, 6, KEY_OK), |
125 | KEY(7, 7, KEY_DOWN), | 130 | KEY(7, 7, KEY_DOWN), |
126 | }; | 131 | }; |
132 | static struct omap_device_pad keypad_pads[] __initdata = { | ||
133 | { .name = "kpd_col1.kpd_col1", | ||
134 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
135 | }, | ||
136 | { .name = "kpd_col1.kpd_col1", | ||
137 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
138 | }, | ||
139 | { .name = "kpd_col2.kpd_col2", | ||
140 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
141 | }, | ||
142 | { .name = "kpd_col3.kpd_col3", | ||
143 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
144 | }, | ||
145 | { .name = "kpd_col4.kpd_col4", | ||
146 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
147 | }, | ||
148 | { .name = "kpd_col5.kpd_col5", | ||
149 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
150 | }, | ||
151 | { .name = "gpmc_a23.kpd_col7", | ||
152 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
153 | }, | ||
154 | { .name = "gpmc_a22.kpd_col6", | ||
155 | .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1, | ||
156 | }, | ||
157 | { .name = "kpd_row0.kpd_row0", | ||
158 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
159 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
160 | }, | ||
161 | { .name = "kpd_row1.kpd_row1", | ||
162 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
163 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
164 | }, | ||
165 | { .name = "kpd_row2.kpd_row2", | ||
166 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
167 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
168 | }, | ||
169 | { .name = "kpd_row3.kpd_row3", | ||
170 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
171 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
172 | }, | ||
173 | { .name = "kpd_row4.kpd_row4", | ||
174 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
175 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
176 | }, | ||
177 | { .name = "kpd_row5.kpd_row5", | ||
178 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
179 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
180 | }, | ||
181 | { .name = "gpmc_a18.kpd_row6", | ||
182 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
183 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
184 | }, | ||
185 | { .name = "gpmc_a19.kpd_row7", | ||
186 | .enable = OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | | ||
187 | OMAP_MUX_MODE1 | OMAP_INPUT_EN, | ||
188 | }, | ||
189 | }; | ||
127 | 190 | ||
128 | static struct matrix_keymap_data sdp4430_keymap_data = { | 191 | static struct matrix_keymap_data sdp4430_keymap_data = { |
129 | .keymap = sdp4430_keymap, | 192 | .keymap = sdp4430_keymap, |
@@ -135,6 +198,13 @@ static struct omap4_keypad_platform_data sdp4430_keypad_data = { | |||
135 | .rows = 8, | 198 | .rows = 8, |
136 | .cols = 8, | 199 | .cols = 8, |
137 | }; | 200 | }; |
201 | |||
202 | static struct omap_board_data keypad_data = { | ||
203 | .id = 1, | ||
204 | .pads = keypad_pads, | ||
205 | .pads_cnt = ARRAY_SIZE(keypad_pads), | ||
206 | }; | ||
207 | |||
138 | static struct gpio_led sdp4430_gpio_leds[] = { | 208 | static struct gpio_led sdp4430_gpio_leds[] = { |
139 | { | 209 | { |
140 | .name = "omap4:green:debug0", | 210 | .name = "omap4:green:debug0", |
@@ -315,8 +385,17 @@ static struct omap2_hsmmc_info mmc[] = { | |||
315 | { | 385 | { |
316 | .mmc = 1, | 386 | .mmc = 1, |
317 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | 387 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
388 | .gpio_cd = -EINVAL, | ||
318 | .gpio_wp = -EINVAL, | 389 | .gpio_wp = -EINVAL, |
319 | }, | 390 | }, |
391 | { | ||
392 | .mmc = 5, | ||
393 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, | ||
394 | .gpio_cd = -EINVAL, | ||
395 | .gpio_wp = -EINVAL, | ||
396 | .ocr_mask = MMC_VDD_165_195, | ||
397 | .nonremovable = true, | ||
398 | }, | ||
320 | {} /* Terminator */ | 399 | {} /* Terminator */ |
321 | }; | 400 | }; |
322 | 401 | ||
@@ -324,6 +403,37 @@ static struct regulator_consumer_supply sdp4430_vaux_supply[] = { | |||
324 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), | 403 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
325 | }; | 404 | }; |
326 | 405 | ||
406 | static struct regulator_consumer_supply omap4_sdp4430_vmmc5_supply = { | ||
407 | .supply = "vmmc", | ||
408 | .dev_name = "omap_hsmmc.4", | ||
409 | }; | ||
410 | |||
411 | static struct regulator_init_data sdp4430_vmmc5 = { | ||
412 | .constraints = { | ||
413 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
414 | }, | ||
415 | .num_consumer_supplies = 1, | ||
416 | .consumer_supplies = &omap4_sdp4430_vmmc5_supply, | ||
417 | }; | ||
418 | |||
419 | static struct fixed_voltage_config sdp4430_vwlan = { | ||
420 | .supply_name = "vwl1271", | ||
421 | .microvolts = 1800000, /* 1.8V */ | ||
422 | .gpio = GPIO_WIFI_PMENA, | ||
423 | .startup_delay = 70000, /* 70msec */ | ||
424 | .enable_high = 1, | ||
425 | .enabled_at_boot = 0, | ||
426 | .init_data = &sdp4430_vmmc5, | ||
427 | }; | ||
428 | |||
429 | static struct platform_device omap_vwlan_device = { | ||
430 | .name = "reg-fixed-voltage", | ||
431 | .id = 1, | ||
432 | .dev = { | ||
433 | .platform_data = &sdp4430_vwlan, | ||
434 | }, | ||
435 | }; | ||
436 | |||
327 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | 437 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
328 | { | 438 | { |
329 | int ret = 0; | 439 | int ret = 0; |
@@ -593,6 +703,41 @@ static inline void board_serial_init(void) | |||
593 | } | 703 | } |
594 | #endif | 704 | #endif |
595 | 705 | ||
706 | static void omap4_sdp4430_wifi_mux_init(void) | ||
707 | { | ||
708 | omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT | | ||
709 | OMAP_PIN_OFF_WAKEUPENABLE); | ||
710 | omap_mux_init_gpio(GPIO_WIFI_PMENA, OMAP_PIN_OUTPUT); | ||
711 | |||
712 | omap_mux_init_signal("sdmmc5_cmd.sdmmc5_cmd", | ||
713 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
714 | omap_mux_init_signal("sdmmc5_clk.sdmmc5_clk", | ||
715 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
716 | omap_mux_init_signal("sdmmc5_dat0.sdmmc5_dat0", | ||
717 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
718 | omap_mux_init_signal("sdmmc5_dat1.sdmmc5_dat1", | ||
719 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
720 | omap_mux_init_signal("sdmmc5_dat2.sdmmc5_dat2", | ||
721 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
722 | omap_mux_init_signal("sdmmc5_dat3.sdmmc5_dat3", | ||
723 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
724 | |||
725 | } | ||
726 | |||
727 | static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata = { | ||
728 | .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ), | ||
729 | .board_ref_clock = WL12XX_REFCLOCK_26, | ||
730 | .board_tcxo_clock = WL12XX_TCXOCLOCK_26, | ||
731 | }; | ||
732 | |||
733 | static void omap4_sdp4430_wifi_init(void) | ||
734 | { | ||
735 | omap4_sdp4430_wifi_mux_init(); | ||
736 | if (wl12xx_set_platform_data(&omap4_sdp4430_wlan_data)) | ||
737 | pr_err("Error setting wl12xx data\n"); | ||
738 | platform_device_register(&omap_vwlan_device); | ||
739 | } | ||
740 | |||
596 | static void __init omap_4430sdp_init(void) | 741 | static void __init omap_4430sdp_init(void) |
597 | { | 742 | { |
598 | int status; | 743 | int status; |
@@ -609,6 +754,7 @@ static void __init omap_4430sdp_init(void) | |||
609 | omap_sfh7741prox_init(); | 754 | omap_sfh7741prox_init(); |
610 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 755 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
611 | board_serial_init(); | 756 | board_serial_init(); |
757 | omap4_sdp4430_wifi_init(); | ||
612 | omap4_twl6030_hsmmc_init(mmc); | 758 | omap4_twl6030_hsmmc_init(mmc); |
613 | 759 | ||
614 | usb_musb_init(&musb_board_data); | 760 | usb_musb_init(&musb_board_data); |
@@ -622,7 +768,7 @@ static void __init omap_4430sdp_init(void) | |||
622 | ARRAY_SIZE(sdp4430_spi_board_info)); | 768 | ARRAY_SIZE(sdp4430_spi_board_info)); |
623 | } | 769 | } |
624 | 770 | ||
625 | status = omap4_keyboard_init(&sdp4430_keypad_data); | 771 | status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data); |
626 | if (status) | 772 | if (status) |
627 | pr_err("Keypad initialization failed: %d\n", status); | 773 | pr_err("Keypad initialization failed: %d\n", status); |
628 | 774 | ||