]> git.karo-electronics.de Git - mv-sheeva.git/blob - arch/arm/mach-omap2/board-igep0020.c
omap3: IGEP v2: Remove onenand_setup no-op function
[mv-sheeva.git] / arch / arm / mach-omap2 / board-igep0020.c
1 /*
2  * Copyright (C) 2009 Integration Software and Electronic Engineering.
3  *
4  * Modified from mach-omap2/board-generic.c
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/delay.h>
15 #include <linux/err.h>
16 #include <linux/clk.h>
17 #include <linux/io.h>
18 #include <linux/gpio.h>
19 #include <linux/interrupt.h>
20
21 #include <linux/regulator/machine.h>
22 #include <linux/i2c/twl.h>
23 #include <linux/mmc/host.h>
24
25 #include <asm/mach-types.h>
26 #include <asm/mach/arch.h>
27
28 #include <plat/board.h>
29 #include <plat/common.h>
30 #include <plat/gpmc.h>
31 #include <plat/usb.h>
32 #include <plat/display.h>
33 #include <plat/onenand.h>
34
35 #include "mux.h"
36 #include "hsmmc.h"
37 #include "sdram-numonyx-m65kxxxxam.h"
38
39 #define IGEP2_SMSC911X_CS       5
40 #define IGEP2_SMSC911X_GPIO     176
41 #define IGEP2_GPIO_USBH_NRESET  24
42 #define IGEP2_GPIO_LED0_GREEN   26
43 #define IGEP2_GPIO_LED0_RED     27
44 #define IGEP2_GPIO_LED1_RED     28
45 #define IGEP2_GPIO_DVI_PUP      170
46
47 #define IGEP2_RB_GPIO_WIFI_NPD     94
48 #define IGEP2_RB_GPIO_WIFI_NRESET  95
49 #define IGEP2_RB_GPIO_BT_NRESET    137
50 #define IGEP2_RC_GPIO_WIFI_NPD     138
51 #define IGEP2_RC_GPIO_WIFI_NRESET  139
52 #define IGEP2_RC_GPIO_BT_NRESET    137
53
54 /*
55  * IGEP2 Hardware Revision Table
56  *
57  *  --------------------------------------------------------------------------
58  * | Id. | Hw Rev.            | HW0 (28) | WIFI_NPD | WIFI_NRESET | BT_NRESET |
59  *  --------------------------------------------------------------------------
60  * |  0  | B                  |   high   |  gpio94  |   gpio95    |     -     |
61  * |  0  | B/C (B-compatible) |   high   |  gpio94  |   gpio95    |  gpio137  |
62  * |  1  | C                  |   low    |  gpio138 |   gpio139   |  gpio137  |
63  *  --------------------------------------------------------------------------
64  */
65
66 #define IGEP2_BOARD_HWREV_B     0
67 #define IGEP2_BOARD_HWREV_C     1
68
69 static u8 hwrev;
70
71 static void __init igep2_get_revision(void)
72 {
73         u8 ret;
74
75         omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
76
77         if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_HW0_REV") == 0) &&
78             (gpio_direction_input(IGEP2_GPIO_LED1_RED) == 0)) {
79                 ret = gpio_get_value(IGEP2_GPIO_LED1_RED);
80                 if (ret == 0) {
81                         pr_info("IGEP2: Hardware Revision C (B-NON compatible)\n");
82                         hwrev = IGEP2_BOARD_HWREV_C;
83                 } else if (ret ==  1) {
84                         pr_info("IGEP2: Hardware Revision B/C (B compatible)\n");
85                         hwrev = IGEP2_BOARD_HWREV_B;
86                 } else {
87                         pr_err("IGEP2: Unknown Hardware Revision\n");
88                         hwrev = -1;
89                 }
90         } else {
91                 pr_warning("IGEP2: Could not obtain gpio GPIO_HW0_REV\n");
92                 pr_err("IGEP2: Unknown Hardware Revision\n");
93         }
94
95         gpio_free(IGEP2_GPIO_LED1_RED);
96 }
97
98 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
99         defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
100
101 #define ONENAND_MAP             0x20000000
102
103 /* NAND04GR4E1A ( x2 Flash built-in COMBO POP MEMORY )
104  * Since the device is equipped with two DataRAMs, and two-plane NAND
105  * Flash memory array, these two component enables simultaneous program
106  * of 4KiB. Plane1 has only even blocks such as block0, block2, block4
107  * while Plane2 has only odd blocks such as block1, block3, block5.
108  * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
109  */
110
111 static struct mtd_partition igep2_onenand_partitions[] = {
112         {
113                 .name           = "X-Loader",
114                 .offset         = 0,
115                 .size           = 2 * (64*(2*2048))
116         },
117         {
118                 .name           = "U-Boot",
119                 .offset         = MTDPART_OFS_APPEND,
120                 .size           = 6 * (64*(2*2048)),
121         },
122         {
123                 .name           = "Environment",
124                 .offset         = MTDPART_OFS_APPEND,
125                 .size           = 2 * (64*(2*2048)),
126         },
127         {
128                 .name           = "Kernel",
129                 .offset         = MTDPART_OFS_APPEND,
130                 .size           = 12 * (64*(2*2048)),
131         },
132         {
133                 .name           = "File System",
134                 .offset         = MTDPART_OFS_APPEND,
135                 .size           = MTDPART_SIZ_FULL,
136         },
137 };
138
139 static struct omap_onenand_platform_data igep2_onenand_data = {
140         .parts = igep2_onenand_partitions,
141         .nr_parts = ARRAY_SIZE(igep2_onenand_partitions),
142         .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
143 };
144
145 static struct platform_device igep2_onenand_device = {
146         .name           = "omap2-onenand",
147         .id             = -1,
148         .dev = {
149                 .platform_data = &igep2_onenand_data,
150         },
151 };
152
153 static void __init igep2_flash_init(void)
154 {
155         u8              cs = 0;
156         u8              onenandcs = GPMC_CS_NUM + 1;
157
158         while (cs < GPMC_CS_NUM) {
159                 u32 ret = 0;
160                 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
161
162                 /* Check if NAND/oneNAND is configured */
163                 if ((ret & 0xC00) == 0x800)
164                         /* NAND found */
165                         pr_err("IGEP v2: Unsupported NAND found\n");
166                 else {
167                         ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
168                         if ((ret & 0x3F) == (ONENAND_MAP >> 24))
169                                 /* ONENAND found */
170                                 onenandcs = cs;
171                 }
172                 cs++;
173         }
174         if (onenandcs > GPMC_CS_NUM) {
175                 pr_err("IGEP v2: Unable to find configuration in GPMC\n");
176                 return;
177         }
178
179         if (onenandcs < GPMC_CS_NUM) {
180                 igep2_onenand_data.cs = onenandcs;
181                 if (platform_device_register(&igep2_onenand_device) < 0)
182                         pr_err("IGEP v2: Unable to register OneNAND device\n");
183         }
184 }
185
186 #else
187 static void __init igep2_flash_init(void) {}
188 #endif
189
190 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
191
192 #include <linux/smsc911x.h>
193
194 static struct smsc911x_platform_config igep2_smsc911x_config = {
195         .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
196         .irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
197         .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS  ,
198         .phy_interface  = PHY_INTERFACE_MODE_MII,
199 };
200
201 static struct resource igep2_smsc911x_resources[] = {
202         {
203                 .flags  = IORESOURCE_MEM,
204         },
205         {
206                 .start  = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
207                 .end    = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
208                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
209         },
210 };
211
212 static struct platform_device igep2_smsc911x_device = {
213         .name           = "smsc911x",
214         .id             = 0,
215         .num_resources  = ARRAY_SIZE(igep2_smsc911x_resources),
216         .resource       = igep2_smsc911x_resources,
217         .dev            = {
218                 .platform_data = &igep2_smsc911x_config,
219         },
220 };
221
222 static inline void __init igep2_init_smsc911x(void)
223 {
224         unsigned long cs_mem_base;
225
226         if (gpmc_cs_request(IGEP2_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
227                 pr_err("IGEP v2: Failed request for GPMC mem for smsc911x\n");
228                 gpmc_cs_free(IGEP2_SMSC911X_CS);
229                 return;
230         }
231
232         igep2_smsc911x_resources[0].start = cs_mem_base + 0x0;
233         igep2_smsc911x_resources[0].end   = cs_mem_base + 0xff;
234
235         if ((gpio_request(IGEP2_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
236             (gpio_direction_input(IGEP2_SMSC911X_GPIO) == 0)) {
237                 gpio_export(IGEP2_SMSC911X_GPIO, 0);
238         } else {
239                 pr_err("IGEP v2: Could not obtain gpio for for SMSC911X IRQ\n");
240                 return;
241         }
242
243         platform_device_register(&igep2_smsc911x_device);
244 }
245
246 #else
247 static inline void __init igep2_init_smsc911x(void) { }
248 #endif
249
250 static struct omap_board_config_kernel igep2_config[] __initdata = {
251 };
252
253 static struct regulator_consumer_supply igep2_vmmc1_supply = {
254         .supply         = "vmmc",
255 };
256
257 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
258 static struct regulator_init_data igep2_vmmc1 = {
259         .constraints = {
260                 .min_uV                 = 1850000,
261                 .max_uV                 = 3150000,
262                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
263                                         | REGULATOR_MODE_STANDBY,
264                 .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
265                                         | REGULATOR_CHANGE_MODE
266                                         | REGULATOR_CHANGE_STATUS,
267         },
268         .num_consumer_supplies  = 1,
269         .consumer_supplies      = &igep2_vmmc1_supply,
270 };
271
272 static struct omap2_hsmmc_info mmc[] = {
273         {
274                 .mmc            = 1,
275                 .caps           = MMC_CAP_4_BIT_DATA,
276                 .gpio_cd        = -EINVAL,
277                 .gpio_wp        = -EINVAL,
278         },
279 #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
280         {
281                 .mmc            = 2,
282                 .caps           = MMC_CAP_4_BIT_DATA,
283                 .gpio_cd        = -EINVAL,
284                 .gpio_wp        = -EINVAL,
285         },
286 #endif
287         {}      /* Terminator */
288 };
289
290 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
291 #include <linux/leds.h>
292
293 static struct gpio_led igep2_gpio_leds[] = {
294         [0] = {
295                 .name                   = "gpio-led:red:d0",
296                 .gpio                   = IGEP2_GPIO_LED0_RED,
297                 .default_trigger        = "default-off"
298         },
299         [1] = {
300                 .name                   = "gpio-led:green:d0",
301                 .gpio                   = IGEP2_GPIO_LED0_GREEN,
302                 .default_trigger        = "default-off",
303         },
304         [2] = {
305                 .name                   = "gpio-led:red:d1",
306                 .gpio                   = IGEP2_GPIO_LED1_RED,
307                 .default_trigger        = "default-off",
308         },
309         [3] = {
310                 .name                   = "gpio-led:green:d1",
311                 .default_trigger        = "heartbeat",
312                 .gpio                   = -EINVAL, /* gets replaced */
313         },
314 };
315
316 static struct gpio_led_platform_data igep2_led_pdata = {
317         .leds           = igep2_gpio_leds,
318         .num_leds       = ARRAY_SIZE(igep2_gpio_leds),
319 };
320
321 static struct platform_device igep2_led_device = {
322          .name   = "leds-gpio",
323          .id     = -1,
324          .dev    = {
325                  .platform_data  =  &igep2_led_pdata,
326         },
327 };
328
329 static void __init igep2_leds_init(void)
330 {
331         platform_device_register(&igep2_led_device);
332 }
333
334 #else
335 static inline void igep2_leds_init(void)
336 {
337         if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) &&
338             (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) {
339                 gpio_export(IGEP2_GPIO_LED0_RED, 0);
340                 gpio_set_value(IGEP2_GPIO_LED0_RED, 0);
341         } else
342                 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
343
344         if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) &&
345             (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) {
346                 gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
347                 gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);
348         } else
349                 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
350
351         if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) &&
352             (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {
353                 gpio_export(IGEP2_GPIO_LED1_RED, 0);
354                 gpio_set_value(IGEP2_GPIO_LED1_RED, 0);
355         } else
356                 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
357
358 }
359 #endif
360
361 static int igep2_twl_gpio_setup(struct device *dev,
362                 unsigned gpio, unsigned ngpio)
363 {
364         /* gpio + 0 is "mmc0_cd" (input/IRQ) */
365         mmc[0].gpio_cd = gpio + 0;
366         omap2_hsmmc_init(mmc);
367
368         /*
369          * link regulators to MMC adapters ... we "know" the
370          * regulators will be set up only *after* we return.
371          */
372         igep2_vmmc1_supply.dev = mmc[0].dev;
373
374         /*
375          * REVISIT: need ehci-omap hooks for external VBUS
376          * power switch and overcurrent detect
377          */
378         if ((gpio_request(gpio + 1, "GPIO_EHCI_NOC") < 0) ||
379             (gpio_direction_input(gpio + 1) < 0))
380                 pr_err("IGEP2: Could not obtain gpio for EHCI NOC");
381
382         /*
383          * TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN
384          * (out, active low)
385          */
386         if ((gpio_request(gpio + TWL4030_GPIO_MAX, "GPIO_USBH_CPEN") < 0) ||
387             (gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0) < 0))
388                 pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
389
390         /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
391 #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
392         if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
393             && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) {
394                 gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
395                 gpio_set_value(gpio + TWL4030_GPIO_MAX + 1, 0);
396         } else
397                 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
398 #else
399         igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
400 #endif
401
402         return 0;
403 };
404
405 static struct twl4030_gpio_platform_data igep2_twl4030_gpio_pdata = {
406         .gpio_base      = OMAP_MAX_GPIO_LINES,
407         .irq_base       = TWL4030_GPIO_IRQ_BASE,
408         .irq_end        = TWL4030_GPIO_IRQ_END,
409         .use_leds       = true,
410         .setup          = igep2_twl_gpio_setup,
411 };
412
413 static struct twl4030_usb_data igep2_usb_data = {
414         .usb_mode       = T2_USB_MODE_ULPI,
415 };
416
417 static int igep2_enable_dvi(struct omap_dss_device *dssdev)
418 {
419         gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1);
420
421         return 0;
422 }
423
424 static void igep2_disable_dvi(struct omap_dss_device *dssdev)
425 {
426         gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);
427 }
428
429 static struct omap_dss_device igep2_dvi_device = {
430         .type                   = OMAP_DISPLAY_TYPE_DPI,
431         .name                   = "dvi",
432         .driver_name            = "generic_panel",
433         .phy.dpi.data_lines     = 24,
434         .platform_enable        = igep2_enable_dvi,
435         .platform_disable       = igep2_disable_dvi,
436 };
437
438 static struct omap_dss_device *igep2_dss_devices[] = {
439         &igep2_dvi_device
440 };
441
442 static struct omap_dss_board_info igep2_dss_data = {
443         .num_devices    = ARRAY_SIZE(igep2_dss_devices),
444         .devices        = igep2_dss_devices,
445         .default_device = &igep2_dvi_device,
446 };
447
448 static struct platform_device igep2_dss_device = {
449         .name   = "omapdss",
450         .id     = -1,
451         .dev    = {
452                 .platform_data = &igep2_dss_data,
453         },
454 };
455
456 static struct regulator_consumer_supply igep2_vpll2_supply = {
457         .supply = "vdds_dsi",
458         .dev    = &igep2_dss_device.dev,
459 };
460
461 static struct regulator_init_data igep2_vpll2 = {
462         .constraints = {
463                 .name                   = "VDVI",
464                 .min_uV                 = 1800000,
465                 .max_uV                 = 1800000,
466                 .apply_uV               = true,
467                 .valid_modes_mask       = REGULATOR_MODE_NORMAL
468                                         | REGULATOR_MODE_STANDBY,
469                 .valid_ops_mask         = REGULATOR_CHANGE_MODE
470                                         | REGULATOR_CHANGE_STATUS,
471         },
472         .num_consumer_supplies  = 1,
473         .consumer_supplies      = &igep2_vpll2_supply,
474 };
475
476 static void __init igep2_display_init(void)
477 {
478         if (gpio_request(IGEP2_GPIO_DVI_PUP, "GPIO_DVI_PUP") &&
479             gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1))
480                 pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");
481 }
482
483 static struct platform_device *igep2_devices[] __initdata = {
484         &igep2_dss_device,
485 };
486
487 static void __init igep2_init_irq(void)
488 {
489         omap_board_config = igep2_config;
490         omap_board_config_size = ARRAY_SIZE(igep2_config);
491         omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
492         omap_init_irq();
493         omap_gpio_init();
494 }
495
496 static struct twl4030_codec_audio_data igep2_audio_data = {
497         .audio_mclk = 26000000,
498 };
499
500 static struct twl4030_codec_data igep2_codec_data = {
501         .audio_mclk = 26000000,
502         .audio = &igep2_audio_data,
503 };
504
505 static struct twl4030_platform_data igep2_twldata = {
506         .irq_base       = TWL4030_IRQ_BASE,
507         .irq_end        = TWL4030_IRQ_END,
508
509         /* platform_data for children goes here */
510         .usb            = &igep2_usb_data,
511         .codec          = &igep2_codec_data,
512         .gpio           = &igep2_twl4030_gpio_pdata,
513         .vmmc1          = &igep2_vmmc1,
514         .vpll2          = &igep2_vpll2,
515
516 };
517
518 static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = {
519         {
520                 I2C_BOARD_INFO("twl4030", 0x48),
521                 .flags          = I2C_CLIENT_WAKE,
522                 .irq            = INT_34XX_SYS_NIRQ,
523                 .platform_data  = &igep2_twldata,
524         },
525 };
526
527 static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
528         {
529                 I2C_BOARD_INFO("eeprom", 0x50),
530         },
531 };
532
533 static void __init igep2_i2c_init(void)
534 {
535         int ret;
536
537         ret = omap_register_i2c_bus(1, 2600, igep2_i2c1_boardinfo,
538                 ARRAY_SIZE(igep2_i2c1_boardinfo));
539         if (ret)
540                 pr_warning("IGEP2: Could not register I2C1 bus (%d)\n", ret);
541
542         /*
543          * Bus 3 is attached to the DVI port where devices like the pico DLP
544          * projector don't work reliably with 400kHz
545          */
546         ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
547                 ARRAY_SIZE(igep2_i2c3_boardinfo));
548         if (ret)
549                 pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
550 }
551
552 static struct omap_musb_board_data musb_board_data = {
553         .interface_type         = MUSB_INTERFACE_ULPI,
554         .mode                   = MUSB_OTG,
555         .power                  = 100,
556 };
557
558 static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
559         .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
560         .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
561         .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
562
563         .phy_reset = true,
564         .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
565         .reset_gpio_port[1] = -EINVAL,
566         .reset_gpio_port[2] = -EINVAL,
567 };
568
569 #ifdef CONFIG_OMAP_MUX
570 static struct omap_board_mux board_mux[] __initdata = {
571         { .reg_offset = OMAP_MUX_TERMINATOR },
572 };
573 #else
574 #define board_mux       NULL
575 #endif
576
577 #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
578
579 static void __init igep2_wlan_bt_init(void)
580 {
581         unsigned npd, wreset, btreset;
582
583         /* GPIO's for WLAN-BT combo depends on hardware revision */
584         if (hwrev == IGEP2_BOARD_HWREV_B) {
585                 npd = IGEP2_RB_GPIO_WIFI_NPD;
586                 wreset = IGEP2_RB_GPIO_WIFI_NRESET;
587                 btreset = IGEP2_RB_GPIO_BT_NRESET;
588         } else if (hwrev == IGEP2_BOARD_HWREV_C) {
589                 npd = IGEP2_RC_GPIO_WIFI_NPD;
590                 wreset = IGEP2_RC_GPIO_WIFI_NRESET;
591                 btreset = IGEP2_RC_GPIO_BT_NRESET;
592         } else
593                 return;
594
595         /* Set GPIO's for  WLAN-BT combo module */
596         if ((gpio_request(npd, "GPIO_WIFI_NPD") == 0) &&
597             (gpio_direction_output(npd, 1) == 0)) {
598                 gpio_export(npd, 0);
599         } else
600                 pr_warning("IGEP2: Could not obtain gpio GPIO_WIFI_NPD\n");
601
602         if ((gpio_request(wreset, "GPIO_WIFI_NRESET") == 0) &&
603             (gpio_direction_output(wreset, 1) == 0)) {
604                 gpio_export(wreset, 0);
605                 gpio_set_value(wreset, 0);
606                 udelay(10);
607                 gpio_set_value(wreset, 1);
608         } else
609                 pr_warning("IGEP2: Could not obtain gpio GPIO_WIFI_NRESET\n");
610
611         if ((gpio_request(btreset, "GPIO_BT_NRESET") == 0) &&
612             (gpio_direction_output(btreset, 1) == 0)) {
613                 gpio_export(btreset, 0);
614         } else
615                 pr_warning("IGEP2: Could not obtain gpio GPIO_BT_NRESET\n");
616 }
617 #else
618 static inline void __init igep2_wlan_bt_init(void) { }
619 #endif
620
621 static void __init igep2_init(void)
622 {
623         omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
624
625         /* Get IGEP2 hardware revision */
626         igep2_get_revision();
627         /* Register I2C busses and drivers */
628         igep2_i2c_init();
629         platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
630         omap_serial_init();
631         usb_musb_init(&musb_board_data);
632         usb_ehci_init(&ehci_pdata);
633
634         igep2_flash_init();
635         igep2_leds_init();
636         igep2_display_init();
637         igep2_init_smsc911x();
638
639         /*
640          * WLAN-BT combo module from MuRata wich has a Marvell WLAN
641          * (88W8686) + CSR Bluetooth chipset. Uses SDIO interface.
642          */
643         igep2_wlan_bt_init();
644
645 }
646
647 MACHINE_START(IGEP0020, "IGEP v2 board")
648         .boot_params    = 0x80000100,
649         .map_io         = omap3_map_io,
650         .reserve        = omap_reserve,
651         .init_irq       = igep2_init_irq,
652         .init_machine   = igep2_init,
653         .timer          = &omap_timer,
654 MACHINE_END