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