kernel: bump 4.14 to 4.14.44
[openwrt/staging/chunkeey.git] / target / linux / mediatek / patches-4.14 / 0152-mmc-mediatek-make-hs400_tune_response-only-for-mt817.patch
1 From bc70c7f1174b937af2784977281a1567f69dd2b6 Mon Sep 17 00:00:00 2001
2 From: Chaotian Jing <chaotian.jing@mediatek.com>
3 Date: Mon, 16 Oct 2017 09:46:31 +0800
4 Subject: [PATCH 152/224] mmc: mediatek: make hs400_tune_response only for
5 mt8173
6
7 the origin design of hs400_tune_response is for mt8173 because of
8 mt8173 has a special design. for doing that, we add a new member
9 "compatible", by now it's only for mt8173.
10
11 Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
12 Tested-by: Sean Wang <sean.wang@mediatek.com>
13 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
14 ---
15 drivers/mmc/host/mtk-sd.c | 11 +++++++++--
16 1 file changed, 9 insertions(+), 2 deletions(-)
17
18 --- a/drivers/mmc/host/mtk-sd.c
19 +++ b/drivers/mmc/host/mtk-sd.c
20 @@ -300,6 +300,7 @@ struct msdc_save_para {
21
22 struct mtk_mmc_compatible {
23 u8 clk_div_bits;
24 + bool hs400_tune; /* only used for MT8173 */
25 };
26
27 struct msdc_tune_para {
28 @@ -360,18 +361,22 @@ struct msdc_host {
29
30 static const struct mtk_mmc_compatible mt8135_compat = {
31 .clk_div_bits = 8,
32 + .hs400_tune = false,
33 };
34
35 static const struct mtk_mmc_compatible mt8173_compat = {
36 .clk_div_bits = 8,
37 + .hs400_tune = true,
38 };
39
40 static const struct mtk_mmc_compatible mt2701_compat = {
41 .clk_div_bits = 12,
42 + .hs400_tune = false,
43 };
44
45 static const struct mtk_mmc_compatible mt2712_compat = {
46 .clk_div_bits = 12,
47 + .hs400_tune = false,
48 };
49
50 static const struct of_device_id msdc_of_ids[] = {
51 @@ -666,7 +671,8 @@ static void msdc_set_mclk(struct msdc_ho
52 host->base + PAD_CMD_TUNE);
53 }
54
55 - if (timing == MMC_TIMING_MMC_HS400)
56 + if (timing == MMC_TIMING_MMC_HS400 &&
57 + host->dev_comp->hs400_tune)
58 sdr_set_field(host->base + PAD_CMD_TUNE,
59 MSDC_PAD_TUNE_CMDRRDLY,
60 host->hs400_cmd_int_delay);
61 @@ -1594,7 +1600,8 @@ static int msdc_execute_tuning(struct mm
62 struct msdc_host *host = mmc_priv(mmc);
63 int ret;
64
65 - if (host->hs400_mode)
66 + if (host->hs400_mode &&
67 + host->dev_comp->hs400_tune)
68 ret = hs400_tune_response(mmc, opcode);
69 else
70 ret = msdc_tune_response(mmc, opcode);