]> git.ipfire.org Git - thirdparty/linux.git/commit
misc: rtsx_pci: Add separate CD/WP pin polarity reversal support
authorRicky Wu <ricky_wu@realtek.com>
Tue, 12 Aug 2025 06:35:21 +0000 (14:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Aug 2025 10:37:10 +0000 (12:37 +0200)
commit807221d3c5ff6e3c91ff57bc82a0b7a541462e20
tree87b2069866b02286e2b17e23126c14e8670b99f5
parent6e6fe5a99048c020594d815a1c0f8ad183073e66
misc: rtsx_pci: Add separate CD/WP pin polarity reversal support

Previously, the Card Detect (CD) and Write Protect (WP) pins shared the
same reverse polarity setting in the configuration space. This meant both
signals were reversed together, without the ability to configure them
individually.

This patch introduces two new parameters:
sd_cd_reverse_en – enable reverse polarity for the CD pin.
sd_wp_reverse_en – enable reverse polarity for the WP pin.

With this change, the controller can now support:
1.Reversing both CD and WP pins together (original behavior).
2.Reversing CD and WP pins separately (newly added behavior), if
supported by the configuration space.

This provides greater flexibility when dealing with devices that have
independent polarity requirements for CD and WP pins.

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
Link: https://lore.kernel.org/r/20250812063521.2427696-1-ricky_wu@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/cardreader/rts5227.c
drivers/misc/cardreader/rts5228.c
drivers/misc/cardreader/rts5249.c
drivers/misc/cardreader/rts5264.c
drivers/misc/cardreader/rts5264.h
drivers/misc/cardreader/rtsx_pcr.h
include/linux/rtsx_pci.h