]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mmc/host/sdhci.h
mmc: sdhci: Add CQE support
[karo-tx-linux.git] / drivers / mmc / host / sdhci.h
index 477b3f5bedfd709ec7d08edbd9dffe52870b2608..35b41da0a6366af962ae2f7752a9b3a345929081 100644 (file)
 #define  SDHCI_INT_CARD_REMOVE 0x00000080
 #define  SDHCI_INT_CARD_INT    0x00000100
 #define  SDHCI_INT_RETUNE      0x00001000
+#define  SDHCI_INT_CQE         0x00004000
 #define  SDHCI_INT_ERROR       0x00008000
 #define  SDHCI_INT_TIMEOUT     0x00010000
 #define  SDHCI_INT_CRC         0x00020000
                SDHCI_INT_BLK_GAP)
 #define SDHCI_INT_ALL_MASK     ((unsigned int)-1)
 
+#define SDHCI_CQE_INT_ERR_MASK ( \
+       SDHCI_INT_ADMA_ERROR | SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | \
+       SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | \
+       SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT)
+
+#define SDHCI_CQE_INT_MASK (SDHCI_CQE_INT_ERR_MASK | SDHCI_INT_CQE)
+
 #define SDHCI_ACMD12_ERR       0x3C
 
 #define SDHCI_HOST_CONTROL2            0x3E
@@ -518,6 +526,10 @@ struct sdhci_host {
        /* cached registers */
        u32                     ier;
 
+       bool                    cqe_on;         /* CQE is operating */
+       u32                     cqe_ier;        /* CQE interrupt mask */
+       u32                     cqe_err_ier;    /* CQE error interrupt mask */
+
        wait_queue_head_t       buf_ready_int;  /* Waitqueue for Buffer Read Ready interrupt */
        unsigned int            tuning_done;    /* Condition flag set when CMD19 succeeds */
 
@@ -544,6 +556,8 @@ struct sdhci_ops {
        void    (*set_power)(struct sdhci_host *host, unsigned char mode,
                             unsigned short vdd);
 
+       u32             (*irq)(struct sdhci_host *host, u32 intmask);
+
        int             (*enable_dma)(struct sdhci_host *host);
        unsigned int    (*get_max_clock)(struct sdhci_host *host);
        unsigned int    (*get_min_clock)(struct sdhci_host *host);
@@ -697,6 +711,11 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host);
 int sdhci_runtime_resume_host(struct sdhci_host *host);
 #endif
 
+void sdhci_cqe_enable(struct mmc_host *mmc);
+void sdhci_cqe_disable(struct mmc_host *mmc, bool recovery);
+bool sdhci_cqe_irq(struct sdhci_host *host, u32 intmask, int *cmd_error,
+                  int *data_error);
+
 void sdhci_dumpregs(struct sdhci_host *host);
 
 #endif /* __SDHCI_HW_H */