diff options
Diffstat (limited to 'include/linux/mmc/host.h')
-rw-r--r-- | include/linux/mmc/host.h | 61 |
1 files changed, 49 insertions, 12 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 61a10c17aabd..d6f20cc6415e 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -131,9 +131,11 @@ struct mmc_host_ops { | |||
131 | 131 | ||
132 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | 132 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); |
133 | 133 | ||
134 | /* Check if the card is pulling dat[0:3] low */ | ||
135 | int (*card_busy)(struct mmc_host *host); | ||
136 | |||
134 | /* The tuning command opcode value is different for SD and eMMC cards */ | 137 | /* The tuning command opcode value is different for SD and eMMC cards */ |
135 | int (*execute_tuning)(struct mmc_host *host, u32 opcode); | 138 | int (*execute_tuning)(struct mmc_host *host, u32 opcode); |
136 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | ||
137 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 139 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
138 | void (*hw_reset)(struct mmc_host *host); | 140 | void (*hw_reset)(struct mmc_host *host); |
139 | void (*card_event)(struct mmc_host *host); | 141 | void (*card_event)(struct mmc_host *host); |
@@ -170,6 +172,22 @@ struct mmc_slot { | |||
170 | void *handler_priv; | 172 | void *handler_priv; |
171 | }; | 173 | }; |
172 | 174 | ||
175 | /** | ||
176 | * mmc_context_info - synchronization details for mmc context | ||
177 | * @is_done_rcv wake up reason was done request | ||
178 | * @is_new_req wake up reason was new request | ||
179 | * @is_waiting_last_req mmc context waiting for single running request | ||
180 | * @wait wait queue | ||
181 | * @lock lock to protect data fields | ||
182 | */ | ||
183 | struct mmc_context_info { | ||
184 | bool is_done_rcv; | ||
185 | bool is_new_req; | ||
186 | bool is_waiting_last_req; | ||
187 | wait_queue_head_t wait; | ||
188 | spinlock_t lock; | ||
189 | }; | ||
190 | |||
173 | struct regulator; | 191 | struct regulator; |
174 | 192 | ||
175 | struct mmc_supply { | 193 | struct mmc_supply { |
@@ -258,6 +276,10 @@ struct mmc_host { | |||
258 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ | 276 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ |
259 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ | 277 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ |
260 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ | 278 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ |
279 | #define MMC_CAP2_PACKED_RD (1 << 12) /* Allow packed read */ | ||
280 | #define MMC_CAP2_PACKED_WR (1 << 13) /* Allow packed write */ | ||
281 | #define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ | ||
282 | MMC_CAP2_PACKED_WR) | ||
261 | 283 | ||
262 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 284 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
263 | 285 | ||
@@ -331,6 +353,7 @@ struct mmc_host { | |||
331 | struct dentry *debugfs_root; | 353 | struct dentry *debugfs_root; |
332 | 354 | ||
333 | struct mmc_async_req *areq; /* active async req */ | 355 | struct mmc_async_req *areq; /* active async req */ |
356 | struct mmc_context_info context_info; /* async synchronization info */ | ||
334 | 357 | ||
335 | #ifdef CONFIG_FAIL_MMC_REQUEST | 358 | #ifdef CONFIG_FAIL_MMC_REQUEST |
336 | struct fault_attr fail_mmc_request; | 359 | struct fault_attr fail_mmc_request; |
@@ -341,10 +364,11 @@ struct mmc_host { | |||
341 | unsigned long private[0] ____cacheline_aligned; | 364 | unsigned long private[0] ____cacheline_aligned; |
342 | }; | 365 | }; |
343 | 366 | ||
344 | extern struct mmc_host *mmc_alloc_host(int extra, struct device *); | 367 | struct mmc_host *mmc_alloc_host(int extra, struct device *); |
345 | extern int mmc_add_host(struct mmc_host *); | 368 | int mmc_add_host(struct mmc_host *); |
346 | extern void mmc_remove_host(struct mmc_host *); | 369 | void mmc_remove_host(struct mmc_host *); |
347 | extern void mmc_free_host(struct mmc_host *); | 370 | void mmc_free_host(struct mmc_host *); |
371 | void mmc_of_parse(struct mmc_host *host); | ||
348 | 372 | ||
349 | static inline void *mmc_priv(struct mmc_host *host) | 373 | static inline void *mmc_priv(struct mmc_host *host) |
350 | { | 374 | { |
@@ -357,16 +381,16 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
357 | #define mmc_classdev(x) (&(x)->class_dev) | 381 | #define mmc_classdev(x) (&(x)->class_dev) |
358 | #define mmc_hostname(x) (dev_name(&(x)->class_dev)) | 382 | #define mmc_hostname(x) (dev_name(&(x)->class_dev)) |
359 | 383 | ||
360 | extern int mmc_suspend_host(struct mmc_host *); | 384 | int mmc_suspend_host(struct mmc_host *); |
361 | extern int mmc_resume_host(struct mmc_host *); | 385 | int mmc_resume_host(struct mmc_host *); |
362 | 386 | ||
363 | extern int mmc_power_save_host(struct mmc_host *host); | 387 | int mmc_power_save_host(struct mmc_host *host); |
364 | extern int mmc_power_restore_host(struct mmc_host *host); | 388 | int mmc_power_restore_host(struct mmc_host *host); |
365 | 389 | ||
366 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 390 | void mmc_detect_change(struct mmc_host *, unsigned long delay); |
367 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 391 | void mmc_request_done(struct mmc_host *, struct mmc_request *); |
368 | 392 | ||
369 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | 393 | int mmc_cache_ctrl(struct mmc_host *, u8); |
370 | 394 | ||
371 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 395 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
372 | { | 396 | { |
@@ -434,6 +458,19 @@ static inline int mmc_boot_partition_access(struct mmc_host *host) | |||
434 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); | 458 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); |
435 | } | 459 | } |
436 | 460 | ||
461 | static inline int mmc_host_uhs(struct mmc_host *host) | ||
462 | { | ||
463 | return host->caps & | ||
464 | (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | | ||
465 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 | | ||
466 | MMC_CAP_UHS_DDR50); | ||
467 | } | ||
468 | |||
469 | static inline int mmc_host_packed_wr(struct mmc_host *host) | ||
470 | { | ||
471 | return host->caps2 & MMC_CAP2_PACKED_WR; | ||
472 | } | ||
473 | |||
437 | #ifdef CONFIG_MMC_CLKGATE | 474 | #ifdef CONFIG_MMC_CLKGATE |
438 | void mmc_host_clk_hold(struct mmc_host *host); | 475 | void mmc_host_clk_hold(struct mmc_host *host); |
439 | void mmc_host_clk_release(struct mmc_host *host); | 476 | void mmc_host_clk_release(struct mmc_host *host); |