c34bf12445abf496a4a9d0d2cdb7a33565989d01
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.14 / 0160-mmc-mediatek-perfer-to-use-rise-edge-latching-for-cm.patch
1 From 81fdc4983e33ef01935a9bf01187951aad34e2ac Mon Sep 17 00:00:00 2001
2 From: Chaotian Jing <chaotian.jing@mediatek.com>
3 Date: Mon, 16 Oct 2017 09:46:39 +0800
4 Subject: [PATCH 160/224] mmc: mediatek: perfer to use rise edge latching for
5 cmd line
6
7 data lines have applied to perfer to use rise edge, also need
8 apply it to cmd line.
9
10 Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
11 Tested-by: Sean Wang <sean.wang@mediatek.com>
12 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
13 ---
14 drivers/mmc/host/mtk-sd.c | 3 ++-
15 1 file changed, 2 insertions(+), 1 deletion(-)
16
17 diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
18 index 95759bba0dd0..27a62254f12f 100644
19 --- a/drivers/mmc/host/mtk-sd.c
20 +++ b/drivers/mmc/host/mtk-sd.c
21 @@ -1550,7 +1550,8 @@ static int msdc_tune_response(struct mmc_host *mmc, u32 opcode)
22 }
23 final_rise_delay = get_best_delay(host, rise_delay);
24 /* if rising edge has enough margin, then do not scan falling edge */
25 - if (final_rise_delay.maxlen >= 12 && final_rise_delay.start < 4)
26 + if (final_rise_delay.maxlen >= 12 ||
27 + (final_rise_delay.start == 0 && final_rise_delay.maxlen >= 4))
28 goto skip_fall;
29
30 sdr_set_bits(host->base + MSDC_IOCON, MSDC_IOCON_RSPL);
31 --
32 2.11.0
33