Commit b6fbd29c authored by wwang's avatar wwang Committed by Greg Kroah-Hartman

staging:rts_pstor:Fix SDIO issue

Fix a bug that SDIO and SD normal card would appear simultaneously if a SDIO card inserted.
Signed-off-by: default avatarwwang <wei_wang@realsil.com.cn>
Acked-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 963ff774
...@@ -3134,41 +3134,40 @@ int reset_sd_card(struct rtsx_chip *chip) ...@@ -3134,41 +3134,40 @@ int reset_sd_card(struct rtsx_chip *chip)
if (chip->sd_ctl & RESET_MMC_FIRST) { if (chip->sd_ctl & RESET_MMC_FIRST) {
retval = reset_mmc(chip); retval = reset_mmc(chip);
if ((retval != STATUS_SUCCESS) && !sd_check_err_code(chip, SD_NO_CARD)) { if (retval != STATUS_SUCCESS) {
if (sd_check_err_code(chip, SD_NO_CARD))
TRACE_RET(chip, STATUS_FAIL);
retval = reset_sd(chip); retval = reset_sd(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
if (CHECK_PID(chip, 0x5209)) { if (CHECK_PID(chip, 0x5209))
retval = sd_change_bank_voltage(chip, SD_IO_3V3); sd_change_bank_voltage(chip, SD_IO_3V3);
if (retval != STATUS_SUCCESS) {
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
}
} }
} }
} else { } else {
retval = reset_sd(chip); retval = reset_sd(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
if (sd_check_err_code(chip, SD_NO_CARD)) { if (sd_check_err_code(chip, SD_NO_CARD))
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
if (CHECK_PID(chip, 0x5209)) { if (CHECK_PID(chip, 0x5209)) {
retval = sd_change_bank_voltage(chip, SD_IO_3V3); retval = sd_change_bank_voltage(chip, SD_IO_3V3);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
} }
if (!chip->sd_io) { if (chip->sd_io) {
TRACE_RET(chip, STATUS_FAIL);
} else {
retval = reset_mmc(chip); retval = reset_mmc(chip);
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
} }
} }
} }
if (retval != STATUS_SUCCESS) {
TRACE_RET(chip, STATUS_FAIL);
}
retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0); retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment