aboutsummaryrefslogtreecommitdiffstats
path: root/meta-e3000/recipes-kernel/linux/linux-yocto-4.14.71/0097-mmc-core-Move-calls-to-prepare_hs400_tuning-closer-t.patch
blob: 5dcdadebb6d77a01e5835b0f9d9faaeebb0191ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From b81f61d97f8e479d3ee3cc8fe428accbaf3a5cf6 Mon Sep 17 00:00:00 2001
From: Ulf Hansson <ulf.hansson@linaro.org>
Date: Tue, 22 May 2018 16:26:26 +0200
Subject: [PATCH 097/131] mmc: core: Move calls to ->prepare_hs400_tuning()
 closer to mmc code

Move the calls to ->prepare_hs400_tuning(), from mmc_retune() into
mmc_hs400_to_hs200(), as it better belongs there, rather than being generic
to all type of cards.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
---
 drivers/mmc/core/host.c | 3 ---
 drivers/mmc/core/mmc.c  | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index ad88deb..4651e9b 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -148,9 +148,6 @@ int mmc_retune(struct mmc_host *host)
 			goto out;
 
 		return_to_hs400 = true;
-
-		if (host->ops->prepare_hs400_tuning)
-			host->ops->prepare_hs400_tuning(host, &host->ios);
 	}
 
 	err = mmc_execute_tuning(host->card);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index bad5c1b..16845a8 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1278,6 +1278,10 @@ int mmc_hs400_to_hs200(struct mmc_card *card)
 
 	mmc_set_bus_speed(card);
 
+	/* Prepare tuning for HS400 mode. */
+	if (host->ops->prepare_hs400_tuning)
+		host->ops->prepare_hs400_tuning(host, &host->ios);
+
 	return 0;
 
 out_err:
-- 
2.7.4