mmc: mediatek: enable SDIO IRQ low level trigger function
authoryong mao <yong.mao@mediatek.com>
Wed, 28 Aug 2019 09:45:24 +0000 (17:45 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 11 Sep 2019 13:58:39 +0000 (15:58 +0200)
SDIO IRQ is not defaultly triggered by low level,
but by falling edge. It needs to set related register
to enable SDIO IRQ low level trigger function.
Otherwise the SDIO IRQ may be lost in some specail condition.

Signed-off-by: Yong Mao <yong.mao@mediatek.com>
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mtk-sd.c

index 4c72c5b..6946bb0 100644 (file)
 #define SDC_STS_CMDBUSY         (0x1 << 1)     /* RW */
 #define SDC_STS_SWR_COMPL       (0x1 << 31)    /* RW */
 
+#define SDC_DAT1_IRQ_TRIGGER   (0x1 << 19)     /* RW */
 /* SDC_ADV_CFG0 mask */
 #define SDC_RX_ENHANCE_EN      (0x1 << 20)     /* RW */
 
@@ -1577,6 +1578,7 @@ static void msdc_init_hw(struct msdc_host *host)
 
        /* Config SDIO device detect interrupt function */
        sdr_clr_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
+       sdr_set_bits(host->base + SDC_ADV_CFG0, SDC_DAT1_IRQ_TRIGGER);
 
        /* Configure to default data timeout */
        sdr_set_field(host->base + SDC_CFG, SDC_CFG_DTOC, 3);