浏览代码

ARM: 5698/1: MMCI pass capabilities in platform data

This makes it possible to pass down the host controller
capabilities for the MMCI driver using the platform data. It
also provides the capabilties for the U300 implementation as an
example, and makes sure the 4bit wide mode is set if this is
requested by the ios() now that we can actually set that
capability for a platform.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Linus Walleij 15 年之前
父节点
当前提交
9e6c82cd3e
共有 3 个文件被更改,包括 7 次插入0 次删除
  1. 1 0
      arch/arm/include/asm/mach/mmc.h
  2. 2 0
      arch/arm/mach-u300/mmc.c
  3. 4 0
      drivers/mmc/host/mmci.c

+ 1 - 0
arch/arm/include/asm/mach/mmc.h

@@ -12,6 +12,7 @@ struct mmc_platform_data {
 	unsigned int (*status)(struct device *);
 	unsigned int (*status)(struct device *);
 	int	gpio_wp;
 	int	gpio_wp;
 	int	gpio_cd;
 	int	gpio_cd;
+	unsigned long capabilities;
 };
 };
 
 
 #endif
 #endif

+ 2 - 0
arch/arm/mach-u300/mmc.c

@@ -158,6 +158,8 @@ int __devinit mmc_init(struct amba_device *adev)
 	mmci_card->mmc0_plat_data.status = mmc_status;
 	mmci_card->mmc0_plat_data.status = mmc_status;
 	mmci_card->mmc0_plat_data.gpio_wp = -1;
 	mmci_card->mmc0_plat_data.gpio_wp = -1;
 	mmci_card->mmc0_plat_data.gpio_cd = -1;
 	mmci_card->mmc0_plat_data.gpio_cd = -1;
+	mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED |
+		MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA;
 
 
 	mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data;
 	mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data;
 
 

+ 4 - 0
drivers/mmc/host/mmci.c

@@ -62,6 +62,9 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
 		/* clk |= MCI_CLK_PWRSAVE; */
 		/* clk |= MCI_CLK_PWRSAVE; */
 	}
 	}
 
 
+	if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4)
+		clk |= MCI_WIDE_BUS;
+
 	writel(clk, host->base + MMCICLOCK);
 	writel(clk, host->base + MMCICLOCK);
 }
 }
 
 
@@ -601,6 +604,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 	mmc->f_min = (host->mclk + 511) / 512;
 	mmc->f_min = (host->mclk + 511) / 512;
 	mmc->f_max = min(host->mclk, fmax);
 	mmc->f_max = min(host->mclk, fmax);
 	mmc->ocr_avail = plat->ocr_mask;
 	mmc->ocr_avail = plat->ocr_mask;
+	mmc->caps = plat->capabilities;
 
 
 	/*
 	/*
 	 * We can do SGIO
 	 * We can do SGIO