Skip to content

Commit

Permalink
mmc: slot-gpio: Fix debounce time to use miliseconds again
Browse files Browse the repository at this point in the history
The debounce value passed to mmc_gpiod_request_cd() function is in
microseconds, but msecs_to_jiffies() requires the value to be in
miliseconds to properly calculate the delay, so adjust the value stored
in cd_debounce_delay_ms context entry.

Fixes: 1d71926 ("mmc: core: Fix debounce time to use microseconds")
Fixes: bfd694d ("mmc: core: Add tunable delay before detecting card
after card is inserted")
Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Marek Szyprowski authored and Ulf Hansson committed Sep 28, 2018
1 parent 1d71926 commit 1b09d9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/slot-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
if (debounce) {
ret = gpiod_set_debounce(desc, debounce);
if (ret < 0)
ctx->cd_debounce_delay_ms = debounce;
ctx->cd_debounce_delay_ms = debounce / 1000;
}

if (gpio_invert)
Expand Down

0 comments on commit 1b09d9c

Please sign in to comment.