diff options
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 9b7b9f34767f..a5e8e5bc6496 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/interrupt.h> | 46 | #include <linux/interrupt.h> |
47 | #include <linux/i2c.h> | 47 | #include <linux/i2c.h> |
48 | #include <linux/usb/sl811.h> | 48 | #include <linux/usb/sl811.h> |
49 | #include <linux/spi/mmc_spi.h> | ||
49 | #include <asm/dma.h> | 50 | #include <asm/dma.h> |
50 | #include <asm/bfin5xx_spi.h> | 51 | #include <asm/bfin5xx_spi.h> |
51 | #include <asm/reboot.h> | 52 | #include <asm/reboot.h> |
@@ -533,6 +534,33 @@ static struct bfin5xx_spi_chip spi_mmc_chip_info = { | |||
533 | }; | 534 | }; |
534 | #endif | 535 | #endif |
535 | 536 | ||
537 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) | ||
538 | #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 | ||
539 | |||
540 | static int bfin_mmc_spi_init(struct device *dev, | ||
541 | irqreturn_t (*detect_int)(int, void *), void *data) | ||
542 | { | ||
543 | return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int, | ||
544 | IRQF_TRIGGER_FALLING, "mmc-spi-detect", data); | ||
545 | } | ||
546 | |||
547 | static void bfin_mmc_spi_exit(struct device *dev, void *data) | ||
548 | { | ||
549 | free_irq(MMC_SPI_CARD_DETECT_INT, data); | ||
550 | } | ||
551 | |||
552 | static struct mmc_spi_platform_data bfin_mmc_spi_pdata = { | ||
553 | .init = bfin_mmc_spi_init, | ||
554 | .exit = bfin_mmc_spi_exit, | ||
555 | .detect_delay = 100, /* msecs */ | ||
556 | }; | ||
557 | |||
558 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { | ||
559 | .enable_dma = 0, | ||
560 | .bits_per_word = 8, | ||
561 | }; | ||
562 | #endif | ||
563 | |||
536 | #if defined(CONFIG_PBX) | 564 | #if defined(CONFIG_PBX) |
537 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { | 565 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { |
538 | .ctl_reg = 0x4, /* send zero */ | 566 | .ctl_reg = 0x4, /* send zero */ |
@@ -712,6 +740,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
712 | .mode = SPI_MODE_3, | 740 | .mode = SPI_MODE_3, |
713 | }, | 741 | }, |
714 | #endif | 742 | #endif |
743 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) | ||
744 | { | ||
745 | .modalias = "mmc_spi", | ||
746 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ | ||
747 | .bus_num = 0, | ||
748 | .chip_select = 4, | ||
749 | .platform_data = &bfin_mmc_spi_pdata, | ||
750 | .controller_data = &mmc_spi_chip_info, | ||
751 | .mode = SPI_MODE_3, | ||
752 | }, | ||
753 | #endif | ||
715 | #if defined(CONFIG_PBX) | 754 | #if defined(CONFIG_PBX) |
716 | { | 755 | { |
717 | .modalias = "fxs-spi", | 756 | .modalias = "fxs-spi", |