aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc/host.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mmc/host.h')
-rw-r--r--include/linux/mmc/host.h61
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 */
183struct 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
173struct regulator; 191struct regulator;
174 192
175struct mmc_supply { 193struct 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
344extern struct mmc_host *mmc_alloc_host(int extra, struct device *); 367struct mmc_host *mmc_alloc_host(int extra, struct device *);
345extern int mmc_add_host(struct mmc_host *); 368int mmc_add_host(struct mmc_host *);
346extern void mmc_remove_host(struct mmc_host *); 369void mmc_remove_host(struct mmc_host *);
347extern void mmc_free_host(struct mmc_host *); 370void mmc_free_host(struct mmc_host *);
371void mmc_of_parse(struct mmc_host *host);
348 372
349static inline void *mmc_priv(struct mmc_host *host) 373static 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
360extern int mmc_suspend_host(struct mmc_host *); 384int mmc_suspend_host(struct mmc_host *);
361extern int mmc_resume_host(struct mmc_host *); 385int mmc_resume_host(struct mmc_host *);
362 386
363extern int mmc_power_save_host(struct mmc_host *host); 387int mmc_power_save_host(struct mmc_host *host);
364extern int mmc_power_restore_host(struct mmc_host *host); 388int mmc_power_restore_host(struct mmc_host *host);
365 389
366extern void mmc_detect_change(struct mmc_host *, unsigned long delay); 390void mmc_detect_change(struct mmc_host *, unsigned long delay);
367extern void mmc_request_done(struct mmc_host *, struct mmc_request *); 391void mmc_request_done(struct mmc_host *, struct mmc_request *);
368 392
369extern int mmc_cache_ctrl(struct mmc_host *, u8); 393int mmc_cache_ctrl(struct mmc_host *, u8);
370 394
371static inline void mmc_signal_sdio_irq(struct mmc_host *host) 395static 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
461static 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
469static 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
438void mmc_host_clk_hold(struct mmc_host *host); 475void mmc_host_clk_hold(struct mmc_host *host);
439void mmc_host_clk_release(struct mmc_host *host); 476void mmc_host_clk_release(struct mmc_host *host);