brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0014-sdhci-bcm2708-add-allow_highspeed-parameter.patch
1 From f779191cd42376e2b1f555be1b2c486dd99b2fef Mon Sep 17 00:00:00 2001
2 From: Grigori Goronzy <greg@blackbox>
3 Date: Mon, 11 Jun 2012 18:57:13 +0200
4 Subject: [PATCH 014/174] sdhci-bcm2708: add allow_highspeed parameter
5
6 Add a parameter to disable high-speed mode for the few cards that
7 still might have problems. High-speed mode is enabled by default.
8 ---
9  drivers/mmc/host/sdhci-bcm2708.c | 9 ++++++++-
10  1 file changed, 8 insertions(+), 1 deletion(-)
11
12 --- a/drivers/mmc/host/sdhci-bcm2708.c
13 +++ b/drivers/mmc/host/sdhci-bcm2708.c
14 @@ -129,6 +129,8 @@ static inline unsigned long int since_ns
15         return (unsigned long)((hptime() - t) * HPTIME_CLK_NS);
16  }
17  
18 +static bool allow_highspeed = 1;
19 +
20  #if 0
21  static void hptime_test(void)
22  {
23 @@ -1254,7 +1256,8 @@ static int sdhci_bcm2708_probe(struct pl
24             host_priv->dma_chan, host_priv->dma_chan_base,
25             host_priv->dma_irq);
26  
27 -       host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
28 +    if (allow_highspeed)
29 +        host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
30  #endif
31  
32         ret = sdhci_add_host(host);
33 @@ -1357,8 +1360,12 @@ static void __exit sdhci_drv_exit(void)
34  module_init(sdhci_drv_init);
35  module_exit(sdhci_drv_exit);
36  
37 +module_param(allow_highspeed, bool, 0444);
38 +
39  MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver");
40  MODULE_AUTHOR("Broadcom <info@broadcom.com>");
41  MODULE_LICENSE("GPL v2");
42  MODULE_ALIAS("platform:"DRIVER_NAME);
43  
44 +MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes");
45 +