Skip to content

Commit cbdcf7e

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
mmc: bcm2835-mmc: Support underclocking
Support underclocking of the SD bus using the max-frequency DT property (which currently has no DT parameter). The sd_overclock parameter already provides another way to achieve the same thing which should be equivalent in end result, but it is a bug not to support max-frequency as well. See: #2350 Signed-off-by: Phil Elwell <[email protected]>
1 parent 12fa443 commit cbdcf7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/host/bcm2835-mmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,8 +1308,8 @@ static int bcm2835_mmc_add_host(struct bcm2835_host *host)
13081308

13091309
host->clk_mul = 0;
13101310

1311-
mmc->f_max = host->max_clk;
1312-
mmc->f_max = host->max_clk;
1311+
if (!mmc->f_max || mmc->f_max > host->max_clk)
1312+
mmc->f_max = host->max_clk;
13131313
mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
13141314

13151315
/* SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK */

0 commit comments

Comments
 (0)