]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/mmc/core/host.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[mirror_ubuntu-jammy-kernel.git] / drivers / mmc / core / host.h
CommitLineData
d2912cb1 1/* SPDX-License-Identifier: GPL-2.0-only */
b93931a6
PO
2/*
3 * linux/drivers/mmc/core/host.h
4 *
5 * Copyright (C) 2003 Russell King, All Rights Reserved.
6 * Copyright 2007 Pierre Ossman
b93931a6
PO
7 */
8#ifndef _MMC_CORE_HOST_H
9#define _MMC_CORE_HOST_H
066185d6 10
5857b29b 11#include <linux/mmc/host.h>
b93931a6
PO
12
13int mmc_register_host_class(void);
14void mmc_unregister_host_class(void);
8ea926b2 15
dfa13ebb
AH
16void mmc_retune_enable(struct mmc_host *host);
17void mmc_retune_disable(struct mmc_host *host);
18void mmc_retune_hold(struct mmc_host *host);
19void mmc_retune_release(struct mmc_host *host);
20int mmc_retune(struct mmc_host *host);
5857b29b
UH
21void mmc_retune_pause(struct mmc_host *host);
22void mmc_retune_unpause(struct mmc_host *host);
23
cb39f61e
AH
24static inline void mmc_retune_hold_now(struct mmc_host *host)
25{
26 host->retune_now = 0;
27 host->hold_retune += 1;
28}
29
5857b29b
UH
30static inline void mmc_retune_recheck(struct mmc_host *host)
31{
32 if (host->hold_retune <= 1)
33 host->retune_now = 1;
34}
35
36static inline int mmc_host_cmd23(struct mmc_host *host)
37{
38 return host->caps & MMC_CAP_CMD23;
39}
40
10f21df4
AH
41static inline bool mmc_host_done_complete(struct mmc_host *host)
42{
43 return host->caps & MMC_CAP_DONE_COMPLETE;
44}
45
5857b29b
UH
46static inline int mmc_boot_partition_access(struct mmc_host *host)
47{
48 return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
49}
50
51static inline int mmc_host_uhs(struct mmc_host *host)
52{
53 return host->caps &
54 (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
55 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
d6743a8a
SL
56 MMC_CAP_UHS_DDR50) &&
57 host->caps & MMC_CAP_4_BIT_DATA;
5857b29b
UH
58}
59
60static inline bool mmc_card_hs200(struct mmc_card *card)
61{
62 return card->host->ios.timing == MMC_TIMING_MMC_HS200;
63}
64
65static inline bool mmc_card_ddr52(struct mmc_card *card)
66{
67 return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
68}
69
70static inline bool mmc_card_hs400(struct mmc_card *card)
71{
72 return card->host->ios.timing == MMC_TIMING_MMC_HS400;
73}
74
75static inline bool mmc_card_hs400es(struct mmc_card *card)
76{
77 return card->host->ios.enhanced_strobe;
78}
79
b93931a6
PO
80#endif
81