diff options
Diffstat (limited to 'include/linux/mmc/host.h')
| -rw-r--r-- | include/linux/mmc/host.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 1d09562ccf73..a3ac9c48e5de 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | #include <linux/fault-inject.h> | ||
| 15 | 16 | ||
| 16 | #include <linux/mmc/core.h> | 17 | #include <linux/mmc/core.h> |
| 17 | #include <linux/mmc/pm.h> | 18 | #include <linux/mmc/pm.h> |
| @@ -108,6 +109,9 @@ struct mmc_host_ops { | |||
| 108 | * It is optional for the host to implement pre_req and post_req in | 109 | * It is optional for the host to implement pre_req and post_req in |
| 109 | * order to support double buffering of requests (prepare one | 110 | * order to support double buffering of requests (prepare one |
| 110 | * request while another request is active). | 111 | * request while another request is active). |
| 112 | * pre_req() must always be followed by a post_req(). | ||
| 113 | * To undo a call made to pre_req(), call post_req() with | ||
| 114 | * a nonzero err condition. | ||
| 111 | */ | 115 | */ |
| 112 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, | 116 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, |
| 113 | int err); | 117 | int err); |
| @@ -147,6 +151,7 @@ struct mmc_host_ops { | |||
| 147 | int (*execute_tuning)(struct mmc_host *host); | 151 | int (*execute_tuning)(struct mmc_host *host); |
| 148 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 152 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
| 149 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 153 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
| 154 | void (*hw_reset)(struct mmc_host *host); | ||
| 150 | }; | 155 | }; |
| 151 | 156 | ||
| 152 | struct mmc_card; | 157 | struct mmc_card; |
| @@ -229,8 +234,20 @@ struct mmc_host { | |||
| 229 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ | 234 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ |
| 230 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ | 235 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ |
| 231 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ | 236 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ |
| 237 | #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ | ||
| 238 | |||
| 239 | unsigned int caps2; /* More host capabilities */ | ||
| 240 | |||
| 241 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | ||
| 242 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | ||
| 243 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ | ||
| 244 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ | ||
| 232 | 245 | ||
| 233 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 246 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
| 247 | unsigned int power_notify_type; | ||
| 248 | #define MMC_HOST_PW_NOTIFY_NONE 0 | ||
| 249 | #define MMC_HOST_PW_NOTIFY_SHORT 1 | ||
| 250 | #define MMC_HOST_PW_NOTIFY_LONG 2 | ||
| 234 | 251 | ||
| 235 | #ifdef CONFIG_MMC_CLKGATE | 252 | #ifdef CONFIG_MMC_CLKGATE |
| 236 | int clk_requests; /* internal reference counter */ | 253 | int clk_requests; /* internal reference counter */ |
| @@ -302,6 +319,10 @@ struct mmc_host { | |||
| 302 | 319 | ||
| 303 | struct mmc_async_req *areq; /* active async req */ | 320 | struct mmc_async_req *areq; /* active async req */ |
| 304 | 321 | ||
| 322 | #ifdef CONFIG_FAIL_MMC_REQUEST | ||
| 323 | struct fault_attr fail_mmc_request; | ||
| 324 | #endif | ||
| 325 | |||
| 305 | unsigned long private[0] ____cacheline_aligned; | 326 | unsigned long private[0] ____cacheline_aligned; |
| 306 | }; | 327 | }; |
| 307 | 328 | ||
| @@ -330,6 +351,8 @@ extern int mmc_power_restore_host(struct mmc_host *host); | |||
| 330 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 351 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
| 331 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 352 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
| 332 | 353 | ||
| 354 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | ||
| 355 | |||
| 333 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 356 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
| 334 | { | 357 | { |
| 335 | host->ops->enable_sdio_irq(host, 0); | 358 | host->ops->enable_sdio_irq(host, 0); |
| @@ -394,4 +417,10 @@ static inline int mmc_host_cmd23(struct mmc_host *host) | |||
| 394 | { | 417 | { |
| 395 | return host->caps & MMC_CAP_CMD23; | 418 | return host->caps & MMC_CAP_CMD23; |
| 396 | } | 419 | } |
| 420 | |||
| 421 | static inline int mmc_boot_partition_access(struct mmc_host *host) | ||
| 422 | { | ||
| 423 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); | ||
| 424 | } | ||
| 425 | |||
| 397 | #endif /* LINUX_MMC_HOST_H */ | 426 | #endif /* LINUX_MMC_HOST_H */ |
