aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorYi Li <yi.li@analog.com>2009-07-16 06:12:30 -0400
committerMike Frysinger <vapier@gentoo.org>2009-09-16 21:31:49 -0400
commit2120b68f31d3b08be99010b3992f58f07794b8b0 (patch)
tree73daa69bf78abb3d95d034324ba5dccf10dcb567 /arch/blackfin
parentf41e2fded031cd8f3c0430687fa6b35ca0589088 (diff)
Blackfin: bf533-stamp: add resources for mmc_spi card
Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 42d4c9fcc12f..e6548a623940 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -35,6 +35,7 @@
35#include <linux/mtd/physmap.h> 35#include <linux/mtd/physmap.h>
36#include <linux/spi/spi.h> 36#include <linux/spi/spi.h>
37#include <linux/spi/flash.h> 37#include <linux/spi/flash.h>
38#include <linux/spi/mmc_spi.h>
38#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 39#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
39#include <linux/usb/isp1362.h> 40#include <linux/usb/isp1362.h>
40#endif 41#endif
@@ -223,6 +224,34 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
223}; 224};
224#endif 225#endif
225 226
227#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
228#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
229static int bfin_mmc_spi_init(struct device *dev,
230 irqreturn_t (*detect_int)(int, void *), void *data)
231{
232 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
233 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
234 "mmc-spi-detect", data);
235}
236
237static void bfin_mmc_spi_exit(struct device *dev, void *data)
238{
239 free_irq(MMC_SPI_CARD_DETECT_INT, data);
240}
241
242static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
243 .init = bfin_mmc_spi_init,
244 .exit = bfin_mmc_spi_exit,
245 .detect_delay = 100, /* msecs */
246};
247
248static struct bfin5xx_spi_chip mmc_spi_chip_info = {
249 .enable_dma = 0,
250 .bits_per_word = 8,
251 .pio_interrupt = 0,
252};
253#endif
254
226static struct spi_board_info bfin_spi_board_info[] __initdata = { 255static struct spi_board_info bfin_spi_board_info[] __initdata = {
227#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 256#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
228 { 257 {
@@ -286,6 +315,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
286 .controller_data = &spidev_chip_info, 315 .controller_data = &spidev_chip_info,
287 }, 316 },
288#endif 317#endif
318#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
319 {
320 .modalias = "mmc_spi",
321 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
322 .bus_num = 0,
323 .chip_select = 4,
324 .platform_data = &bfin_mmc_spi_pdata,
325 .controller_data = &mmc_spi_chip_info,
326 .mode = SPI_MODE_3,
327 },
328#endif
289}; 329};
290 330
291#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 331#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)