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.
9 #include <linux/device.h>
10 #include <linux/kernel.h>
11 #include <linux/platform_device.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>
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>
34 #include <asm/bfin5xx_spi.h>
35 #include <asm/reboot.h>
36 #include <asm/portmux.h>
38 #ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
39 #include <linux/regulator/fixed.h>
41 #include <linux/regulator/machine.h>
42 #include <linux/regulator/consumer.h>
43 #include <linux/regulator/userspace-consumer.h>
46 * Name the Board for the /proc/cpuinfo
48 const char bfin_board_name[] = "ADI BF537-STAMP";
51 * Driver needs to know address, irq and flag pin.
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[] = {
59 .end = 0x203C0000 + 0x000fffff,
60 .flags = IORESOURCE_MEM,
65 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
69 static struct isp1760_platform_data isp1760_priv = {
74 .dack_polarity_high = 0,
75 .dreq_polarity_high = 0,
78 static struct platform_device bfin_isp1760_device = {
82 .platform_data = &isp1760_priv,
84 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
85 .resource = bfin_isp1760_resources,
89 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
90 #include <linux/gpio_keys.h>
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"},
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),
104 static struct platform_device bfin_device_gpiokeys = {
107 .platform_data = &bfin_gpio_keys_data,
112 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
113 static struct resource bfin_pcmcia_cf_resources[] = {
115 .start = 0x20310000, /* IO PORT */
117 .flags = IORESOURCE_MEM,
119 .start = 0x20311000, /* Attribute Memory */
121 .flags = IORESOURCE_MEM,
125 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
127 .start = 6, /* Card Detect PF6 */
129 .flags = IORESOURCE_IRQ,
133 static struct platform_device bfin_pcmcia_cf_device = {
134 .name = "bfin_cf_pcmcia",
136 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
137 .resource = bfin_pcmcia_cf_resources,
141 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
142 static struct platform_device rtc_device = {
148 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
149 #include <linux/smc91x.h>
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,
157 static struct resource smc91x_resources[] = {
159 .name = "smc91x-regs",
161 .end = 0x20300300 + 16,
162 .flags = IORESOURCE_MEM,
167 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
170 static struct platform_device smc91x_device = {
173 .num_resources = ARRAY_SIZE(smc91x_resources),
174 .resource = smc91x_resources,
176 .platform_data = &smc91x_info,
181 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
182 static struct resource dm9000_resources[] = {
185 .end = 0x203FB800 + 1,
186 .flags = IORESOURCE_MEM,
190 .end = 0x203FB804 + 1,
191 .flags = IORESOURCE_MEM,
196 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
200 static struct platform_device dm9000_device = {
203 .num_resources = ARRAY_SIZE(dm9000_resources),
204 .resource = dm9000_resources,
208 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
209 static struct resource sl811_hcd_resources[] = {
213 .flags = IORESOURCE_MEM,
217 .flags = IORESOURCE_MEM,
221 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
225 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
226 void sl811_port_power(struct device *dev, int is_on)
228 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
229 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
233 static struct sl811_platform_data sl811_priv = {
235 .power = 250, /* == 500mA */
236 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
237 .port_power = &sl811_port_power,
241 static struct platform_device sl811_hcd_device = {
245 .platform_data = &sl811_priv,
247 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
248 .resource = sl811_hcd_resources,
252 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
253 static struct resource isp1362_hcd_resources[] = {
257 .flags = IORESOURCE_MEM,
261 .flags = IORESOURCE_MEM,
265 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
269 static struct isp1362_platform_data isp1362_priv = {
274 .int_edge_triggered = 0,
275 .remote_wakeup_connected = 0,
276 .no_power_switching = 1,
277 .power_switching_mode = 0,
280 static struct platform_device isp1362_hcd_device = {
281 .name = "isp1362-hcd",
284 .platform_data = &isp1362_priv,
286 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
287 .resource = isp1362_hcd_resources,
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
296 static struct resource bfin_can_resources[] = {
300 .flags = IORESOURCE_MEM,
305 .flags = IORESOURCE_IRQ,
310 .flags = IORESOURCE_IRQ,
313 .start = IRQ_CAN_ERROR,
314 .end = IRQ_CAN_ERROR,
315 .flags = IORESOURCE_IRQ,
319 static struct platform_device bfin_can_device = {
321 .num_resources = ARRAY_SIZE(bfin_can_resources),
322 .resource = bfin_can_resources,
324 .platform_data = &bfin_can_peripherals, /* Passed to driver */
329 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
330 static struct platform_device bfin_mii_bus = {
331 .name = "bfin_mii_bus",
334 static struct platform_device bfin_mac_device = {
336 .dev.platform_data = &bfin_mii_bus,
340 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
341 static struct resource net2272_bfin_resources[] = {
344 .end = 0x20300000 + 0x100,
345 .flags = IORESOURCE_MEM,
349 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
353 static struct platform_device net2272_bfin_device = {
356 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
357 .resource = net2272_bfin_resources,
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 };
365 static struct mtd_partition bfin_plat_nand_partitions[] = {
367 .name = "linux kernel(nand)",
371 .name = "file system(nand)",
372 .size = MTDPART_SIZ_FULL,
373 .offset = MTDPART_OFS_APPEND,
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)
382 struct nand_chip *this = mtd->priv;
384 if (cmd == NAND_CMD_NONE)
388 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
390 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
393 #define BFIN_NAND_PLAT_READY GPIO_PF3
394 static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
396 return gpio_get_value(BFIN_NAND_PLAT_READY);
399 static struct platform_nand_data bfin_plat_nand_data = {
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),
410 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
411 .dev_ready = bfin_plat_nand_dev_ready,
415 #define MAX(x, y) (x > y ? x : y)
416 static struct resource bfin_plat_nand_resources = {
418 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
419 .flags = IORESOURCE_MEM,
422 static struct platform_device bfin_async_nand_device = {
426 .resource = &bfin_plat_nand_resources,
428 .platform_data = &bfin_plat_nand_data,
432 static void bfin_plat_nand_init(void)
434 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
437 static void bfin_plat_nand_init(void) {}
440 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
441 static struct mtd_partition stamp_partitions[] = {
443 .name = "bootloader(nor)",
447 .name = "linux kernel(nor)",
449 .offset = MTDPART_OFS_APPEND,
451 .name = "file system(nor)",
452 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
453 .offset = MTDPART_OFS_APPEND,
455 .name = "MAC Address(nor)",
456 .size = MTDPART_SIZ_FULL,
458 .mask_flags = MTD_WRITEABLE,
462 static struct physmap_flash_data stamp_flash_data = {
464 .parts = stamp_partitions,
465 .nr_parts = ARRAY_SIZE(stamp_partitions),
466 #ifdef CONFIG_ROMKERNEL
467 .probe_type = "map_rom",
471 static struct resource stamp_flash_resource = {
474 .flags = IORESOURCE_MEM,
477 static struct platform_device stamp_flash_device = {
478 .name = "physmap-flash",
481 .platform_data = &stamp_flash_data,
484 .resource = &stamp_flash_resource,
488 #if defined(CONFIG_MTD_M25P80) \
489 || defined(CONFIG_MTD_M25P80_MODULE)
490 static struct mtd_partition bfin_spi_flash_partitions[] = {
492 .name = "bootloader(spi)",
495 .mask_flags = MTD_CAP_ROM
497 .name = "linux kernel(spi)",
499 .offset = MTDPART_OFS_APPEND,
501 .name = "file system(spi)",
502 .size = MTDPART_SIZ_FULL,
503 .offset = MTDPART_OFS_APPEND,
507 static struct flash_platform_data bfin_spi_flash_data = {
509 .parts = bfin_spi_flash_partitions,
510 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
511 /* .type = "m25p64", */
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*/
521 #if defined(CONFIG_BFIN_SPI_ADC) \
522 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
524 static struct bfin5xx_spi_chip spi_adc_chip_info = {
525 .enable_dma = 1, /* use dma transfer with this chip*/
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 = {
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 = {
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 = {
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 = {
561 static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
569 static struct ad714x_button_plat ad7147_spi_button_plat[] = {
571 .keycode = BTN_FORWARD,
581 .keycode = BTN_MIDDLE,
586 .keycode = BTN_RIGHT,
596 static struct ad714x_platform_data ad7147_spi_platform_data = {
599 .slider = ad7147_spi_slider_plat,
600 .button = ad7147_spi_button_plat,
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},
615 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
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[] = {
643 static struct ad714x_platform_data ad7142_i2c_platform_data = {
645 .button = ad7142_i2c_button_plat,
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},
662 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
666 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
667 static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
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
679 static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
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 */
696 static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
702 #if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
703 static struct bfin5xx_spi_chip ad7314_spi_chip_info = {
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 */
717 static struct bfin5xx_spi_chip ad7816_spi_chip_info = {
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 */
731 static struct bfin5xx_spi_chip adt7310_spi_chip_info = {
737 #if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
738 static unsigned short ad7298_platform_data[] = {
739 GPIO_PF7, /* busy_pin */
743 static struct bfin5xx_spi_chip ad7298_spi_chip_info = {
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 */
755 static struct bfin5xx_spi_chip adt7316_spi_chip_info = {
761 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
762 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
764 static int bfin_mmc_spi_init(struct device *dev,
765 irqreturn_t (*detect_int)(int, void *), void *data)
767 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
768 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
771 static void bfin_mmc_spi_exit(struct device *dev, void *data)
773 free_irq(MMC_SPI_CARD_DETECT_INT, data);
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 */
782 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
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 = {
796 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
798 .vref_delay_usecs = 50, /* internal, no capacitor */
801 .pressure_max = 1000,
803 .stopacq_polarity = 1,
804 .first_conversion_delay = 3,
805 .acquisition_time = 1,
807 .pen_down_acc_interval = 1,
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,
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 */
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 = {
834 .tap_threshold = 0x31,
835 .tap_duration = 0x10,
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,
846 .data_range = ADXL_FULL_RES,
849 .ev_code_x = ABS_X, /* EV_REL */
850 .ev_code_y = ABS_Y, /* EV_REL */
851 .ev_code_z = ABS_Z, /* EV_REL */
853 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
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},
867 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
868 static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
874 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
875 static struct bfin5xx_spi_chip spidev_chip_info = {
881 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
882 static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
888 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
889 static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
895 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
896 static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
900 #include <linux/spi/adf702x.h>
901 #define TXREG 0x0160A470
902 static const u32 adf7021_regs[] = {
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,
933 static inline void adf702x_mac_init(void)
935 random_ether_addr(adf7021_platform_data.mac_addr);
938 static inline void adf702x_mac_init(void) {}
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 = {
947 static int ads7873_get_pendown_state(void)
949 return gpio_get_value(GPIO_PF6);
952 static struct ads7846_platform_data __initdata ad7873_pdata = {
953 .model = 7873, /* AD7873 */
959 .debounce_tol = (~0),
960 .get_pendown_state = ads7873_get_pendown_state,
964 #if defined(CONFIG_MTD_DATAFLASH) \
965 || defined(CONFIG_MTD_DATAFLASH_MODULE)
967 static struct mtd_partition bfin_spi_dataflash_partitions[] = {
969 .name = "bootloader(spi)",
972 .mask_flags = MTD_CAP_ROM
974 .name = "linux kernel(spi)",
976 .offset = MTDPART_OFS_APPEND,
978 .name = "file system(spi)",
979 .size = MTDPART_SIZ_FULL,
980 .offset = MTDPART_OFS_APPEND,
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),
991 static struct bfin5xx_spi_chip data_flash_chip_info = {
992 .enable_dma = 0, /* use dma transfer with this chip*/
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*/
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*/
1011 static struct spi_board_info bfin_spi_board_info[] __initdata = {
1012 #if defined(CONFIG_MTD_M25P80) \
1013 || defined(CONFIG_MTD_M25P80_MODULE)
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,
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,
1037 #if defined(CONFIG_BFIN_SPI_ADC) \
1038 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
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,
1049 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1050 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1052 .modalias = "ad183x",
1053 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1056 .platform_data = "ad1836", /* only includes chip name for the moment */
1057 .controller_data = &ad1836_spi_chip_info,
1062 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
1064 .modalias = "ad193x",
1065 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1068 .controller_data = &ad1938_spi_chip_info,
1073 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
1075 .modalias = "adav80x",
1076 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1079 .controller_data = &adav801_spi_chip_info,
1084 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
1086 .modalias = "ad714x_captouch",
1087 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1092 .platform_data = &ad7147_spi_platform_data,
1093 .controller_data = &ad7147_spi_chip_info,
1097 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1099 .modalias = "ad2s90",
1101 .chip_select = 3, /* change it for your board */
1103 .platform_data = NULL,
1104 .controller_data = &ad2s90_spi_chip_info,
1108 #if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1110 .modalias = "ad2s120x",
1112 .chip_select = 4, /* CS, change it for your board */
1113 .platform_data = ad2s120x_platform_data,
1114 .controller_data = &ad2s120x_spi_chip_info,
1118 #if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1120 .modalias = "ad2s1210",
1121 .max_speed_hz = 8192000,
1123 .chip_select = 4, /* CS, change it for your board */
1124 .platform_data = ad2s1210_platform_data,
1125 .controller_data = &ad2s1210_spi_chip_info,
1129 #if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
1131 .modalias = "ad7314",
1132 .max_speed_hz = 1000000,
1134 .chip_select = 4, /* CS, change it for your board */
1135 .controller_data = &ad7314_spi_chip_info,
1140 #if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
1142 .modalias = "ad7818",
1143 .max_speed_hz = 1000000,
1145 .chip_select = 4, /* CS, change it for your board */
1146 .platform_data = ad7816_platform_data,
1147 .controller_data = &ad7816_spi_chip_info,
1152 #if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
1154 .modalias = "adt7310",
1155 .max_speed_hz = 1000000,
1156 .irq = IRQ_PG5, /* CT alarm event. Line 0 */
1158 .chip_select = 4, /* CS, change it for your board */
1159 .platform_data = adt7310_platform_data,
1160 .controller_data = &adt7310_spi_chip_info,
1165 #if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
1167 .modalias = "ad7298",
1168 .max_speed_hz = 1000000,
1170 .chip_select = 4, /* CS, change it for your board */
1171 .platform_data = ad7298_platform_data,
1172 .controller_data = &ad7298_spi_chip_info,
1177 #if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
1179 .modalias = "adt7316",
1180 .max_speed_hz = 1000000,
1181 .irq = IRQ_PG5, /* interrupt line */
1183 .chip_select = 4, /* CS, change it for your board */
1184 .platform_data = adt7316_spi_data,
1185 .controller_data = &adt7316_spi_chip_info,
1190 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1192 .modalias = "mmc_spi",
1193 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1196 .platform_data = &bfin_mmc_spi_pdata,
1197 .controller_data = &mmc_spi_chip_info,
1201 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1203 .modalias = "ad7877",
1204 .platform_data = &bfin_ad7877_ts_info,
1206 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1209 .controller_data = &spi_ad7877_chip_info,
1212 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
1214 .modalias = "ad7879",
1215 .platform_data = &bfin_ad7879_ts_info,
1217 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1220 .controller_data = &spi_ad7879_chip_info,
1221 .mode = SPI_CPHA | SPI_CPOL,
1224 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1226 .modalias = "spidev",
1227 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1230 .controller_data = &spidev_chip_info,
1233 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1235 .modalias = "bfin-lq035q1-spi",
1236 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1239 .controller_data = &lq035q1_spi_chip_info,
1240 .mode = SPI_CPHA | SPI_CPOL,
1243 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1245 .modalias = "enc28j60",
1246 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1249 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1250 .controller_data = &enc28j60_spi_chip_info,
1254 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1256 .modalias = "adxl34x",
1257 .platform_data = &adxl34x_info,
1259 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1262 .controller_data = &spi_adxl34x_chip_info,
1266 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1268 .modalias = "adf702x",
1269 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1271 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1272 .controller_data = &adf7021_spi_chip_info,
1273 .platform_data = &adf7021_platform_data,
1277 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1279 .modalias = "ads7846",
1280 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1283 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1284 .controller_data = &ad7873_spi_chip_info,
1285 .platform_data = &ad7873_pdata,
1289 #if defined(CONFIG_AD7476) \
1290 || defined(CONFIG_AD7476_MODULE)
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,
1301 #if defined(CONFIG_ADE7753) \
1302 || defined(CONFIG_ADE7753_MODULE)
1304 .modalias = "ade7753",
1305 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1307 .chip_select = 1, /* CS, change it for your board */
1308 .platform_data = NULL, /* No spi_driver specific config */
1312 #if defined(CONFIG_ADE7754) \
1313 || defined(CONFIG_ADE7754_MODULE)
1315 .modalias = "ade7754",
1316 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1318 .chip_select = 1, /* CS, change it for your board */
1319 .platform_data = NULL, /* No spi_driver specific config */
1323 #if defined(CONFIG_ADE7758) \
1324 || defined(CONFIG_ADE7758_MODULE)
1326 .modalias = "ade7758",
1327 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1329 .chip_select = 1, /* CS, change it for your board */
1330 .platform_data = NULL, /* No spi_driver specific config */
1334 #if defined(CONFIG_ADE7759) \
1335 || defined(CONFIG_ADE7759_MODULE)
1337 .modalias = "ade7759",
1338 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1340 .chip_select = 1, /* CS, change it for your board */
1341 .platform_data = NULL, /* No spi_driver specific config */
1345 #if defined(CONFIG_ADE7854_SPI) \
1346 || defined(CONFIG_ADE7854_SPI_MODULE)
1348 .modalias = "ade7854",
1349 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1351 .chip_select = 1, /* CS, change it for your board */
1352 .platform_data = NULL, /* No spi_driver specific config */
1356 #if defined(CONFIG_ADIS16060) \
1357 || defined(CONFIG_ADIS16060_MODULE)
1359 .modalias = "adis16060_r",
1360 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1362 .chip_select = MAX_CTRL_CS + 1, /* CS for read, change it for your board */
1363 .platform_data = NULL, /* No spi_driver specific config */
1367 .modalias = "adis16060_w",
1368 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1370 .chip_select = 2, /* CS for write, change it for your board */
1371 .platform_data = NULL, /* No spi_driver specific config */
1375 #if defined(CONFIG_ADIS16130) \
1376 || defined(CONFIG_ADIS16130_MODULE)
1378 .modalias = "adis16130",
1379 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1381 .chip_select = 1, /* CS for read, change it for your board */
1382 .platform_data = NULL, /* No spi_driver specific config */
1386 #if defined(CONFIG_ADIS16201) \
1387 || defined(CONFIG_ADIS16201_MODULE)
1389 .modalias = "adis16201",
1390 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1392 .chip_select = 5, /* CS, change it for your board */
1393 .platform_data = NULL, /* No spi_driver specific config */
1398 #if defined(CONFIG_ADIS16203) \
1399 || defined(CONFIG_ADIS16203_MODULE)
1401 .modalias = "adis16203",
1402 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1404 .chip_select = 5, /* CS, change it for your board */
1405 .platform_data = NULL, /* No spi_driver specific config */
1410 #if defined(CONFIG_ADIS16204) \
1411 || defined(CONFIG_ADIS16204_MODULE)
1413 .modalias = "adis16204",
1414 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1416 .chip_select = 5, /* CS, change it for your board */
1417 .platform_data = NULL, /* No spi_driver specific config */
1422 #if defined(CONFIG_ADIS16209) \
1423 || defined(CONFIG_ADIS16209_MODULE)
1425 .modalias = "adis16209",
1426 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1428 .chip_select = 5, /* CS, change it for your board */
1429 .platform_data = NULL, /* No spi_driver specific config */
1434 #if defined(CONFIG_ADIS16220) \
1435 || defined(CONFIG_ADIS16220_MODULE)
1437 .modalias = "adis16220",
1438 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1440 .chip_select = 5, /* CS, change it for your board */
1441 .platform_data = NULL, /* No spi_driver specific config */
1446 #if defined(CONFIG_ADIS16240) \
1447 || defined(CONFIG_ADIS16240_MODULE)
1449 .modalias = "adis16240",
1450 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1452 .chip_select = 5, /* CS, change it for your board */
1453 .platform_data = NULL, /* No spi_driver specific config */
1458 #if defined(CONFIG_ADIS16260) \
1459 || defined(CONFIG_ADIS16260_MODULE)
1461 .modalias = "adis16260",
1462 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1464 .chip_select = 5, /* CS, change it for your board */
1465 .platform_data = NULL, /* No spi_driver specific config */
1470 #if defined(CONFIG_ADIS16261) \
1471 || defined(CONFIG_ADIS16261_MODULE)
1473 .modalias = "adis16261",
1474 .max_speed_hz = 2500000, /* max spi clock (SCK) speed in HZ */
1476 .chip_select = 1, /* CS, change it for your board */
1477 .platform_data = NULL, /* No spi_driver specific config */
1481 #if defined(CONFIG_ADIS16300) \
1482 || defined(CONFIG_ADIS16300_MODULE)
1484 .modalias = "adis16300",
1485 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1487 .chip_select = 5, /* CS, change it for your board */
1488 .platform_data = NULL, /* No spi_driver specific config */
1493 #if defined(CONFIG_ADIS16350) \
1494 || defined(CONFIG_ADIS16350_MODULE)
1496 .modalias = "adis16364",
1497 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1499 .chip_select = 5, /* CS, change it for your board */
1500 .platform_data = NULL, /* No spi_driver specific config */
1505 #if defined(CONFIG_ADIS16400) \
1506 || defined(CONFIG_ADIS16400_MODULE)
1508 .modalias = "adis16400",
1509 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1511 .chip_select = 1, /* CS, change it for your board */
1512 .platform_data = NULL, /* No spi_driver specific config */
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},
1527 static struct resource bfin_spi0_resource[] = {
1529 .start = SPI0_REGBASE,
1530 .end = SPI0_REGBASE + 0xFF,
1531 .flags = IORESOURCE_MEM,
1536 .flags = IORESOURCE_DMA,
1541 .flags = IORESOURCE_IRQ,
1545 static struct platform_device bfin_spi0_device = {
1547 .id = 0, /* Bus number */
1548 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1549 .resource = bfin_spi0_resource,
1551 .platform_data = &bfin_spi0_info, /* Passed to driver */
1554 #endif /* spi master and devices */
1556 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
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},
1566 static struct resource bfin_sport_spi0_resource[] = {
1568 .start = SPORT0_TCR1,
1569 .end = SPORT0_TCR1 + 0xFF,
1570 .flags = IORESOURCE_MEM,
1573 .start = IRQ_SPORT0_ERROR,
1574 .end = IRQ_SPORT0_ERROR,
1575 .flags = IORESOURCE_IRQ,
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,
1585 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
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},
1596 static struct resource bfin_sport_spi1_resource[] = {
1598 .start = SPORT1_TCR1,
1599 .end = SPORT1_TCR1 + 0xFF,
1600 .flags = IORESOURCE_MEM,
1603 .start = IRQ_SPORT1_ERROR,
1604 .end = IRQ_SPORT1_ERROR,
1605 .flags = IORESOURCE_IRQ,
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,
1615 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1619 #endif /* sport spi master and devices */
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",
1627 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1628 #include <asm/bfin-lq035q1.h>
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,
1637 static struct resource bfin_lq035q1_resources[] = {
1639 .start = IRQ_PPI_ERROR,
1640 .end = IRQ_PPI_ERROR,
1641 .flags = IORESOURCE_IRQ,
1645 static struct platform_device bfin_lq035q1_device = {
1646 .name = "bfin-lq035q1",
1648 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1649 .resource = bfin_lq035q1_resources,
1651 .platform_data = &bfin_lq035q1_data,
1656 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1657 #ifdef CONFIG_SERIAL_BFIN_UART0
1658 static struct resource bfin_uart0_resources[] = {
1661 .end = UART0_GCTL+2,
1662 .flags = IORESOURCE_MEM,
1665 .start = IRQ_UART0_RX,
1666 .end = IRQ_UART0_RX+1,
1667 .flags = IORESOURCE_IRQ,
1670 .start = IRQ_UART0_ERROR,
1671 .end = IRQ_UART0_ERROR,
1672 .flags = IORESOURCE_IRQ,
1675 .start = CH_UART0_TX,
1677 .flags = IORESOURCE_DMA,
1680 .start = CH_UART0_RX,
1682 .flags = IORESOURCE_DMA,
1684 #ifdef CONFIG_BFIN_UART0_CTSRTS
1688 .flags = IORESOURCE_IO,
1693 .flags = IORESOURCE_IO,
1698 unsigned short bfin_uart0_peripherals[] = {
1699 P_UART0_TX, P_UART0_RX, 0
1702 static struct platform_device bfin_uart0_device = {
1703 .name = "bfin-uart",
1705 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1706 .resource = bfin_uart0_resources,
1708 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1712 #ifdef CONFIG_SERIAL_BFIN_UART1
1713 static struct resource bfin_uart1_resources[] = {
1716 .end = UART1_GCTL+2,
1717 .flags = IORESOURCE_MEM,
1720 .start = IRQ_UART1_RX,
1721 .end = IRQ_UART1_RX+1,
1722 .flags = IORESOURCE_IRQ,
1725 .start = IRQ_UART1_ERROR,
1726 .end = IRQ_UART1_ERROR,
1727 .flags = IORESOURCE_IRQ,
1730 .start = CH_UART1_TX,
1732 .flags = IORESOURCE_DMA,
1735 .start = CH_UART1_RX,
1737 .flags = IORESOURCE_DMA,
1741 unsigned short bfin_uart1_peripherals[] = {
1742 P_UART1_TX, P_UART1_RX, 0
1745 static struct platform_device bfin_uart1_device = {
1746 .name = "bfin-uart",
1748 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1749 .resource = bfin_uart1_resources,
1751 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1757 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1758 #ifdef CONFIG_BFIN_SIR0
1759 static struct resource bfin_sir0_resources[] = {
1761 .start = 0xFFC00400,
1763 .flags = IORESOURCE_MEM,
1766 .start = IRQ_UART0_RX,
1767 .end = IRQ_UART0_RX+1,
1768 .flags = IORESOURCE_IRQ,
1771 .start = CH_UART0_RX,
1772 .end = CH_UART0_RX+1,
1773 .flags = IORESOURCE_DMA,
1777 static struct platform_device bfin_sir0_device = {
1780 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1781 .resource = bfin_sir0_resources,
1784 #ifdef CONFIG_BFIN_SIR1
1785 static struct resource bfin_sir1_resources[] = {
1787 .start = 0xFFC02000,
1789 .flags = IORESOURCE_MEM,
1792 .start = IRQ_UART1_RX,
1793 .end = IRQ_UART1_RX+1,
1794 .flags = IORESOURCE_IRQ,
1797 .start = CH_UART1_RX,
1798 .end = CH_UART1_RX+1,
1799 .flags = IORESOURCE_DMA,
1803 static struct platform_device bfin_sir1_device = {
1806 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1807 .resource = bfin_sir1_resources,
1812 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1813 static struct resource bfin_twi0_resource[] = {
1815 .start = TWI0_REGBASE,
1816 .end = TWI0_REGBASE,
1817 .flags = IORESOURCE_MEM,
1822 .flags = IORESOURCE_IRQ,
1826 static struct platform_device i2c_bfin_twi_device = {
1827 .name = "i2c-bfin-twi",
1829 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1830 .resource = bfin_twi0_resource,
1834 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1835 static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1849 [13] = KEY_BACKSLASH,
1861 [26] = KEY_LEFTBRACE,
1862 [27] = KEY_RIGHTBRACE,
1875 [41] = KEY_SEMICOLON,
1876 [42] = KEY_APOSTROPHE,
1877 [43] = KEY_BACKSLASH,
1897 [65] = KEY_BACKSPACE,
1910 static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1913 .keymap = adp5588_keymap,
1914 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1919 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1920 #include <linux/mfd/adp5520.h>
1923 * ADP5520/5501 Backlight Data
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,
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),
1945 * ADP5520/5501 LEDs Data
1948 static struct led_info adp5520_leds[] = {
1950 .name = "adp5520-led1",
1951 .default_trigger = "none",
1952 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
1954 #ifdef ADP5520_EN_ALL_LEDS
1956 .name = "adp5520-led2",
1957 .default_trigger = "none",
1958 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1961 .name = "adp5520-led3",
1962 .default_trigger = "none",
1963 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
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,
1980 static struct adp5520_gpio_platform_data adp5520_gpio_data = {
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,
1987 * ADP5520 Keypad Data
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,
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),
2018 * ADP5520/5501 Multifunction Device Init Data
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,
2030 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2031 static struct adp5588_gpio_platform_data adp5588_gpio_data = {
2033 .pullup_dis_mask = 0,
2037 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2038 #include <linux/i2c/adp8870.h>
2039 static struct led_info adp8870_leds[] = {
2041 .name = "adp8870-led7",
2042 .default_trigger = "none",
2043 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
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 */
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 */
2057 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2058 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
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 */
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 */
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,
2089 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2090 #include <linux/i2c/adp8860.h>
2091 static struct led_info adp8860_leds[] = {
2093 .name = "adp8860-led7",
2094 .default_trigger = "none",
2095 .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
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 */
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 */
2107 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2108 .abml_filt = ADP8860_BL_AMBL_FILT_320ms, /* Light sensor filter time */
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 */
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 */
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,
2131 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2132 static struct regulator_consumer_supply ad5398_consumer = {
2133 .supply = "current",
2136 static struct regulator_init_data ad5398_regulator_data = {
2138 .name = "current range",
2140 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
2142 .num_consumer_supplies = 1,
2143 .consumer_supplies = &ad5398_consumer,
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",
2152 .platform_data = "current", /* Passed to driver */
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",
2162 static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
2165 .supplies = &ad5398_bulk_data,
2168 static struct platform_device ad5398_userspace_consumer_device = {
2169 .name = "reg-userspace-consumer",
2172 .platform_data = &ad5398_userspace_comsumer_data,
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,
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 */
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)
2196 I2C_BOARD_INFO("ad1937", 0x04),
2200 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
2202 I2C_BOARD_INFO("adav803", 0x10),
2206 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
2208 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
2210 .platform_data = (void *)&ad7142_i2c_platform_data,
2214 #if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
2216 I2C_BOARD_INFO("ad7150", 0x48),
2217 .irq = IRQ_PG5, /* fixme: use real interrupt number */
2221 #if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
2223 I2C_BOARD_INFO("ad7152", 0x48),
2227 #if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
2229 I2C_BOARD_INFO("ad774x", 0x48),
2233 #if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
2235 I2C_BOARD_INFO("ad7414", 0x9),
2237 .irq_flags = IRQF_TRIGGER_LOW,
2241 #if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
2243 I2C_BOARD_INFO("ad7417", 0xb),
2245 .irq_flags = IRQF_TRIGGER_LOW,
2246 .platform_data = (void *)GPIO_PF4,
2250 #if defined(CONFIG_ADE7854_I2C) || defined(CONFIG_ADE7854_I2C_MODULE)
2252 I2C_BOARD_INFO("ade7854", 0x38),
2256 #if defined(CONFIG_ADT75) || defined(CONFIG_ADT75_MODULE)
2258 I2C_BOARD_INFO("adt75", 0x9),
2260 .irq_flags = IRQF_TRIGGER_LOW,
2264 #if defined(CONFIG_ADT7408) || defined(CONFIG_ADT7408_MODULE)
2266 I2C_BOARD_INFO("adt7408", 0x18),
2268 .irq_flags = IRQF_TRIGGER_LOW,
2272 #if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2274 I2C_BOARD_INFO("adt7410", 0x48),
2275 /* CT critical temperature event. line 0 */
2277 .irq_flags = IRQF_TRIGGER_LOW,
2278 .platform_data = (void *)&adt7410_platform_data,
2282 #if defined(CONFIG_AD7291) || defined(CONFIG_AD7291_MODULE)
2284 I2C_BOARD_INFO("ad7291", 0x20),
2286 .irq_flags = IRQF_TRIGGER_LOW,
2290 #if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2292 I2C_BOARD_INFO("adt7316", 0x48),
2294 .platform_data = (void *)&adt7316_i2c_data,
2298 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
2300 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
2303 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
2305 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
2309 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
2311 I2C_BOARD_INFO("ad7879", 0x2F),
2313 .platform_data = (void *)&bfin_ad7879_ts_info,
2316 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
2318 I2C_BOARD_INFO("adp5588-keys", 0x34),
2320 .platform_data = (void *)&adp5588_kpad_data,
2323 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
2325 I2C_BOARD_INFO("pmic-adp5520", 0x32),
2327 .platform_data = (void *)&adp5520_pdev_data,
2330 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
2332 I2C_BOARD_INFO("adxl34x", 0x53),
2334 .platform_data = (void *)&adxl34x_info,
2337 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2339 I2C_BOARD_INFO("adp5588-gpio", 0x34),
2340 .platform_data = (void *)&adp5588_gpio_data,
2343 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
2345 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
2348 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2350 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2F),
2353 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2355 I2C_BOARD_INFO("adp8870", 0x2B),
2356 .platform_data = (void *)&adp8870_pdata,
2359 #if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
2361 I2C_BOARD_INFO("adau1371", 0x1A),
2364 #if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
2366 I2C_BOARD_INFO("adau1761", 0x38),
2369 #if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
2371 I2C_BOARD_INFO("adau1361", 0x38),
2374 #if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
2376 I2C_BOARD_INFO("ad5258", 0x18),
2379 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
2381 I2C_BOARD_INFO("ssm2602", 0x1b),
2384 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2386 I2C_BOARD_INFO("ad5398", 0xC),
2387 .platform_data = (void *)&ad5398_regulator_data,
2390 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2392 I2C_BOARD_INFO("adp8860", 0x2A),
2393 .platform_data = (void *)&adp8860_pdata,
2396 #if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE)
2398 I2C_BOARD_INFO("adau1373", 0x1A),
2401 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
2403 I2C_BOARD_INFO("ad5252", 0x2e),
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[] = {
2412 .start = SPORT0_TCR1,
2413 .end = SPORT0_MRCS3+4,
2414 .flags = IORESOURCE_MEM,
2417 .start = IRQ_SPORT0_RX,
2418 .end = IRQ_SPORT0_RX+1,
2419 .flags = IORESOURCE_IRQ,
2422 .start = IRQ_SPORT0_ERROR,
2423 .end = IRQ_SPORT0_ERROR,
2424 .flags = IORESOURCE_IRQ,
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
2433 static struct platform_device bfin_sport0_uart_device = {
2434 .name = "bfin-sport-uart",
2436 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
2437 .resource = bfin_sport0_uart_resources,
2439 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
2443 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2444 static struct resource bfin_sport1_uart_resources[] = {
2446 .start = SPORT1_TCR1,
2447 .end = SPORT1_MRCS3+4,
2448 .flags = IORESOURCE_MEM,
2451 .start = IRQ_SPORT1_RX,
2452 .end = IRQ_SPORT1_RX+1,
2453 .flags = IORESOURCE_IRQ,
2456 .start = IRQ_SPORT1_ERROR,
2457 .end = IRQ_SPORT1_ERROR,
2458 .flags = IORESOURCE_IRQ,
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
2467 static struct platform_device bfin_sport1_uart_device = {
2468 .name = "bfin-sport-uart",
2470 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
2471 .resource = bfin_sport1_uart_resources,
2473 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
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 */
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 = {
2487 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
2490 static struct resource bfin_pata_resources[] = {
2492 .start = 0x20314020,
2494 .flags = IORESOURCE_MEM,
2497 .start = 0x2031401C,
2499 .flags = IORESOURCE_MEM,
2504 .flags = IORESOURCE_IRQ,
2507 #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
2508 static struct pata_platform_info bfin_pata_platform_data = {
2511 /* CompactFlash Storage Card Memory Mapped Adressing
2514 static struct resource bfin_pata_resources[] = {
2516 .start = 0x20211800,
2518 .flags = IORESOURCE_MEM,
2521 .start = 0x2021180E, /* Device Ctl */
2523 .flags = IORESOURCE_MEM,
2528 static struct platform_device bfin_pata_device = {
2529 .name = "pata_platform",
2531 .num_resources = ARRAY_SIZE(bfin_pata_resources),
2532 .resource = bfin_pata_resources,
2534 .platform_data = &bfin_pata_platform_data,
2539 static const unsigned int cclk_vlev_datasheet[] =
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),
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 */,
2559 static struct platform_device bfin_dpmc = {
2560 .name = "bfin dpmc",
2562 .platform_data = &bfin_dmpc_vreg_data,
2566 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2567 static struct platform_device bfin_i2s = {
2569 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2570 /* TODO: add platform data here */
2574 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2575 static struct platform_device bfin_tdm = {
2577 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2578 /* TODO: add platform data here */
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 */
2590 #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
2591 #define REGULATOR_ADP122 "adp122"
2592 #define REGULATOR_ADP122_UV 2500000
2594 static struct regulator_consumer_supply adp122_consumers = {
2595 .supply = REGULATOR_ADP122,
2598 static struct regulator_init_data adp_switch_regulator_data = {
2600 .name = REGULATOR_ADP122,
2601 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2602 .min_uV = REGULATOR_ADP122_UV,
2603 .max_uV = REGULATOR_ADP122_UV,
2607 .num_consumer_supplies = 1, /* only 1 */
2608 .consumer_supplies = &adp122_consumers,
2611 static struct fixed_voltage_config adp_switch_pdata = {
2612 .supply_name = REGULATOR_ADP122,
2613 .microvolts = REGULATOR_ADP122_UV,
2616 .enabled_at_boot = 0,
2617 .init_data = &adp_switch_regulator_data,
2620 static struct platform_device adp_switch_device = {
2621 .name = "reg-fixed-voltage",
2624 .platform_data = &adp_switch_pdata,
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,
2634 static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2635 .name = REGULATOR_ADP122,
2637 .supplies = &adp122_bulk_data,
2640 static struct platform_device adp122_userspace_consumer_device = {
2641 .name = "reg-userspace-consumer",
2644 .platform_data = &adp122_userspace_comsumer_data,
2650 #if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2651 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2653 static struct resource iio_gpio_trigger_resources[] = {
2657 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
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,
2668 static struct platform_device *stamp_devices[] __initdata = {
2672 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2673 &bfin_pcmcia_cf_device,
2676 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2680 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2684 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2685 &isp1362_hcd_device,
2688 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2689 &bfin_isp1760_device,
2692 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2696 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2700 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2704 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
2709 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2710 &net2272_bfin_device,
2713 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
2717 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2718 &bfin_sport_spi0_device,
2719 &bfin_sport_spi1_device,
2722 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2726 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2727 &bfin_lq035q1_device,
2730 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
2731 #ifdef CONFIG_SERIAL_BFIN_UART0
2734 #ifdef CONFIG_SERIAL_BFIN_UART1
2739 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
2740 #ifdef CONFIG_BFIN_SIR0
2743 #ifdef CONFIG_BFIN_SIR1
2748 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2749 &i2c_bfin_twi_device,
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,
2756 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2757 &bfin_sport1_uart_device,
2761 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2765 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2766 &bfin_device_gpiokeys,
2769 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2770 &bfin_async_nand_device,
2773 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
2774 &stamp_flash_device,
2777 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2781 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2785 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
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,
2793 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2794 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2795 &ad5398_userspace_consumer_device,
2799 #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
2801 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2802 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2803 &adp122_userspace_consumer_device,
2807 #if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2808 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2813 static int __init stamp_init(void)
2815 printk(KERN_INFO "%s(): registering device resources\n", __func__);
2816 bfin_plat_nand_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));
2826 arch_initcall(stamp_init);
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
2834 #ifdef CONFIG_SERIAL_BFIN_UART1
2839 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2840 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2841 &bfin_sport0_uart_device,
2843 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2844 &bfin_sport1_uart_device,
2849 void __init native_machine_early_platform_add_devices(void)
2851 printk(KERN_INFO "register early platform devices\n");
2852 early_platform_add_devices(stamp_early_devices,
2853 ARRAY_SIZE(stamp_early_devices));
2856 void native_machine_restart(char *cmd)
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);
2864 * Currently the MAC address is saved in Flash by U-Boot
2866 #define FLASH_MAC 0x203f0000
2867 void bfin_get_ether_addr(char *addr)
2869 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2870 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2872 EXPORT_SYMBOL(bfin_get_ether_addr);