Skip to content

Commit

Permalink
misc: rtsx: Check mmc support for RTS5261
Browse files Browse the repository at this point in the history
This patch check mmc support when RTS5261 initialize,
and not support mmc default.

Signed-off-by: Rui Feng <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
Rui Feng authored and storulf committed Nov 16, 2020
1 parent 6f61dd2 commit 5b0f429
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/misc/cardreader/rts5261.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,18 @@ static void rtsx5261_fetch_vendor_settings(struct rtsx_pcr *pcr)
pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG2, reg);

if (!rts5261_vendor_setting_valid(reg)) {
/* Not support MMC default */
pcr->extra_caps |= EXTRA_CAPS_NO_MMC;
pcr_dbg(pcr, "skip fetch vendor setting\n");
return;
}

if (!rts5261_reg_check_mmc_support(reg))
pcr->extra_caps |= EXTRA_CAPS_NO_MMC;

/* TO do: need to add rtd3 function */
pcr->rtd3_en = rts5261_reg_to_rtd3(reg);

if (rts5261_reg_check_reverse_socket(reg))
pcr->flags |= PCR_REVERSE_SOCKET;

Expand Down
2 changes: 2 additions & 0 deletions drivers/misc/cardreader/rts5261.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#define rts5261_reg_check_reverse_socket(reg) ((reg) & 0x04)
#define rts5261_reg_to_sd30_drive_sel_1v8(reg) (((reg) >> 22) & 0x03)
#define rts5261_reg_to_sd30_drive_sel_3v3(reg) (((reg) >> 16) & 0x03)
#define rts5261_reg_to_rtd3(reg) ((reg) & 0x08)
#define rts5261_reg_check_mmc_support(reg) ((reg) & 0x10)

#define RTS5261_AUTOLOAD_CFG0 0xFF7B
#define RTS5261_AUTOLOAD_CFG1 0xFF7C
Expand Down

0 comments on commit 5b0f429

Please sign in to comment.