Merge tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping
[linux-2.6-block.git] / include / linux / mmc / host.h
index 4a351cb7f20fc884df8720f66f0be9691d9eb6d3..ba703384bea0c8d4fa2b37717b8656f7e9a04227 100644 (file)
@@ -128,6 +128,7 @@ struct mmc_host_ops {
        int     (*get_cd)(struct mmc_host *host);
 
        void    (*enable_sdio_irq)(struct mmc_host *host, int enable);
+       /* Mandatory callback when using MMC_CAP2_SDIO_IRQ_NOTHREAD. */
        void    (*ack_sdio_irq)(struct mmc_host *host);
 
        /* optional callback for HC quirks */
@@ -367,6 +368,7 @@ struct mmc_host {
 #define MMC_CAP2_CQE           (1 << 23)       /* Has eMMC command queue engine */
 #define MMC_CAP2_CQE_DCMD      (1 << 24)       /* CQE can issue a direct command */
 #define MMC_CAP2_AVOID_3_3V    (1 << 25)       /* Host must negotiate down from 3.3V */
+#define MMC_CAP2_MERGE_CAPABLE (1 << 26)       /* Host can merge a segment over the segment size */
 
        int                     fixed_drv_type; /* fixed driver type for non-removable media */
 
@@ -396,6 +398,7 @@ struct mmc_host {
        unsigned int            retune_paused:1; /* re-tuning is temporarily disabled */
        unsigned int            use_blk_mq:1;   /* use blk-mq */
        unsigned int            retune_crc_disable:1; /* don't trigger retune upon crc */
+       unsigned int            can_dma_map_merge:1; /* merging can be used */
 
        int                     rescan_disable; /* disable card detection */
        int                     rescan_entered; /* used with nonremovable devices */
@@ -493,6 +496,15 @@ void mmc_command_done(struct mmc_host *host, struct mmc_request *mrq);
 
 void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq);
 
+/*
+ * May be called from host driver's system/runtime suspend/resume callbacks,
+ * to know if SDIO IRQs has been claimed.
+ */
+static inline bool sdio_irq_claimed(struct mmc_host *host)
+{
+       return host->sdio_irqs > 0;
+}
+
 static inline void mmc_signal_sdio_irq(struct mmc_host *host)
 {
        host->ops->enable_sdio_irq(host, 0);