Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: rtsx: Fix clock timing for RTS5261

This patch fix clock timing for RTS5261, using 256 divide
for the version higher than version C.

Signed-off-by: Rui Feng <rui_feng@realsil.com.cn>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/1604397321-3026-1-git-send-email-rui_feng@realsil.com.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Rui Feng and committed by
Ulf Hansson
5eefe22d 1672617d

+2 -2
+2 -2
drivers/misc/cardreader/rts5261.c
··· 649 649 650 650 if (initial_mode) { 651 651 /* We use 250k(around) here, in initial stage */ 652 - if (is_version(pcr, PID_5261, IC_VER_D)) { 652 + if (is_version_higher_than(pcr, PID_5261, IC_VER_C)) { 653 653 clk_divider = SD_CLK_DIVIDE_256; 654 654 card_clock = 60000000; 655 655 } else { ··· 700 700 div++; 701 701 } 702 702 703 - n = (n / 2); 703 + n = (n / 2) - 1; 704 704 pcr_dbg(pcr, "n = %d, div = %d\n", n, div); 705 705 706 706 ssc_depth = depth[ssc_depth];