1 From d63cca1d57881d931236d101fe16fd249d91b060 Mon Sep 17 00:00:00 2001
2 From: Grigori Goronzy <greg@blackbox>
3 Date: Mon, 11 Jun 2012 18:52:04 +0200
4 Subject: [PATCH 012/196] sdhci-bcm2708: remove custom clock handling
6 The custom clock handling code is redundant and buggy. The MMC/SDHCI
7 subsystem does a better job than it, so remove it for good.
9 drivers/mmc/host/sdhci-bcm2708.c | 65 +---------------------------------------
10 1 file changed, 1 insertion(+), 64 deletions(-)
12 diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c
13 index a6bdc25..0ed4d85 100644
14 --- a/drivers/mmc/host/sdhci-bcm2708.c
15 +++ b/drivers/mmc/host/sdhci-bcm2708.c
16 @@ -353,68 +353,9 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg)
18 static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host)
20 - return 20000000; // this value is in Hz (20MHz)
21 + return BCM2708_EMMC_CLOCK_FREQ;
24 -static unsigned int sdhci_bcm2708_get_timeout_clock(struct sdhci_host *host)
27 - return (host->clock / 1000); // this value is in kHz (100MHz)
29 - return (sdhci_bcm2708_get_max_clock(host) / 1000);
32 -static void sdhci_bcm2708_set_clock(struct sdhci_host *host, unsigned int clock)
36 - unsigned long timeout;
38 - if (clock == host->clock)
41 - sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
46 - if (BCM2708_EMMC_CLOCK_FREQ <= clock)
49 - for (div = 2; div < SDHCI_MAX_DIV_SPEC_300; div += 2) {
50 - if ((BCM2708_EMMC_CLOCK_FREQ / div) <= clock)
55 - DBG( "desired SD clock: %d, actual: %d\n",
56 - clock, BCM2708_EMMC_CLOCK_FREQ / div);
58 - clk |= (div & SDHCI_DIV_MASK) << SDHCI_DIVIDER_SHIFT;
59 - clk |= ((div & SDHCI_DIV_HI_MASK) >> SDHCI_DIV_MASK_LEN)
60 - << SDHCI_DIVIDER_HI_SHIFT;
61 - clk |= SDHCI_CLOCK_INT_EN;
63 - sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
66 - while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL))
67 - & SDHCI_CLOCK_INT_STABLE)) {
69 - printk(KERN_ERR "%s: Internal clock never "
70 - "stabilised.\n", mmc_hostname(host->mmc));
77 - clk |= SDHCI_CLOCK_CARD_EN;
78 - sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
80 - host->clock = clock;
83 /*****************************************************************************\
86 @@ -1189,11 +1130,7 @@ static struct sdhci_ops sdhci_bcm2708_ops = {
88 #error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set
90 - //.enable_dma = NULL,
91 - .set_clock = sdhci_bcm2708_set_clock,
92 .get_max_clock = sdhci_bcm2708_get_max_clock,
93 - //.get_min_clock = NULL,
94 - .get_timeout_clock = sdhci_bcm2708_get_timeout_clock,
96 #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
97 // Platform DMA operations