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 static 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 #include <linux/bfin_mac.h>
331 static const unsigned short bfin_mac_peripherals[] = P_MII0;
333 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
336 .irq = PHY_POLL, /* IRQ_MAC_PHYINT */
340 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
342 .phydev_data = bfin_phydev_data,
343 .phy_mode = PHY_INTERFACE_MODE_MII,
344 .mac_peripherals = bfin_mac_peripherals,
347 static struct platform_device bfin_mii_bus = {
348 .name = "bfin_mii_bus",
350 .platform_data = &bfin_mii_bus_data,
354 static struct platform_device bfin_mac_device = {
357 .platform_data = &bfin_mii_bus,
362 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
363 static struct resource net2272_bfin_resources[] = {
366 .end = 0x20300000 + 0x100,
367 .flags = IORESOURCE_MEM,
371 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
375 static struct platform_device net2272_bfin_device = {
378 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
379 .resource = net2272_bfin_resources,
383 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
384 #ifdef CONFIG_MTD_PARTITIONS
385 const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
387 static struct mtd_partition bfin_plat_nand_partitions[] = {
389 .name = "linux kernel(nand)",
393 .name = "file system(nand)",
394 .size = MTDPART_SIZ_FULL,
395 .offset = MTDPART_OFS_APPEND,
400 #define BFIN_NAND_PLAT_CLE 2
401 #define BFIN_NAND_PLAT_ALE 1
402 static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
404 struct nand_chip *this = mtd->priv;
406 if (cmd == NAND_CMD_NONE)
410 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
412 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
415 #define BFIN_NAND_PLAT_READY GPIO_PF3
416 static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
418 return gpio_get_value(BFIN_NAND_PLAT_READY);
421 static struct platform_nand_data bfin_plat_nand_data = {
425 #ifdef CONFIG_MTD_PARTITIONS
426 .part_probe_types = part_probes,
427 .partitions = bfin_plat_nand_partitions,
428 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
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 = {
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 = {
448 .resource = &bfin_plat_nand_resources,
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");
459 static void bfin_plat_nand_init(void) {}
462 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
463 static struct mtd_partition stamp_partitions[] = {
465 .name = "bootloader(nor)",
469 .name = "linux kernel(nor)",
471 .offset = MTDPART_OFS_APPEND,
473 .name = "file system(nor)",
474 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
475 .offset = MTDPART_OFS_APPEND,
477 .name = "MAC Address(nor)",
478 .size = MTDPART_SIZ_FULL,
480 .mask_flags = MTD_WRITEABLE,
484 static struct physmap_flash_data stamp_flash_data = {
486 .parts = stamp_partitions,
487 .nr_parts = ARRAY_SIZE(stamp_partitions),
488 #ifdef CONFIG_ROMKERNEL
489 .probe_type = "map_rom",
493 static struct resource stamp_flash_resource = {
496 .flags = IORESOURCE_MEM,
499 static struct platform_device stamp_flash_device = {
500 .name = "physmap-flash",
503 .platform_data = &stamp_flash_data,
506 .resource = &stamp_flash_resource,
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)",
517 .mask_flags = MTD_CAP_ROM
519 .name = "linux kernel(spi)",
521 .offset = MTDPART_OFS_APPEND,
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 = {
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*/
543 #if defined(CONFIG_BFIN_SPI_ADC) \
544 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
546 static struct bfin5xx_spi_chip spi_adc_chip_info = {
547 .enable_dma = 1, /* use dma transfer with this chip*/
552 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
553 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
554 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
560 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
561 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
562 static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
568 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) \
569 || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
570 static struct bfin5xx_spi_chip adav801_spi_chip_info = {
576 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
577 #include <linux/input/ad714x.h>
578 static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
583 static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
591 static struct ad714x_button_plat ad7147_spi_button_plat[] = {
593 .keycode = BTN_FORWARD,
603 .keycode = BTN_MIDDLE,
608 .keycode = BTN_RIGHT,
618 static struct ad714x_platform_data ad7147_spi_platform_data = {
621 .slider = ad7147_spi_slider_plat,
622 .button = ad7147_spi_button_plat,
624 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
625 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
626 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
627 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
628 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
629 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
630 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
631 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
632 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
633 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
634 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
635 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
637 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
641 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
642 #include <linux/input/ad714x.h>
643 static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
665 static struct ad714x_platform_data ad7142_i2c_platform_data = {
667 .button = ad7142_i2c_button_plat,
669 /* fixme: figure out right setting for all comoponent according
670 * to hardware feature of EVAL-AD7142EB board */
671 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
672 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
673 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
674 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
675 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
676 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
677 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
678 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
679 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
680 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
681 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
682 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
684 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
688 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
689 static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
695 #if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
696 static unsigned short ad2s120x_platform_data[] = {
697 /* used as SAMPLE and RDVEL */
698 GPIO_PF5, GPIO_PF6, 0
701 static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
707 #if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
708 static unsigned short ad2s1210_platform_data[] = {
709 /* use as SAMPLE, A0, A1 */
710 GPIO_PF7, GPIO_PF8, GPIO_PF9,
711 # if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT)
712 /* the RES0 and RES1 pins */
718 static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
724 #if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
725 static struct bfin5xx_spi_chip ad7314_spi_chip_info = {
731 #if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
732 static unsigned short ad7816_platform_data[] = {
733 GPIO_PF4, /* rdwr_pin */
734 GPIO_PF5, /* convert_pin */
735 GPIO_PF7, /* busy_pin */
739 static struct bfin5xx_spi_chip ad7816_spi_chip_info = {
745 #if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
746 static unsigned long adt7310_platform_data[3] = {
747 /* INT bound temperature alarm event. line 1 */
748 IRQ_PG4, IRQF_TRIGGER_LOW,
749 /* CT bound temperature alarm event irq_flags. line 0 */
753 static struct bfin5xx_spi_chip adt7310_spi_chip_info = {
759 #if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
760 static unsigned short ad7298_platform_data[] = {
761 GPIO_PF7, /* busy_pin */
765 static struct bfin5xx_spi_chip ad7298_spi_chip_info = {
771 #if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
772 static unsigned long adt7316_spi_data[2] = {
773 IRQF_TRIGGER_LOW, /* interrupt flags */
774 GPIO_PF7, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
777 static struct bfin5xx_spi_chip adt7316_spi_chip_info = {
783 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
784 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
786 static int bfin_mmc_spi_init(struct device *dev,
787 irqreturn_t (*detect_int)(int, void *), void *data)
789 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
790 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
793 static void bfin_mmc_spi_exit(struct device *dev, void *data)
795 free_irq(MMC_SPI_CARD_DETECT_INT, data);
798 static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
799 .init = bfin_mmc_spi_init,
800 .exit = bfin_mmc_spi_exit,
801 .detect_delay = 100, /* msecs */
804 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
811 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
812 #include <linux/spi/ad7877.h>
813 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
818 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
820 .vref_delay_usecs = 50, /* internal, no capacitor */
823 .pressure_max = 1000,
825 .stopacq_polarity = 1,
826 .first_conversion_delay = 3,
827 .acquisition_time = 1,
829 .pen_down_acc_interval = 1,
833 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
834 #include <linux/spi/ad7879.h>
835 static const struct ad7879_platform_data bfin_ad7879_ts_info = {
836 .model = 7879, /* Model = AD7879 */
837 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
838 .pressure_max = 10000,
840 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
841 .acquisition_time = 1, /* 4us acquisition time per sample */
842 .median = 2, /* do 8 measurements */
843 .averaging = 1, /* take the average of 4 middle samples */
844 .pen_down_acc_interval = 255, /* 9.4 ms */
845 .gpio_export = 1, /* Export GPIO to gpiolib */
846 .gpio_base = -1, /* Dynamic allocation */
850 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
851 #include <linux/input/adxl34x.h>
852 static const struct adxl34x_platform_data adxl34x_info = {
856 .tap_threshold = 0x31,
857 .tap_duration = 0x10,
860 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
861 .act_axis_control = 0xFF,
862 .activity_threshold = 5,
863 .inactivity_threshold = 3,
864 .inactivity_time = 4,
865 .free_fall_threshold = 0x7,
866 .free_fall_time = 0x20,
868 .data_range = ADXL_FULL_RES,
871 .ev_code_x = ABS_X, /* EV_REL */
872 .ev_code_y = ABS_Y, /* EV_REL */
873 .ev_code_z = ABS_Z, /* EV_REL */
875 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
877 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
878 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
879 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
880 .fifo_mode = ADXL_FIFO_STREAM,
881 .orientation_enable = ADXL_EN_ORIENTATION_3D,
882 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
883 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
884 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
885 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
889 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
890 static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
896 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
897 static struct bfin5xx_spi_chip spidev_chip_info = {
903 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
904 static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
910 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
911 static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
917 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
918 static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
922 #include <linux/spi/adf702x.h>
923 #define TXREG 0x0160A470
924 static const u32 adf7021_regs[] = {
943 static struct adf702x_platform_data adf7021_platform_data = {
944 .regs_base = (void *)SPORT1_TCR1,
945 .dma_ch_rx = CH_SPORT1_RX,
946 .dma_ch_tx = CH_SPORT1_TX,
947 .irq_sport_err = IRQ_SPORT1_ERROR,
948 .gpio_int_rfs = GPIO_PF8,
949 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
950 P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
951 .adf702x_model = MODEL_ADF7021,
952 .adf702x_regs = adf7021_regs,
955 static inline void adf702x_mac_init(void)
957 random_ether_addr(adf7021_platform_data.mac_addr);
960 static inline void adf702x_mac_init(void) {}
963 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
964 #include <linux/spi/ads7846.h>
965 static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
969 static int ads7873_get_pendown_state(void)
971 return gpio_get_value(GPIO_PF6);
974 static struct ads7846_platform_data __initdata ad7873_pdata = {
975 .model = 7873, /* AD7873 */
981 .debounce_tol = (~0),
982 .get_pendown_state = ads7873_get_pendown_state,
986 #if defined(CONFIG_MTD_DATAFLASH) \
987 || defined(CONFIG_MTD_DATAFLASH_MODULE)
989 static struct mtd_partition bfin_spi_dataflash_partitions[] = {
991 .name = "bootloader(spi)",
994 .mask_flags = MTD_CAP_ROM
996 .name = "linux kernel(spi)",
998 .offset = MTDPART_OFS_APPEND,
1000 .name = "file system(spi)",
1001 .size = MTDPART_SIZ_FULL,
1002 .offset = MTDPART_OFS_APPEND,
1006 static struct flash_platform_data bfin_spi_dataflash_data = {
1007 .name = "SPI Dataflash",
1008 .parts = bfin_spi_dataflash_partitions,
1009 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
1012 /* DataFlash chip */
1013 static struct bfin5xx_spi_chip data_flash_chip_info = {
1014 .enable_dma = 0, /* use dma transfer with this chip*/
1019 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1020 static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
1021 .enable_dma = 0, /* use dma transfer with this chip*/
1026 #if defined(CONFIG_AD7476) || defined(CONFIG_AD7476_MODULE)
1027 static struct bfin5xx_spi_chip spi_ad7476_chip_info = {
1028 .enable_dma = 0, /* use dma transfer with this chip*/
1033 static struct spi_board_info bfin_spi_board_info[] __initdata = {
1034 #if defined(CONFIG_MTD_M25P80) \
1035 || defined(CONFIG_MTD_M25P80_MODULE)
1037 /* the modalias must be the same as spi device driver name */
1038 .modalias = "m25p80", /* Name of spi_driver for this device */
1039 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1040 .bus_num = 0, /* Framework bus number */
1041 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
1042 .platform_data = &bfin_spi_flash_data,
1043 .controller_data = &spi_flash_chip_info,
1047 #if defined(CONFIG_MTD_DATAFLASH) \
1048 || defined(CONFIG_MTD_DATAFLASH_MODULE)
1049 { /* DataFlash chip */
1050 .modalias = "mtd_dataflash",
1051 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
1052 .bus_num = 0, /* Framework bus number */
1053 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
1054 .platform_data = &bfin_spi_dataflash_data,
1055 .controller_data = &data_flash_chip_info,
1059 #if defined(CONFIG_BFIN_SPI_ADC) \
1060 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
1062 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
1063 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
1064 .bus_num = 0, /* Framework bus number */
1065 .chip_select = 1, /* Framework chip select. */
1066 .platform_data = NULL, /* No spi_driver specific config */
1067 .controller_data = &spi_adc_chip_info,
1071 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1072 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1074 .modalias = "ad183x",
1075 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1078 .platform_data = "ad1836", /* only includes chip name for the moment */
1079 .controller_data = &ad1836_spi_chip_info,
1084 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
1086 .modalias = "ad193x",
1087 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1090 .controller_data = &ad1938_spi_chip_info,
1095 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
1097 .modalias = "adav80x",
1098 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1101 .controller_data = &adav801_spi_chip_info,
1106 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
1108 .modalias = "ad714x_captouch",
1109 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1114 .platform_data = &ad7147_spi_platform_data,
1115 .controller_data = &ad7147_spi_chip_info,
1119 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1121 .modalias = "ad2s90",
1123 .chip_select = 3, /* change it for your board */
1125 .platform_data = NULL,
1126 .controller_data = &ad2s90_spi_chip_info,
1130 #if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1132 .modalias = "ad2s120x",
1134 .chip_select = 4, /* CS, change it for your board */
1135 .platform_data = ad2s120x_platform_data,
1136 .controller_data = &ad2s120x_spi_chip_info,
1140 #if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1142 .modalias = "ad2s1210",
1143 .max_speed_hz = 8192000,
1145 .chip_select = 4, /* CS, change it for your board */
1146 .platform_data = ad2s1210_platform_data,
1147 .controller_data = &ad2s1210_spi_chip_info,
1151 #if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
1153 .modalias = "ad7314",
1154 .max_speed_hz = 1000000,
1156 .chip_select = 4, /* CS, change it for your board */
1157 .controller_data = &ad7314_spi_chip_info,
1162 #if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
1164 .modalias = "ad7818",
1165 .max_speed_hz = 1000000,
1167 .chip_select = 4, /* CS, change it for your board */
1168 .platform_data = ad7816_platform_data,
1169 .controller_data = &ad7816_spi_chip_info,
1174 #if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
1176 .modalias = "adt7310",
1177 .max_speed_hz = 1000000,
1178 .irq = IRQ_PG5, /* CT alarm event. Line 0 */
1180 .chip_select = 4, /* CS, change it for your board */
1181 .platform_data = adt7310_platform_data,
1182 .controller_data = &adt7310_spi_chip_info,
1187 #if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
1189 .modalias = "ad7298",
1190 .max_speed_hz = 1000000,
1192 .chip_select = 4, /* CS, change it for your board */
1193 .platform_data = ad7298_platform_data,
1194 .controller_data = &ad7298_spi_chip_info,
1199 #if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
1201 .modalias = "adt7316",
1202 .max_speed_hz = 1000000,
1203 .irq = IRQ_PG5, /* interrupt line */
1205 .chip_select = 4, /* CS, change it for your board */
1206 .platform_data = adt7316_spi_data,
1207 .controller_data = &adt7316_spi_chip_info,
1212 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1214 .modalias = "mmc_spi",
1215 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1218 .platform_data = &bfin_mmc_spi_pdata,
1219 .controller_data = &mmc_spi_chip_info,
1223 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1225 .modalias = "ad7877",
1226 .platform_data = &bfin_ad7877_ts_info,
1228 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1231 .controller_data = &spi_ad7877_chip_info,
1234 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
1236 .modalias = "ad7879",
1237 .platform_data = &bfin_ad7879_ts_info,
1239 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1242 .controller_data = &spi_ad7879_chip_info,
1243 .mode = SPI_CPHA | SPI_CPOL,
1246 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1248 .modalias = "spidev",
1249 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1252 .controller_data = &spidev_chip_info,
1255 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1257 .modalias = "bfin-lq035q1-spi",
1258 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1261 .controller_data = &lq035q1_spi_chip_info,
1262 .mode = SPI_CPHA | SPI_CPOL,
1265 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1267 .modalias = "enc28j60",
1268 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1271 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1272 .controller_data = &enc28j60_spi_chip_info,
1276 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1278 .modalias = "adxl34x",
1279 .platform_data = &adxl34x_info,
1281 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1284 .controller_data = &spi_adxl34x_chip_info,
1288 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1290 .modalias = "adf702x",
1291 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1293 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1294 .controller_data = &adf7021_spi_chip_info,
1295 .platform_data = &adf7021_platform_data,
1299 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1301 .modalias = "ads7846",
1302 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1305 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1306 .controller_data = &ad7873_spi_chip_info,
1307 .platform_data = &ad7873_pdata,
1311 #if defined(CONFIG_AD7476) \
1312 || defined(CONFIG_AD7476_MODULE)
1314 .modalias = "ad7476", /* Name of spi_driver for this device */
1315 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
1316 .bus_num = 0, /* Framework bus number */
1317 .chip_select = 1, /* Framework chip select. */
1318 .platform_data = NULL, /* No spi_driver specific config */
1319 .controller_data = &spi_ad7476_chip_info,
1323 #if defined(CONFIG_ADE7753) \
1324 || defined(CONFIG_ADE7753_MODULE)
1326 .modalias = "ade7753",
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_ADE7754) \
1335 || defined(CONFIG_ADE7754_MODULE)
1337 .modalias = "ade7754",
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_ADE7758) \
1346 || defined(CONFIG_ADE7758_MODULE)
1348 .modalias = "ade7758",
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_ADE7759) \
1357 || defined(CONFIG_ADE7759_MODULE)
1359 .modalias = "ade7759",
1360 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1362 .chip_select = 1, /* CS, change it for your board */
1363 .platform_data = NULL, /* No spi_driver specific config */
1367 #if defined(CONFIG_ADE7854_SPI) \
1368 || defined(CONFIG_ADE7854_SPI_MODULE)
1370 .modalias = "ade7854",
1371 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1373 .chip_select = 1, /* CS, change it for your board */
1374 .platform_data = NULL, /* No spi_driver specific config */
1378 #if defined(CONFIG_ADIS16060) \
1379 || defined(CONFIG_ADIS16060_MODULE)
1381 .modalias = "adis16060_r",
1382 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1384 .chip_select = MAX_CTRL_CS + 1, /* CS for read, change it for your board */
1385 .platform_data = NULL, /* No spi_driver specific config */
1389 .modalias = "adis16060_w",
1390 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1392 .chip_select = 2, /* CS for write, change it for your board */
1393 .platform_data = NULL, /* No spi_driver specific config */
1397 #if defined(CONFIG_ADIS16130) \
1398 || defined(CONFIG_ADIS16130_MODULE)
1400 .modalias = "adis16130",
1401 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1403 .chip_select = 1, /* CS for read, change it for your board */
1404 .platform_data = NULL, /* No spi_driver specific config */
1408 #if defined(CONFIG_ADIS16201) \
1409 || defined(CONFIG_ADIS16201_MODULE)
1411 .modalias = "adis16201",
1412 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1414 .chip_select = 5, /* CS, change it for your board */
1415 .platform_data = NULL, /* No spi_driver specific config */
1420 #if defined(CONFIG_ADIS16203) \
1421 || defined(CONFIG_ADIS16203_MODULE)
1423 .modalias = "adis16203",
1424 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1426 .chip_select = 5, /* CS, change it for your board */
1427 .platform_data = NULL, /* No spi_driver specific config */
1432 #if defined(CONFIG_ADIS16204) \
1433 || defined(CONFIG_ADIS16204_MODULE)
1435 .modalias = "adis16204",
1436 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1438 .chip_select = 5, /* CS, change it for your board */
1439 .platform_data = NULL, /* No spi_driver specific config */
1444 #if defined(CONFIG_ADIS16209) \
1445 || defined(CONFIG_ADIS16209_MODULE)
1447 .modalias = "adis16209",
1448 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1450 .chip_select = 5, /* CS, change it for your board */
1451 .platform_data = NULL, /* No spi_driver specific config */
1456 #if defined(CONFIG_ADIS16220) \
1457 || defined(CONFIG_ADIS16220_MODULE)
1459 .modalias = "adis16220",
1460 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1462 .chip_select = 5, /* CS, change it for your board */
1463 .platform_data = NULL, /* No spi_driver specific config */
1468 #if defined(CONFIG_ADIS16240) \
1469 || defined(CONFIG_ADIS16240_MODULE)
1471 .modalias = "adis16240",
1472 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1474 .chip_select = 5, /* CS, change it for your board */
1475 .platform_data = NULL, /* No spi_driver specific config */
1480 #if defined(CONFIG_ADIS16260) \
1481 || defined(CONFIG_ADIS16260_MODULE)
1483 .modalias = "adis16260",
1484 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1486 .chip_select = 5, /* CS, change it for your board */
1487 .platform_data = NULL, /* No spi_driver specific config */
1492 #if defined(CONFIG_ADIS16261) \
1493 || defined(CONFIG_ADIS16261_MODULE)
1495 .modalias = "adis16261",
1496 .max_speed_hz = 2500000, /* max spi clock (SCK) speed in HZ */
1498 .chip_select = 1, /* CS, change it for your board */
1499 .platform_data = NULL, /* No spi_driver specific config */
1503 #if defined(CONFIG_ADIS16300) \
1504 || defined(CONFIG_ADIS16300_MODULE)
1506 .modalias = "adis16300",
1507 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1509 .chip_select = 5, /* CS, change it for your board */
1510 .platform_data = NULL, /* No spi_driver specific config */
1515 #if defined(CONFIG_ADIS16350) \
1516 || defined(CONFIG_ADIS16350_MODULE)
1518 .modalias = "adis16364",
1519 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1521 .chip_select = 5, /* CS, change it for your board */
1522 .platform_data = NULL, /* No spi_driver specific config */
1527 #if defined(CONFIG_ADIS16400) \
1528 || defined(CONFIG_ADIS16400_MODULE)
1530 .modalias = "adis16400",
1531 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1533 .chip_select = 1, /* CS, change it for your board */
1534 .platform_data = NULL, /* No spi_driver specific config */
1540 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1541 /* SPI controller data */
1542 static struct bfin5xx_spi_master bfin_spi0_info = {
1543 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
1544 .enable_dma = 1, /* master has the ability to do dma transfer */
1545 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
1549 static struct resource bfin_spi0_resource[] = {
1551 .start = SPI0_REGBASE,
1552 .end = SPI0_REGBASE + 0xFF,
1553 .flags = IORESOURCE_MEM,
1558 .flags = IORESOURCE_DMA,
1563 .flags = IORESOURCE_IRQ,
1567 static struct platform_device bfin_spi0_device = {
1569 .id = 0, /* Bus number */
1570 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1571 .resource = bfin_spi0_resource,
1573 .platform_data = &bfin_spi0_info, /* Passed to driver */
1576 #endif /* spi master and devices */
1578 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1580 /* SPORT SPI controller data */
1581 static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1582 .num_chipselect = 1, /* master only supports one device */
1583 .enable_dma = 0, /* master don't support DMA */
1584 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1585 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1588 static struct resource bfin_sport_spi0_resource[] = {
1590 .start = SPORT0_TCR1,
1591 .end = SPORT0_TCR1 + 0xFF,
1592 .flags = IORESOURCE_MEM,
1595 .start = IRQ_SPORT0_ERROR,
1596 .end = IRQ_SPORT0_ERROR,
1597 .flags = IORESOURCE_IRQ,
1601 static struct platform_device bfin_sport_spi0_device = {
1602 .name = "bfin-sport-spi",
1603 .id = 1, /* Bus number */
1604 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1605 .resource = bfin_sport_spi0_resource,
1607 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1611 static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1612 .num_chipselect = 1, /* master only supports one device */
1613 .enable_dma = 0, /* master don't support DMA */
1614 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1615 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1618 static struct resource bfin_sport_spi1_resource[] = {
1620 .start = SPORT1_TCR1,
1621 .end = SPORT1_TCR1 + 0xFF,
1622 .flags = IORESOURCE_MEM,
1625 .start = IRQ_SPORT1_ERROR,
1626 .end = IRQ_SPORT1_ERROR,
1627 .flags = IORESOURCE_IRQ,
1631 static struct platform_device bfin_sport_spi1_device = {
1632 .name = "bfin-sport-spi",
1633 .id = 2, /* Bus number */
1634 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1635 .resource = bfin_sport_spi1_resource,
1637 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1641 #endif /* sport spi master and devices */
1643 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1644 static struct platform_device bfin_fb_device = {
1645 .name = "bf537-lq035",
1649 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1650 #include <asm/bfin-lq035q1.h>
1652 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
1653 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1654 .ppi_mode = USE_RGB565_16_BIT_PPI,
1655 .use_bl = 0, /* let something else control the LCD Blacklight */
1656 .gpio_bl = GPIO_PF7,
1659 static struct resource bfin_lq035q1_resources[] = {
1661 .start = IRQ_PPI_ERROR,
1662 .end = IRQ_PPI_ERROR,
1663 .flags = IORESOURCE_IRQ,
1667 static struct platform_device bfin_lq035q1_device = {
1668 .name = "bfin-lq035q1",
1670 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1671 .resource = bfin_lq035q1_resources,
1673 .platform_data = &bfin_lq035q1_data,
1678 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1679 #ifdef CONFIG_SERIAL_BFIN_UART0
1680 static struct resource bfin_uart0_resources[] = {
1683 .end = UART0_GCTL+2,
1684 .flags = IORESOURCE_MEM,
1687 .start = IRQ_UART0_RX,
1688 .end = IRQ_UART0_RX+1,
1689 .flags = IORESOURCE_IRQ,
1692 .start = IRQ_UART0_ERROR,
1693 .end = IRQ_UART0_ERROR,
1694 .flags = IORESOURCE_IRQ,
1697 .start = CH_UART0_TX,
1699 .flags = IORESOURCE_DMA,
1702 .start = CH_UART0_RX,
1704 .flags = IORESOURCE_DMA,
1706 #ifdef CONFIG_BFIN_UART0_CTSRTS
1710 .flags = IORESOURCE_IO,
1715 .flags = IORESOURCE_IO,
1720 static unsigned short bfin_uart0_peripherals[] = {
1721 P_UART0_TX, P_UART0_RX, 0
1724 static struct platform_device bfin_uart0_device = {
1725 .name = "bfin-uart",
1727 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1728 .resource = bfin_uart0_resources,
1730 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1734 #ifdef CONFIG_SERIAL_BFIN_UART1
1735 static struct resource bfin_uart1_resources[] = {
1738 .end = UART1_GCTL+2,
1739 .flags = IORESOURCE_MEM,
1742 .start = IRQ_UART1_RX,
1743 .end = IRQ_UART1_RX+1,
1744 .flags = IORESOURCE_IRQ,
1747 .start = IRQ_UART1_ERROR,
1748 .end = IRQ_UART1_ERROR,
1749 .flags = IORESOURCE_IRQ,
1752 .start = CH_UART1_TX,
1754 .flags = IORESOURCE_DMA,
1757 .start = CH_UART1_RX,
1759 .flags = IORESOURCE_DMA,
1763 static unsigned short bfin_uart1_peripherals[] = {
1764 P_UART1_TX, P_UART1_RX, 0
1767 static struct platform_device bfin_uart1_device = {
1768 .name = "bfin-uart",
1770 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1771 .resource = bfin_uart1_resources,
1773 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1779 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1780 #ifdef CONFIG_BFIN_SIR0
1781 static struct resource bfin_sir0_resources[] = {
1783 .start = 0xFFC00400,
1785 .flags = IORESOURCE_MEM,
1788 .start = IRQ_UART0_RX,
1789 .end = IRQ_UART0_RX+1,
1790 .flags = IORESOURCE_IRQ,
1793 .start = CH_UART0_RX,
1794 .end = CH_UART0_RX+1,
1795 .flags = IORESOURCE_DMA,
1799 static struct platform_device bfin_sir0_device = {
1802 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1803 .resource = bfin_sir0_resources,
1806 #ifdef CONFIG_BFIN_SIR1
1807 static struct resource bfin_sir1_resources[] = {
1809 .start = 0xFFC02000,
1811 .flags = IORESOURCE_MEM,
1814 .start = IRQ_UART1_RX,
1815 .end = IRQ_UART1_RX+1,
1816 .flags = IORESOURCE_IRQ,
1819 .start = CH_UART1_RX,
1820 .end = CH_UART1_RX+1,
1821 .flags = IORESOURCE_DMA,
1825 static struct platform_device bfin_sir1_device = {
1828 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1829 .resource = bfin_sir1_resources,
1834 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1835 static struct resource bfin_twi0_resource[] = {
1837 .start = TWI0_REGBASE,
1838 .end = TWI0_REGBASE,
1839 .flags = IORESOURCE_MEM,
1844 .flags = IORESOURCE_IRQ,
1848 static struct platform_device i2c_bfin_twi_device = {
1849 .name = "i2c-bfin-twi",
1851 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1852 .resource = bfin_twi0_resource,
1856 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1857 static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1871 [13] = KEY_BACKSLASH,
1883 [26] = KEY_LEFTBRACE,
1884 [27] = KEY_RIGHTBRACE,
1897 [41] = KEY_SEMICOLON,
1898 [42] = KEY_APOSTROPHE,
1899 [43] = KEY_BACKSLASH,
1919 [65] = KEY_BACKSPACE,
1932 static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1935 .keymap = adp5588_keymap,
1936 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1941 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1942 #include <linux/mfd/adp5520.h>
1945 * ADP5520/5501 Backlight Data
1948 static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1949 .fade_in = ADP5520_FADE_T_1200ms,
1950 .fade_out = ADP5520_FADE_T_1200ms,
1951 .fade_led_law = ADP5520_BL_LAW_LINEAR,
1953 .abml_filt = ADP5520_BL_AMBL_FILT_640ms,
1954 .l1_daylight_max = ADP5520_BL_CUR_mA(15),
1955 .l1_daylight_dim = ADP5520_BL_CUR_mA(0),
1956 .l2_office_max = ADP5520_BL_CUR_mA(7),
1957 .l2_office_dim = ADP5520_BL_CUR_mA(0),
1958 .l3_dark_max = ADP5520_BL_CUR_mA(3),
1959 .l3_dark_dim = ADP5520_BL_CUR_mA(0),
1960 .l2_trip = ADP5520_L2_COMP_CURR_uA(700),
1961 .l2_hyst = ADP5520_L2_COMP_CURR_uA(50),
1962 .l3_trip = ADP5520_L3_COMP_CURR_uA(80),
1963 .l3_hyst = ADP5520_L3_COMP_CURR_uA(20),
1967 * ADP5520/5501 LEDs Data
1970 static struct led_info adp5520_leds[] = {
1972 .name = "adp5520-led1",
1973 .default_trigger = "none",
1974 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
1976 #ifdef ADP5520_EN_ALL_LEDS
1978 .name = "adp5520-led2",
1979 .default_trigger = "none",
1980 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1983 .name = "adp5520-led3",
1984 .default_trigger = "none",
1985 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1990 static struct adp5520_leds_platform_data adp5520_leds_data = {
1991 .num_leds = ARRAY_SIZE(adp5520_leds),
1992 .leds = adp5520_leds,
1993 .fade_in = ADP5520_FADE_T_600ms,
1994 .fade_out = ADP5520_FADE_T_600ms,
1995 .led_on_time = ADP5520_LED_ONT_600ms,
2002 static struct adp5520_gpio_platform_data adp5520_gpio_data = {
2004 .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
2005 .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
2009 * ADP5520 Keypad Data
2012 static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
2013 [ADP5520_KEY(0, 0)] = KEY_GRAVE,
2014 [ADP5520_KEY(0, 1)] = KEY_1,
2015 [ADP5520_KEY(0, 2)] = KEY_2,
2016 [ADP5520_KEY(0, 3)] = KEY_3,
2017 [ADP5520_KEY(1, 0)] = KEY_4,
2018 [ADP5520_KEY(1, 1)] = KEY_5,
2019 [ADP5520_KEY(1, 2)] = KEY_6,
2020 [ADP5520_KEY(1, 3)] = KEY_7,
2021 [ADP5520_KEY(2, 0)] = KEY_8,
2022 [ADP5520_KEY(2, 1)] = KEY_9,
2023 [ADP5520_KEY(2, 2)] = KEY_0,
2024 [ADP5520_KEY(2, 3)] = KEY_MINUS,
2025 [ADP5520_KEY(3, 0)] = KEY_EQUAL,
2026 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH,
2027 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE,
2028 [ADP5520_KEY(3, 3)] = KEY_ENTER,
2031 static struct adp5520_keys_platform_data adp5520_keys_data = {
2032 .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
2033 .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
2034 .keymap = adp5520_keymap,
2035 .keymapsize = ARRAY_SIZE(adp5520_keymap),
2040 * ADP5520/5501 Multifunction Device Init Data
2043 static struct adp5520_platform_data adp5520_pdev_data = {
2044 .backlight = &adp5520_backlight_data,
2045 .leds = &adp5520_leds_data,
2046 .gpio = &adp5520_gpio_data,
2047 .keys = &adp5520_keys_data,
2052 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2053 static struct adp5588_gpio_platform_data adp5588_gpio_data = {
2055 .pullup_dis_mask = 0,
2059 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2060 #include <linux/i2c/adp8870.h>
2061 static struct led_info adp8870_leds[] = {
2063 .name = "adp8870-led7",
2064 .default_trigger = "none",
2065 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
2070 static struct adp8870_backlight_platform_data adp8870_pdata = {
2071 .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
2072 ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
2073 .pwm_assign = 0, /* 1 = Enables PWM mode */
2075 .bl_fade_in = ADP8870_FADE_T_1200ms, /* Backlight Fade-In Timer */
2076 .bl_fade_out = ADP8870_FADE_T_1200ms, /* Backlight Fade-Out Timer */
2077 .bl_fade_law = ADP8870_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
2079 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2080 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
2082 .l1_daylight_max = ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2083 .l1_daylight_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2084 .l2_bright_max = ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2085 .l2_bright_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2086 .l3_office_max = ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2087 .l3_office_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2088 .l4_indoor_max = ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2089 .l4_indor_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2090 .l5_dark_max = ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2091 .l5_dark_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2093 .l2_trip = ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2094 .l2_hyst = ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2095 .l3_trip = ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2096 .l3_hyst = ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2097 .l4_trip = ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2098 .l4_hyst = ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2099 .l5_trip = ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2100 .l5_hyst = ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2102 .leds = adp8870_leds,
2103 .num_leds = ARRAY_SIZE(adp8870_leds),
2104 .led_fade_law = ADP8870_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
2105 .led_fade_in = ADP8870_FADE_T_600ms,
2106 .led_fade_out = ADP8870_FADE_T_600ms,
2107 .led_on_time = ADP8870_LED_ONT_200ms,
2111 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2112 #include <linux/i2c/adp8860.h>
2113 static struct led_info adp8860_leds[] = {
2115 .name = "adp8860-led7",
2116 .default_trigger = "none",
2117 .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
2121 static struct adp8860_backlight_platform_data adp8860_pdata = {
2122 .bl_led_assign = ADP8860_BL_D1 | ADP8860_BL_D2 | ADP8860_BL_D3 |
2123 ADP8860_BL_D4 | ADP8860_BL_D5 | ADP8860_BL_D6, /* 1 = Backlight 0 = Individual LED */
2125 .bl_fade_in = ADP8860_FADE_T_1200ms, /* Backlight Fade-In Timer */
2126 .bl_fade_out = ADP8860_FADE_T_1200ms, /* Backlight Fade-Out Timer */
2127 .bl_fade_law = ADP8860_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
2129 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2130 .abml_filt = ADP8860_BL_AMBL_FILT_320ms, /* Light sensor filter time */
2132 .l1_daylight_max = ADP8860_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2133 .l1_daylight_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2134 .l2_office_max = ADP8860_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2135 .l2_office_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2136 .l3_dark_max = ADP8860_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2137 .l3_dark_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2139 .l2_trip = ADP8860_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2140 .l2_hyst = ADP8860_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2141 .l3_trip = ADP8860_L3_COMP_CURR_uA(43), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2142 .l3_hyst = ADP8860_L3_COMP_CURR_uA(11), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2144 .leds = adp8860_leds,
2145 .num_leds = ARRAY_SIZE(adp8860_leds),
2146 .led_fade_law = ADP8860_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
2147 .led_fade_in = ADP8860_FADE_T_600ms,
2148 .led_fade_out = ADP8860_FADE_T_600ms,
2149 .led_on_time = ADP8860_LED_ONT_200ms,
2153 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2154 static struct regulator_consumer_supply ad5398_consumer = {
2155 .supply = "current",
2158 static struct regulator_init_data ad5398_regulator_data = {
2160 .name = "current range",
2162 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
2164 .num_consumer_supplies = 1,
2165 .consumer_supplies = &ad5398_consumer,
2168 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2169 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2170 static struct platform_device ad5398_virt_consumer_device = {
2171 .name = "reg-virt-consumer",
2174 .platform_data = "current", /* Passed to driver */
2178 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2179 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2180 static struct regulator_bulk_data ad5398_bulk_data = {
2181 .supply = "current",
2184 static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
2187 .supplies = &ad5398_bulk_data,
2190 static struct platform_device ad5398_userspace_consumer_device = {
2191 .name = "reg-userspace-consumer",
2194 .platform_data = &ad5398_userspace_comsumer_data,
2200 #if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2201 /* INT bound temperature alarm event. line 1 */
2202 static unsigned long adt7410_platform_data[2] = {
2203 IRQ_PG4, IRQF_TRIGGER_LOW,
2207 #if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2208 /* INT bound temperature alarm event. line 1 */
2209 static unsigned long adt7316_i2c_data[2] = {
2210 IRQF_TRIGGER_LOW, /* interrupt flags */
2211 GPIO_PF4, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
2215 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
2216 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
2218 I2C_BOARD_INFO("ad1937", 0x04),
2222 #if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
2224 I2C_BOARD_INFO("adav803", 0x10),
2228 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
2230 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
2232 .platform_data = (void *)&ad7142_i2c_platform_data,
2236 #if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
2238 I2C_BOARD_INFO("ad7150", 0x48),
2239 .irq = IRQ_PG5, /* fixme: use real interrupt number */
2243 #if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
2245 I2C_BOARD_INFO("ad7152", 0x48),
2249 #if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
2251 I2C_BOARD_INFO("ad774x", 0x48),
2255 #if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
2257 I2C_BOARD_INFO("ad7414", 0x9),
2259 .irq_flags = IRQF_TRIGGER_LOW,
2263 #if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
2265 I2C_BOARD_INFO("ad7417", 0xb),
2267 .irq_flags = IRQF_TRIGGER_LOW,
2268 .platform_data = (void *)GPIO_PF4,
2272 #if defined(CONFIG_ADE7854_I2C) || defined(CONFIG_ADE7854_I2C_MODULE)
2274 I2C_BOARD_INFO("ade7854", 0x38),
2278 #if defined(CONFIG_ADT75) || defined(CONFIG_ADT75_MODULE)
2280 I2C_BOARD_INFO("adt75", 0x9),
2282 .irq_flags = IRQF_TRIGGER_LOW,
2286 #if defined(CONFIG_ADT7408) || defined(CONFIG_ADT7408_MODULE)
2288 I2C_BOARD_INFO("adt7408", 0x18),
2290 .irq_flags = IRQF_TRIGGER_LOW,
2294 #if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2296 I2C_BOARD_INFO("adt7410", 0x48),
2297 /* CT critical temperature event. line 0 */
2299 .irq_flags = IRQF_TRIGGER_LOW,
2300 .platform_data = (void *)&adt7410_platform_data,
2304 #if defined(CONFIG_AD7291) || defined(CONFIG_AD7291_MODULE)
2306 I2C_BOARD_INFO("ad7291", 0x20),
2308 .irq_flags = IRQF_TRIGGER_LOW,
2312 #if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2314 I2C_BOARD_INFO("adt7316", 0x48),
2316 .platform_data = (void *)&adt7316_i2c_data,
2320 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
2322 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
2325 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
2327 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
2331 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
2333 I2C_BOARD_INFO("ad7879", 0x2F),
2335 .platform_data = (void *)&bfin_ad7879_ts_info,
2338 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
2340 I2C_BOARD_INFO("adp5588-keys", 0x34),
2342 .platform_data = (void *)&adp5588_kpad_data,
2345 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
2347 I2C_BOARD_INFO("pmic-adp5520", 0x32),
2349 .platform_data = (void *)&adp5520_pdev_data,
2352 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
2354 I2C_BOARD_INFO("adxl34x", 0x53),
2356 .platform_data = (void *)&adxl34x_info,
2359 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2361 I2C_BOARD_INFO("adp5588-gpio", 0x34),
2362 .platform_data = (void *)&adp5588_gpio_data,
2365 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
2367 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
2370 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2372 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2F),
2375 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2377 I2C_BOARD_INFO("adp8870", 0x2B),
2378 .platform_data = (void *)&adp8870_pdata,
2381 #if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
2383 I2C_BOARD_INFO("adau1371", 0x1A),
2386 #if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
2388 I2C_BOARD_INFO("adau1761", 0x38),
2391 #if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
2393 I2C_BOARD_INFO("adau1361", 0x38),
2396 #if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
2398 I2C_BOARD_INFO("ad5258", 0x18),
2401 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
2403 I2C_BOARD_INFO("ssm2602", 0x1b),
2406 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2408 I2C_BOARD_INFO("ad5398", 0xC),
2409 .platform_data = (void *)&ad5398_regulator_data,
2412 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2414 I2C_BOARD_INFO("adp8860", 0x2A),
2415 .platform_data = (void *)&adp8860_pdata,
2418 #if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE)
2420 I2C_BOARD_INFO("adau1373", 0x1A),
2423 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
2425 I2C_BOARD_INFO("ad5252", 0x2e),
2430 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
2431 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2432 static struct resource bfin_sport0_uart_resources[] = {
2434 .start = SPORT0_TCR1,
2435 .end = SPORT0_MRCS3+4,
2436 .flags = IORESOURCE_MEM,
2439 .start = IRQ_SPORT0_RX,
2440 .end = IRQ_SPORT0_RX+1,
2441 .flags = IORESOURCE_IRQ,
2444 .start = IRQ_SPORT0_ERROR,
2445 .end = IRQ_SPORT0_ERROR,
2446 .flags = IORESOURCE_IRQ,
2450 static unsigned short bfin_sport0_peripherals[] = {
2451 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
2452 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
2455 static struct platform_device bfin_sport0_uart_device = {
2456 .name = "bfin-sport-uart",
2458 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
2459 .resource = bfin_sport0_uart_resources,
2461 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
2465 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2466 static struct resource bfin_sport1_uart_resources[] = {
2468 .start = SPORT1_TCR1,
2469 .end = SPORT1_MRCS3+4,
2470 .flags = IORESOURCE_MEM,
2473 .start = IRQ_SPORT1_RX,
2474 .end = IRQ_SPORT1_RX+1,
2475 .flags = IORESOURCE_IRQ,
2478 .start = IRQ_SPORT1_ERROR,
2479 .end = IRQ_SPORT1_ERROR,
2480 .flags = IORESOURCE_IRQ,
2484 static unsigned short bfin_sport1_peripherals[] = {
2485 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
2486 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
2489 static struct platform_device bfin_sport1_uart_device = {
2490 .name = "bfin-sport-uart",
2492 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
2493 .resource = bfin_sport1_uart_resources,
2495 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
2501 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2502 #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2503 /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
2505 #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2506 #define PATA_INT IRQ_PF5
2507 static struct pata_platform_info bfin_pata_platform_data = {
2509 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
2512 static struct resource bfin_pata_resources[] = {
2514 .start = 0x20314020,
2516 .flags = IORESOURCE_MEM,
2519 .start = 0x2031401C,
2521 .flags = IORESOURCE_MEM,
2526 .flags = IORESOURCE_IRQ,
2529 #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
2530 static struct pata_platform_info bfin_pata_platform_data = {
2533 /* CompactFlash Storage Card Memory Mapped Addressing
2536 static struct resource bfin_pata_resources[] = {
2538 .start = 0x20211800,
2540 .flags = IORESOURCE_MEM,
2543 .start = 0x2021180E, /* Device Ctl */
2545 .flags = IORESOURCE_MEM,
2550 static struct platform_device bfin_pata_device = {
2551 .name = "pata_platform",
2553 .num_resources = ARRAY_SIZE(bfin_pata_resources),
2554 .resource = bfin_pata_resources,
2556 .platform_data = &bfin_pata_platform_data,
2561 static const unsigned int cclk_vlev_datasheet[] =
2563 VRPAIR(VLEV_085, 250000000),
2564 VRPAIR(VLEV_090, 376000000),
2565 VRPAIR(VLEV_095, 426000000),
2566 VRPAIR(VLEV_100, 426000000),
2567 VRPAIR(VLEV_105, 476000000),
2568 VRPAIR(VLEV_110, 476000000),
2569 VRPAIR(VLEV_115, 476000000),
2570 VRPAIR(VLEV_120, 500000000),
2571 VRPAIR(VLEV_125, 533000000),
2572 VRPAIR(VLEV_130, 600000000),
2575 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
2576 .tuple_tab = cclk_vlev_datasheet,
2577 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
2578 .vr_settling_time = 25 /* us */,
2581 static struct platform_device bfin_dpmc = {
2582 .name = "bfin dpmc",
2584 .platform_data = &bfin_dmpc_vreg_data,
2588 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2589 static struct platform_device bfin_i2s = {
2591 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2592 /* TODO: add platform data here */
2596 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2597 static struct platform_device bfin_tdm = {
2599 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2600 /* TODO: add platform data here */
2604 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2605 static struct platform_device bfin_ac97 = {
2606 .name = "bfin-ac97",
2607 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2608 /* TODO: add platform data here */
2612 #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
2613 #define REGULATOR_ADP122 "adp122"
2614 #define REGULATOR_ADP122_UV 2500000
2616 static struct regulator_consumer_supply adp122_consumers = {
2617 .supply = REGULATOR_ADP122,
2620 static struct regulator_init_data adp_switch_regulator_data = {
2622 .name = REGULATOR_ADP122,
2623 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2624 .min_uV = REGULATOR_ADP122_UV,
2625 .max_uV = REGULATOR_ADP122_UV,
2629 .num_consumer_supplies = 1, /* only 1 */
2630 .consumer_supplies = &adp122_consumers,
2633 static struct fixed_voltage_config adp_switch_pdata = {
2634 .supply_name = REGULATOR_ADP122,
2635 .microvolts = REGULATOR_ADP122_UV,
2638 .enabled_at_boot = 0,
2639 .init_data = &adp_switch_regulator_data,
2642 static struct platform_device adp_switch_device = {
2643 .name = "reg-fixed-voltage",
2646 .platform_data = &adp_switch_pdata,
2650 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2651 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2652 static struct regulator_bulk_data adp122_bulk_data = {
2653 .supply = REGULATOR_ADP122,
2656 static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2657 .name = REGULATOR_ADP122,
2659 .supplies = &adp122_bulk_data,
2662 static struct platform_device adp122_userspace_consumer_device = {
2663 .name = "reg-userspace-consumer",
2666 .platform_data = &adp122_userspace_comsumer_data,
2672 #if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2673 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2675 static struct resource iio_gpio_trigger_resources[] = {
2679 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
2683 static struct platform_device iio_gpio_trigger = {
2684 .name = "iio_gpio_trigger",
2685 .num_resources = ARRAY_SIZE(iio_gpio_trigger_resources),
2686 .resource = iio_gpio_trigger_resources,
2690 static struct platform_device *stamp_devices[] __initdata = {
2694 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2695 &bfin_pcmcia_cf_device,
2698 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2702 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2706 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2707 &isp1362_hcd_device,
2710 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2711 &bfin_isp1760_device,
2714 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2718 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2722 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2726 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
2731 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2732 &net2272_bfin_device,
2735 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
2739 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2740 &bfin_sport_spi0_device,
2741 &bfin_sport_spi1_device,
2744 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2748 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2749 &bfin_lq035q1_device,
2752 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
2753 #ifdef CONFIG_SERIAL_BFIN_UART0
2756 #ifdef CONFIG_SERIAL_BFIN_UART1
2761 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
2762 #ifdef CONFIG_BFIN_SIR0
2765 #ifdef CONFIG_BFIN_SIR1
2770 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2771 &i2c_bfin_twi_device,
2774 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
2775 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2776 &bfin_sport0_uart_device,
2778 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2779 &bfin_sport1_uart_device,
2783 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2787 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2788 &bfin_device_gpiokeys,
2791 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2792 &bfin_async_nand_device,
2795 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
2796 &stamp_flash_device,
2799 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2803 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2807 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2810 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2811 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2812 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2813 &ad5398_virt_consumer_device,
2815 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2816 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2817 &ad5398_userspace_consumer_device,
2821 #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
2823 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2824 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2825 &adp122_userspace_consumer_device,
2829 #if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2830 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2835 static int __init stamp_init(void)
2837 printk(KERN_INFO "%s(): registering device resources\n", __func__);
2838 bfin_plat_nand_init();
2840 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
2841 i2c_register_board_info(0, bfin_i2c_board_info,
2842 ARRAY_SIZE(bfin_i2c_board_info));
2843 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
2848 arch_initcall(stamp_init);
2851 static struct platform_device *stamp_early_devices[] __initdata = {
2852 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2853 #ifdef CONFIG_SERIAL_BFIN_UART0
2856 #ifdef CONFIG_SERIAL_BFIN_UART1
2861 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2862 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2863 &bfin_sport0_uart_device,
2865 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2866 &bfin_sport1_uart_device,
2871 void __init native_machine_early_platform_add_devices(void)
2873 printk(KERN_INFO "register early platform devices\n");
2874 early_platform_add_devices(stamp_early_devices,
2875 ARRAY_SIZE(stamp_early_devices));
2878 void native_machine_restart(char *cmd)
2880 /* workaround reboot hang when booting from SPI */
2881 if ((bfin_read_SYSCR() & 0x7) == 0x3)
2882 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
2886 * Currently the MAC address is saved in Flash by U-Boot
2888 #define FLASH_MAC 0x203f0000
2889 void bfin_get_ether_addr(char *addr)
2891 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2892 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2894 EXPORT_SYMBOL(bfin_get_ether_addr);