diff --git a/drivers/mmc/core/Kconfig b/drivers/mmc/core/Kconfig index 7124b2ba3fa8..a6b06e6967c0 100644 --- a/drivers/mmc/core/Kconfig +++ b/drivers/mmc/core/Kconfig @@ -108,3 +108,6 @@ config MMC_CRYPTO Enabling this makes it possible for the kernel to use the crypto capabilities of the MMC device (if present) to perform crypto operations on data being transferred to/from the device. +config SD_INSERT_DEBOUNCE_DELAY_LONGER + bool "add the debounce time when sdcard insert" + default n diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index f41fec57a7ee..2d8cd55ae2d5 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -43,7 +43,17 @@ static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) mmc_hostname(host), present, present?"INSERT":"REMOVAL"); host->trigger_card_event = true; - mmc_detect_change(host, msecs_to_jiffies(ctx->cd_debounce_delay_ms)); + + #ifdef CONFIG_SD_INSERT_DEBOUNCE_DELAY_LONGER + if(present){ + mmc_detect_change(host, msecs_to_jiffies(1500)); + } + else{ + mmc_detect_change(host, msecs_to_jiffies(ctx->cd_debounce_delay_ms)); + } + #else //other project not use this function + mmc_detect_change(host, msecs_to_jiffies(ctx->cd_debounce_delay_ms)); + #endif return IRQ_HANDLED; }