i2c: gpio: fault-injector: refactor incomplete transfer
[linux/fpc-iii.git] / drivers / mmc / core / host.h
blob4805438c02ffe2165a54e73683cec8be753b1be1
1 /*
2 * linux/drivers/mmc/core/host.h
4 * Copyright (C) 2003 Russell King, All Rights Reserved.
5 * Copyright 2007 Pierre Ossman
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.
11 #ifndef _MMC_CORE_HOST_H
12 #define _MMC_CORE_HOST_H
14 #include <linux/mmc/host.h>
16 int mmc_register_host_class(void);
17 void mmc_unregister_host_class(void);
19 void mmc_retune_enable(struct mmc_host *host);
20 void mmc_retune_disable(struct mmc_host *host);
21 void mmc_retune_hold(struct mmc_host *host);
22 void mmc_retune_release(struct mmc_host *host);
23 int mmc_retune(struct mmc_host *host);
24 void mmc_retune_pause(struct mmc_host *host);
25 void mmc_retune_unpause(struct mmc_host *host);
27 static inline void mmc_retune_hold_now(struct mmc_host *host)
29 host->retune_now = 0;
30 host->hold_retune += 1;
33 static inline void mmc_retune_recheck(struct mmc_host *host)
35 if (host->hold_retune <= 1)
36 host->retune_now = 1;
39 static inline int mmc_host_cmd23(struct mmc_host *host)
41 return host->caps & MMC_CAP_CMD23;
44 static inline bool mmc_host_done_complete(struct mmc_host *host)
46 return host->caps & MMC_CAP_DONE_COMPLETE;
49 static inline int mmc_boot_partition_access(struct mmc_host *host)
51 return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
54 static inline int mmc_host_uhs(struct mmc_host *host)
56 return host->caps &
57 (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
58 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
59 MMC_CAP_UHS_DDR50) &&
60 host->caps & MMC_CAP_4_BIT_DATA;
63 static inline bool mmc_card_hs200(struct mmc_card *card)
65 return card->host->ios.timing == MMC_TIMING_MMC_HS200;
68 static inline bool mmc_card_ddr52(struct mmc_card *card)
70 return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
73 static inline bool mmc_card_hs400(struct mmc_card *card)
75 return card->host->ios.timing == MMC_TIMING_MMC_HS400;
78 static inline bool mmc_card_hs400es(struct mmc_card *card)
80 return card->host->ios.enhanced_strobe;
83 #endif