Loading...
1/*
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
13#include <linux/mmc/host.h>
14
15int mmc_register_host_class(void);
16void mmc_unregister_host_class(void);
17
18#ifdef CONFIG_MMC_CLKGATE
19void mmc_host_clk_hold(struct mmc_host *host);
20void mmc_host_clk_release(struct mmc_host *host);
21unsigned int mmc_host_clk_rate(struct mmc_host *host);
22
23#else
24static inline void mmc_host_clk_hold(struct mmc_host *host)
25{
26}
27
28static inline void mmc_host_clk_release(struct mmc_host *host)
29{
30}
31
32static inline unsigned int mmc_host_clk_rate(struct mmc_host *host)
33{
34 return host->ios.clock;
35}
36#endif
37
38void mmc_host_deeper_disable(struct work_struct *work);
39
40#endif
41
1/*
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
13
14#include <linux/mmc/host.h>
15
16int mmc_register_host_class(void);
17void mmc_unregister_host_class(void);
18
19void mmc_retune_enable(struct mmc_host *host);
20void mmc_retune_disable(struct mmc_host *host);
21void mmc_retune_hold(struct mmc_host *host);
22void mmc_retune_release(struct mmc_host *host);
23int mmc_retune(struct mmc_host *host);
24void mmc_retune_pause(struct mmc_host *host);
25void mmc_retune_unpause(struct mmc_host *host);
26
27static inline void mmc_retune_hold_now(struct mmc_host *host)
28{
29 host->retune_now = 0;
30 host->hold_retune += 1;
31}
32
33static inline void mmc_retune_recheck(struct mmc_host *host)
34{
35 if (host->hold_retune <= 1)
36 host->retune_now = 1;
37}
38
39static inline int mmc_host_cmd23(struct mmc_host *host)
40{
41 return host->caps & MMC_CAP_CMD23;
42}
43
44static inline bool mmc_host_done_complete(struct mmc_host *host)
45{
46 return host->caps & MMC_CAP_DONE_COMPLETE;
47}
48
49static inline int mmc_boot_partition_access(struct mmc_host *host)
50{
51 return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
52}
53
54static inline int mmc_host_uhs(struct mmc_host *host)
55{
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;
61}
62
63static inline bool mmc_card_hs200(struct mmc_card *card)
64{
65 return card->host->ios.timing == MMC_TIMING_MMC_HS200;
66}
67
68static inline bool mmc_card_ddr52(struct mmc_card *card)
69{
70 return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
71}
72
73static inline bool mmc_card_hs400(struct mmc_card *card)
74{
75 return card->host->ios.timing == MMC_TIMING_MMC_HS400;
76}
77
78static inline bool mmc_card_hs400es(struct mmc_card *card)
79{
80 return card->host->ios.enhanced_strobe;
81}
82
83#endif
84