Skip to content

Commit c6a55f5

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 17781c0 commit c6a55f5

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
@@ -1310,8 +1310,8 @@ static int bcm2835_mmc_add_host(struct bcm2835_host *host)
13101310

13111311
host->clk_mul = 0;
13121312

1313-
mmc->f_max = host->max_clk;
1314-
mmc->f_max = host->max_clk;
1313+
if (!mmc->f_max || mmc->f_max > host->max_clk)
1314+
mmc->f_max = host->max_clk;
13151315
mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
13161316

13171317
/* SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK */

0 commit comments

Comments
 (0)