diff options
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/stamp.c')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index b2ac4816ae62..fddce32901a2 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #endif | 40 | #endif |
41 | #include <linux/ata_platform.h> | 41 | #include <linux/ata_platform.h> |
42 | #include <linux/irq.h> | 42 | #include <linux/irq.h> |
43 | #include <linux/i2c.h> | ||
43 | #include <asm/dma.h> | 44 | #include <asm/dma.h> |
44 | #include <asm/bfin5xx_spi.h> | 45 | #include <asm/bfin5xx_spi.h> |
45 | #include <asm/reboot.h> | 46 | #include <asm/reboot.h> |
@@ -109,6 +110,7 @@ static struct platform_device net2272_bfin_device = { | |||
109 | }; | 110 | }; |
110 | #endif | 111 | #endif |
111 | 112 | ||
113 | #if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE) | ||
112 | static struct mtd_partition stamp_partitions[] = { | 114 | static struct mtd_partition stamp_partitions[] = { |
113 | { | 115 | { |
114 | .name = "Bootloader", | 116 | .name = "Bootloader", |
@@ -152,6 +154,7 @@ static struct platform_device stamp_flash_device = { | |||
152 | .num_resources = ARRAY_SIZE(stamp_flash_resource), | 154 | .num_resources = ARRAY_SIZE(stamp_flash_resource), |
153 | .resource = stamp_flash_resource, | 155 | .resource = stamp_flash_resource, |
154 | }; | 156 | }; |
157 | #endif | ||
155 | 158 | ||
156 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 159 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
157 | /* all SPI peripherals info goes here */ | 160 | /* all SPI peripherals info goes here */ |
@@ -367,6 +370,25 @@ static struct platform_device bfin_uart_device = { | |||
367 | }; | 370 | }; |
368 | #endif | 371 | #endif |
369 | 372 | ||
373 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
374 | static struct resource bfin_sir_resources[] = { | ||
375 | #ifdef CONFIG_BFIN_SIR0 | ||
376 | { | ||
377 | .start = 0xFFC00400, | ||
378 | .end = 0xFFC004FF, | ||
379 | .flags = IORESOURCE_MEM, | ||
380 | }, | ||
381 | #endif | ||
382 | }; | ||
383 | |||
384 | static struct platform_device bfin_sir_device = { | ||
385 | .name = "bfin_sir", | ||
386 | .id = 0, | ||
387 | .num_resources = ARRAY_SIZE(bfin_sir_resources), | ||
388 | .resource = bfin_sir_resources, | ||
389 | }; | ||
390 | #endif | ||
391 | |||
370 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 392 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
371 | static struct platform_device bfin_sport0_uart_device = { | 393 | static struct platform_device bfin_sport0_uart_device = { |
372 | .name = "bfin-sport-uart", | 394 | .name = "bfin-sport-uart", |
@@ -472,6 +494,31 @@ static struct platform_device i2c_gpio_device = { | |||
472 | }; | 494 | }; |
473 | #endif | 495 | #endif |
474 | 496 | ||
497 | #ifdef CONFIG_I2C_BOARDINFO | ||
498 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { | ||
499 | #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) | ||
500 | { | ||
501 | I2C_BOARD_INFO("ad7142_joystick", 0x2C), | ||
502 | .type = "ad7142_joystick", | ||
503 | .irq = 39, | ||
504 | }, | ||
505 | #endif | ||
506 | #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) | ||
507 | { | ||
508 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), | ||
509 | .type = "pcf8574_lcd", | ||
510 | }, | ||
511 | #endif | ||
512 | #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) | ||
513 | { | ||
514 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), | ||
515 | .type = "pcf8574_keypad", | ||
516 | .irq = 39, | ||
517 | }, | ||
518 | #endif | ||
519 | }; | ||
520 | #endif | ||
521 | |||
475 | static struct platform_device *stamp_devices[] __initdata = { | 522 | static struct platform_device *stamp_devices[] __initdata = { |
476 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 523 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
477 | &rtc_device, | 524 | &rtc_device, |
@@ -497,6 +544,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
497 | &bfin_uart_device, | 544 | &bfin_uart_device, |
498 | #endif | 545 | #endif |
499 | 546 | ||
547 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
548 | &bfin_sir_device, | ||
549 | #endif | ||
550 | |||
500 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 551 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
501 | &bfin_sport0_uart_device, | 552 | &bfin_sport0_uart_device, |
502 | &bfin_sport1_uart_device, | 553 | &bfin_sport1_uart_device, |
@@ -515,14 +566,23 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
515 | #endif | 566 | #endif |
516 | 567 | ||
517 | &bfin_gpios_device, | 568 | &bfin_gpios_device, |
569 | |||
570 | #if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE) | ||
518 | &stamp_flash_device, | 571 | &stamp_flash_device, |
572 | #endif | ||
519 | }; | 573 | }; |
520 | 574 | ||
521 | static int __init stamp_init(void) | 575 | static int __init stamp_init(void) |
522 | { | 576 | { |
523 | int ret; | 577 | int ret; |
524 | 578 | ||
525 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | 579 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
580 | |||
581 | #ifdef CONFIG_I2C_BOARDINFO | ||
582 | i2c_register_board_info(0, bfin_i2c_board_info, | ||
583 | ARRAY_SIZE(bfin_i2c_board_info)); | ||
584 | #endif | ||
585 | |||
526 | ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); | 586 | ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
527 | if (ret < 0) | 587 | if (ret < 0) |
528 | return ret; | 588 | return ret; |