Pierre Ossman | b93931a | 2007-05-19 14:06:24 +0200 | [diff] [blame] | 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 |
Ulf Hansson | 066185d | 2017-01-13 14:14:07 +0100 | [diff] [blame] | 13 | |
Ulf Hansson | 5857b29 | 2017-01-13 14:14:15 +0100 | [diff] [blame] | 14 | #include <linux/mmc/host.h> |
Pierre Ossman | b93931a | 2007-05-19 14:06:24 +0200 | [diff] [blame] | 15 | |
| 16 | int mmc_register_host_class(void); |
| 17 | void mmc_unregister_host_class(void); |
Adrian Hunter | 8ea926b | 2009-09-22 16:44:29 -0700 | [diff] [blame] | 18 | |
Adrian Hunter | dfa13eb | 2015-05-07 13:10:12 +0300 | [diff] [blame] | 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); |
Ulf Hansson | 5857b29 | 2017-01-13 14:14:15 +0100 | [diff] [blame] | 24 | void mmc_retune_pause(struct mmc_host *host); |
| 25 | void mmc_retune_unpause(struct mmc_host *host); |
| 26 | |
| 27 | static inline void mmc_retune_recheck(struct mmc_host *host) |
| 28 | { |
| 29 | if (host->hold_retune <= 1) |
| 30 | host->retune_now = 1; |
| 31 | } |
| 32 | |
| 33 | static inline int mmc_host_cmd23(struct mmc_host *host) |
| 34 | { |
| 35 | return host->caps & MMC_CAP_CMD23; |
| 36 | } |
| 37 | |
| 38 | static inline int mmc_boot_partition_access(struct mmc_host *host) |
| 39 | { |
| 40 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); |
| 41 | } |
| 42 | |
| 43 | static inline int mmc_host_uhs(struct mmc_host *host) |
| 44 | { |
| 45 | return host->caps & |
| 46 | (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | |
| 47 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 | |
| 48 | MMC_CAP_UHS_DDR50); |
| 49 | } |
| 50 | |
| 51 | static inline bool mmc_card_hs200(struct mmc_card *card) |
| 52 | { |
| 53 | return card->host->ios.timing == MMC_TIMING_MMC_HS200; |
| 54 | } |
| 55 | |
| 56 | static inline bool mmc_card_ddr52(struct mmc_card *card) |
| 57 | { |
| 58 | return card->host->ios.timing == MMC_TIMING_MMC_DDR52; |
| 59 | } |
| 60 | |
| 61 | static inline bool mmc_card_hs400(struct mmc_card *card) |
| 62 | { |
| 63 | return card->host->ios.timing == MMC_TIMING_MMC_HS400; |
| 64 | } |
| 65 | |
| 66 | static inline bool mmc_card_hs400es(struct mmc_card *card) |
| 67 | { |
| 68 | return card->host->ios.enhanced_strobe; |
| 69 | } |
| 70 | |
Adrian Hunter | dfa13eb | 2015-05-07 13:10:12 +0300 | [diff] [blame] | 71 | |
Pierre Ossman | b93931a | 2007-05-19 14:06:24 +0200 | [diff] [blame] | 72 | #endif |
| 73 | |