diff options
author | Yi Li <yi.li@analog.com> | 2009-01-07 10:14:38 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-01-07 10:14:38 -0500 |
commit | f79ea4cba00e2c2f5ffde9007e7ba0fe992b2e18 (patch) | |
tree | 379c72dfab33a4069621af81a12da3ba0253af4c /arch | |
parent | 211daf9d7252288ad88ab6b97268a8d828e6b696 (diff) |
Blackfin arch: add mmc_spi support to BF537-STAMP
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch')
-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", |