Merge branch 'kvm-updates/2.6.37' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[pandora-kernel.git] / arch / blackfin / mach-bf537 / boards / stamp.c
1 /*
2  * Copyright 2004-2009 Analog Devices Inc.
3  *                2005 National ICT Australia (NICTA)
4  *                      Aidan Williams <aidan@nicta.com.au>
5  *
6  * Licensed under the GPL-2 or later.
7  */
8
9 #include <linux/device.h>
10 #include <linux/kernel.h>
11 #include <linux/platform_device.h>
12 #include <linux/io.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/nand.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mtd/plat-ram.h>
17 #include <linux/mtd/physmap.h>
18 #include <linux/spi/spi.h>
19 #include <linux/spi/flash.h>
20 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
21 #include <linux/usb/isp1362.h>
22 #endif
23 #include <linux/i2c.h>
24 #include <linux/i2c/adp5588.h>
25 #include <linux/etherdevice.h>
26 #include <linux/ata_platform.h>
27 #include <linux/irq.h>
28 #include <linux/interrupt.h>
29 #include <linux/usb/sl811.h>
30 #include <linux/spi/mmc_spi.h>
31 #include <linux/leds.h>
32 #include <linux/input.h>
33 #include <asm/dma.h>
34 #include <asm/bfin5xx_spi.h>
35 #include <asm/reboot.h>
36 #include <asm/portmux.h>
37 #include <asm/dpmc.h>
38 #ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
39 #include <linux/regulator/fixed.h>
40 #endif
41 #include <linux/regulator/machine.h>
42 #include <linux/regulator/consumer.h>
43 #include <linux/regulator/userspace-consumer.h>
44
45 /*
46  * Name the Board for the /proc/cpuinfo
47  */
48 const char bfin_board_name[] = "ADI BF537-STAMP";
49
50 /*
51  *  Driver needs to know address, irq and flag pin.
52  */
53
54 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
55 #include <linux/usb/isp1760.h>
56 static struct resource bfin_isp1760_resources[] = {
57         [0] = {
58                 .start  = 0x203C0000,
59                 .end    = 0x203C0000 + 0x000fffff,
60                 .flags  = IORESOURCE_MEM,
61         },
62         [1] = {
63                 .start  = IRQ_PF7,
64                 .end    = IRQ_PF7,
65                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
66         },
67 };
68
69 static struct isp1760_platform_data isp1760_priv = {
70         .is_isp1761 = 0,
71         .bus_width_16 = 1,
72         .port1_otg = 0,
73         .analog_oc = 0,
74         .dack_polarity_high = 0,
75         .dreq_polarity_high = 0,
76 };
77
78 static struct platform_device bfin_isp1760_device = {
79         .name           = "isp1760",
80         .id             = 0,
81         .dev = {
82                 .platform_data = &isp1760_priv,
83         },
84         .num_resources  = ARRAY_SIZE(bfin_isp1760_resources),
85         .resource       = bfin_isp1760_resources,
86 };
87 #endif
88
89 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
90 #include <linux/gpio_keys.h>
91
92 static struct gpio_keys_button bfin_gpio_keys_table[] = {
93         {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
94         {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
95         {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
96         {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
97 };
98
99 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
100         .buttons        = bfin_gpio_keys_table,
101         .nbuttons       = ARRAY_SIZE(bfin_gpio_keys_table),
102 };
103
104 static struct platform_device bfin_device_gpiokeys = {
105         .name      = "gpio-keys",
106         .dev = {
107                 .platform_data = &bfin_gpio_keys_data,
108         },
109 };
110 #endif
111
112 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
113 static struct resource bfin_pcmcia_cf_resources[] = {
114         {
115                 .start = 0x20310000, /* IO PORT */
116                 .end = 0x20312000,
117                 .flags = IORESOURCE_MEM,
118         }, {
119                 .start = 0x20311000, /* Attribute Memory */
120                 .end = 0x20311FFF,
121                 .flags = IORESOURCE_MEM,
122         }, {
123                 .start = IRQ_PF4,
124                 .end = IRQ_PF4,
125                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
126         }, {
127                 .start = 6, /* Card Detect PF6 */
128                 .end = 6,
129                 .flags = IORESOURCE_IRQ,
130         },
131 };
132
133 static struct platform_device bfin_pcmcia_cf_device = {
134         .name = "bfin_cf_pcmcia",
135         .id = -1,
136         .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
137         .resource = bfin_pcmcia_cf_resources,
138 };
139 #endif
140
141 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
142 static struct platform_device rtc_device = {
143         .name = "rtc-bfin",
144         .id   = -1,
145 };
146 #endif
147
148 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
149 #include <linux/smc91x.h>
150
151 static struct smc91x_platdata smc91x_info = {
152         .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
153         .leda = RPC_LED_100_10,
154         .ledb = RPC_LED_TX_RX,
155 };
156
157 static struct resource smc91x_resources[] = {
158         {
159                 .name = "smc91x-regs",
160                 .start = 0x20300300,
161                 .end = 0x20300300 + 16,
162                 .flags = IORESOURCE_MEM,
163         }, {
164
165                 .start = IRQ_PF7,
166                 .end = IRQ_PF7,
167                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
168         },
169 };
170 static struct platform_device smc91x_device = {
171         .name = "smc91x",
172         .id = 0,
173         .num_resources = ARRAY_SIZE(smc91x_resources),
174         .resource = smc91x_resources,
175         .dev    = {
176                 .platform_data  = &smc91x_info,
177         },
178 };
179 #endif
180
181 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
182 static struct resource dm9000_resources[] = {
183         [0] = {
184                 .start  = 0x203FB800,
185                 .end    = 0x203FB800 + 1,
186                 .flags  = IORESOURCE_MEM,
187         },
188         [1] = {
189                 .start  = 0x203FB804,
190                 .end    = 0x203FB804 + 1,
191                 .flags  = IORESOURCE_MEM,
192         },
193         [2] = {
194                 .start  = IRQ_PF9,
195                 .end    = IRQ_PF9,
196                 .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
197         },
198 };
199
200 static struct platform_device dm9000_device = {
201         .name           = "dm9000",
202         .id             = -1,
203         .num_resources  = ARRAY_SIZE(dm9000_resources),
204         .resource       = dm9000_resources,
205 };
206 #endif
207
208 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
209 static struct resource sl811_hcd_resources[] = {
210         {
211                 .start = 0x20340000,
212                 .end = 0x20340000,
213                 .flags = IORESOURCE_MEM,
214         }, {
215                 .start = 0x20340004,
216                 .end = 0x20340004,
217                 .flags = IORESOURCE_MEM,
218         }, {
219                 .start = IRQ_PF4,
220                 .end = IRQ_PF4,
221                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
222         },
223 };
224
225 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
226 void sl811_port_power(struct device *dev, int is_on)
227 {
228         gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
229         gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
230 }
231 #endif
232
233 static struct sl811_platform_data sl811_priv = {
234         .potpg = 10,
235         .power = 250,       /* == 500mA */
236 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
237         .port_power = &sl811_port_power,
238 #endif
239 };
240
241 static struct platform_device sl811_hcd_device = {
242         .name = "sl811-hcd",
243         .id = 0,
244         .dev = {
245                 .platform_data = &sl811_priv,
246         },
247         .num_resources = ARRAY_SIZE(sl811_hcd_resources),
248         .resource = sl811_hcd_resources,
249 };
250 #endif
251
252 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
253 static struct resource isp1362_hcd_resources[] = {
254         {
255                 .start = 0x20360000,
256                 .end = 0x20360000,
257                 .flags = IORESOURCE_MEM,
258         }, {
259                 .start = 0x20360004,
260                 .end = 0x20360004,
261                 .flags = IORESOURCE_MEM,
262         }, {
263                 .start = IRQ_PF3,
264                 .end = IRQ_PF3,
265                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
266         },
267 };
268
269 static struct isp1362_platform_data isp1362_priv = {
270         .sel15Kres = 1,
271         .clknotstop = 0,
272         .oc_enable = 0,
273         .int_act_high = 0,
274         .int_edge_triggered = 0,
275         .remote_wakeup_connected = 0,
276         .no_power_switching = 1,
277         .power_switching_mode = 0,
278 };
279
280 static struct platform_device isp1362_hcd_device = {
281         .name = "isp1362-hcd",
282         .id = 0,
283         .dev = {
284                 .platform_data = &isp1362_priv,
285         },
286         .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
287         .resource = isp1362_hcd_resources,
288 };
289 #endif
290
291 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
292 unsigned short bfin_can_peripherals[] = {
293         P_CAN0_RX, P_CAN0_TX, 0
294 };
295
296 static struct resource bfin_can_resources[] = {
297         {
298                 .start = 0xFFC02A00,
299                 .end = 0xFFC02FFF,
300                 .flags = IORESOURCE_MEM,
301         },
302         {
303                 .start = IRQ_CAN_RX,
304                 .end = IRQ_CAN_RX,
305                 .flags = IORESOURCE_IRQ,
306         },
307         {
308                 .start = IRQ_CAN_TX,
309                 .end = IRQ_CAN_TX,
310                 .flags = IORESOURCE_IRQ,
311         },
312         {
313                 .start = IRQ_CAN_ERROR,
314                 .end = IRQ_CAN_ERROR,
315                 .flags = IORESOURCE_IRQ,
316         },
317 };
318
319 static struct platform_device bfin_can_device = {
320         .name = "bfin_can",
321         .num_resources = ARRAY_SIZE(bfin_can_resources),
322         .resource = bfin_can_resources,
323         .dev = {
324                 .platform_data = &bfin_can_peripherals, /* Passed to driver */
325         },
326 };
327 #endif
328
329 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
330 static struct platform_device bfin_mii_bus = {
331         .name = "bfin_mii_bus",
332 };
333
334 static struct platform_device bfin_mac_device = {
335         .name = "bfin_mac",
336         .dev.platform_data = &bfin_mii_bus,
337 };
338 #endif
339
340 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
341 static struct resource net2272_bfin_resources[] = {
342         {
343                 .start = 0x20300000,
344                 .end = 0x20300000 + 0x100,
345                 .flags = IORESOURCE_MEM,
346         }, {
347                 .start = IRQ_PF7,
348                 .end = IRQ_PF7,
349                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
350         },
351 };
352
353 static struct platform_device net2272_bfin_device = {
354         .name = "net2272",
355         .id = -1,
356         .num_resources = ARRAY_SIZE(net2272_bfin_resources),
357         .resource = net2272_bfin_resources,
358 };
359 #endif
360
361 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
362 #ifdef CONFIG_MTD_PARTITIONS
363 const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
364
365 static struct mtd_partition bfin_plat_nand_partitions[] = {
366         {
367                 .name   = "linux kernel(nand)",
368                 .size   = 0x400000,
369                 .offset = 0,
370         }, {
371                 .name   = "file system(nand)",
372                 .size   = MTDPART_SIZ_FULL,
373                 .offset = MTDPART_OFS_APPEND,
374         },
375 };
376 #endif
377
378 #define BFIN_NAND_PLAT_CLE 2
379 #define BFIN_NAND_PLAT_ALE 1
380 static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
381 {
382         struct nand_chip *this = mtd->priv;
383
384         if (cmd == NAND_CMD_NONE)
385                 return;
386
387         if (ctrl & NAND_CLE)
388                 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
389         else
390                 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
391 }
392
393 #define BFIN_NAND_PLAT_READY GPIO_PF3
394 static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
395 {
396         return gpio_get_value(BFIN_NAND_PLAT_READY);
397 }
398
399 static struct platform_nand_data bfin_plat_nand_data = {
400         .chip = {
401                 .nr_chips = 1,
402                 .chip_delay = 30,
403 #ifdef CONFIG_MTD_PARTITIONS
404                 .part_probe_types = part_probes,
405                 .partitions = bfin_plat_nand_partitions,
406                 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
407 #endif
408         },
409         .ctrl = {
410                 .cmd_ctrl  = bfin_plat_nand_cmd_ctrl,
411                 .dev_ready = bfin_plat_nand_dev_ready,
412         },
413 };
414
415 #define MAX(x, y) (x > y ? x : y)
416 static struct resource bfin_plat_nand_resources = {
417         .start = 0x20212000,
418         .end   = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
419         .flags = IORESOURCE_MEM,
420 };
421
422 static struct platform_device bfin_async_nand_device = {
423         .name = "gen_nand",
424         .id = -1,
425         .num_resources = 1,
426         .resource = &bfin_plat_nand_resources,
427         .dev = {
428                 .platform_data = &bfin_plat_nand_data,
429         },
430 };
431
432 static void bfin_plat_nand_init(void)
433 {
434         gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
435 }
436 #else
437 static void bfin_plat_nand_init(void) {}
438 #endif
439
440 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
441 static struct mtd_partition stamp_partitions[] = {
442         {
443                 .name       = "bootloader(nor)",
444                 .size       = 0x40000,
445                 .offset     = 0,
446         }, {
447                 .name       = "linux kernel(nor)",
448                 .size       = 0x180000,
449                 .offset     = MTDPART_OFS_APPEND,
450         }, {
451                 .name       = "file system(nor)",
452                 .size       = 0x400000 - 0x40000 - 0x180000 - 0x10000,
453                 .offset     = MTDPART_OFS_APPEND,
454         }, {
455                 .name       = "MAC Address(nor)",
456                 .size       = MTDPART_SIZ_FULL,
457                 .offset     = 0x3F0000,
458                 .mask_flags = MTD_WRITEABLE,
459         }
460 };
461
462 static struct physmap_flash_data stamp_flash_data = {
463         .width      = 2,
464         .parts      = stamp_partitions,
465         .nr_parts   = ARRAY_SIZE(stamp_partitions),
466 #ifdef CONFIG_ROMKERNEL
467         .probe_type = "map_rom",
468 #endif
469 };
470
471 static struct resource stamp_flash_resource = {
472         .start = 0x20000000,
473         .end   = 0x203fffff,
474         .flags = IORESOURCE_MEM,
475 };
476
477 static struct platform_device stamp_flash_device = {
478         .name          = "physmap-flash",
479         .id            = 0,
480         .dev = {
481                 .platform_data = &stamp_flash_data,
482         },
483         .num_resources = 1,
484         .resource      = &stamp_flash_resource,
485 };
486 #endif
487
488 #if defined(CONFIG_MTD_M25P80) \
489         || defined(CONFIG_MTD_M25P80_MODULE)
490 static struct mtd_partition bfin_spi_flash_partitions[] = {
491         {
492                 .name = "bootloader(spi)",
493                 .size = 0x00040000,
494                 .offset = 0,
495                 .mask_flags = MTD_CAP_ROM
496         }, {
497                 .name = "linux kernel(spi)",
498                 .size = 0x180000,
499                 .offset = MTDPART_OFS_APPEND,
500         }, {
501                 .name = "file system(spi)",
502                 .size = MTDPART_SIZ_FULL,
503                 .offset = MTDPART_OFS_APPEND,
504         }
505 };
506
507 static struct flash_platform_data bfin_spi_flash_data = {
508         .name = "m25p80",
509         .parts = bfin_spi_flash_partitions,
510         .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
511         /* .type = "m25p64", */
512 };
513
514 /* SPI flash chip (m25p64) */
515 static struct bfin5xx_spi_chip spi_flash_chip_info = {
516         .enable_dma = 0,         /* use dma transfer with this chip*/
517         .bits_per_word = 8,
518 };
519 #endif
520
521 #if defined(CONFIG_BFIN_SPI_ADC) \
522         || defined(CONFIG_BFIN_SPI_ADC_MODULE)
523 /* SPI ADC chip */
524 static struct bfin5xx_spi_chip spi_adc_chip_info = {
525         .enable_dma = 1,         /* use dma transfer with this chip*/
526         .bits_per_word = 16,
527 };
528 #endif
529
530 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
531         || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
532 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
533         .enable_dma = 0,
534         .bits_per_word = 16,
535 };
536 #endif
537
538 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
539         || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
540 static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
541         .enable_dma = 0,
542         .bits_per_word = 8,
543 };
544 #endif
545
546 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) \
547         || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
548 static struct bfin5xx_spi_chip adav801_spi_chip_info = {
549         .enable_dma = 0,
550         .bits_per_word = 8,
551 };
552 #endif
553
554 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
555 #include <linux/input/ad714x.h>
556 static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
557         .enable_dma = 0,
558         .bits_per_word = 16,
559 };
560
561 static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
562         {
563                 .start_stage = 0,
564                 .end_stage = 7,
565                 .max_coord = 128,
566         },
567 };
568
569 static struct ad714x_button_plat ad7147_spi_button_plat[] = {
570         {
571                 .keycode = BTN_FORWARD,
572                 .l_mask = 0,
573                 .h_mask = 0x600,
574         },
575         {
576                 .keycode = BTN_LEFT,
577                 .l_mask = 0,
578                 .h_mask = 0x500,
579         },
580         {
581                 .keycode = BTN_MIDDLE,
582                 .l_mask = 0,
583                 .h_mask = 0x800,
584         },
585         {
586                 .keycode = BTN_RIGHT,
587                 .l_mask = 0x100,
588                 .h_mask = 0x400,
589         },
590         {
591                 .keycode = BTN_BACK,
592                 .l_mask = 0x200,
593                 .h_mask = 0x400,
594         },
595 };
596 static struct ad714x_platform_data ad7147_spi_platform_data = {
597         .slider_num = 1,
598         .button_num = 5,
599         .slider = ad7147_spi_slider_plat,
600         .button = ad7147_spi_button_plat,
601         .stage_cfg_reg =  {
602                 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
603                 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
604                 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
605                 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
606                 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
607                 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
608                 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
609                 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
610                 {0xFF7B, 0x3FFF, 0x506,  0x2626, 1100, 1100, 1150, 1150},
611                 {0xFDFE, 0x3FFF, 0x606,  0x2626, 1100, 1100, 1150, 1150},
612                 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
613                 {0xFFEF, 0x1FFF, 0x0,    0x2626, 1100, 1100, 1150, 1150},
614         },
615         .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
616 };
617 #endif
618
619 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
620 #include <linux/input/ad714x.h>
621 static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
622         {
623                 .keycode = BTN_1,
624                 .l_mask = 0,
625                 .h_mask = 0x1,
626         },
627         {
628                 .keycode = BTN_2,
629                 .l_mask = 0,
630                 .h_mask = 0x2,
631         },
632         {
633                 .keycode = BTN_3,
634                 .l_mask = 0,
635                 .h_mask = 0x4,
636         },
637         {
638                 .keycode = BTN_4,
639                 .l_mask = 0x0,
640                 .h_mask = 0x8,
641         },
642 };
643 static struct ad714x_platform_data ad7142_i2c_platform_data = {
644         .button_num = 4,
645         .button = ad7142_i2c_button_plat,
646         .stage_cfg_reg =  {
647                 /* fixme: figure out right setting for all comoponent according
648                  * to hardware feature of EVAL-AD7142EB board */
649                 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
650                 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
651                 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
652                 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
653                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
654                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
655                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
656                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
657                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
658                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
659                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
660                 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
661         },
662         .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
663 };
664 #endif
665
666 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
667 static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
668         .enable_dma = 0,
669         .bits_per_word = 16,
670 };
671 #endif
672
673 #if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
674 unsigned short ad2s120x_platform_data[] = {
675         /* used as SAMPLE and RDVEL */
676         GPIO_PF5, GPIO_PF6, 0
677 };
678
679 static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
680         .enable_dma = 0,
681         .bits_per_word = 16,
682 };
683 #endif
684
685 #if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
686 unsigned short ad2s1210_platform_data[] = {
687         /* use as SAMPLE, A0, A1 */
688         GPIO_PF7, GPIO_PF8, GPIO_PF9,
689 # if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT)
690         /* the RES0 and RES1 pins */
691         GPIO_PF4, GPIO_PF5,
692 # endif
693         0,
694 };
695
696 static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
697         .enable_dma = 0,
698         .bits_per_word = 8,
699 };
700 #endif
701
702 #if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
703 static struct bfin5xx_spi_chip ad7314_spi_chip_info = {
704         .enable_dma = 0,
705         .bits_per_word = 16,
706 };
707 #endif
708
709 #if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
710 static unsigned short ad7816_platform_data[] = {
711         GPIO_PF4, /* rdwr_pin */
712         GPIO_PF5, /* convert_pin */
713         GPIO_PF7, /* busy_pin */
714         0,
715 };
716
717 static struct bfin5xx_spi_chip ad7816_spi_chip_info = {
718         .enable_dma = 0,
719         .bits_per_word = 8,
720 };
721 #endif
722
723 #if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
724 static unsigned long adt7310_platform_data[3] = {
725 /* INT bound temperature alarm event. line 1 */
726         IRQ_PG4, IRQF_TRIGGER_LOW,
727 /* CT bound temperature alarm event irq_flags. line 0 */
728         IRQF_TRIGGER_LOW,
729 };
730
731 static struct bfin5xx_spi_chip adt7310_spi_chip_info = {
732         .enable_dma = 0,
733         .bits_per_word = 8,
734 };
735 #endif
736
737 #if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
738 static unsigned short ad7298_platform_data[] = {
739         GPIO_PF7, /* busy_pin */
740         0,
741 };
742
743 static struct bfin5xx_spi_chip ad7298_spi_chip_info = {
744         .enable_dma = 0,
745         .bits_per_word = 16,
746 };
747 #endif
748
749 #if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
750 static unsigned long adt7316_spi_data[2] = {
751         IRQF_TRIGGER_LOW, /* interrupt flags */
752         GPIO_PF7, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
753 };
754
755 static struct bfin5xx_spi_chip adt7316_spi_chip_info = {
756         .enable_dma = 0,
757         .bits_per_word = 8,
758 };
759 #endif
760
761 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
762 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
763
764 static int bfin_mmc_spi_init(struct device *dev,
765         irqreturn_t (*detect_int)(int, void *), void *data)
766 {
767         return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
768                 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
769 }
770
771 static void bfin_mmc_spi_exit(struct device *dev, void *data)
772 {
773         free_irq(MMC_SPI_CARD_DETECT_INT, data);
774 }
775
776 static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
777         .init = bfin_mmc_spi_init,
778         .exit = bfin_mmc_spi_exit,
779         .detect_delay = 100, /* msecs */
780 };
781
782 static struct bfin5xx_spi_chip  mmc_spi_chip_info = {
783         .enable_dma = 0,
784         .bits_per_word = 8,
785         .pio_interrupt = 0,
786 };
787 #endif
788
789 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
790 #include <linux/spi/ad7877.h>
791 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
792         .enable_dma = 0,
793         .bits_per_word = 16,
794 };
795
796 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
797         .model                  = 7877,
798         .vref_delay_usecs       = 50,   /* internal, no capacitor */
799         .x_plate_ohms           = 419,
800         .y_plate_ohms           = 486,
801         .pressure_max           = 1000,
802         .pressure_min           = 0,
803         .stopacq_polarity       = 1,
804         .first_conversion_delay = 3,
805         .acquisition_time       = 1,
806         .averaging              = 1,
807         .pen_down_acc_interval  = 1,
808 };
809 #endif
810
811 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
812 #include <linux/spi/ad7879.h>
813 static const struct ad7879_platform_data bfin_ad7879_ts_info = {
814         .model                  = 7879, /* Model = AD7879 */
815         .x_plate_ohms           = 620,  /* 620 Ohm from the touch datasheet */
816         .pressure_max           = 10000,
817         .pressure_min           = 0,
818         .first_conversion_delay = 3,    /* wait 512us before do a first conversion */
819         .acquisition_time       = 1,    /* 4us acquisition time per sample */
820         .median                 = 2,    /* do 8 measurements */
821         .averaging              = 1,    /* take the average of 4 middle samples */
822         .pen_down_acc_interval  = 255,  /* 9.4 ms */
823         .gpio_export            = 1,    /* Export GPIO to gpiolib */
824         .gpio_base              = -1,   /* Dynamic allocation */
825 };
826 #endif
827
828 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
829 #include <linux/input/adxl34x.h>
830 static const struct adxl34x_platform_data adxl34x_info = {
831         .x_axis_offset = 0,
832         .y_axis_offset = 0,
833         .z_axis_offset = 0,
834         .tap_threshold = 0x31,
835         .tap_duration = 0x10,
836         .tap_latency = 0x60,
837         .tap_window = 0xF0,
838         .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
839         .act_axis_control = 0xFF,
840         .activity_threshold = 5,
841         .inactivity_threshold = 3,
842         .inactivity_time = 4,
843         .free_fall_threshold = 0x7,
844         .free_fall_time = 0x20,
845         .data_rate = 0x8,
846         .data_range = ADXL_FULL_RES,
847
848         .ev_type = EV_ABS,
849         .ev_code_x = ABS_X,             /* EV_REL */
850         .ev_code_y = ABS_Y,             /* EV_REL */
851         .ev_code_z = ABS_Z,             /* EV_REL */
852
853         .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
854
855 /*      .ev_code_ff = KEY_F,*/          /* EV_KEY */
856 /*      .ev_code_act_inactivity = KEY_A,*/      /* EV_KEY */
857         .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
858         .fifo_mode = ADXL_FIFO_STREAM,
859         .orientation_enable = ADXL_EN_ORIENTATION_3D,
860         .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
861         .divisor_length =  ADXL_LP_FILTER_DIVISOR_16,
862         /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
863         .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
864 };
865 #endif
866
867 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
868 static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
869         .enable_dma = 0,
870         .bits_per_word = 16,
871 };
872 #endif
873
874 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
875 static struct bfin5xx_spi_chip spidev_chip_info = {
876         .enable_dma = 0,
877         .bits_per_word = 8,
878 };
879 #endif
880
881 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
882 static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
883         .enable_dma     = 0,
884         .bits_per_word  = 8,
885 };
886 #endif
887
888 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
889 static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
890         .enable_dma     = 1,
891         .bits_per_word  = 8,
892 };
893 #endif
894
895 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
896 static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
897         .bits_per_word = 16,
898 };
899
900 #include <linux/spi/adf702x.h>
901 #define TXREG 0x0160A470
902 static const u32 adf7021_regs[] = {
903         0x09608FA0,
904         0x00575011,
905         0x00A7F092,
906         0x2B141563,
907         0x81F29E94,
908         0x00003155,
909         0x050A4F66,
910         0x00000007,
911         0x00000008,
912         0x000231E9,
913         0x3296354A,
914         0x891A2B3B,
915         0x00000D9C,
916         0x0000000D,
917         0x0000000E,
918         0x0000000F,
919 };
920
921 static struct adf702x_platform_data adf7021_platform_data = {
922         .regs_base = (void *)SPORT1_TCR1,
923         .dma_ch_rx = CH_SPORT1_RX,
924         .dma_ch_tx = CH_SPORT1_TX,
925         .irq_sport_err = IRQ_SPORT1_ERROR,
926         .gpio_int_rfs = GPIO_PF8,
927         .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
928                         P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
929         .adf702x_model = MODEL_ADF7021,
930         .adf702x_regs = adf7021_regs,
931         .tx_reg = TXREG,
932 };
933 static inline void adf702x_mac_init(void)
934 {
935         random_ether_addr(adf7021_platform_data.mac_addr);
936 }
937 #else
938 static inline void adf702x_mac_init(void) {}
939 #endif
940
941 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
942 #include <linux/spi/ads7846.h>
943 static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
944         .bits_per_word  = 8,
945 };
946
947 static int ads7873_get_pendown_state(void)
948 {
949         return gpio_get_value(GPIO_PF6);
950 }
951
952 static struct ads7846_platform_data __initdata ad7873_pdata = {
953         .model          = 7873,         /* AD7873 */
954         .x_max          = 0xfff,
955         .y_max          = 0xfff,
956         .x_plate_ohms   = 620,
957         .debounce_max   = 1,
958         .debounce_rep   = 0,
959         .debounce_tol   = (~0),
960         .get_pendown_state = ads7873_get_pendown_state,
961 };
962 #endif
963
964 #if defined(CONFIG_MTD_DATAFLASH) \
965         || defined(CONFIG_MTD_DATAFLASH_MODULE)
966
967 static struct mtd_partition bfin_spi_dataflash_partitions[] = {
968         {
969                 .name = "bootloader(spi)",
970                 .size = 0x00040000,
971                 .offset = 0,
972                 .mask_flags = MTD_CAP_ROM
973         }, {
974                 .name = "linux kernel(spi)",
975                 .size = 0x180000,
976                 .offset = MTDPART_OFS_APPEND,
977         }, {
978                 .name = "file system(spi)",
979                 .size = MTDPART_SIZ_FULL,
980                 .offset = MTDPART_OFS_APPEND,
981         }
982 };
983
984 static struct flash_platform_data bfin_spi_dataflash_data = {
985         .name = "SPI Dataflash",
986         .parts = bfin_spi_dataflash_partitions,
987         .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
988 };
989
990 /* DataFlash chip */
991 static struct bfin5xx_spi_chip data_flash_chip_info = {
992         .enable_dma = 0,         /* use dma transfer with this chip*/
993         .bits_per_word = 8,
994 };
995 #endif
996
997 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
998 static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
999         .enable_dma = 0,         /* use dma transfer with this chip*/
1000         .bits_per_word = 8,
1001 };
1002 #endif
1003
1004 #if defined(CONFIG_AD7476) || defined(CONFIG_AD7476_MODULE)
1005 static struct bfin5xx_spi_chip spi_ad7476_chip_info = {
1006         .enable_dma = 0,         /* use dma transfer with this chip*/
1007         .bits_per_word = 8,
1008 };
1009 #endif
1010
1011 static struct spi_board_info bfin_spi_board_info[] __initdata = {
1012 #if defined(CONFIG_MTD_M25P80) \
1013         || defined(CONFIG_MTD_M25P80_MODULE)
1014         {
1015                 /* the modalias must be the same as spi device driver name */
1016                 .modalias = "m25p80", /* Name of spi_driver for this device */
1017                 .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
1018                 .bus_num = 0, /* Framework bus number */
1019                 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
1020                 .platform_data = &bfin_spi_flash_data,
1021                 .controller_data = &spi_flash_chip_info,
1022                 .mode = SPI_MODE_3,
1023         },
1024 #endif
1025 #if defined(CONFIG_MTD_DATAFLASH) \
1026         || defined(CONFIG_MTD_DATAFLASH_MODULE)
1027         {       /* DataFlash chip */
1028                 .modalias = "mtd_dataflash",
1029                 .max_speed_hz = 33250000,     /* max spi clock (SCK) speed in HZ */
1030                 .bus_num = 0, /* Framework bus number */
1031                 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
1032                 .platform_data = &bfin_spi_dataflash_data,
1033                 .controller_data = &data_flash_chip_info,
1034                 .mode = SPI_MODE_3,
1035         },
1036 #endif
1037 #if defined(CONFIG_BFIN_SPI_ADC) \
1038         || defined(CONFIG_BFIN_SPI_ADC_MODULE)
1039         {
1040                 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
1041                 .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
1042                 .bus_num = 0, /* Framework bus number */
1043                 .chip_select = 1, /* Framework chip select. */
1044                 .platform_data = NULL, /* No spi_driver specific config */
1045                 .controller_data = &spi_adc_chip_info,
1046         },
1047 #endif
1048
1049 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1050         || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1051         {
1052                 .modalias = "ad183x",
1053                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
1054                 .bus_num = 0,
1055                 .chip_select = 4,
1056                 .platform_data = "ad1836", /* only includes chip name for the moment */
1057                 .controller_data = &ad1836_spi_chip_info,
1058                 .mode = SPI_MODE_3,
1059         },
1060 #endif
1061
1062 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
1063         {
1064                 .modalias = "ad193x",
1065                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
1066                 .bus_num = 0,
1067                 .chip_select = 5,
1068                 .controller_data = &ad1938_spi_chip_info,
1069                 .mode = SPI_MODE_3,
1070         },
1071 #endif
1072
1073 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
1074         {
1075                 .modalias = "adav80x",
1076                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
1077                 .bus_num = 0,
1078                 .chip_select = 1,
1079                 .controller_data = &adav801_spi_chip_info,
1080                 .mode = SPI_MODE_3,
1081         },
1082 #endif
1083
1084 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
1085         {
1086                 .modalias = "ad714x_captouch",
1087                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1088                 .irq = IRQ_PF4,
1089                 .bus_num = 0,
1090                 .chip_select = 5,
1091                 .mode = SPI_MODE_3,
1092                 .platform_data = &ad7147_spi_platform_data,
1093                 .controller_data = &ad7147_spi_chip_info,
1094         },
1095 #endif
1096
1097 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1098         {
1099                 .modalias = "ad2s90",
1100                 .bus_num = 0,
1101                 .chip_select = 3,            /* change it for your board */
1102                 .mode = SPI_MODE_3,
1103                 .platform_data = NULL,
1104                 .controller_data = &ad2s90_spi_chip_info,
1105         },
1106 #endif
1107
1108 #if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1109         {
1110                 .modalias = "ad2s120x",
1111                 .bus_num = 0,
1112                 .chip_select = 4,            /* CS, change it for your board */
1113                 .platform_data = ad2s120x_platform_data,
1114                 .controller_data = &ad2s120x_spi_chip_info,
1115         },
1116 #endif
1117
1118 #if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1119         {
1120                 .modalias = "ad2s1210",
1121                 .max_speed_hz = 8192000,
1122                 .bus_num = 0,
1123                 .chip_select = 4,            /* CS, change it for your board */
1124                 .platform_data = ad2s1210_platform_data,
1125                 .controller_data = &ad2s1210_spi_chip_info,
1126         },
1127 #endif
1128
1129 #if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
1130         {
1131                 .modalias = "ad7314",
1132                 .max_speed_hz = 1000000,
1133                 .bus_num = 0,
1134                 .chip_select = 4,            /* CS, change it for your board */
1135                 .controller_data = &ad7314_spi_chip_info,
1136                 .mode = SPI_MODE_1,
1137         },
1138 #endif
1139
1140 #if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
1141         {
1142                 .modalias = "ad7818",
1143                 .max_speed_hz = 1000000,
1144                 .bus_num = 0,
1145                 .chip_select = 4,            /* CS, change it for your board */
1146                 .platform_data = ad7816_platform_data,
1147                 .controller_data = &ad7816_spi_chip_info,
1148                 .mode = SPI_MODE_3,
1149         },
1150 #endif
1151
1152 #if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
1153         {
1154                 .modalias = "adt7310",
1155                 .max_speed_hz = 1000000,
1156                 .irq = IRQ_PG5,         /* CT alarm event. Line 0 */
1157                 .bus_num = 0,
1158                 .chip_select = 4,       /* CS, change it for your board */
1159                 .platform_data = adt7310_platform_data,
1160                 .controller_data = &adt7310_spi_chip_info,
1161                 .mode = SPI_MODE_3,
1162         },
1163 #endif
1164
1165 #if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
1166         {
1167                 .modalias = "ad7298",
1168                 .max_speed_hz = 1000000,
1169                 .bus_num = 0,
1170                 .chip_select = 4,            /* CS, change it for your board */
1171                 .platform_data = ad7298_platform_data,
1172                 .controller_data = &ad7298_spi_chip_info,
1173                 .mode = SPI_MODE_3,
1174         },
1175 #endif
1176
1177 #if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
1178         {
1179                 .modalias = "adt7316",
1180                 .max_speed_hz = 1000000,
1181                 .irq = IRQ_PG5,         /* interrupt line */
1182                 .bus_num = 0,
1183                 .chip_select = 4,       /* CS, change it for your board */
1184                 .platform_data = adt7316_spi_data,
1185                 .controller_data = &adt7316_spi_chip_info,
1186                 .mode = SPI_MODE_3,
1187         },
1188 #endif
1189
1190 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1191         {
1192                 .modalias = "mmc_spi",
1193                 .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
1194                 .bus_num = 0,
1195                 .chip_select = 4,
1196                 .platform_data = &bfin_mmc_spi_pdata,
1197                 .controller_data = &mmc_spi_chip_info,
1198                 .mode = SPI_MODE_3,
1199         },
1200 #endif
1201 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1202         {
1203                 .modalias               = "ad7877",
1204                 .platform_data          = &bfin_ad7877_ts_info,
1205                 .irq                    = IRQ_PF6,
1206                 .max_speed_hz   = 12500000,     /* max spi clock (SCK) speed in HZ */
1207                 .bus_num        = 0,
1208                 .chip_select  = 1,
1209                 .controller_data = &spi_ad7877_chip_info,
1210         },
1211 #endif
1212 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
1213         {
1214                 .modalias = "ad7879",
1215                 .platform_data = &bfin_ad7879_ts_info,
1216                 .irq = IRQ_PF7,
1217                 .max_speed_hz = 5000000,     /* max spi clock (SCK) speed in HZ */
1218                 .bus_num = 0,
1219                 .chip_select = 1,
1220                 .controller_data = &spi_ad7879_chip_info,
1221                 .mode = SPI_CPHA | SPI_CPOL,
1222         },
1223 #endif
1224 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1225         {
1226                 .modalias = "spidev",
1227                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
1228                 .bus_num = 0,
1229                 .chip_select = 1,
1230                 .controller_data = &spidev_chip_info,
1231         },
1232 #endif
1233 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1234         {
1235                 .modalias = "bfin-lq035q1-spi",
1236                 .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
1237                 .bus_num = 0,
1238                 .chip_select = 2,
1239                 .controller_data = &lq035q1_spi_chip_info,
1240                 .mode = SPI_CPHA | SPI_CPOL,
1241         },
1242 #endif
1243 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1244         {
1245                 .modalias = "enc28j60",
1246                 .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
1247                 .irq = IRQ_PF6,
1248                 .bus_num = 0,
1249                 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1250                 .controller_data = &enc28j60_spi_chip_info,
1251                 .mode = SPI_MODE_0,
1252         },
1253 #endif
1254 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1255         {
1256                 .modalias       = "adxl34x",
1257                 .platform_data  = &adxl34x_info,
1258                 .irq            = IRQ_PF6,
1259                 .max_speed_hz   = 5000000,    /* max spi clock (SCK) speed in HZ */
1260                 .bus_num        = 0,
1261                 .chip_select    = 2,
1262                 .controller_data = &spi_adxl34x_chip_info,
1263                 .mode = SPI_MODE_3,
1264         },
1265 #endif
1266 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1267         {
1268                 .modalias = "adf702x",
1269                 .max_speed_hz = 16000000,     /* max spi clock (SCK) speed in HZ */
1270                 .bus_num = 0,
1271                 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1272                 .controller_data = &adf7021_spi_chip_info,
1273                 .platform_data = &adf7021_platform_data,
1274                 .mode = SPI_MODE_0,
1275         },
1276 #endif
1277 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1278         {
1279                 .modalias = "ads7846",
1280                 .max_speed_hz = 2000000,     /* max spi clock (SCK) speed in HZ */
1281                 .bus_num = 0,
1282                 .irq = IRQ_PF6,
1283                 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1284                 .controller_data = &ad7873_spi_chip_info,
1285                 .platform_data = &ad7873_pdata,
1286                 .mode = SPI_MODE_0,
1287         },
1288 #endif
1289 #if defined(CONFIG_AD7476) \
1290         || defined(CONFIG_AD7476_MODULE)
1291         {
1292                 .modalias = "ad7476", /* Name of spi_driver for this device */
1293                 .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
1294                 .bus_num = 0, /* Framework bus number */
1295                 .chip_select = 1, /* Framework chip select. */
1296                 .platform_data = NULL, /* No spi_driver specific config */
1297                 .controller_data = &spi_ad7476_chip_info,
1298                 .mode = SPI_MODE_3,
1299         },
1300 #endif
1301 #if defined(CONFIG_ADE7753) \
1302         || defined(CONFIG_ADE7753_MODULE)
1303         {
1304                 .modalias = "ade7753",
1305                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1306                 .bus_num = 0,
1307                 .chip_select = 1, /* CS, change it for your board */
1308                 .platform_data = NULL, /* No spi_driver specific config */
1309                 .mode = SPI_MODE_1,
1310         },
1311 #endif
1312 #if defined(CONFIG_ADE7754) \
1313         || defined(CONFIG_ADE7754_MODULE)
1314         {
1315                 .modalias = "ade7754",
1316                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1317                 .bus_num = 0,
1318                 .chip_select = 1, /* CS, change it for your board */
1319                 .platform_data = NULL, /* No spi_driver specific config */
1320                 .mode = SPI_MODE_1,
1321         },
1322 #endif
1323 #if defined(CONFIG_ADE7758) \
1324         || defined(CONFIG_ADE7758_MODULE)
1325         {
1326                 .modalias = "ade7758",
1327                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1328                 .bus_num = 0,
1329                 .chip_select = 1, /* CS, change it for your board */
1330                 .platform_data = NULL, /* No spi_driver specific config */
1331                 .mode = SPI_MODE_1,
1332         },
1333 #endif
1334 #if defined(CONFIG_ADE7759) \
1335         || defined(CONFIG_ADE7759_MODULE)
1336         {
1337                 .modalias = "ade7759",
1338                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1339                 .bus_num = 0,
1340                 .chip_select = 1, /* CS, change it for your board */
1341                 .platform_data = NULL, /* No spi_driver specific config */
1342                 .mode = SPI_MODE_1,
1343         },
1344 #endif
1345 #if defined(CONFIG_ADE7854_SPI) \
1346         || defined(CONFIG_ADE7854_SPI_MODULE)
1347         {
1348                 .modalias = "ade7854",
1349                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1350                 .bus_num = 0,
1351                 .chip_select = 1, /* CS, change it for your board */
1352                 .platform_data = NULL, /* No spi_driver specific config */
1353                 .mode = SPI_MODE_3,
1354         },
1355 #endif
1356 #if defined(CONFIG_ADIS16060) \
1357         || defined(CONFIG_ADIS16060_MODULE)
1358         {
1359                 .modalias = "adis16060_r",
1360                 .max_speed_hz = 2900000,     /* max spi clock (SCK) speed in HZ */
1361                 .bus_num = 0,
1362                 .chip_select = MAX_CTRL_CS + 1, /* CS for read, change it for your board */
1363                 .platform_data = NULL, /* No spi_driver specific config */
1364                 .mode = SPI_MODE_0,
1365         },
1366         {
1367                 .modalias = "adis16060_w",
1368                 .max_speed_hz = 2900000,     /* max spi clock (SCK) speed in HZ */
1369                 .bus_num = 0,
1370                 .chip_select = 2, /* CS for write, change it for your board */
1371                 .platform_data = NULL, /* No spi_driver specific config */
1372                 .mode = SPI_MODE_1,
1373         },
1374 #endif
1375 #if defined(CONFIG_ADIS16130) \
1376         || defined(CONFIG_ADIS16130_MODULE)
1377         {
1378                 .modalias = "adis16130",
1379                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1380                 .bus_num = 0,
1381                 .chip_select = 1, /* CS for read, change it for your board */
1382                 .platform_data = NULL, /* No spi_driver specific config */
1383                 .mode = SPI_MODE_3,
1384         },
1385 #endif
1386 #if defined(CONFIG_ADIS16201) \
1387         || defined(CONFIG_ADIS16201_MODULE)
1388         {
1389                 .modalias = "adis16201",
1390                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1391                 .bus_num = 0,
1392                 .chip_select = 5, /* CS, change it for your board */
1393                 .platform_data = NULL, /* No spi_driver specific config */
1394                 .mode = SPI_MODE_3,
1395                 .irq = IRQ_PF4,
1396         },
1397 #endif
1398 #if defined(CONFIG_ADIS16203) \
1399         || defined(CONFIG_ADIS16203_MODULE)
1400         {
1401                 .modalias = "adis16203",
1402                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1403                 .bus_num = 0,
1404                 .chip_select = 5, /* CS, change it for your board */
1405                 .platform_data = NULL, /* No spi_driver specific config */
1406                 .mode = SPI_MODE_3,
1407                 .irq = IRQ_PF4,
1408         },
1409 #endif
1410 #if defined(CONFIG_ADIS16204) \
1411         || defined(CONFIG_ADIS16204_MODULE)
1412         {
1413                 .modalias = "adis16204",
1414                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1415                 .bus_num = 0,
1416                 .chip_select = 5, /* CS, change it for your board */
1417                 .platform_data = NULL, /* No spi_driver specific config */
1418                 .mode = SPI_MODE_3,
1419                 .irq = IRQ_PF4,
1420         },
1421 #endif
1422 #if defined(CONFIG_ADIS16209) \
1423         || defined(CONFIG_ADIS16209_MODULE)
1424         {
1425                 .modalias = "adis16209",
1426                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1427                 .bus_num = 0,
1428                 .chip_select = 5, /* CS, change it for your board */
1429                 .platform_data = NULL, /* No spi_driver specific config */
1430                 .mode = SPI_MODE_3,
1431                 .irq = IRQ_PF4,
1432         },
1433 #endif
1434 #if defined(CONFIG_ADIS16220) \
1435         || defined(CONFIG_ADIS16220_MODULE)
1436         {
1437                 .modalias = "adis16220",
1438                 .max_speed_hz = 2000000,     /* max spi clock (SCK) speed in HZ */
1439                 .bus_num = 0,
1440                 .chip_select = 5, /* CS, change it for your board */
1441                 .platform_data = NULL, /* No spi_driver specific config */
1442                 .mode = SPI_MODE_3,
1443                 .irq = IRQ_PF4,
1444         },
1445 #endif
1446 #if defined(CONFIG_ADIS16240) \
1447         || defined(CONFIG_ADIS16240_MODULE)
1448         {
1449                 .modalias = "adis16240",
1450                 .max_speed_hz = 1500000,     /* max spi clock (SCK) speed in HZ */
1451                 .bus_num = 0,
1452                 .chip_select = 5, /* CS, change it for your board */
1453                 .platform_data = NULL, /* No spi_driver specific config */
1454                 .mode = SPI_MODE_3,
1455                 .irq = IRQ_PF4,
1456         },
1457 #endif
1458 #if defined(CONFIG_ADIS16260) \
1459         || defined(CONFIG_ADIS16260_MODULE)
1460         {
1461                 .modalias = "adis16260",
1462                 .max_speed_hz = 1500000,     /* max spi clock (SCK) speed in HZ */
1463                 .bus_num = 0,
1464                 .chip_select = 5, /* CS, change it for your board */
1465                 .platform_data = NULL, /* No spi_driver specific config */
1466                 .mode = SPI_MODE_3,
1467                 .irq = IRQ_PF4,
1468         },
1469 #endif
1470 #if defined(CONFIG_ADIS16261) \
1471         || defined(CONFIG_ADIS16261_MODULE)
1472         {
1473                 .modalias = "adis16261",
1474                 .max_speed_hz = 2500000,     /* max spi clock (SCK) speed in HZ */
1475                 .bus_num = 0,
1476                 .chip_select = 1, /* CS, change it for your board */
1477                 .platform_data = NULL, /* No spi_driver specific config */
1478                 .mode = SPI_MODE_3,
1479         },
1480 #endif
1481 #if defined(CONFIG_ADIS16300) \
1482         || defined(CONFIG_ADIS16300_MODULE)
1483         {
1484                 .modalias = "adis16300",
1485                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1486                 .bus_num = 0,
1487                 .chip_select = 5, /* CS, change it for your board */
1488                 .platform_data = NULL, /* No spi_driver specific config */
1489                 .mode = SPI_MODE_3,
1490                 .irq = IRQ_PF4,
1491         },
1492 #endif
1493 #if defined(CONFIG_ADIS16350) \
1494         || defined(CONFIG_ADIS16350_MODULE)
1495         {
1496                 .modalias = "adis16364",
1497                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1498                 .bus_num = 0,
1499                 .chip_select = 5, /* CS, change it for your board */
1500                 .platform_data = NULL, /* No spi_driver specific config */
1501                 .mode = SPI_MODE_3,
1502                 .irq = IRQ_PF4,
1503         },
1504 #endif
1505 #if defined(CONFIG_ADIS16400) \
1506         || defined(CONFIG_ADIS16400_MODULE)
1507         {
1508                 .modalias = "adis16400",
1509                 .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
1510                 .bus_num = 0,
1511                 .chip_select = 1, /* CS, change it for your board */
1512                 .platform_data = NULL, /* No spi_driver specific config */
1513                 .mode = SPI_MODE_3,
1514         },
1515 #endif
1516 };
1517
1518 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1519 /* SPI controller data */
1520 static struct bfin5xx_spi_master bfin_spi0_info = {
1521         .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
1522         .enable_dma = 1,  /* master has the ability to do dma transfer */
1523         .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
1524 };
1525
1526 /* SPI (0) */
1527 static struct resource bfin_spi0_resource[] = {
1528         [0] = {
1529                 .start = SPI0_REGBASE,
1530                 .end   = SPI0_REGBASE + 0xFF,
1531                 .flags = IORESOURCE_MEM,
1532                 },
1533         [1] = {
1534                 .start = CH_SPI,
1535                 .end   = CH_SPI,
1536                 .flags = IORESOURCE_DMA,
1537         },
1538         [2] = {
1539                 .start = IRQ_SPI,
1540                 .end   = IRQ_SPI,
1541                 .flags = IORESOURCE_IRQ,
1542         },
1543 };
1544
1545 static struct platform_device bfin_spi0_device = {
1546         .name = "bfin-spi",
1547         .id = 0, /* Bus number */
1548         .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1549         .resource = bfin_spi0_resource,
1550         .dev = {
1551                 .platform_data = &bfin_spi0_info, /* Passed to driver */
1552         },
1553 };
1554 #endif  /* spi master and devices */
1555
1556 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1557
1558 /* SPORT SPI controller data */
1559 static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1560         .num_chipselect = 1, /* master only supports one device */
1561         .enable_dma = 0,  /* master don't support DMA */
1562         .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1563                 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1564 };
1565
1566 static struct resource bfin_sport_spi0_resource[] = {
1567         [0] = {
1568                 .start = SPORT0_TCR1,
1569                 .end   = SPORT0_TCR1 + 0xFF,
1570                 .flags = IORESOURCE_MEM,
1571                 },
1572         [1] = {
1573                 .start = IRQ_SPORT0_ERROR,
1574                 .end   = IRQ_SPORT0_ERROR,
1575                 .flags = IORESOURCE_IRQ,
1576                 },
1577 };
1578
1579 static struct platform_device bfin_sport_spi0_device = {
1580         .name = "bfin-sport-spi",
1581         .id = 1, /* Bus number */
1582         .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1583         .resource = bfin_sport_spi0_resource,
1584         .dev = {
1585                 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1586         },
1587 };
1588
1589 static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1590         .num_chipselect = 1, /* master only supports one device */
1591         .enable_dma = 0,  /* master don't support DMA */
1592         .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1593                 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1594 };
1595
1596 static struct resource bfin_sport_spi1_resource[] = {
1597         [0] = {
1598                 .start = SPORT1_TCR1,
1599                 .end   = SPORT1_TCR1 + 0xFF,
1600                 .flags = IORESOURCE_MEM,
1601                 },
1602         [1] = {
1603                 .start = IRQ_SPORT1_ERROR,
1604                 .end   = IRQ_SPORT1_ERROR,
1605                 .flags = IORESOURCE_IRQ,
1606                 },
1607 };
1608
1609 static struct platform_device bfin_sport_spi1_device = {
1610         .name = "bfin-sport-spi",
1611         .id = 2, /* Bus number */
1612         .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1613         .resource = bfin_sport_spi1_resource,
1614         .dev = {
1615                 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1616         },
1617 };
1618
1619 #endif  /* sport spi master and devices */
1620
1621 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1622 static struct platform_device bfin_fb_device = {
1623         .name = "bf537-lq035",
1624 };
1625 #endif
1626
1627 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1628 #include <asm/bfin-lq035q1.h>
1629
1630 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
1631         .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1632         .ppi_mode = USE_RGB565_16_BIT_PPI,
1633         .use_bl = 0,    /* let something else control the LCD Blacklight */
1634         .gpio_bl = GPIO_PF7,
1635 };
1636
1637 static struct resource bfin_lq035q1_resources[] = {
1638         {
1639                 .start = IRQ_PPI_ERROR,
1640                 .end = IRQ_PPI_ERROR,
1641                 .flags = IORESOURCE_IRQ,
1642         },
1643 };
1644
1645 static struct platform_device bfin_lq035q1_device = {
1646         .name           = "bfin-lq035q1",
1647         .id             = -1,
1648         .num_resources  = ARRAY_SIZE(bfin_lq035q1_resources),
1649         .resource       = bfin_lq035q1_resources,
1650         .dev            = {
1651                 .platform_data = &bfin_lq035q1_data,
1652         },
1653 };
1654 #endif
1655
1656 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1657 #ifdef CONFIG_SERIAL_BFIN_UART0
1658 static struct resource bfin_uart0_resources[] = {
1659         {
1660                 .start = UART0_THR,
1661                 .end = UART0_GCTL+2,
1662                 .flags = IORESOURCE_MEM,
1663         },
1664         {
1665                 .start = IRQ_UART0_RX,
1666                 .end = IRQ_UART0_RX+1,
1667                 .flags = IORESOURCE_IRQ,
1668         },
1669         {
1670                 .start = IRQ_UART0_ERROR,
1671                 .end = IRQ_UART0_ERROR,
1672                 .flags = IORESOURCE_IRQ,
1673         },
1674         {
1675                 .start = CH_UART0_TX,
1676                 .end = CH_UART0_TX,
1677                 .flags = IORESOURCE_DMA,
1678         },
1679         {
1680                 .start = CH_UART0_RX,
1681                 .end = CH_UART0_RX,
1682                 .flags = IORESOURCE_DMA,
1683         },
1684 #ifdef CONFIG_BFIN_UART0_CTSRTS
1685         {       /* CTS pin */
1686                 .start = GPIO_PG7,
1687                 .end = GPIO_PG7,
1688                 .flags = IORESOURCE_IO,
1689         },
1690         {       /* RTS pin */
1691                 .start = GPIO_PG6,
1692                 .end = GPIO_PG6,
1693                 .flags = IORESOURCE_IO,
1694         },
1695 #endif
1696 };
1697
1698 unsigned short bfin_uart0_peripherals[] = {
1699         P_UART0_TX, P_UART0_RX, 0
1700 };
1701
1702 static struct platform_device bfin_uart0_device = {
1703         .name = "bfin-uart",
1704         .id = 0,
1705         .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1706         .resource = bfin_uart0_resources,
1707         .dev = {
1708                 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1709         },
1710 };
1711 #endif
1712 #ifdef CONFIG_SERIAL_BFIN_UART1
1713 static struct resource bfin_uart1_resources[] = {
1714         {
1715                 .start = UART1_THR,
1716                 .end = UART1_GCTL+2,
1717                 .flags = IORESOURCE_MEM,
1718         },
1719         {
1720                 .start = IRQ_UART1_RX,
1721                 .end = IRQ_UART1_RX+1,
1722                 .flags = IORESOURCE_IRQ,
1723         },
1724         {
1725                 .start = IRQ_UART1_ERROR,
1726                 .end = IRQ_UART1_ERROR,
1727                 .flags = IORESOURCE_IRQ,
1728         },
1729         {
1730                 .start = CH_UART1_TX,
1731                 .end = CH_UART1_TX,
1732                 .flags = IORESOURCE_DMA,
1733         },
1734         {
1735                 .start = CH_UART1_RX,
1736                 .end = CH_UART1_RX,
1737                 .flags = IORESOURCE_DMA,
1738         },
1739 };
1740
1741 unsigned short bfin_uart1_peripherals[] = {
1742         P_UART1_TX, P_UART1_RX, 0
1743 };
1744
1745 static struct platform_device bfin_uart1_device = {
1746         .name = "bfin-uart",
1747         .id = 1,
1748         .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1749         .resource = bfin_uart1_resources,
1750         .dev = {
1751                 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1752         },
1753 };
1754 #endif
1755 #endif
1756
1757 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1758 #ifdef CONFIG_BFIN_SIR0
1759 static struct resource bfin_sir0_resources[] = {
1760         {
1761                 .start = 0xFFC00400,
1762                 .end = 0xFFC004FF,
1763                 .flags = IORESOURCE_MEM,
1764         },
1765         {
1766                 .start = IRQ_UART0_RX,
1767                 .end = IRQ_UART0_RX+1,
1768                 .flags = IORESOURCE_IRQ,
1769         },
1770         {
1771                 .start = CH_UART0_RX,
1772                 .end = CH_UART0_RX+1,
1773                 .flags = IORESOURCE_DMA,
1774         },
1775 };
1776
1777 static struct platform_device bfin_sir0_device = {
1778         .name = "bfin_sir",
1779         .id = 0,
1780         .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1781         .resource = bfin_sir0_resources,
1782 };
1783 #endif
1784 #ifdef CONFIG_BFIN_SIR1
1785 static struct resource bfin_sir1_resources[] = {
1786         {
1787                 .start = 0xFFC02000,
1788                 .end = 0xFFC020FF,
1789                 .flags = IORESOURCE_MEM,
1790         },
1791         {
1792                 .start = IRQ_UART1_RX,
1793                 .end = IRQ_UART1_RX+1,
1794                 .flags = IORESOURCE_IRQ,
1795         },
1796         {
1797                 .start = CH_UART1_RX,
1798                 .end = CH_UART1_RX+1,
1799                 .flags = IORESOURCE_DMA,
1800         },
1801 };
1802
1803 static struct platform_device bfin_sir1_device = {
1804         .name = "bfin_sir",
1805         .id = 1,
1806         .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1807         .resource = bfin_sir1_resources,
1808 };
1809 #endif
1810 #endif
1811
1812 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1813 static struct resource bfin_twi0_resource[] = {
1814         [0] = {
1815                 .start = TWI0_REGBASE,
1816                 .end   = TWI0_REGBASE,
1817                 .flags = IORESOURCE_MEM,
1818         },
1819         [1] = {
1820                 .start = IRQ_TWI,
1821                 .end   = IRQ_TWI,
1822                 .flags = IORESOURCE_IRQ,
1823         },
1824 };
1825
1826 static struct platform_device i2c_bfin_twi_device = {
1827         .name = "i2c-bfin-twi",
1828         .id = 0,
1829         .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1830         .resource = bfin_twi0_resource,
1831 };
1832 #endif
1833
1834 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1835 static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1836         [0]      = KEY_GRAVE,
1837         [1]      = KEY_1,
1838         [2]      = KEY_2,
1839         [3]      = KEY_3,
1840         [4]      = KEY_4,
1841         [5]      = KEY_5,
1842         [6]      = KEY_6,
1843         [7]      = KEY_7,
1844         [8]      = KEY_8,
1845         [9]      = KEY_9,
1846         [10]     = KEY_0,
1847         [11]     = KEY_MINUS,
1848         [12]     = KEY_EQUAL,
1849         [13]     = KEY_BACKSLASH,
1850         [15]     = KEY_KP0,
1851         [16]     = KEY_Q,
1852         [17]     = KEY_W,
1853         [18]     = KEY_E,
1854         [19]     = KEY_R,
1855         [20]     = KEY_T,
1856         [21]     = KEY_Y,
1857         [22]     = KEY_U,
1858         [23]     = KEY_I,
1859         [24]     = KEY_O,
1860         [25]     = KEY_P,
1861         [26]     = KEY_LEFTBRACE,
1862         [27]     = KEY_RIGHTBRACE,
1863         [29]     = KEY_KP1,
1864         [30]     = KEY_KP2,
1865         [31]     = KEY_KP3,
1866         [32]     = KEY_A,
1867         [33]     = KEY_S,
1868         [34]     = KEY_D,
1869         [35]     = KEY_F,
1870         [36]     = KEY_G,
1871         [37]     = KEY_H,
1872         [38]     = KEY_J,
1873         [39]     = KEY_K,
1874         [40]     = KEY_L,
1875         [41]     = KEY_SEMICOLON,
1876         [42]     = KEY_APOSTROPHE,
1877         [43]     = KEY_BACKSLASH,
1878         [45]     = KEY_KP4,
1879         [46]     = KEY_KP5,
1880         [47]     = KEY_KP6,
1881         [48]     = KEY_102ND,
1882         [49]     = KEY_Z,
1883         [50]     = KEY_X,
1884         [51]     = KEY_C,
1885         [52]     = KEY_V,
1886         [53]     = KEY_B,
1887         [54]     = KEY_N,
1888         [55]     = KEY_M,
1889         [56]     = KEY_COMMA,
1890         [57]     = KEY_DOT,
1891         [58]     = KEY_SLASH,
1892         [60]     = KEY_KPDOT,
1893         [61]     = KEY_KP7,
1894         [62]     = KEY_KP8,
1895         [63]     = KEY_KP9,
1896         [64]     = KEY_SPACE,
1897         [65]     = KEY_BACKSPACE,
1898         [66]     = KEY_TAB,
1899         [67]     = KEY_KPENTER,
1900         [68]     = KEY_ENTER,
1901         [69]     = KEY_ESC,
1902         [70]     = KEY_DELETE,
1903         [74]     = KEY_KPMINUS,
1904         [76]     = KEY_UP,
1905         [77]     = KEY_DOWN,
1906         [78]     = KEY_RIGHT,
1907         [79]     = KEY_LEFT,
1908 };
1909
1910 static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1911         .rows           = 8,
1912         .cols           = 10,
1913         .keymap         = adp5588_keymap,
1914         .keymapsize     = ARRAY_SIZE(adp5588_keymap),
1915         .repeat         = 0,
1916 };
1917 #endif
1918
1919 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1920 #include <linux/mfd/adp5520.h>
1921
1922         /*
1923          *  ADP5520/5501 Backlight Data
1924          */
1925
1926 static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1927         .fade_in                = ADP5520_FADE_T_1200ms,
1928         .fade_out               = ADP5520_FADE_T_1200ms,
1929         .fade_led_law           = ADP5520_BL_LAW_LINEAR,
1930         .en_ambl_sens           = 1,
1931         .abml_filt              = ADP5520_BL_AMBL_FILT_640ms,
1932         .l1_daylight_max        = ADP5520_BL_CUR_mA(15),
1933         .l1_daylight_dim        = ADP5520_BL_CUR_mA(0),
1934         .l2_office_max          = ADP5520_BL_CUR_mA(7),
1935         .l2_office_dim          = ADP5520_BL_CUR_mA(0),
1936         .l3_dark_max            = ADP5520_BL_CUR_mA(3),
1937         .l3_dark_dim            = ADP5520_BL_CUR_mA(0),
1938         .l2_trip                = ADP5520_L2_COMP_CURR_uA(700),
1939         .l2_hyst                = ADP5520_L2_COMP_CURR_uA(50),
1940         .l3_trip                = ADP5520_L3_COMP_CURR_uA(80),
1941         .l3_hyst                = ADP5520_L3_COMP_CURR_uA(20),
1942 };
1943
1944         /*
1945          *  ADP5520/5501 LEDs Data
1946          */
1947
1948 static struct led_info adp5520_leds[] = {
1949         {
1950                 .name = "adp5520-led1",
1951                 .default_trigger = "none",
1952                 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
1953         },
1954 #ifdef ADP5520_EN_ALL_LEDS
1955         {
1956                 .name = "adp5520-led2",
1957                 .default_trigger = "none",
1958                 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1959         },
1960         {
1961                 .name = "adp5520-led3",
1962                 .default_trigger = "none",
1963                 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1964         },
1965 #endif
1966 };
1967
1968 static struct adp5520_leds_platform_data adp5520_leds_data = {
1969         .num_leds = ARRAY_SIZE(adp5520_leds),
1970         .leds = adp5520_leds,
1971         .fade_in = ADP5520_FADE_T_600ms,
1972         .fade_out = ADP5520_FADE_T_600ms,
1973         .led_on_time = ADP5520_LED_ONT_600ms,
1974 };
1975
1976         /*
1977          *  ADP5520 GPIO Data
1978          */
1979
1980 static struct adp5520_gpio_platform_data adp5520_gpio_data = {
1981         .gpio_start = 50,
1982         .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1983         .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1984 };
1985
1986         /*
1987          *  ADP5520 Keypad Data
1988          */
1989
1990 static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
1991         [ADP5520_KEY(0, 0)]     = KEY_GRAVE,
1992         [ADP5520_KEY(0, 1)]     = KEY_1,
1993         [ADP5520_KEY(0, 2)]     = KEY_2,
1994         [ADP5520_KEY(0, 3)]     = KEY_3,
1995         [ADP5520_KEY(1, 0)]     = KEY_4,
1996         [ADP5520_KEY(1, 1)]     = KEY_5,
1997         [ADP5520_KEY(1, 2)]     = KEY_6,
1998         [ADP5520_KEY(1, 3)]     = KEY_7,
1999         [ADP5520_KEY(2, 0)]     = KEY_8,
2000         [ADP5520_KEY(2, 1)]     = KEY_9,
2001         [ADP5520_KEY(2, 2)]     = KEY_0,
2002         [ADP5520_KEY(2, 3)]     = KEY_MINUS,
2003         [ADP5520_KEY(3, 0)]     = KEY_EQUAL,
2004         [ADP5520_KEY(3, 1)]     = KEY_BACKSLASH,
2005         [ADP5520_KEY(3, 2)]     = KEY_BACKSPACE,
2006         [ADP5520_KEY(3, 3)]     = KEY_ENTER,
2007 };
2008
2009 static struct adp5520_keys_platform_data adp5520_keys_data = {
2010         .rows_en_mask   = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
2011         .cols_en_mask   = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
2012         .keymap         = adp5520_keymap,
2013         .keymapsize     = ARRAY_SIZE(adp5520_keymap),
2014         .repeat         = 0,
2015 };
2016
2017         /*
2018          *  ADP5520/5501 Multifuction Device Init Data
2019          */
2020
2021 static struct adp5520_platform_data adp5520_pdev_data = {
2022         .backlight = &adp5520_backlight_data,
2023         .leds = &adp5520_leds_data,
2024         .gpio = &adp5520_gpio_data,
2025         .keys = &adp5520_keys_data,
2026 };
2027
2028 #endif
2029
2030 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2031 static struct adp5588_gpio_platform_data adp5588_gpio_data = {
2032         .gpio_start = 50,
2033         .pullup_dis_mask = 0,
2034 };
2035 #endif
2036
2037 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2038 #include <linux/i2c/adp8870.h>
2039 static struct led_info adp8870_leds[] = {
2040         {
2041                 .name = "adp8870-led7",
2042                 .default_trigger = "none",
2043                 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
2044         },
2045 };
2046
2047
2048 static struct adp8870_backlight_platform_data adp8870_pdata = {
2049         .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
2050                          ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
2051         .pwm_assign = 0,                                /* 1 = Enables PWM mode */
2052
2053         .bl_fade_in = ADP8870_FADE_T_1200ms,            /* Backlight Fade-In Timer */
2054         .bl_fade_out = ADP8870_FADE_T_1200ms,           /* Backlight Fade-Out Timer */
2055         .bl_fade_law = ADP8870_FADE_LAW_CUBIC1,         /* fade-on/fade-off transfer characteristic */
2056
2057         .en_ambl_sens = 1,                              /* 1 = enable ambient light sensor */
2058         .abml_filt = ADP8870_BL_AMBL_FILT_320ms,        /* Light sensor filter time */
2059
2060         .l1_daylight_max = ADP8870_BL_CUR_mA(20),       /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2061         .l1_daylight_dim = ADP8870_BL_CUR_mA(0),        /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2062         .l2_bright_max = ADP8870_BL_CUR_mA(14),         /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2063         .l2_bright_dim = ADP8870_BL_CUR_mA(0),          /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2064         .l3_office_max = ADP8870_BL_CUR_mA(6),          /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2065         .l3_office_dim = ADP8870_BL_CUR_mA(0),          /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2066         .l4_indoor_max = ADP8870_BL_CUR_mA(3),          /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2067         .l4_indor_dim = ADP8870_BL_CUR_mA(0),           /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2068         .l5_dark_max = ADP8870_BL_CUR_mA(2),            /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2069         .l5_dark_dim = ADP8870_BL_CUR_mA(0),            /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2070
2071         .l2_trip = ADP8870_L2_COMP_CURR_uA(710),        /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2072         .l2_hyst = ADP8870_L2_COMP_CURR_uA(73),         /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2073         .l3_trip = ADP8870_L3_COMP_CURR_uA(389),        /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2074         .l3_hyst = ADP8870_L3_COMP_CURR_uA(54),         /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2075         .l4_trip = ADP8870_L4_COMP_CURR_uA(167),        /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2076         .l4_hyst = ADP8870_L4_COMP_CURR_uA(16),         /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2077         .l5_trip = ADP8870_L5_COMP_CURR_uA(43),         /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2078         .l5_hyst = ADP8870_L5_COMP_CURR_uA(11),         /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2079
2080         .leds = adp8870_leds,
2081         .num_leds = ARRAY_SIZE(adp8870_leds),
2082         .led_fade_law = ADP8870_FADE_LAW_SQUARE,        /* fade-on/fade-off transfer characteristic */
2083         .led_fade_in = ADP8870_FADE_T_600ms,
2084         .led_fade_out = ADP8870_FADE_T_600ms,
2085         .led_on_time = ADP8870_LED_ONT_200ms,
2086 };
2087 #endif
2088
2089 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2090 #include <linux/i2c/adp8860.h>
2091 static struct led_info adp8860_leds[] = {
2092         {
2093                 .name = "adp8860-led7",
2094                 .default_trigger = "none",
2095                 .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
2096         },
2097 };
2098
2099 static struct adp8860_backlight_platform_data adp8860_pdata = {
2100         .bl_led_assign = ADP8860_BL_D1 | ADP8860_BL_D2 | ADP8860_BL_D3 |
2101                          ADP8860_BL_D4 | ADP8860_BL_D5 | ADP8860_BL_D6, /* 1 = Backlight 0 = Individual LED */
2102
2103         .bl_fade_in = ADP8860_FADE_T_1200ms,            /* Backlight Fade-In Timer */
2104         .bl_fade_out = ADP8860_FADE_T_1200ms,           /* Backlight Fade-Out Timer */
2105         .bl_fade_law = ADP8860_FADE_LAW_CUBIC1,         /* fade-on/fade-off transfer characteristic */
2106
2107         .en_ambl_sens = 1,                              /* 1 = enable ambient light sensor */
2108         .abml_filt = ADP8860_BL_AMBL_FILT_320ms,        /* Light sensor filter time */
2109
2110         .l1_daylight_max = ADP8860_BL_CUR_mA(20),       /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2111         .l1_daylight_dim = ADP8860_BL_CUR_mA(0),        /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2112         .l2_office_max = ADP8860_BL_CUR_mA(6),          /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2113         .l2_office_dim = ADP8860_BL_CUR_mA(0),          /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2114         .l3_dark_max = ADP8860_BL_CUR_mA(2),            /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2115         .l3_dark_dim = ADP8860_BL_CUR_mA(0),            /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2116
2117         .l2_trip = ADP8860_L2_COMP_CURR_uA(710),        /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2118         .l2_hyst = ADP8860_L2_COMP_CURR_uA(73),         /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2119         .l3_trip = ADP8860_L3_COMP_CURR_uA(43),         /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2120         .l3_hyst = ADP8860_L3_COMP_CURR_uA(11),         /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2121
2122         .leds = adp8860_leds,
2123         .num_leds = ARRAY_SIZE(adp8860_leds),
2124         .led_fade_law = ADP8860_FADE_LAW_SQUARE,        /* fade-on/fade-off transfer characteristic */
2125         .led_fade_in = ADP8860_FADE_T_600ms,
2126         .led_fade_out = ADP8860_FADE_T_600ms,
2127         .led_on_time = ADP8860_LED_ONT_200ms,
2128 };
2129 #endif
2130
2131 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2132 static struct regulator_consumer_supply ad5398_consumer = {
2133         .supply = "current",
2134 };
2135
2136 static struct regulator_init_data ad5398_regulator_data = {
2137         .constraints = {
2138                 .name = "current range",
2139                 .max_uA = 120000,
2140                 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
2141         },
2142         .num_consumer_supplies = 1,
2143         .consumer_supplies     = &ad5398_consumer,
2144 };
2145
2146 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2147         defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2148 static struct platform_device ad5398_virt_consumer_device = {
2149         .name = "reg-virt-consumer",
2150         .id = 0,
2151         .dev = {
2152                 .platform_data = "current", /* Passed to driver */
2153         },
2154 };
2155 #endif
2156 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2157         defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2158 static struct regulator_bulk_data ad5398_bulk_data = {
2159         .supply = "current",
2160 };
2161
2162 static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
2163         .name = "ad5398",
2164         .num_supplies = 1,
2165         .supplies = &ad5398_bulk_data,
2166 };
2167
2168 static struct platform_device ad5398_userspace_consumer_device = {
2169         .name = "reg-userspace-consumer",
2170         .id = 0,
2171         .dev = {
2172                 .platform_data = &ad5398_userspace_comsumer_data,
2173         },
2174 };
2175 #endif
2176 #endif
2177
2178 #if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2179 /* INT bound temperature alarm event. line 1 */
2180 static unsigned long adt7410_platform_data[2] = {
2181         IRQ_PG4, IRQF_TRIGGER_LOW,
2182 };
2183 #endif
2184
2185 #if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2186 /* INT bound temperature alarm event. line 1 */
2187 static unsigned long adt7316_i2c_data[2] = {
2188         IRQF_TRIGGER_LOW, /* interrupt flags */
2189         GPIO_PF4, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
2190 };
2191 #endif
2192
2193 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
2194 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
2195         {
2196                 I2C_BOARD_INFO("ad1937", 0x04),
2197         },
2198 #endif
2199
2200 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
2201         {
2202                 I2C_BOARD_INFO("adav803", 0x10),
2203         },
2204 #endif
2205
2206 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
2207         {
2208                 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
2209                 .irq = IRQ_PG5,
2210                 .platform_data = (void *)&ad7142_i2c_platform_data,
2211         },
2212 #endif
2213
2214 #if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
2215         {
2216                 I2C_BOARD_INFO("ad7150", 0x48),
2217                 .irq = IRQ_PG5, /* fixme: use real interrupt number */
2218         },
2219 #endif
2220
2221 #if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
2222         {
2223                 I2C_BOARD_INFO("ad7152", 0x48),
2224         },
2225 #endif
2226
2227 #if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
2228         {
2229                 I2C_BOARD_INFO("ad774x", 0x48),
2230         },
2231 #endif
2232
2233 #if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
2234         {
2235                 I2C_BOARD_INFO("ad7414", 0x9),
2236                 .irq = IRQ_PG5,
2237                 .irq_flags = IRQF_TRIGGER_LOW,
2238         },
2239 #endif
2240
2241 #if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
2242         {
2243                 I2C_BOARD_INFO("ad7417", 0xb),
2244                 .irq = IRQ_PG5,
2245                 .irq_flags = IRQF_TRIGGER_LOW,
2246                 .platform_data = (void *)GPIO_PF4,
2247         },
2248 #endif
2249
2250 #if defined(CONFIG_ADE7854_I2C) || defined(CONFIG_ADE7854_I2C_MODULE)
2251         {
2252                 I2C_BOARD_INFO("ade7854", 0x38),
2253         },
2254 #endif
2255
2256 #if defined(CONFIG_ADT75) || defined(CONFIG_ADT75_MODULE)
2257         {
2258                 I2C_BOARD_INFO("adt75", 0x9),
2259                 .irq = IRQ_PG5,
2260                 .irq_flags = IRQF_TRIGGER_LOW,
2261         },
2262 #endif
2263
2264 #if defined(CONFIG_ADT7408) || defined(CONFIG_ADT7408_MODULE)
2265         {
2266                 I2C_BOARD_INFO("adt7408", 0x18),
2267                 .irq = IRQ_PG5,
2268                 .irq_flags = IRQF_TRIGGER_LOW,
2269         },
2270 #endif
2271
2272 #if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2273         {
2274                 I2C_BOARD_INFO("adt7410", 0x48),
2275                 /* CT critical temperature event. line 0 */
2276                 .irq = IRQ_PG5,
2277                 .irq_flags = IRQF_TRIGGER_LOW,
2278                 .platform_data = (void *)&adt7410_platform_data,
2279         },
2280 #endif
2281
2282 #if defined(CONFIG_AD7291) || defined(CONFIG_AD7291_MODULE)
2283         {
2284                 I2C_BOARD_INFO("ad7291", 0x20),
2285                 .irq = IRQ_PG5,
2286                 .irq_flags = IRQF_TRIGGER_LOW,
2287         },
2288 #endif
2289
2290 #if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2291         {
2292                 I2C_BOARD_INFO("adt7316", 0x48),
2293                 .irq = IRQ_PG6,
2294                 .platform_data = (void *)&adt7316_i2c_data,
2295         },
2296 #endif
2297
2298 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
2299         {
2300                 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
2301         },
2302 #endif
2303 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
2304         {
2305                 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
2306                 .irq = IRQ_PG6,
2307         },
2308 #endif
2309 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
2310         {
2311                 I2C_BOARD_INFO("ad7879", 0x2F),
2312                 .irq = IRQ_PG5,
2313                 .platform_data = (void *)&bfin_ad7879_ts_info,
2314         },
2315 #endif
2316 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
2317         {
2318                 I2C_BOARD_INFO("adp5588-keys", 0x34),
2319                 .irq = IRQ_PG0,
2320                 .platform_data = (void *)&adp5588_kpad_data,
2321         },
2322 #endif
2323 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
2324         {
2325                 I2C_BOARD_INFO("pmic-adp5520", 0x32),
2326                 .irq = IRQ_PG0,
2327                 .platform_data = (void *)&adp5520_pdev_data,
2328         },
2329 #endif
2330 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
2331         {
2332                 I2C_BOARD_INFO("adxl34x", 0x53),
2333                 .irq = IRQ_PG3,
2334                 .platform_data = (void *)&adxl34x_info,
2335         },
2336 #endif
2337 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2338         {
2339                 I2C_BOARD_INFO("adp5588-gpio", 0x34),
2340                 .platform_data = (void *)&adp5588_gpio_data,
2341         },
2342 #endif
2343 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
2344         {
2345                 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
2346         },
2347 #endif
2348 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2349         {
2350                 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2F),
2351         },
2352 #endif
2353 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2354         {
2355                 I2C_BOARD_INFO("adp8870", 0x2B),
2356                 .platform_data = (void *)&adp8870_pdata,
2357         },
2358 #endif
2359 #if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
2360         {
2361                 I2C_BOARD_INFO("adau1371", 0x1A),
2362         },
2363 #endif
2364 #if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
2365         {
2366                 I2C_BOARD_INFO("adau1761", 0x38),
2367         },
2368 #endif
2369 #if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
2370         {
2371                 I2C_BOARD_INFO("adau1361", 0x38),
2372         },
2373 #endif
2374 #if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
2375         {
2376                 I2C_BOARD_INFO("ad5258", 0x18),
2377         },
2378 #endif
2379 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
2380         {
2381                 I2C_BOARD_INFO("ssm2602", 0x1b),
2382         },
2383 #endif
2384 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2385         {
2386                 I2C_BOARD_INFO("ad5398", 0xC),
2387                 .platform_data = (void *)&ad5398_regulator_data,
2388         },
2389 #endif
2390 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2391         {
2392                 I2C_BOARD_INFO("adp8860", 0x2A),
2393                 .platform_data = (void *)&adp8860_pdata,
2394         },
2395 #endif
2396 #if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE)
2397         {
2398                 I2C_BOARD_INFO("adau1373", 0x1A),
2399         },
2400 #endif
2401 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
2402         {
2403                 I2C_BOARD_INFO("ad5252", 0x2e),
2404         },
2405 #endif
2406 };
2407
2408 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
2409 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2410 static struct resource bfin_sport0_uart_resources[] = {
2411         {
2412                 .start = SPORT0_TCR1,
2413                 .end = SPORT0_MRCS3+4,
2414                 .flags = IORESOURCE_MEM,
2415         },
2416         {
2417                 .start = IRQ_SPORT0_RX,
2418                 .end = IRQ_SPORT0_RX+1,
2419                 .flags = IORESOURCE_IRQ,
2420         },
2421         {
2422                 .start = IRQ_SPORT0_ERROR,
2423                 .end = IRQ_SPORT0_ERROR,
2424                 .flags = IORESOURCE_IRQ,
2425         },
2426 };
2427
2428 unsigned short bfin_sport0_peripherals[] = {
2429         P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
2430         P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
2431 };
2432
2433 static struct platform_device bfin_sport0_uart_device = {
2434         .name = "bfin-sport-uart",
2435         .id = 0,
2436         .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
2437         .resource = bfin_sport0_uart_resources,
2438         .dev = {
2439                 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
2440         },
2441 };
2442 #endif
2443 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2444 static struct resource bfin_sport1_uart_resources[] = {
2445         {
2446                 .start = SPORT1_TCR1,
2447                 .end = SPORT1_MRCS3+4,
2448                 .flags = IORESOURCE_MEM,
2449         },
2450         {
2451                 .start = IRQ_SPORT1_RX,
2452                 .end = IRQ_SPORT1_RX+1,
2453                 .flags = IORESOURCE_IRQ,
2454         },
2455         {
2456                 .start = IRQ_SPORT1_ERROR,
2457                 .end = IRQ_SPORT1_ERROR,
2458                 .flags = IORESOURCE_IRQ,
2459         },
2460 };
2461
2462 unsigned short bfin_sport1_peripherals[] = {
2463         P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
2464         P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
2465 };
2466
2467 static struct platform_device bfin_sport1_uart_device = {
2468         .name = "bfin-sport-uart",
2469         .id = 1,
2470         .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
2471         .resource = bfin_sport1_uart_resources,
2472         .dev = {
2473                 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
2474         },
2475 };
2476 #endif
2477 #endif
2478
2479 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2480 #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2481 /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
2482
2483 #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2484 #define PATA_INT        IRQ_PF5
2485 static struct pata_platform_info bfin_pata_platform_data = {
2486         .ioport_shift = 1,
2487         .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
2488 };
2489
2490 static struct resource bfin_pata_resources[] = {
2491         {
2492                 .start = 0x20314020,
2493                 .end = 0x2031403F,
2494                 .flags = IORESOURCE_MEM,
2495         },
2496         {
2497                 .start = 0x2031401C,
2498                 .end = 0x2031401F,
2499                 .flags = IORESOURCE_MEM,
2500         },
2501         {
2502                 .start = PATA_INT,
2503                 .end = PATA_INT,
2504                 .flags = IORESOURCE_IRQ,
2505         },
2506 };
2507 #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
2508 static struct pata_platform_info bfin_pata_platform_data = {
2509         .ioport_shift = 0,
2510 };
2511 /* CompactFlash Storage Card Memory Mapped Adressing
2512  * /REG = A11 = 1
2513  */
2514 static struct resource bfin_pata_resources[] = {
2515         {
2516                 .start = 0x20211800,
2517                 .end = 0x20211807,
2518                 .flags = IORESOURCE_MEM,
2519         },
2520         {
2521                 .start = 0x2021180E,    /* Device Ctl */
2522                 .end = 0x2021180E,
2523                 .flags = IORESOURCE_MEM,
2524         },
2525 };
2526 #endif
2527
2528 static struct platform_device bfin_pata_device = {
2529         .name = "pata_platform",
2530         .id = -1,
2531         .num_resources = ARRAY_SIZE(bfin_pata_resources),
2532         .resource = bfin_pata_resources,
2533         .dev = {
2534                 .platform_data = &bfin_pata_platform_data,
2535         }
2536 };
2537 #endif
2538
2539 static const unsigned int cclk_vlev_datasheet[] =
2540 {
2541         VRPAIR(VLEV_085, 250000000),
2542         VRPAIR(VLEV_090, 376000000),
2543         VRPAIR(VLEV_095, 426000000),
2544         VRPAIR(VLEV_100, 426000000),
2545         VRPAIR(VLEV_105, 476000000),
2546         VRPAIR(VLEV_110, 476000000),
2547         VRPAIR(VLEV_115, 476000000),
2548         VRPAIR(VLEV_120, 500000000),
2549         VRPAIR(VLEV_125, 533000000),
2550         VRPAIR(VLEV_130, 600000000),
2551 };
2552
2553 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
2554         .tuple_tab = cclk_vlev_datasheet,
2555         .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
2556         .vr_settling_time = 25 /* us */,
2557 };
2558
2559 static struct platform_device bfin_dpmc = {
2560         .name = "bfin dpmc",
2561         .dev = {
2562                 .platform_data = &bfin_dmpc_vreg_data,
2563         },
2564 };
2565
2566 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2567 static struct platform_device bfin_i2s = {
2568         .name = "bfin-i2s",
2569         .id = CONFIG_SND_BF5XX_SPORT_NUM,
2570         /* TODO: add platform data here */
2571 };
2572 #endif
2573
2574 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2575 static struct platform_device bfin_tdm = {
2576         .name = "bfin-tdm",
2577         .id = CONFIG_SND_BF5XX_SPORT_NUM,
2578         /* TODO: add platform data here */
2579 };
2580 #endif
2581
2582 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2583 static struct platform_device bfin_ac97 = {
2584         .name = "bfin-ac97",
2585         .id = CONFIG_SND_BF5XX_SPORT_NUM,
2586         /* TODO: add platform data here */
2587 };
2588 #endif
2589
2590 #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
2591 #define REGULATOR_ADP122        "adp122"
2592 #define REGULATOR_ADP122_UV     2500000
2593
2594 static struct regulator_consumer_supply adp122_consumers = {
2595                 .supply = REGULATOR_ADP122,
2596 };
2597
2598 static struct regulator_init_data adp_switch_regulator_data = {
2599         .constraints = {
2600                 .name = REGULATOR_ADP122,
2601                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2602                 .min_uV = REGULATOR_ADP122_UV,
2603                 .max_uV = REGULATOR_ADP122_UV,
2604                 .min_uA = 0,
2605                 .max_uA = 300000,
2606         },
2607         .num_consumer_supplies = 1,     /* only 1 */
2608         .consumer_supplies     = &adp122_consumers,
2609 };
2610
2611 static struct fixed_voltage_config adp_switch_pdata = {
2612         .supply_name = REGULATOR_ADP122,
2613         .microvolts = REGULATOR_ADP122_UV,
2614         .gpio = GPIO_PF2,
2615         .enable_high = 1,
2616         .enabled_at_boot = 0,
2617         .init_data = &adp_switch_regulator_data,
2618 };
2619
2620 static struct platform_device adp_switch_device = {
2621         .name = "reg-fixed-voltage",
2622         .id = 0,
2623         .dev = {
2624                 .platform_data = &adp_switch_pdata,
2625         },
2626 };
2627
2628 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2629         defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2630 static struct regulator_bulk_data adp122_bulk_data = {
2631         .supply = REGULATOR_ADP122,
2632 };
2633
2634 static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2635         .name = REGULATOR_ADP122,
2636         .num_supplies = 1,
2637         .supplies = &adp122_bulk_data,
2638 };
2639
2640 static struct platform_device adp122_userspace_consumer_device = {
2641         .name = "reg-userspace-consumer",
2642         .id = 0,
2643         .dev = {
2644                 .platform_data = &adp122_userspace_comsumer_data,
2645         },
2646 };
2647 #endif
2648 #endif
2649
2650 #if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2651         defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2652
2653 static struct resource iio_gpio_trigger_resources[] = {
2654         [0] = {
2655                 .start  = IRQ_PF5,
2656                 .end    = IRQ_PF5,
2657                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
2658         },
2659 };
2660
2661 static struct platform_device iio_gpio_trigger = {
2662         .name = "iio_gpio_trigger",
2663         .num_resources = ARRAY_SIZE(iio_gpio_trigger_resources),
2664         .resource = iio_gpio_trigger_resources,
2665 };
2666 #endif
2667
2668 static struct platform_device *stamp_devices[] __initdata = {
2669
2670         &bfin_dpmc,
2671
2672 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2673         &bfin_pcmcia_cf_device,
2674 #endif
2675
2676 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2677         &rtc_device,
2678 #endif
2679
2680 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2681         &sl811_hcd_device,
2682 #endif
2683
2684 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2685         &isp1362_hcd_device,
2686 #endif
2687
2688 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2689         &bfin_isp1760_device,
2690 #endif
2691
2692 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2693         &smc91x_device,
2694 #endif
2695
2696 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2697         &dm9000_device,
2698 #endif
2699
2700 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2701         &bfin_can_device,
2702 #endif
2703
2704 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
2705         &bfin_mii_bus,
2706         &bfin_mac_device,
2707 #endif
2708
2709 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2710         &net2272_bfin_device,
2711 #endif
2712
2713 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
2714         &bfin_spi0_device,
2715 #endif
2716
2717 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2718         &bfin_sport_spi0_device,
2719         &bfin_sport_spi1_device,
2720 #endif
2721
2722 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2723         &bfin_fb_device,
2724 #endif
2725
2726 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2727         &bfin_lq035q1_device,
2728 #endif
2729
2730 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
2731 #ifdef CONFIG_SERIAL_BFIN_UART0
2732         &bfin_uart0_device,
2733 #endif
2734 #ifdef CONFIG_SERIAL_BFIN_UART1
2735         &bfin_uart1_device,
2736 #endif
2737 #endif
2738
2739 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
2740 #ifdef CONFIG_BFIN_SIR0
2741         &bfin_sir0_device,
2742 #endif
2743 #ifdef CONFIG_BFIN_SIR1
2744         &bfin_sir1_device,
2745 #endif
2746 #endif
2747
2748 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2749         &i2c_bfin_twi_device,
2750 #endif
2751
2752 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
2753 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2754         &bfin_sport0_uart_device,
2755 #endif
2756 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2757         &bfin_sport1_uart_device,
2758 #endif
2759 #endif
2760
2761 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2762         &bfin_pata_device,
2763 #endif
2764
2765 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2766         &bfin_device_gpiokeys,
2767 #endif
2768
2769 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2770         &bfin_async_nand_device,
2771 #endif
2772
2773 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
2774         &stamp_flash_device,
2775 #endif
2776
2777 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2778         &bfin_i2s,
2779 #endif
2780
2781 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2782         &bfin_tdm,
2783 #endif
2784
2785 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2786         &bfin_ac97,
2787 #endif
2788 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2789 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2790         defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2791         &ad5398_virt_consumer_device,
2792 #endif
2793 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2794         defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2795         &ad5398_userspace_consumer_device,
2796 #endif
2797 #endif
2798
2799 #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
2800         &adp_switch_device,
2801 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2802         defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2803         &adp122_userspace_consumer_device,
2804 #endif
2805 #endif
2806
2807 #if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2808         defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2809         &iio_gpio_trigger,
2810 #endif
2811 };
2812
2813 static int __init stamp_init(void)
2814 {
2815         printk(KERN_INFO "%s(): registering device resources\n", __func__);
2816         bfin_plat_nand_init();
2817         adf702x_mac_init();
2818         platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
2819         i2c_register_board_info(0, bfin_i2c_board_info,
2820                                 ARRAY_SIZE(bfin_i2c_board_info));
2821         spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
2822
2823         return 0;
2824 }
2825
2826 arch_initcall(stamp_init);
2827
2828
2829 static struct platform_device *stamp_early_devices[] __initdata = {
2830 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2831 #ifdef CONFIG_SERIAL_BFIN_UART0
2832         &bfin_uart0_device,
2833 #endif
2834 #ifdef CONFIG_SERIAL_BFIN_UART1
2835         &bfin_uart1_device,
2836 #endif
2837 #endif
2838
2839 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2840 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2841         &bfin_sport0_uart_device,
2842 #endif
2843 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2844         &bfin_sport1_uart_device,
2845 #endif
2846 #endif
2847 };
2848
2849 void __init native_machine_early_platform_add_devices(void)
2850 {
2851         printk(KERN_INFO "register early platform devices\n");
2852         early_platform_add_devices(stamp_early_devices,
2853                 ARRAY_SIZE(stamp_early_devices));
2854 }
2855
2856 void native_machine_restart(char *cmd)
2857 {
2858         /* workaround reboot hang when booting from SPI */
2859         if ((bfin_read_SYSCR() & 0x7) == 0x3)
2860                 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
2861 }
2862
2863 /*
2864  * Currently the MAC address is saved in Flash by U-Boot
2865  */
2866 #define FLASH_MAC       0x203f0000
2867 void bfin_get_ether_addr(char *addr)
2868 {
2869         *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2870         *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2871 }
2872 EXPORT_SYMBOL(bfin_get_ether_addr);