[PATCH 6/8] misc: rtsx: Add CD & WP reverse support for RTS5261

From: rui_feng
Date: Tue Nov 03 2020 - 04:55:18 EST


From: Rui Feng <rui_feng@xxxxxxxxxxxxxx>

This patch add CD & WP reverse support for RTS5261

Signed-off-by: Rui Feng <rui_feng@xxxxxxxxxxxxxx>
---
drivers/misc/cardreader/rts5261.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/misc/cardreader/rts5261.c b/drivers/misc/cardreader/rts5261.c
index ce65c5703453..0ef6b3e04a8d 100644
--- a/drivers/misc/cardreader/rts5261.c
+++ b/drivers/misc/cardreader/rts5261.c
@@ -510,6 +510,11 @@ static int rts5261_extra_init_hw(struct rtsx_pcr *pcr)
/* Configure driving */
rts5261_fill_driving(pcr, OUTPUT_3V3);

+ if (pcr->flags & PCR_REVERSE_SOCKET)
+ rtsx_pci_write_register(pcr, PETXCFG, 0x30, 0x30);
+ else
+ rtsx_pci_write_register(pcr, PETXCFG, 0x30, 0x00);
+
/*
* If u_force_clkreq_0 is enabled, CLKREQ# PIN will be forced
* to drive low, and we forcibly request clock.
--
2.17.1