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/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/spi/spi.h>
15 #include <linux/spi/flash.h>
16 #include <linux/irq.h>
17 #include <linux/i2c.h>
18 #include <linux/interrupt.h>
19 #include <linux/usb/musb.h>
20 #include <asm/bfin5xx_spi.h>
25 #include <asm/portmux.h>
26 #include <asm/bfin_sdh.h>
27 #include <mach/bf54x_keys.h>
28 #include <linux/input.h>
29 #include <linux/spi/ad7877.h>
32 * Name the Board for the /proc/cpuinfo
34 const char bfin_board_name
[] = "ADI BF548-EZKIT";
37 * Driver needs to know address, irq and flag pin.
40 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
41 #include <linux/usb/isp1760.h>
42 static struct resource bfin_isp1760_resources
[] = {
45 .end
= 0x2C0C0000 + 0xfffff,
46 .flags
= IORESOURCE_MEM
,
51 .flags
= IORESOURCE_IRQ
,
55 static struct isp1760_platform_data isp1760_priv
= {
60 .dack_polarity_high
= 0,
61 .dreq_polarity_high
= 0,
64 static struct platform_device bfin_isp1760_device
= {
65 .name
= "isp1760-hcd",
68 .platform_data
= &isp1760_priv
,
70 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
71 .resource
= bfin_isp1760_resources
,
75 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
77 #include <mach/bf54x-lq043.h>
79 static struct bfin_bf54xfb_mach_info bf54x_lq043_data
= {
82 .xres
= {480, 480, 480},
83 .yres
= {272, 272, 272},
88 static struct resource bf54x_lq043_resources
[] = {
90 .start
= IRQ_EPPI0_ERR
,
92 .flags
= IORESOURCE_IRQ
,
96 static struct platform_device bf54x_lq043_device
= {
97 .name
= "bf54x-lq043",
99 .num_resources
= ARRAY_SIZE(bf54x_lq043_resources
),
100 .resource
= bf54x_lq043_resources
,
102 .platform_data
= &bf54x_lq043_data
,
107 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
108 static const unsigned int bf548_keymap
[] = {
109 KEYVAL(0, 0, KEY_ENTER
),
110 KEYVAL(0, 1, KEY_HELP
),
112 KEYVAL(0, 3, KEY_BACKSPACE
),
113 KEYVAL(1, 0, KEY_TAB
),
117 KEYVAL(2, 0, KEY_DOWN
),
121 KEYVAL(3, 0, KEY_UP
),
127 static struct bfin_kpad_platform_data bf54x_kpad_data
= {
130 .keymap
= bf548_keymap
,
131 .keymapsize
= ARRAY_SIZE(bf548_keymap
),
133 .debounce_time
= 5000, /* ns (5ms) */
134 .coldrive_time
= 1000, /* ns (1ms) */
135 .keyup_test_interval
= 50, /* ms (50ms) */
138 static struct resource bf54x_kpad_resources
[] = {
142 .flags
= IORESOURCE_IRQ
,
146 static struct platform_device bf54x_kpad_device
= {
147 .name
= "bf54x-keys",
149 .num_resources
= ARRAY_SIZE(bf54x_kpad_resources
),
150 .resource
= bf54x_kpad_resources
,
152 .platform_data
= &bf54x_kpad_data
,
157 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
158 #include <asm/bfin_rotary.h>
160 static struct bfin_rotary_platform_data bfin_rotary_data
= {
161 /*.rotary_up_key = KEY_UP,*/
162 /*.rotary_down_key = KEY_DOWN,*/
163 .rotary_rel_code
= REL_WHEEL
,
164 .rotary_button_key
= KEY_ENTER
,
165 .debounce
= 10, /* 0..17 */
166 .mode
= ROT_QUAD_ENC
| ROT_DEBE
,
169 static struct resource bfin_rotary_resources
[] = {
173 .flags
= IORESOURCE_IRQ
,
177 static struct platform_device bfin_rotary_device
= {
178 .name
= "bfin-rotary",
180 .num_resources
= ARRAY_SIZE(bfin_rotary_resources
),
181 .resource
= bfin_rotary_resources
,
183 .platform_data
= &bfin_rotary_data
,
188 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
189 #include <linux/spi/adxl34x.h>
190 static const struct adxl34x_platform_data adxl34x_info
= {
194 .tap_threshold
= 0x31,
195 .tap_duration
= 0x10,
198 .tap_axis_control
= ADXL_TAP_X_EN
| ADXL_TAP_Y_EN
| ADXL_TAP_Z_EN
,
199 .act_axis_control
= 0xFF,
200 .activity_threshold
= 5,
201 .inactivity_threshold
= 3,
202 .inactivity_time
= 4,
203 .free_fall_threshold
= 0x7,
204 .free_fall_time
= 0x20,
206 .data_range
= ADXL_FULL_RES
,
209 .ev_code_x
= ABS_X
, /* EV_REL */
210 .ev_code_y
= ABS_Y
, /* EV_REL */
211 .ev_code_z
= ABS_Z
, /* EV_REL */
213 .ev_code_tap_x
= BTN_TOUCH
, /* EV_KEY */
214 .ev_code_tap_y
= BTN_TOUCH
, /* EV_KEY */
215 .ev_code_tap_z
= BTN_TOUCH
, /* EV_KEY */
217 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
218 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
219 .power_mode
= ADXL_AUTO_SLEEP
| ADXL_LINK
,
220 .fifo_mode
= ADXL_FIFO_STREAM
,
224 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
225 static struct platform_device rtc_device
= {
231 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
232 static struct resource bfin_uart_resources
[] = {
233 #ifdef CONFIG_SERIAL_BFIN_UART0
237 .flags
= IORESOURCE_MEM
,
240 #ifdef CONFIG_SERIAL_BFIN_UART1
244 .flags
= IORESOURCE_MEM
,
247 #ifdef CONFIG_SERIAL_BFIN_UART2
251 .flags
= IORESOURCE_MEM
,
254 #ifdef CONFIG_SERIAL_BFIN_UART3
258 .flags
= IORESOURCE_MEM
,
263 static struct platform_device bfin_uart_device
= {
266 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
267 .resource
= bfin_uart_resources
,
271 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
272 #ifdef CONFIG_BFIN_SIR0
273 static struct resource bfin_sir0_resources
[] = {
277 .flags
= IORESOURCE_MEM
,
280 .start
= IRQ_UART0_RX
,
281 .end
= IRQ_UART0_RX
+1,
282 .flags
= IORESOURCE_IRQ
,
285 .start
= CH_UART0_RX
,
286 .end
= CH_UART0_RX
+1,
287 .flags
= IORESOURCE_DMA
,
290 static struct platform_device bfin_sir0_device
= {
293 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
294 .resource
= bfin_sir0_resources
,
297 #ifdef CONFIG_BFIN_SIR1
298 static struct resource bfin_sir1_resources
[] = {
302 .flags
= IORESOURCE_MEM
,
305 .start
= IRQ_UART1_RX
,
306 .end
= IRQ_UART1_RX
+1,
307 .flags
= IORESOURCE_IRQ
,
310 .start
= CH_UART1_RX
,
311 .end
= CH_UART1_RX
+1,
312 .flags
= IORESOURCE_DMA
,
315 static struct platform_device bfin_sir1_device
= {
318 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
319 .resource
= bfin_sir1_resources
,
322 #ifdef CONFIG_BFIN_SIR2
323 static struct resource bfin_sir2_resources
[] = {
327 .flags
= IORESOURCE_MEM
,
330 .start
= IRQ_UART2_RX
,
331 .end
= IRQ_UART2_RX
+1,
332 .flags
= IORESOURCE_IRQ
,
335 .start
= CH_UART2_RX
,
336 .end
= CH_UART2_RX
+1,
337 .flags
= IORESOURCE_DMA
,
340 static struct platform_device bfin_sir2_device
= {
343 .num_resources
= ARRAY_SIZE(bfin_sir2_resources
),
344 .resource
= bfin_sir2_resources
,
347 #ifdef CONFIG_BFIN_SIR3
348 static struct resource bfin_sir3_resources
[] = {
352 .flags
= IORESOURCE_MEM
,
355 .start
= IRQ_UART3_RX
,
356 .end
= IRQ_UART3_RX
+1,
357 .flags
= IORESOURCE_IRQ
,
360 .start
= CH_UART3_RX
,
361 .end
= CH_UART3_RX
+1,
362 .flags
= IORESOURCE_DMA
,
365 static struct platform_device bfin_sir3_device
= {
368 .num_resources
= ARRAY_SIZE(bfin_sir3_resources
),
369 .resource
= bfin_sir3_resources
,
374 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
375 #include <linux/smsc911x.h>
377 static struct resource smsc911x_resources
[] = {
379 .name
= "smsc911x-memory",
381 .end
= 0x24000000 + 0xFF,
382 .flags
= IORESOURCE_MEM
,
387 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
391 static struct smsc911x_platform_config smsc911x_config
= {
392 .flags
= SMSC911X_USE_32BIT
,
393 .irq_polarity
= SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
394 .irq_type
= SMSC911X_IRQ_TYPE_OPEN_DRAIN
,
395 .phy_interface
= PHY_INTERFACE_MODE_MII
,
398 static struct platform_device smsc911x_device
= {
401 .num_resources
= ARRAY_SIZE(smsc911x_resources
),
402 .resource
= smsc911x_resources
,
404 .platform_data
= &smsc911x_config
,
409 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
410 static struct resource musb_resources
[] = {
414 .flags
= IORESOURCE_MEM
,
416 [1] = { /* general IRQ */
417 .start
= IRQ_USB_INT0
,
419 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
421 [2] = { /* DMA IRQ */
422 .start
= IRQ_USB_DMA
,
424 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
428 static struct musb_hdrc_config musb_config
= {
435 .gpio_vrsel
= GPIO_PE7
,
438 static struct musb_hdrc_platform_data musb_plat
= {
439 #if defined(CONFIG_USB_MUSB_OTG)
441 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
443 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
444 .mode
= MUSB_PERIPHERAL
,
446 .config
= &musb_config
,
449 static u64 musb_dmamask
= ~(u32
)0;
451 static struct platform_device musb_device
= {
455 .dma_mask
= &musb_dmamask
,
456 .coherent_dma_mask
= 0xffffffff,
457 .platform_data
= &musb_plat
,
459 .num_resources
= ARRAY_SIZE(musb_resources
),
460 .resource
= musb_resources
,
464 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
465 static struct resource bfin_atapi_resources
[] = {
469 .flags
= IORESOURCE_MEM
,
472 .start
= IRQ_ATAPI_ERR
,
473 .end
= IRQ_ATAPI_ERR
,
474 .flags
= IORESOURCE_IRQ
,
478 static struct platform_device bfin_atapi_device
= {
479 .name
= "pata-bf54x",
481 .num_resources
= ARRAY_SIZE(bfin_atapi_resources
),
482 .resource
= bfin_atapi_resources
,
486 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
487 static struct mtd_partition partition_info
[] = {
489 .name
= "linux kernel(nand)",
491 .size
= 4 * 1024 * 1024,
494 .name
= "file system(nand)",
495 .offset
= MTDPART_OFS_APPEND
,
496 .size
= MTDPART_SIZ_FULL
,
500 static struct bf5xx_nand_platform bf5xx_nand_platform
= {
501 .page_size
= NFC_PG_SIZE_256
,
502 .data_width
= NFC_NWIDTH_8
,
503 .partitions
= partition_info
,
504 .nr_partitions
= ARRAY_SIZE(partition_info
),
509 static struct resource bf5xx_nand_resources
[] = {
513 .flags
= IORESOURCE_MEM
,
518 .flags
= IORESOURCE_IRQ
,
522 static struct platform_device bf5xx_nand_device
= {
523 .name
= "bf5xx-nand",
525 .num_resources
= ARRAY_SIZE(bf5xx_nand_resources
),
526 .resource
= bf5xx_nand_resources
,
528 .platform_data
= &bf5xx_nand_platform
,
533 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
535 static struct bfin_sd_host bfin_sdh_data
= {
537 .irq_int0
= IRQ_SDH_MASK0
,
538 .pin_req
= {P_SD_D0
, P_SD_D1
, P_SD_D2
, P_SD_D3
, P_SD_CLK
, P_SD_CMD
, 0},
541 static struct platform_device bf54x_sdh_device
= {
545 .platform_data
= &bfin_sdh_data
,
550 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
551 static struct mtd_partition ezkit_partitions
[] = {
553 .name
= "bootloader(nor)",
557 .name
= "linux kernel(nor)",
559 .offset
= MTDPART_OFS_APPEND
,
561 .name
= "file system(nor)",
562 .size
= MTDPART_SIZ_FULL
,
563 .offset
= MTDPART_OFS_APPEND
,
567 static struct physmap_flash_data ezkit_flash_data
= {
569 .parts
= ezkit_partitions
,
570 .nr_parts
= ARRAY_SIZE(ezkit_partitions
),
573 static struct resource ezkit_flash_resource
= {
576 .flags
= IORESOURCE_MEM
,
579 static struct platform_device ezkit_flash_device
= {
580 .name
= "physmap-flash",
583 .platform_data
= &ezkit_flash_data
,
586 .resource
= &ezkit_flash_resource
,
590 #if defined(CONFIG_MTD_M25P80) \
591 || defined(CONFIG_MTD_M25P80_MODULE)
592 /* SPI flash chip (m25p16) */
593 static struct mtd_partition bfin_spi_flash_partitions
[] = {
595 .name
= "bootloader(spi)",
598 .mask_flags
= MTD_CAP_ROM
600 .name
= "linux kernel(spi)",
601 .size
= MTDPART_SIZ_FULL
,
602 .offset
= MTDPART_OFS_APPEND
,
606 static struct flash_platform_data bfin_spi_flash_data
= {
608 .parts
= bfin_spi_flash_partitions
,
609 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
613 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
614 .enable_dma
= 0, /* use dma transfer with this chip*/
619 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
620 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
621 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
627 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
628 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
633 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
635 .vref_delay_usecs
= 50, /* internal, no capacitor */
638 .pressure_max
= 1000,
640 .stopacq_polarity
= 1,
641 .first_conversion_delay
= 3,
642 .acquisition_time
= 1,
644 .pen_down_acc_interval
= 1,
648 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
649 static struct bfin5xx_spi_chip spidev_chip_info
= {
655 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
656 static struct bfin5xx_spi_chip spi_adxl34x_chip_info
= {
657 .enable_dma
= 0, /* use dma transfer with this chip*/
662 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
663 #if defined(CONFIG_MTD_M25P80) \
664 || defined(CONFIG_MTD_M25P80_MODULE)
666 /* the modalias must be the same as spi device driver name */
667 .modalias
= "m25p80", /* Name of spi_driver for this device */
668 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
669 .bus_num
= 0, /* Framework bus number */
670 .chip_select
= 1, /* SPI_SSEL1*/
671 .platform_data
= &bfin_spi_flash_data
,
672 .controller_data
= &spi_flash_chip_info
,
676 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
677 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
679 .modalias
= "ad1836",
680 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
682 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
683 .controller_data
= &ad1836_spi_chip_info
,
686 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
688 .modalias
= "ad7877",
689 .platform_data
= &bfin_ad7877_ts_info
,
690 .irq
= IRQ_PB4
, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
691 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
694 .controller_data
= &spi_ad7877_chip_info
,
697 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
699 .modalias
= "spidev",
700 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
703 .controller_data
= &spidev_chip_info
,
706 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
708 .modalias
= "adxl34x",
709 .platform_data
= &adxl34x_info
,
711 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
714 .controller_data
= &spi_adxl34x_chip_info
,
719 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
721 static struct resource bfin_spi0_resource
[] = {
723 .start
= SPI0_REGBASE
,
724 .end
= SPI0_REGBASE
+ 0xFF,
725 .flags
= IORESOURCE_MEM
,
730 .flags
= IORESOURCE_DMA
,
735 .flags
= IORESOURCE_IRQ
,
740 static struct resource bfin_spi1_resource
[] = {
742 .start
= SPI1_REGBASE
,
743 .end
= SPI1_REGBASE
+ 0xFF,
744 .flags
= IORESOURCE_MEM
,
749 .flags
= IORESOURCE_DMA
,
754 .flags
= IORESOURCE_IRQ
,
758 /* SPI controller data */
759 static struct bfin5xx_spi_master bf54x_spi_master_info0
= {
761 .enable_dma
= 1, /* master has the ability to do dma transfer */
762 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
765 static struct platform_device bf54x_spi_master0
= {
767 .id
= 0, /* Bus number */
768 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
769 .resource
= bfin_spi0_resource
,
771 .platform_data
= &bf54x_spi_master_info0
, /* Passed to driver */
775 static struct bfin5xx_spi_master bf54x_spi_master_info1
= {
777 .enable_dma
= 1, /* master has the ability to do dma transfer */
778 .pin_req
= {P_SPI1_SCK
, P_SPI1_MISO
, P_SPI1_MOSI
, 0},
781 static struct platform_device bf54x_spi_master1
= {
783 .id
= 1, /* Bus number */
784 .num_resources
= ARRAY_SIZE(bfin_spi1_resource
),
785 .resource
= bfin_spi1_resource
,
787 .platform_data
= &bf54x_spi_master_info1
, /* Passed to driver */
790 #endif /* spi master and devices */
792 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
793 static struct resource bfin_twi0_resource
[] = {
795 .start
= TWI0_REGBASE
,
796 .end
= TWI0_REGBASE
+ 0xFF,
797 .flags
= IORESOURCE_MEM
,
802 .flags
= IORESOURCE_IRQ
,
806 static struct platform_device i2c_bfin_twi0_device
= {
807 .name
= "i2c-bfin-twi",
809 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
810 .resource
= bfin_twi0_resource
,
813 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
814 static struct resource bfin_twi1_resource
[] = {
816 .start
= TWI1_REGBASE
,
817 .end
= TWI1_REGBASE
+ 0xFF,
818 .flags
= IORESOURCE_MEM
,
823 .flags
= IORESOURCE_IRQ
,
827 static struct platform_device i2c_bfin_twi1_device
= {
828 .name
= "i2c-bfin-twi",
830 .num_resources
= ARRAY_SIZE(bfin_twi1_resource
),
831 .resource
= bfin_twi1_resource
,
836 static struct i2c_board_info __initdata bfin_i2c_board_info0
[] = {
839 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
840 static struct i2c_board_info __initdata bfin_i2c_board_info1
[] = {
841 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
843 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
846 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
848 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
852 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
854 I2C_BOARD_INFO("adxl34x", 0x53),
856 .platform_data
= (void *)&adxl34x_info
,
862 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
863 #include <linux/gpio_keys.h>
865 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
866 {BTN_0
, GPIO_PB8
, 1, "gpio-keys: BTN0"},
867 {BTN_1
, GPIO_PB9
, 1, "gpio-keys: BTN1"},
868 {BTN_2
, GPIO_PB10
, 1, "gpio-keys: BTN2"},
869 {BTN_3
, GPIO_PB11
, 1, "gpio-keys: BTN3"},
872 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
873 .buttons
= bfin_gpio_keys_table
,
874 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
877 static struct platform_device bfin_device_gpiokeys
= {
880 .platform_data
= &bfin_gpio_keys_data
,
885 static const unsigned int cclk_vlev_datasheet
[] =
888 * Internal VLEV BF54XSBBC1533
889 ****temporarily using these values until data sheet is updated
891 VRPAIR(VLEV_085
, 150000000),
892 VRPAIR(VLEV_090
, 250000000),
893 VRPAIR(VLEV_110
, 276000000),
894 VRPAIR(VLEV_115
, 301000000),
895 VRPAIR(VLEV_120
, 525000000),
896 VRPAIR(VLEV_125
, 550000000),
897 VRPAIR(VLEV_130
, 600000000),
900 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
901 .tuple_tab
= cclk_vlev_datasheet
,
902 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
903 .vr_settling_time
= 25 /* us */,
906 static struct platform_device bfin_dpmc
= {
909 .platform_data
= &bfin_dmpc_vreg_data
,
913 static struct platform_device
*ezkit_devices
[] __initdata
= {
917 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
921 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
925 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
926 #ifdef CONFIG_BFIN_SIR0
929 #ifdef CONFIG_BFIN_SIR1
932 #ifdef CONFIG_BFIN_SIR2
935 #ifdef CONFIG_BFIN_SIR3
940 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
944 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
948 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
952 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
953 &bfin_isp1760_device
,
956 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
960 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
964 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
968 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
973 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
977 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
981 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
982 &i2c_bfin_twi0_device
,
983 #if !defined(CONFIG_BF542)
984 &i2c_bfin_twi1_device
,
988 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
989 &bfin_device_gpiokeys
,
992 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
997 static int __init
ezkit_init(void)
999 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
1001 i2c_register_board_info(0, bfin_i2c_board_info0
,
1002 ARRAY_SIZE(bfin_i2c_board_info0
));
1003 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1004 i2c_register_board_info(1, bfin_i2c_board_info1
,
1005 ARRAY_SIZE(bfin_i2c_board_info1
));
1008 platform_add_devices(ezkit_devices
, ARRAY_SIZE(ezkit_devices
));
1010 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
1015 arch_initcall(ezkit_init
);