summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/host.h
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2017-01-13 14:14:15 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2017-02-13 13:20:25 +0100
commit5857b29b96dcf208e4903ec6f20d132e6a77cac2 (patch)
treeb1c0466b31197db5b8e724028d743cf4b5b76500 /drivers/mmc/core/host.h
parent4facdde11394d44b3869807841042d059f074a07 (diff)
downloadlinux-5857b29b96dcf208e4903ec6f20d132e6a77cac2.tar.bz2
mmc: core: Move public functions from host.h to private headers
A significant amount of functions are available through the public mmc host.h header file. Let's slim down this public mmc interface, as to prevent users from abusing it, by moving some of the functions to private mmc host.h header file. This change concentrates on moving the functions into private mmc headers, following changes may continue with additional clean-ups. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Diffstat (limited to 'drivers/mmc/core/host.h')
-rw-r--r--drivers/mmc/core/host.h49
1 files changed, 48 insertions, 1 deletions
diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h
index 366ce79c3498..fb6a76a03833 100644
--- a/drivers/mmc/core/host.h
+++ b/drivers/mmc/core/host.h
@@ -11,7 +11,7 @@
#ifndef _MMC_CORE_HOST_H
#define _MMC_CORE_HOST_H
-struct mmc_host;
+#include <linux/mmc/host.h>
int mmc_register_host_class(void);
void mmc_unregister_host_class(void);
@@ -21,6 +21,53 @@ void mmc_retune_disable(struct mmc_host *host);
void mmc_retune_hold(struct mmc_host *host);
void mmc_retune_release(struct mmc_host *host);
int mmc_retune(struct mmc_host *host);
+void mmc_retune_pause(struct mmc_host *host);
+void mmc_retune_unpause(struct mmc_host *host);
+
+static inline void mmc_retune_recheck(struct mmc_host *host)
+{
+ if (host->hold_retune <= 1)
+ host->retune_now = 1;
+}
+
+static inline int mmc_host_cmd23(struct mmc_host *host)
+{
+ return host->caps & MMC_CAP_CMD23;
+}
+
+static inline int mmc_boot_partition_access(struct mmc_host *host)
+{
+ return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
+}
+
+static inline int mmc_host_uhs(struct mmc_host *host)
+{
+ return host->caps &
+ (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
+ MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
+ MMC_CAP_UHS_DDR50);
+}
+
+static inline bool mmc_card_hs200(struct mmc_card *card)
+{
+ return card->host->ios.timing == MMC_TIMING_MMC_HS200;
+}
+
+static inline bool mmc_card_ddr52(struct mmc_card *card)
+{
+ return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
+}
+
+static inline bool mmc_card_hs400(struct mmc_card *card)
+{
+ return card->host->ios.timing == MMC_TIMING_MMC_HS400;
+}
+
+static inline bool mmc_card_hs400es(struct mmc_card *card)
+{
+ return card->host->ios.enhanced_strobe;
+}
+
#endif