blob: 77d6f60d1bf96814f921cb2a37b8bb429356bf8d [file] [log] [blame]
Pierre Ossmanb93931a2007-05-19 14:06:24 +02001/*
2 * linux/drivers/mmc/core/host.h
3 *
4 * Copyright (C) 2003 Russell King, All Rights Reserved.
5 * Copyright 2007 Pierre Ossman
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _MMC_CORE_HOST_H
12#define _MMC_CORE_HOST_H
Ulf Hansson066185d2017-01-13 14:14:07 +010013
Ulf Hansson5857b292017-01-13 14:14:15 +010014#include <linux/mmc/host.h>
Pierre Ossmanb93931a2007-05-19 14:06:24 +020015
16int mmc_register_host_class(void);
17void mmc_unregister_host_class(void);
Adrian Hunter8ea926b2009-09-22 16:44:29 -070018
Adrian Hunterdfa13eb2015-05-07 13:10:12 +030019void mmc_retune_enable(struct mmc_host *host);
20void mmc_retune_disable(struct mmc_host *host);
21void mmc_retune_hold(struct mmc_host *host);
Adrian Hunterbf517d62017-08-10 15:08:06 +030022void mmc_retune_hold_now(struct mmc_host *host);
Adrian Hunterdfa13eb2015-05-07 13:10:12 +030023void mmc_retune_release(struct mmc_host *host);
24int mmc_retune(struct mmc_host *host);
Ulf Hansson5857b292017-01-13 14:14:15 +010025void mmc_retune_pause(struct mmc_host *host);
26void mmc_retune_unpause(struct mmc_host *host);
27
28static inline void mmc_retune_recheck(struct mmc_host *host)
29{
30 if (host->hold_retune <= 1)
31 host->retune_now = 1;
32}
33
34static inline int mmc_host_cmd23(struct mmc_host *host)
35{
36 return host->caps & MMC_CAP_CMD23;
37}
38
39static inline int mmc_boot_partition_access(struct mmc_host *host)
40{
41 return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
42}
43
44static inline int mmc_host_uhs(struct mmc_host *host)
45{
46 return host->caps &
47 (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
48 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
49 MMC_CAP_UHS_DDR50);
50}
51
52static inline bool mmc_card_hs200(struct mmc_card *card)
53{
54 return card->host->ios.timing == MMC_TIMING_MMC_HS200;
55}
56
57static inline bool mmc_card_ddr52(struct mmc_card *card)
58{
59 return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
60}
61
62static inline bool mmc_card_hs400(struct mmc_card *card)
63{
64 return card->host->ios.timing == MMC_TIMING_MMC_HS400;
65}
66
67static inline bool mmc_card_hs400es(struct mmc_card *card)
68{
69 return card->host->ios.enhanced_strobe;
70}
71
Adrian Hunterdfa13eb2015-05-07 13:10:12 +030072
Pierre Ossmanb93931a2007-05-19 14:06:24 +020073#endif
74