kernel: bump 4.14 to 4.14.93
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0167-mmc-bcm2835-mmc-Support-underclocking.patch
1 From 9cd69b8f61edc246563741cd11d01fa911cd7e91 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 22 Jan 2018 12:22:01 +0000
4 Subject: [PATCH 167/454] mmc: bcm2835-mmc: Support underclocking
5
6 Support underclocking of the SD bus using the max-frequency DT property
7 (which currently has no DT parameter). The sd_overclock parameter
8 already provides another way to achieve the same thing which should be
9 equivalent in end result, but it is a bug not to support max-frequency
10 as well.
11
12 See: https://github.com/raspberrypi/linux/issues/2350
13
14 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
15 ---
16 drivers/mmc/host/bcm2835-mmc.c | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19 --- a/drivers/mmc/host/bcm2835-mmc.c
20 +++ b/drivers/mmc/host/bcm2835-mmc.c
21 @@ -1310,8 +1310,8 @@ static int bcm2835_mmc_add_host(struct b
22
23 host->clk_mul = 0;
24
25 - mmc->f_max = host->max_clk;
26 - mmc->f_max = host->max_clk;
27 + if (!mmc->f_max || mmc->f_max > host->max_clk)
28 + mmc->f_max = host->max_clk;
29 mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
30
31 /* SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK */