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_ADP_SWITCH
39 #include <linux/regulator/adp_switch.h>
41 #ifdef CONFIG_REGULATOR_AD5398
42 #include <linux/regulator/ad5398.h>
44 #include <linux/regulator/consumer.h>
45 #include <linux/regulator/userspace-consumer.h>
48 * Name the Board for the /proc/cpuinfo
50 const char bfin_board_name
[] = "ADI BF537-STAMP";
53 * Driver needs to know address, irq and flag pin.
56 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
57 #include <linux/usb/isp1760.h>
58 static struct resource bfin_isp1760_resources
[] = {
61 .end
= 0x203C0000 + 0x000fffff,
62 .flags
= IORESOURCE_MEM
,
67 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
71 static struct isp1760_platform_data isp1760_priv
= {
76 .dack_polarity_high
= 0,
77 .dreq_polarity_high
= 0,
80 static struct platform_device bfin_isp1760_device
= {
84 .platform_data
= &isp1760_priv
,
86 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
87 .resource
= bfin_isp1760_resources
,
91 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
92 #include <linux/gpio_keys.h>
94 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
95 {BTN_0
, GPIO_PF2
, 1, "gpio-keys: BTN0"},
96 {BTN_1
, GPIO_PF3
, 1, "gpio-keys: BTN1"},
97 {BTN_2
, GPIO_PF4
, 1, "gpio-keys: BTN2"},
98 {BTN_3
, GPIO_PF5
, 1, "gpio-keys: BTN3"},
101 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
102 .buttons
= bfin_gpio_keys_table
,
103 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
106 static struct platform_device bfin_device_gpiokeys
= {
109 .platform_data
= &bfin_gpio_keys_data
,
114 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
115 static struct resource bfin_pcmcia_cf_resources
[] = {
117 .start
= 0x20310000, /* IO PORT */
119 .flags
= IORESOURCE_MEM
,
121 .start
= 0x20311000, /* Attribute Memory */
123 .flags
= IORESOURCE_MEM
,
127 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
129 .start
= 6, /* Card Detect PF6 */
131 .flags
= IORESOURCE_IRQ
,
135 static struct platform_device bfin_pcmcia_cf_device
= {
136 .name
= "bfin_cf_pcmcia",
138 .num_resources
= ARRAY_SIZE(bfin_pcmcia_cf_resources
),
139 .resource
= bfin_pcmcia_cf_resources
,
143 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
144 static struct platform_device rtc_device
= {
150 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
151 #include <linux/smc91x.h>
153 static struct smc91x_platdata smc91x_info
= {
154 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
155 .leda
= RPC_LED_100_10
,
156 .ledb
= RPC_LED_TX_RX
,
159 static struct resource smc91x_resources
[] = {
161 .name
= "smc91x-regs",
163 .end
= 0x20300300 + 16,
164 .flags
= IORESOURCE_MEM
,
169 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
172 static struct platform_device smc91x_device
= {
175 .num_resources
= ARRAY_SIZE(smc91x_resources
),
176 .resource
= smc91x_resources
,
178 .platform_data
= &smc91x_info
,
183 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
184 static struct resource dm9000_resources
[] = {
187 .end
= 0x203FB800 + 1,
188 .flags
= IORESOURCE_MEM
,
192 .end
= 0x203FB804 + 1,
193 .flags
= IORESOURCE_MEM
,
198 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
),
202 static struct platform_device dm9000_device
= {
205 .num_resources
= ARRAY_SIZE(dm9000_resources
),
206 .resource
= dm9000_resources
,
210 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
211 static struct resource sl811_hcd_resources
[] = {
215 .flags
= IORESOURCE_MEM
,
219 .flags
= IORESOURCE_MEM
,
223 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
227 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
228 void sl811_port_power(struct device
*dev
, int is_on
)
230 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, "usb:SL811_VBUS");
231 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, is_on
);
235 static struct sl811_platform_data sl811_priv
= {
237 .power
= 250, /* == 500mA */
238 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
239 .port_power
= &sl811_port_power
,
243 static struct platform_device sl811_hcd_device
= {
247 .platform_data
= &sl811_priv
,
249 .num_resources
= ARRAY_SIZE(sl811_hcd_resources
),
250 .resource
= sl811_hcd_resources
,
254 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
255 static struct resource isp1362_hcd_resources
[] = {
259 .flags
= IORESOURCE_MEM
,
263 .flags
= IORESOURCE_MEM
,
267 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
271 static struct isp1362_platform_data isp1362_priv
= {
276 .int_edge_triggered
= 0,
277 .remote_wakeup_connected
= 0,
278 .no_power_switching
= 1,
279 .power_switching_mode
= 0,
282 static struct platform_device isp1362_hcd_device
= {
283 .name
= "isp1362-hcd",
286 .platform_data
= &isp1362_priv
,
288 .num_resources
= ARRAY_SIZE(isp1362_hcd_resources
),
289 .resource
= isp1362_hcd_resources
,
293 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
294 unsigned short bfin_can_peripherals
[] = {
295 P_CAN0_RX
, P_CAN0_TX
, 0
298 static struct resource bfin_can_resources
[] = {
302 .flags
= IORESOURCE_MEM
,
307 .flags
= IORESOURCE_IRQ
,
312 .flags
= IORESOURCE_IRQ
,
315 .start
= IRQ_CAN_ERROR
,
316 .end
= IRQ_CAN_ERROR
,
317 .flags
= IORESOURCE_IRQ
,
321 static struct platform_device bfin_can_device
= {
323 .num_resources
= ARRAY_SIZE(bfin_can_resources
),
324 .resource
= bfin_can_resources
,
326 .platform_data
= &bfin_can_peripherals
, /* Passed to driver */
331 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
332 static struct platform_device bfin_mii_bus
= {
333 .name
= "bfin_mii_bus",
336 static struct platform_device bfin_mac_device
= {
338 .dev
.platform_data
= &bfin_mii_bus
,
342 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
343 static struct resource net2272_bfin_resources
[] = {
346 .end
= 0x20300000 + 0x100,
347 .flags
= IORESOURCE_MEM
,
351 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
355 static struct platform_device net2272_bfin_device
= {
358 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
359 .resource
= net2272_bfin_resources
,
363 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
364 #ifdef CONFIG_MTD_PARTITIONS
365 const char *part_probes
[] = { "cmdlinepart", "RedBoot", NULL
};
367 static struct mtd_partition bfin_plat_nand_partitions
[] = {
369 .name
= "linux kernel(nand)",
373 .name
= "file system(nand)",
374 .size
= MTDPART_SIZ_FULL
,
375 .offset
= MTDPART_OFS_APPEND
,
380 #define BFIN_NAND_PLAT_CLE 2
381 #define BFIN_NAND_PLAT_ALE 1
382 static void bfin_plat_nand_cmd_ctrl(struct mtd_info
*mtd
, int cmd
, unsigned int ctrl
)
384 struct nand_chip
*this = mtd
->priv
;
386 if (cmd
== NAND_CMD_NONE
)
390 writeb(cmd
, this->IO_ADDR_W
+ (1 << BFIN_NAND_PLAT_CLE
));
392 writeb(cmd
, this->IO_ADDR_W
+ (1 << BFIN_NAND_PLAT_ALE
));
395 #define BFIN_NAND_PLAT_READY GPIO_PF3
396 static int bfin_plat_nand_dev_ready(struct mtd_info
*mtd
)
398 return gpio_get_value(BFIN_NAND_PLAT_READY
);
401 static struct platform_nand_data bfin_plat_nand_data
= {
405 #ifdef CONFIG_MTD_PARTITIONS
406 .part_probe_types
= part_probes
,
407 .partitions
= bfin_plat_nand_partitions
,
408 .nr_partitions
= ARRAY_SIZE(bfin_plat_nand_partitions
),
412 .cmd_ctrl
= bfin_plat_nand_cmd_ctrl
,
413 .dev_ready
= bfin_plat_nand_dev_ready
,
417 #define MAX(x, y) (x > y ? x : y)
418 static struct resource bfin_plat_nand_resources
= {
420 .end
= 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE
, BFIN_NAND_PLAT_ALE
)),
421 .flags
= IORESOURCE_IO
,
424 static struct platform_device bfin_async_nand_device
= {
428 .resource
= &bfin_plat_nand_resources
,
430 .platform_data
= &bfin_plat_nand_data
,
434 static void bfin_plat_nand_init(void)
436 gpio_request(BFIN_NAND_PLAT_READY
, "bfin_nand_plat");
439 static void bfin_plat_nand_init(void) {}
442 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
443 static struct mtd_partition stamp_partitions
[] = {
445 .name
= "bootloader(nor)",
449 .name
= "linux kernel(nor)",
451 .offset
= MTDPART_OFS_APPEND
,
453 .name
= "file system(nor)",
454 .size
= 0x400000 - 0x40000 - 0x180000 - 0x10000,
455 .offset
= MTDPART_OFS_APPEND
,
457 .name
= "MAC Address(nor)",
458 .size
= MTDPART_SIZ_FULL
,
460 .mask_flags
= MTD_WRITEABLE
,
464 static struct physmap_flash_data stamp_flash_data
= {
466 .parts
= stamp_partitions
,
467 .nr_parts
= ARRAY_SIZE(stamp_partitions
),
468 #ifdef CONFIG_ROMKERNEL
469 .probe_type
= "map_rom",
473 static struct resource stamp_flash_resource
= {
476 .flags
= IORESOURCE_MEM
,
479 static struct platform_device stamp_flash_device
= {
480 .name
= "physmap-flash",
483 .platform_data
= &stamp_flash_data
,
486 .resource
= &stamp_flash_resource
,
490 #if defined(CONFIG_MTD_M25P80) \
491 || defined(CONFIG_MTD_M25P80_MODULE)
492 static struct mtd_partition bfin_spi_flash_partitions
[] = {
494 .name
= "bootloader(spi)",
497 .mask_flags
= MTD_CAP_ROM
499 .name
= "linux kernel(spi)",
501 .offset
= MTDPART_OFS_APPEND
,
503 .name
= "file system(spi)",
504 .size
= MTDPART_SIZ_FULL
,
505 .offset
= MTDPART_OFS_APPEND
,
509 static struct flash_platform_data bfin_spi_flash_data
= {
511 .parts
= bfin_spi_flash_partitions
,
512 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
513 /* .type = "m25p64", */
516 /* SPI flash chip (m25p64) */
517 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
518 .enable_dma
= 0, /* use dma transfer with this chip*/
523 #if defined(CONFIG_BFIN_SPI_ADC) \
524 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
526 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
527 .enable_dma
= 1, /* use dma transfer with this chip*/
532 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
533 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
534 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
540 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
541 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
542 static struct bfin5xx_spi_chip ad1938_spi_chip_info
= {
548 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
549 #include <linux/input/ad714x.h>
550 static struct bfin5xx_spi_chip ad7147_spi_chip_info
= {
555 static struct ad714x_slider_plat ad7147_spi_slider_plat
[] = {
563 static struct ad714x_button_plat ad7147_spi_button_plat
[] = {
565 .keycode
= BTN_FORWARD
,
575 .keycode
= BTN_MIDDLE
,
580 .keycode
= BTN_RIGHT
,
590 static struct ad714x_platform_data ad7147_spi_platform_data
= {
593 .slider
= ad7147_spi_slider_plat
,
594 .button
= ad7147_spi_button_plat
,
596 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
597 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
598 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
599 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
600 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
601 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
602 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
603 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
604 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
605 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
606 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
607 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
609 .sys_cfg_reg
= {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
613 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
614 #include <linux/input/ad714x.h>
615 static struct ad714x_button_plat ad7142_i2c_button_plat
[] = {
637 static struct ad714x_platform_data ad7142_i2c_platform_data
= {
639 .button
= ad7142_i2c_button_plat
,
641 /* fixme: figure out right setting for all comoponent according
642 * to hardware feature of EVAL-AD7142EB board */
643 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
644 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
645 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
646 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
647 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
648 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
649 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
650 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
651 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
652 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
653 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
654 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
656 .sys_cfg_reg
= {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
660 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
661 static struct bfin5xx_spi_chip ad2s90_spi_chip_info
= {
667 #if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
668 unsigned short ad2s120x_platform_data
[] = {
669 /* used as SAMPLE and RDVEL */
670 GPIO_PF5
, GPIO_PF6
, 0
673 static struct bfin5xx_spi_chip ad2s120x_spi_chip_info
= {
679 #if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
680 unsigned short ad2s1210_platform_data
[] = {
681 /* use as SAMPLE, A0, A1 */
682 GPIO_PF7
, GPIO_PF8
, GPIO_PF9
,
683 # if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT)
684 /* the RES0 and RES1 pins */
690 static struct bfin5xx_spi_chip ad2s1210_spi_chip_info
= {
696 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
697 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
699 static int bfin_mmc_spi_init(struct device
*dev
,
700 irqreturn_t (*detect_int
)(int, void *), void *data
)
702 return request_irq(MMC_SPI_CARD_DETECT_INT
, detect_int
,
703 IRQF_TRIGGER_FALLING
, "mmc-spi-detect", data
);
706 static void bfin_mmc_spi_exit(struct device
*dev
, void *data
)
708 free_irq(MMC_SPI_CARD_DETECT_INT
, data
);
711 static struct mmc_spi_platform_data bfin_mmc_spi_pdata
= {
712 .init
= bfin_mmc_spi_init
,
713 .exit
= bfin_mmc_spi_exit
,
714 .detect_delay
= 100, /* msecs */
717 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
724 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
725 #include <linux/spi/ad7877.h>
726 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
731 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
733 .vref_delay_usecs
= 50, /* internal, no capacitor */
736 .pressure_max
= 1000,
738 .stopacq_polarity
= 1,
739 .first_conversion_delay
= 3,
740 .acquisition_time
= 1,
742 .pen_down_acc_interval
= 1,
746 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
747 #include <linux/spi/ad7879.h>
748 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
749 .model
= 7879, /* Model = AD7879 */
750 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
751 .pressure_max
= 10000,
753 .first_conversion_delay
= 3, /* wait 512us before do a first conversion */
754 .acquisition_time
= 1, /* 4us acquisition time per sample */
755 .median
= 2, /* do 8 measurements */
756 .averaging
= 1, /* take the average of 4 middle samples */
757 .pen_down_acc_interval
= 255, /* 9.4 ms */
758 .gpio_export
= 1, /* Export GPIO to gpiolib */
759 .gpio_base
= -1, /* Dynamic allocation */
763 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
764 #include <linux/input/adxl34x.h>
765 static const struct adxl34x_platform_data adxl34x_info
= {
769 .tap_threshold
= 0x31,
770 .tap_duration
= 0x10,
773 .tap_axis_control
= ADXL_TAP_X_EN
| ADXL_TAP_Y_EN
| ADXL_TAP_Z_EN
,
774 .act_axis_control
= 0xFF,
775 .activity_threshold
= 5,
776 .inactivity_threshold
= 3,
777 .inactivity_time
= 4,
778 .free_fall_threshold
= 0x7,
779 .free_fall_time
= 0x20,
781 .data_range
= ADXL_FULL_RES
,
784 .ev_code_x
= ABS_X
, /* EV_REL */
785 .ev_code_y
= ABS_Y
, /* EV_REL */
786 .ev_code_z
= ABS_Z
, /* EV_REL */
788 .ev_code_tap
= {BTN_TOUCH
, BTN_TOUCH
, BTN_TOUCH
}, /* EV_KEY x,y,z */
790 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
791 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
792 .power_mode
= ADXL_AUTO_SLEEP
| ADXL_LINK
,
793 .fifo_mode
= ADXL_FIFO_STREAM
,
794 .orientation_enable
= ADXL_EN_ORIENTATION_3D
,
795 .deadzone_angle
= ADXL_DEADZONE_ANGLE_10p8
,
796 .divisor_length
= ADXL_LP_FILTER_DIVISOR_16
,
797 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
798 .ev_codes_orient_3d
= {BTN_Z
, BTN_Y
, BTN_X
, BTN_A
, BTN_B
, BTN_C
},
802 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
803 static struct bfin5xx_spi_chip spi_ad7879_chip_info
= {
809 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
810 static struct bfin5xx_spi_chip spidev_chip_info
= {
816 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
817 static struct bfin5xx_spi_chip lq035q1_spi_chip_info
= {
823 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
824 static struct bfin5xx_spi_chip enc28j60_spi_chip_info
= {
827 .cs_gpio
= GPIO_PF10
,
831 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
832 static struct bfin5xx_spi_chip adf7021_spi_chip_info
= {
834 .cs_gpio
= GPIO_PF10
,
837 #include <linux/spi/adf702x.h>
838 #define TXREG 0x0160A470
839 static const u32 adf7021_regs
[] = {
858 static struct adf702x_platform_data adf7021_platform_data
= {
859 .regs_base
= (void *)SPORT1_TCR1
,
860 .dma_ch_rx
= CH_SPORT1_RX
,
861 .dma_ch_tx
= CH_SPORT1_TX
,
862 .irq_sport_err
= IRQ_SPORT1_ERROR
,
863 .gpio_int_rfs
= GPIO_PF8
,
864 .pin_req
= {P_SPORT1_DTPRI
, P_SPORT1_RFS
, P_SPORT1_DRPRI
,
865 P_SPORT1_RSCLK
, P_SPORT1_TSCLK
, 0},
866 .adf702x_model
= MODEL_ADF7021
,
867 .adf702x_regs
= adf7021_regs
,
870 static inline void adf702x_mac_init(void)
872 random_ether_addr(adf7021_platform_data
.mac_addr
);
875 static inline void adf702x_mac_init(void) {}
878 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
879 #include <linux/spi/ads7846.h>
880 static struct bfin5xx_spi_chip ad7873_spi_chip_info
= {
884 static int ads7873_get_pendown_state(void)
886 return gpio_get_value(GPIO_PF6
);
889 static struct ads7846_platform_data __initdata ad7873_pdata
= {
890 .model
= 7873, /* AD7873 */
896 .debounce_tol
= (~0),
897 .get_pendown_state
= ads7873_get_pendown_state
,
901 #if defined(CONFIG_MTD_DATAFLASH) \
902 || defined(CONFIG_MTD_DATAFLASH_MODULE)
904 static struct mtd_partition bfin_spi_dataflash_partitions
[] = {
906 .name
= "bootloader(spi)",
909 .mask_flags
= MTD_CAP_ROM
911 .name
= "linux kernel(spi)",
913 .offset
= MTDPART_OFS_APPEND
,
915 .name
= "file system(spi)",
916 .size
= MTDPART_SIZ_FULL
,
917 .offset
= MTDPART_OFS_APPEND
,
921 static struct flash_platform_data bfin_spi_dataflash_data
= {
922 .name
= "SPI Dataflash",
923 .parts
= bfin_spi_dataflash_partitions
,
924 .nr_parts
= ARRAY_SIZE(bfin_spi_dataflash_partitions
),
928 static struct bfin5xx_spi_chip data_flash_chip_info
= {
929 .enable_dma
= 0, /* use dma transfer with this chip*/
934 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
935 static struct bfin5xx_spi_chip spi_adxl34x_chip_info
= {
936 .enable_dma
= 0, /* use dma transfer with this chip*/
941 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
942 #if defined(CONFIG_MTD_M25P80) \
943 || defined(CONFIG_MTD_M25P80_MODULE)
945 /* the modalias must be the same as spi device driver name */
946 .modalias
= "m25p80", /* Name of spi_driver for this device */
947 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
948 .bus_num
= 0, /* Framework bus number */
949 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
950 .platform_data
= &bfin_spi_flash_data
,
951 .controller_data
= &spi_flash_chip_info
,
955 #if defined(CONFIG_MTD_DATAFLASH) \
956 || defined(CONFIG_MTD_DATAFLASH_MODULE)
957 { /* DataFlash chip */
958 .modalias
= "mtd_dataflash",
959 .max_speed_hz
= 33250000, /* max spi clock (SCK) speed in HZ */
960 .bus_num
= 0, /* Framework bus number */
961 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
962 .platform_data
= &bfin_spi_dataflash_data
,
963 .controller_data
= &data_flash_chip_info
,
967 #if defined(CONFIG_BFIN_SPI_ADC) \
968 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
970 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
971 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
972 .bus_num
= 0, /* Framework bus number */
973 .chip_select
= 1, /* Framework chip select. */
974 .platform_data
= NULL
, /* No spi_driver specific config */
975 .controller_data
= &spi_adc_chip_info
,
979 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
980 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
982 .modalias
= "ad183x",
983 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
985 .chip_select
= 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
986 .platform_data
= "ad1836", /* only includes chip name for the moment */
987 .controller_data
= &ad1836_spi_chip_info
,
992 #if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
994 .modalias
= "ad193x",
995 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
998 .controller_data
= &ad1938_spi_chip_info
,
1003 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
1005 .modalias
= "ad714x_captouch",
1006 .max_speed_hz
= 1000000, /* max spi clock (SCK) speed in HZ */
1011 .platform_data
= &ad7147_spi_platform_data
,
1012 .controller_data
= &ad7147_spi_chip_info
,
1016 #if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1018 .modalias
= "ad2s90",
1020 .chip_select
= 3, /* change it for your board */
1021 .platform_data
= NULL
,
1022 .controller_data
= &ad2s90_spi_chip_info
,
1026 #if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1028 .modalias
= "ad2s120x",
1030 .chip_select
= 4, /* CS, change it for your board */
1031 .platform_data
= ad2s120x_platform_data
,
1032 .controller_data
= &ad2s120x_spi_chip_info
,
1036 #if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1038 .modalias
= "ad2s1210",
1039 .max_speed_hz
= 8192000,
1041 .chip_select
= 4, /* CS, change it for your board */
1042 .platform_data
= ad2s1210_platform_data
,
1043 .controller_data
= &ad2s1210_spi_chip_info
,
1047 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1049 .modalias
= "mmc_spi",
1050 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
1053 .platform_data
= &bfin_mmc_spi_pdata
,
1054 .controller_data
= &mmc_spi_chip_info
,
1058 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1060 .modalias
= "ad7877",
1061 .platform_data
= &bfin_ad7877_ts_info
,
1063 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
1066 .controller_data
= &spi_ad7877_chip_info
,
1069 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
1071 .modalias
= "ad7879",
1072 .platform_data
= &bfin_ad7879_ts_info
,
1074 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
1077 .controller_data
= &spi_ad7879_chip_info
,
1078 .mode
= SPI_CPHA
| SPI_CPOL
,
1081 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1083 .modalias
= "spidev",
1084 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
1087 .controller_data
= &spidev_chip_info
,
1090 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1092 .modalias
= "bfin-lq035q1-spi",
1093 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
1096 .controller_data
= &lq035q1_spi_chip_info
,
1097 .mode
= SPI_CPHA
| SPI_CPOL
,
1100 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1102 .modalias
= "enc28j60",
1103 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
1106 .chip_select
= 0, /* GPIO controlled SSEL */
1107 .controller_data
= &enc28j60_spi_chip_info
,
1111 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1113 .modalias
= "adxl34x",
1114 .platform_data
= &adxl34x_info
,
1116 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
1119 .controller_data
= &spi_adxl34x_chip_info
,
1123 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1125 .modalias
= "adf702x",
1126 .max_speed_hz
= 16000000, /* max spi clock (SCK) speed in HZ */
1128 .chip_select
= 0, /* GPIO controlled SSEL */
1129 .controller_data
= &adf7021_spi_chip_info
,
1130 .platform_data
= &adf7021_platform_data
,
1134 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1136 .modalias
= "ads7846",
1137 .max_speed_hz
= 2000000, /* max spi clock (SCK) speed in HZ */
1140 .chip_select
= GPIO_PF10
+ MAX_CTRL_CS
, /* GPIO controlled SSEL */
1141 .controller_data
= &ad7873_spi_chip_info
,
1142 .platform_data
= &ad7873_pdata
,
1148 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1149 /* SPI controller data */
1150 static struct bfin5xx_spi_master bfin_spi0_info
= {
1151 .num_chipselect
= 8,
1152 .enable_dma
= 1, /* master has the ability to do dma transfer */
1153 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
1157 static struct resource bfin_spi0_resource
[] = {
1159 .start
= SPI0_REGBASE
,
1160 .end
= SPI0_REGBASE
+ 0xFF,
1161 .flags
= IORESOURCE_MEM
,
1166 .flags
= IORESOURCE_DMA
,
1171 .flags
= IORESOURCE_IRQ
,
1175 static struct platform_device bfin_spi0_device
= {
1177 .id
= 0, /* Bus number */
1178 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
1179 .resource
= bfin_spi0_resource
,
1181 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
1184 #endif /* spi master and devices */
1186 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1188 /* SPORT SPI controller data */
1189 static struct bfin5xx_spi_master bfin_sport_spi0_info
= {
1190 .num_chipselect
= 1, /* master only supports one device */
1191 .enable_dma
= 0, /* master don't support DMA */
1192 .pin_req
= {P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_DRPRI
,
1193 P_SPORT0_RSCLK
, P_SPORT0_TFS
, P_SPORT0_RFS
, 0},
1196 static struct resource bfin_sport_spi0_resource
[] = {
1198 .start
= SPORT0_TCR1
,
1199 .end
= SPORT0_TCR1
+ 0xFF,
1200 .flags
= IORESOURCE_MEM
,
1203 .start
= IRQ_SPORT0_ERROR
,
1204 .end
= IRQ_SPORT0_ERROR
,
1205 .flags
= IORESOURCE_IRQ
,
1209 static struct platform_device bfin_sport_spi0_device
= {
1210 .name
= "bfin-sport-spi",
1211 .id
= 1, /* Bus number */
1212 .num_resources
= ARRAY_SIZE(bfin_sport_spi0_resource
),
1213 .resource
= bfin_sport_spi0_resource
,
1215 .platform_data
= &bfin_sport_spi0_info
, /* Passed to driver */
1219 static struct bfin5xx_spi_master bfin_sport_spi1_info
= {
1220 .num_chipselect
= 1, /* master only supports one device */
1221 .enable_dma
= 0, /* master don't support DMA */
1222 .pin_req
= {P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_DRPRI
,
1223 P_SPORT1_RSCLK
, P_SPORT1_TFS
, P_SPORT1_RFS
, 0},
1226 static struct resource bfin_sport_spi1_resource
[] = {
1228 .start
= SPORT1_TCR1
,
1229 .end
= SPORT1_TCR1
+ 0xFF,
1230 .flags
= IORESOURCE_MEM
,
1233 .start
= IRQ_SPORT1_ERROR
,
1234 .end
= IRQ_SPORT1_ERROR
,
1235 .flags
= IORESOURCE_IRQ
,
1239 static struct platform_device bfin_sport_spi1_device
= {
1240 .name
= "bfin-sport-spi",
1241 .id
= 2, /* Bus number */
1242 .num_resources
= ARRAY_SIZE(bfin_sport_spi1_resource
),
1243 .resource
= bfin_sport_spi1_resource
,
1245 .platform_data
= &bfin_sport_spi1_info
, /* Passed to driver */
1249 #endif /* sport spi master and devices */
1251 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1252 static struct platform_device bfin_fb_device
= {
1253 .name
= "bf537-lq035",
1257 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1258 #include <asm/bfin-lq035q1.h>
1260 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data
= {
1261 .mode
= LQ035_NORM
| LQ035_RGB
| LQ035_RL
| LQ035_TB
,
1262 .ppi_mode
= USE_RGB565_16_BIT_PPI
,
1263 .use_bl
= 0, /* let something else control the LCD Blacklight */
1264 .gpio_bl
= GPIO_PF7
,
1267 static struct resource bfin_lq035q1_resources
[] = {
1269 .start
= IRQ_PPI_ERROR
,
1270 .end
= IRQ_PPI_ERROR
,
1271 .flags
= IORESOURCE_IRQ
,
1275 static struct platform_device bfin_lq035q1_device
= {
1276 .name
= "bfin-lq035q1",
1278 .num_resources
= ARRAY_SIZE(bfin_lq035q1_resources
),
1279 .resource
= bfin_lq035q1_resources
,
1281 .platform_data
= &bfin_lq035q1_data
,
1286 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1287 #ifdef CONFIG_SERIAL_BFIN_UART0
1288 static struct resource bfin_uart0_resources
[] = {
1291 .end
= UART0_GCTL
+2,
1292 .flags
= IORESOURCE_MEM
,
1295 .start
= IRQ_UART0_RX
,
1296 .end
= IRQ_UART0_RX
+1,
1297 .flags
= IORESOURCE_IRQ
,
1300 .start
= IRQ_UART0_ERROR
,
1301 .end
= IRQ_UART0_ERROR
,
1302 .flags
= IORESOURCE_IRQ
,
1305 .start
= CH_UART0_TX
,
1307 .flags
= IORESOURCE_DMA
,
1310 .start
= CH_UART0_RX
,
1312 .flags
= IORESOURCE_DMA
,
1314 #ifdef CONFIG_BFIN_UART0_CTSRTS
1318 .flags
= IORESOURCE_IO
,
1323 .flags
= IORESOURCE_IO
,
1328 unsigned short bfin_uart0_peripherals
[] = {
1329 P_UART0_TX
, P_UART0_RX
, 0
1332 static struct platform_device bfin_uart0_device
= {
1333 .name
= "bfin-uart",
1335 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
1336 .resource
= bfin_uart0_resources
,
1338 .platform_data
= &bfin_uart0_peripherals
, /* Passed to driver */
1342 #ifdef CONFIG_SERIAL_BFIN_UART1
1343 static struct resource bfin_uart1_resources
[] = {
1346 .end
= UART1_GCTL
+2,
1347 .flags
= IORESOURCE_MEM
,
1350 .start
= IRQ_UART1_RX
,
1351 .end
= IRQ_UART1_RX
+1,
1352 .flags
= IORESOURCE_IRQ
,
1355 .start
= IRQ_UART1_ERROR
,
1356 .end
= IRQ_UART1_ERROR
,
1357 .flags
= IORESOURCE_IRQ
,
1360 .start
= CH_UART1_TX
,
1362 .flags
= IORESOURCE_DMA
,
1365 .start
= CH_UART1_RX
,
1367 .flags
= IORESOURCE_DMA
,
1371 unsigned short bfin_uart1_peripherals
[] = {
1372 P_UART1_TX
, P_UART1_RX
, 0
1375 static struct platform_device bfin_uart1_device
= {
1376 .name
= "bfin-uart",
1378 .num_resources
= ARRAY_SIZE(bfin_uart1_resources
),
1379 .resource
= bfin_uart1_resources
,
1381 .platform_data
= &bfin_uart1_peripherals
, /* Passed to driver */
1387 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1388 #ifdef CONFIG_BFIN_SIR0
1389 static struct resource bfin_sir0_resources
[] = {
1391 .start
= 0xFFC00400,
1393 .flags
= IORESOURCE_MEM
,
1396 .start
= IRQ_UART0_RX
,
1397 .end
= IRQ_UART0_RX
+1,
1398 .flags
= IORESOURCE_IRQ
,
1401 .start
= CH_UART0_RX
,
1402 .end
= CH_UART0_RX
+1,
1403 .flags
= IORESOURCE_DMA
,
1407 static struct platform_device bfin_sir0_device
= {
1410 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
1411 .resource
= bfin_sir0_resources
,
1414 #ifdef CONFIG_BFIN_SIR1
1415 static struct resource bfin_sir1_resources
[] = {
1417 .start
= 0xFFC02000,
1419 .flags
= IORESOURCE_MEM
,
1422 .start
= IRQ_UART1_RX
,
1423 .end
= IRQ_UART1_RX
+1,
1424 .flags
= IORESOURCE_IRQ
,
1427 .start
= CH_UART1_RX
,
1428 .end
= CH_UART1_RX
+1,
1429 .flags
= IORESOURCE_DMA
,
1433 static struct platform_device bfin_sir1_device
= {
1436 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
1437 .resource
= bfin_sir1_resources
,
1442 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1443 static struct resource bfin_twi0_resource
[] = {
1445 .start
= TWI0_REGBASE
,
1446 .end
= TWI0_REGBASE
,
1447 .flags
= IORESOURCE_MEM
,
1452 .flags
= IORESOURCE_IRQ
,
1456 static struct platform_device i2c_bfin_twi_device
= {
1457 .name
= "i2c-bfin-twi",
1459 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
1460 .resource
= bfin_twi0_resource
,
1464 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1465 static const unsigned short adp5588_keymap
[ADP5588_KEYMAPSIZE
] = {
1479 [13] = KEY_BACKSLASH
,
1491 [26] = KEY_LEFTBRACE
,
1492 [27] = KEY_RIGHTBRACE
,
1505 [41] = KEY_SEMICOLON
,
1506 [42] = KEY_APOSTROPHE
,
1507 [43] = KEY_BACKSLASH
,
1527 [65] = KEY_BACKSPACE
,
1540 static struct adp5588_kpad_platform_data adp5588_kpad_data
= {
1543 .keymap
= adp5588_keymap
,
1544 .keymapsize
= ARRAY_SIZE(adp5588_keymap
),
1549 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1550 #include <linux/mfd/adp5520.h>
1553 * ADP5520/5501 Backlight Data
1556 static struct adp5520_backlight_platform_data adp5520_backlight_data
= {
1557 .fade_in
= ADP5520_FADE_T_1200ms
,
1558 .fade_out
= ADP5520_FADE_T_1200ms
,
1559 .fade_led_law
= ADP5520_BL_LAW_LINEAR
,
1561 .abml_filt
= ADP5520_BL_AMBL_FILT_640ms
,
1562 .l1_daylight_max
= ADP5520_BL_CUR_mA(15),
1563 .l1_daylight_dim
= ADP5520_BL_CUR_mA(0),
1564 .l2_office_max
= ADP5520_BL_CUR_mA(7),
1565 .l2_office_dim
= ADP5520_BL_CUR_mA(0),
1566 .l3_dark_max
= ADP5520_BL_CUR_mA(3),
1567 .l3_dark_dim
= ADP5520_BL_CUR_mA(0),
1568 .l2_trip
= ADP5520_L2_COMP_CURR_uA(700),
1569 .l2_hyst
= ADP5520_L2_COMP_CURR_uA(50),
1570 .l3_trip
= ADP5520_L3_COMP_CURR_uA(80),
1571 .l3_hyst
= ADP5520_L3_COMP_CURR_uA(20),
1575 * ADP5520/5501 LEDs Data
1578 static struct led_info adp5520_leds
[] = {
1580 .name
= "adp5520-led1",
1581 .default_trigger
= "none",
1582 .flags
= FLAG_ID_ADP5520_LED1_ADP5501_LED0
| ADP5520_LED_OFFT_600ms
,
1584 #ifdef ADP5520_EN_ALL_LEDS
1586 .name
= "adp5520-led2",
1587 .default_trigger
= "none",
1588 .flags
= FLAG_ID_ADP5520_LED2_ADP5501_LED1
,
1591 .name
= "adp5520-led3",
1592 .default_trigger
= "none",
1593 .flags
= FLAG_ID_ADP5520_LED3_ADP5501_LED2
,
1598 static struct adp5520_leds_platform_data adp5520_leds_data
= {
1599 .num_leds
= ARRAY_SIZE(adp5520_leds
),
1600 .leds
= adp5520_leds
,
1601 .fade_in
= ADP5520_FADE_T_600ms
,
1602 .fade_out
= ADP5520_FADE_T_600ms
,
1603 .led_on_time
= ADP5520_LED_ONT_600ms
,
1610 static struct adp5520_gpio_platform_data adp5520_gpio_data
= {
1612 .gpio_en_mask
= ADP5520_GPIO_C1
| ADP5520_GPIO_C2
| ADP5520_GPIO_R2
,
1613 .gpio_pullup_mask
= ADP5520_GPIO_C1
| ADP5520_GPIO_C2
| ADP5520_GPIO_R2
,
1617 * ADP5520 Keypad Data
1620 static const unsigned short adp5520_keymap
[ADP5520_KEYMAPSIZE
] = {
1621 [ADP5520_KEY(0, 0)] = KEY_GRAVE
,
1622 [ADP5520_KEY(0, 1)] = KEY_1
,
1623 [ADP5520_KEY(0, 2)] = KEY_2
,
1624 [ADP5520_KEY(0, 3)] = KEY_3
,
1625 [ADP5520_KEY(1, 0)] = KEY_4
,
1626 [ADP5520_KEY(1, 1)] = KEY_5
,
1627 [ADP5520_KEY(1, 2)] = KEY_6
,
1628 [ADP5520_KEY(1, 3)] = KEY_7
,
1629 [ADP5520_KEY(2, 0)] = KEY_8
,
1630 [ADP5520_KEY(2, 1)] = KEY_9
,
1631 [ADP5520_KEY(2, 2)] = KEY_0
,
1632 [ADP5520_KEY(2, 3)] = KEY_MINUS
,
1633 [ADP5520_KEY(3, 0)] = KEY_EQUAL
,
1634 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH
,
1635 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE
,
1636 [ADP5520_KEY(3, 3)] = KEY_ENTER
,
1639 static struct adp5520_keys_platform_data adp5520_keys_data
= {
1640 .rows_en_mask
= ADP5520_ROW_R3
| ADP5520_ROW_R2
| ADP5520_ROW_R1
| ADP5520_ROW_R0
,
1641 .cols_en_mask
= ADP5520_COL_C3
| ADP5520_COL_C2
| ADP5520_COL_C1
| ADP5520_COL_C0
,
1642 .keymap
= adp5520_keymap
,
1643 .keymapsize
= ARRAY_SIZE(adp5520_keymap
),
1648 * ADP5520/5501 Multifuction Device Init Data
1651 static struct adp5520_platform_data adp5520_pdev_data
= {
1652 .backlight
= &adp5520_backlight_data
,
1653 .leds
= &adp5520_leds_data
,
1654 .gpio
= &adp5520_gpio_data
,
1655 .keys
= &adp5520_keys_data
,
1660 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1661 static struct adp5588_gpio_platform_data adp5588_gpio_data
= {
1663 .pullup_dis_mask
= 0,
1667 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1668 #include <linux/i2c/adp8870.h>
1669 static struct led_info adp8870_leds
[] = {
1671 .name
= "adp8870-led7",
1672 .default_trigger
= "none",
1673 .flags
= ADP8870_LED_D7
| ADP8870_LED_OFFT_600ms
,
1678 static struct adp8870_backlight_platform_data adp8870_pdata
= {
1679 .bl_led_assign
= ADP8870_BL_D1
| ADP8870_BL_D2
| ADP8870_BL_D3
|
1680 ADP8870_BL_D4
| ADP8870_BL_D5
| ADP8870_BL_D6
, /* 1 = Backlight 0 = Individual LED */
1681 .pwm_assign
= 0, /* 1 = Enables PWM mode */
1683 .bl_fade_in
= ADP8870_FADE_T_1200ms
, /* Backlight Fade-In Timer */
1684 .bl_fade_out
= ADP8870_FADE_T_1200ms
, /* Backlight Fade-Out Timer */
1685 .bl_fade_law
= ADP8870_FADE_LAW_CUBIC1
, /* fade-on/fade-off transfer characteristic */
1687 .en_ambl_sens
= 1, /* 1 = enable ambient light sensor */
1688 .abml_filt
= ADP8870_BL_AMBL_FILT_320ms
, /* Light sensor filter time */
1690 .l1_daylight_max
= ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1691 .l1_daylight_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1692 .l2_bright_max
= ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1693 .l2_bright_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1694 .l3_office_max
= ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1695 .l3_office_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1696 .l4_indoor_max
= ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1697 .l4_indor_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1698 .l5_dark_max
= ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1699 .l5_dark_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1701 .l2_trip
= ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1702 .l2_hyst
= ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1703 .l3_trip
= ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1704 .l3_hyst
= ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1705 .l4_trip
= ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1706 .l4_hyst
= ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1707 .l5_trip
= ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1708 .l5_hyst
= ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1710 .leds
= adp8870_leds
,
1711 .num_leds
= ARRAY_SIZE(adp8870_leds
),
1712 .led_fade_law
= ADP8870_FADE_LAW_SQUARE
, /* fade-on/fade-off transfer characteristic */
1713 .led_fade_in
= ADP8870_FADE_T_600ms
,
1714 .led_fade_out
= ADP8870_FADE_T_600ms
,
1715 .led_on_time
= ADP8870_LED_ONT_200ms
,
1719 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
1720 #include <linux/i2c/adp8860.h>
1721 static struct led_info adp8860_leds
[] = {
1723 .name
= "adp8860-led7",
1724 .default_trigger
= "none",
1725 .flags
= ADP8860_LED_D7
| ADP8860_LED_OFFT_600ms
,
1729 static struct adp8860_backlight_platform_data adp8860_pdata
= {
1730 .bl_led_assign
= ADP8860_BL_D1
| ADP8860_BL_D2
| ADP8860_BL_D3
|
1731 ADP8860_BL_D4
| ADP8860_BL_D5
| ADP8860_BL_D6
, /* 1 = Backlight 0 = Individual LED */
1733 .bl_fade_in
= ADP8860_FADE_T_1200ms
, /* Backlight Fade-In Timer */
1734 .bl_fade_out
= ADP8860_FADE_T_1200ms
, /* Backlight Fade-Out Timer */
1735 .bl_fade_law
= ADP8860_FADE_LAW_CUBIC1
, /* fade-on/fade-off transfer characteristic */
1737 .en_ambl_sens
= 1, /* 1 = enable ambient light sensor */
1738 .abml_filt
= ADP8860_BL_AMBL_FILT_320ms
, /* Light sensor filter time */
1740 .l1_daylight_max
= ADP8860_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1741 .l1_daylight_dim
= ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1742 .l2_office_max
= ADP8860_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1743 .l2_office_dim
= ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1744 .l3_dark_max
= ADP8860_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1745 .l3_dark_dim
= ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1747 .l2_trip
= ADP8860_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1748 .l2_hyst
= ADP8860_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1749 .l3_trip
= ADP8860_L3_COMP_CURR_uA(43), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1750 .l3_hyst
= ADP8860_L3_COMP_CURR_uA(11), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1752 .leds
= adp8860_leds
,
1753 .num_leds
= ARRAY_SIZE(adp8860_leds
),
1754 .led_fade_law
= ADP8860_FADE_LAW_SQUARE
, /* fade-on/fade-off transfer characteristic */
1755 .led_fade_in
= ADP8860_FADE_T_600ms
,
1756 .led_fade_out
= ADP8860_FADE_T_600ms
,
1757 .led_on_time
= ADP8860_LED_ONT_200ms
,
1761 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1762 static struct regulator_consumer_supply ad5398_consumer
= {
1763 .supply
= "current",
1766 static struct regulator_init_data ad5398_regulator_data
= {
1768 .name
= "current range",
1770 .valid_ops_mask
= REGULATOR_CHANGE_CURRENT
| REGULATOR_CHANGE_STATUS
,
1772 .num_consumer_supplies
= 1,
1773 .consumer_supplies
= &ad5398_consumer
,
1776 static struct ad5398_platform_data ad5398_i2c_platform_data
= {
1778 .current_offset
= 4,
1779 .regulator_data
= &ad5398_regulator_data
,
1782 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
1783 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
1784 static struct platform_device ad5398_virt_consumer_device
= {
1785 .name
= "reg-virt-consumer",
1788 .platform_data
= "current", /* Passed to driver */
1792 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
1793 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
1794 static struct regulator_bulk_data ad5398_bulk_data
= {
1795 .supply
= "current",
1798 static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data
= {
1801 .supplies
= &ad5398_bulk_data
,
1804 static struct platform_device ad5398_userspace_consumer_device
= {
1805 .name
= "reg-userspace-consumer",
1808 .platform_data
= &ad5398_userspace_comsumer_data
,
1814 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
1815 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
1817 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
1819 .platform_data
= (void *)&ad7142_i2c_platform_data
,
1823 #if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
1825 I2C_BOARD_INFO("ad7150", 0x48),
1826 .irq
= IRQ_PG5
, /* fixme: use real interrupt number */
1830 #if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
1832 I2C_BOARD_INFO("ad7152", 0x48),
1836 #if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
1838 I2C_BOARD_INFO("ad774x", 0x48),
1842 #if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
1844 I2C_BOARD_INFO("ad7414", 0x9),
1847 * platform_data pointer is borrwoed by the driver to
1848 * store custimer defined IRQ ALART level mode.
1849 * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
1851 .platform_data
= (void *)IRQF_TRIGGER_LOW
,
1855 #if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
1857 I2C_BOARD_INFO("ad7417", 0xb),
1860 * platform_data pointer is borrwoed by the driver to
1861 * store custimer defined IRQ ALART level mode.
1862 * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
1864 .platform_data
= (void *)IRQF_TRIGGER_LOW
,
1868 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1870 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1873 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
1875 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1879 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
1881 I2C_BOARD_INFO("ad7879", 0x2F),
1883 .platform_data
= (void *)&bfin_ad7879_ts_info
,
1886 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1888 I2C_BOARD_INFO("adp5588-keys", 0x34),
1890 .platform_data
= (void *)&adp5588_kpad_data
,
1893 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1895 I2C_BOARD_INFO("pmic-adp5520", 0x32),
1897 .platform_data
= (void *)&adp5520_pdev_data
,
1900 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1902 I2C_BOARD_INFO("adxl34x", 0x53),
1904 .platform_data
= (void *)&adxl34x_info
,
1907 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1909 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1910 .platform_data
= (void *)&adp5588_gpio_data
,
1913 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1915 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
1918 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1920 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
1923 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1925 I2C_BOARD_INFO("adp8870", 0x2B),
1926 .platform_data
= (void *)&adp8870_pdata
,
1929 #if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
1931 I2C_BOARD_INFO("adau1371", 0x1A),
1934 #if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
1936 I2C_BOARD_INFO("adau1761", 0x38),
1939 #if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
1941 I2C_BOARD_INFO("adau1361", 0x38),
1944 #if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
1946 I2C_BOARD_INFO("ad5258", 0x18),
1949 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1951 I2C_BOARD_INFO("ssm2602", 0x1b),
1954 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1956 I2C_BOARD_INFO("ad5398", 0xC),
1957 .platform_data
= (void *)&ad5398_i2c_platform_data
,
1960 #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
1962 I2C_BOARD_INFO("adp8860", 0x2A),
1963 .platform_data
= (void *)&adp8860_pdata
,
1968 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1969 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1970 static struct resource bfin_sport0_uart_resources
[] = {
1972 .start
= SPORT0_TCR1
,
1973 .end
= SPORT0_MRCS3
+4,
1974 .flags
= IORESOURCE_MEM
,
1977 .start
= IRQ_SPORT0_RX
,
1978 .end
= IRQ_SPORT0_RX
+1,
1979 .flags
= IORESOURCE_IRQ
,
1982 .start
= IRQ_SPORT0_ERROR
,
1983 .end
= IRQ_SPORT0_ERROR
,
1984 .flags
= IORESOURCE_IRQ
,
1988 unsigned short bfin_sport0_peripherals
[] = {
1989 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
1990 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, P_SPORT0_DRSEC
, P_SPORT0_DTSEC
, 0
1993 static struct platform_device bfin_sport0_uart_device
= {
1994 .name
= "bfin-sport-uart",
1996 .num_resources
= ARRAY_SIZE(bfin_sport0_uart_resources
),
1997 .resource
= bfin_sport0_uart_resources
,
1999 .platform_data
= &bfin_sport0_peripherals
, /* Passed to driver */
2003 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2004 static struct resource bfin_sport1_uart_resources
[] = {
2006 .start
= SPORT1_TCR1
,
2007 .end
= SPORT1_MRCS3
+4,
2008 .flags
= IORESOURCE_MEM
,
2011 .start
= IRQ_SPORT1_RX
,
2012 .end
= IRQ_SPORT1_RX
+1,
2013 .flags
= IORESOURCE_IRQ
,
2016 .start
= IRQ_SPORT1_ERROR
,
2017 .end
= IRQ_SPORT1_ERROR
,
2018 .flags
= IORESOURCE_IRQ
,
2022 unsigned short bfin_sport1_peripherals
[] = {
2023 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
2024 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, P_SPORT1_DRSEC
, P_SPORT1_DTSEC
, 0
2027 static struct platform_device bfin_sport1_uart_device
= {
2028 .name
= "bfin-sport-uart",
2030 .num_resources
= ARRAY_SIZE(bfin_sport1_uart_resources
),
2031 .resource
= bfin_sport1_uart_resources
,
2033 .platform_data
= &bfin_sport1_peripherals
, /* Passed to driver */
2039 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2040 #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2041 /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
2043 #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2044 #define PATA_INT IRQ_PF5
2045 static struct pata_platform_info bfin_pata_platform_data
= {
2047 .irq_flags
= IRQF_TRIGGER_HIGH
| IRQF_DISABLED
,
2050 static struct resource bfin_pata_resources
[] = {
2052 .start
= 0x20314020,
2054 .flags
= IORESOURCE_MEM
,
2057 .start
= 0x2031401C,
2059 .flags
= IORESOURCE_MEM
,
2064 .flags
= IORESOURCE_IRQ
,
2067 #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
2068 static struct pata_platform_info bfin_pata_platform_data
= {
2071 /* CompactFlash Storage Card Memory Mapped Adressing
2074 static struct resource bfin_pata_resources
[] = {
2076 .start
= 0x20211800,
2078 .flags
= IORESOURCE_MEM
,
2081 .start
= 0x2021180E, /* Device Ctl */
2083 .flags
= IORESOURCE_MEM
,
2088 static struct platform_device bfin_pata_device
= {
2089 .name
= "pata_platform",
2091 .num_resources
= ARRAY_SIZE(bfin_pata_resources
),
2092 .resource
= bfin_pata_resources
,
2094 .platform_data
= &bfin_pata_platform_data
,
2099 static const unsigned int cclk_vlev_datasheet
[] =
2101 VRPAIR(VLEV_085
, 250000000),
2102 VRPAIR(VLEV_090
, 376000000),
2103 VRPAIR(VLEV_095
, 426000000),
2104 VRPAIR(VLEV_100
, 426000000),
2105 VRPAIR(VLEV_105
, 476000000),
2106 VRPAIR(VLEV_110
, 476000000),
2107 VRPAIR(VLEV_115
, 476000000),
2108 VRPAIR(VLEV_120
, 500000000),
2109 VRPAIR(VLEV_125
, 533000000),
2110 VRPAIR(VLEV_130
, 600000000),
2113 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
2114 .tuple_tab
= cclk_vlev_datasheet
,
2115 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
2116 .vr_settling_time
= 25 /* us */,
2119 static struct platform_device bfin_dpmc
= {
2120 .name
= "bfin dpmc",
2122 .platform_data
= &bfin_dmpc_vreg_data
,
2126 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2127 static struct platform_device bfin_i2s
= {
2129 .id
= CONFIG_SND_BF5XX_SPORT_NUM
,
2130 /* TODO: add platform data here */
2134 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2135 static struct platform_device bfin_tdm
= {
2137 .id
= CONFIG_SND_BF5XX_SPORT_NUM
,
2138 /* TODO: add platform data here */
2142 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2143 static struct platform_device bfin_ac97
= {
2144 .name
= "bfin-ac97",
2145 .id
= CONFIG_SND_BF5XX_SPORT_NUM
,
2146 /* TODO: add platform data here */
2150 #if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2151 #define REGULATOR_ADP122 "adp122"
2152 #define REGULATOR_ADP150 "adp150"
2154 static struct regulator_consumer_supply adp122_consumers
= {
2155 .supply
= REGULATOR_ADP122
,
2158 static struct regulator_consumer_supply adp150_consumers
= {
2159 .supply
= REGULATOR_ADP150
,
2162 static struct regulator_init_data adp_switch_regulator_data
[] = {
2165 .name
= REGULATOR_ADP122
,
2166 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
2170 .num_consumer_supplies
= 1, /* only 1 */
2171 .consumer_supplies
= &adp122_consumers
,
2172 .driver_data
= (void *)GPIO_PF2
, /* gpio port only */
2176 .name
= REGULATOR_ADP150
,
2177 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
2181 .num_consumer_supplies
= 1, /* only 1 */
2182 .consumer_supplies
= &adp150_consumers
,
2183 .driver_data
= (void *)GPIO_PF3
, /* gpio port only */
2187 static struct adp_switch_platform_data adp_switch_pdata
= {
2188 .regulator_num
= ARRAY_SIZE(adp_switch_regulator_data
),
2189 .regulator_data
= adp_switch_regulator_data
,
2192 static struct platform_device adp_switch_device
= {
2193 .name
= "adp_switch",
2196 .platform_data
= &adp_switch_pdata
,
2200 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2201 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2202 static struct regulator_bulk_data adp122_bulk_data
= {
2203 .supply
= REGULATOR_ADP122
,
2206 static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data
= {
2207 .name
= REGULATOR_ADP122
,
2209 .supplies
= &adp122_bulk_data
,
2212 static struct platform_device adp122_userspace_consumer_device
= {
2213 .name
= "reg-userspace-consumer",
2216 .platform_data
= &adp122_userspace_comsumer_data
,
2220 static struct regulator_bulk_data adp150_bulk_data
= {
2221 .supply
= REGULATOR_ADP150
,
2224 static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data
= {
2225 .name
= REGULATOR_ADP150
,
2227 .supplies
= &adp150_bulk_data
,
2230 static struct platform_device adp150_userspace_consumer_device
= {
2231 .name
= "reg-userspace-consumer",
2234 .platform_data
= &adp150_userspace_comsumer_data
,
2241 static struct platform_device
*stamp_devices
[] __initdata
= {
2245 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2246 &bfin_pcmcia_cf_device
,
2249 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2253 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2257 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2258 &isp1362_hcd_device
,
2261 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2262 &bfin_isp1760_device
,
2265 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2269 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2273 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2277 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
2282 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2283 &net2272_bfin_device
,
2286 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
2290 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2291 &bfin_sport_spi0_device
,
2292 &bfin_sport_spi1_device
,
2295 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2299 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2300 &bfin_lq035q1_device
,
2303 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
2304 #ifdef CONFIG_SERIAL_BFIN_UART0
2307 #ifdef CONFIG_SERIAL_BFIN_UART1
2312 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
2313 #ifdef CONFIG_BFIN_SIR0
2316 #ifdef CONFIG_BFIN_SIR1
2321 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2322 &i2c_bfin_twi_device
,
2325 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
2326 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2327 &bfin_sport0_uart_device
,
2329 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2330 &bfin_sport1_uart_device
,
2334 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2338 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2339 &bfin_device_gpiokeys
,
2342 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2343 &bfin_async_nand_device
,
2346 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
2347 &stamp_flash_device
,
2350 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2354 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2358 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2361 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2362 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2363 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2364 &ad5398_virt_consumer_device
,
2366 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2367 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2368 &ad5398_userspace_consumer_device
,
2372 #if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2374 #if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2375 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2376 &adp122_userspace_consumer_device
,
2377 &adp150_userspace_consumer_device
,
2382 static int __init
stamp_init(void)
2384 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
2385 bfin_plat_nand_init();
2387 platform_add_devices(stamp_devices
, ARRAY_SIZE(stamp_devices
));
2388 i2c_register_board_info(0, bfin_i2c_board_info
,
2389 ARRAY_SIZE(bfin_i2c_board_info
));
2390 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
2395 arch_initcall(stamp_init
);
2398 static struct platform_device
*stamp_early_devices
[] __initdata
= {
2399 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2400 #ifdef CONFIG_SERIAL_BFIN_UART0
2403 #ifdef CONFIG_SERIAL_BFIN_UART1
2408 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2409 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2410 &bfin_sport0_uart_device
,
2412 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2413 &bfin_sport1_uart_device
,
2418 void __init
native_machine_early_platform_add_devices(void)
2420 printk(KERN_INFO
"register early platform devices\n");
2421 early_platform_add_devices(stamp_early_devices
,
2422 ARRAY_SIZE(stamp_early_devices
));
2425 void native_machine_restart(char *cmd
)
2427 /* workaround reboot hang when booting from SPI */
2428 if ((bfin_read_SYSCR() & 0x7) == 0x3)
2429 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
2433 * Currently the MAC address is saved in Flash by U-Boot
2435 #define FLASH_MAC 0x203f0000
2436 void bfin_get_ether_addr(char *addr
)
2438 *(u32
*)(&(addr
[0])) = bfin_read32(FLASH_MAC
);
2439 *(u16
*)(&(addr
[4])) = bfin_read16(FLASH_MAC
+ 4);
2441 EXPORT_SYMBOL(bfin_get_ether_addr
);