# Realtech PCI Card Reader HOW TO [solution]

## RayDude

I wanted to post this for anyone who has the same problem as me.

Here is the hardware:

```
07:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)

        Subsystem: Hewlett-Packard Company RTS522A PCI Express Card Reader

        Kernel driver in use: rtsx_pci

        Kernel modules: rtsx_pci

```

This applies to all the realtech family PCI Express Card Readers: RTS5227, RTS5229 and many others.

See here: https://cateee.net/lkddb/web-lkddb/MFD_RTSX_PCI.html

You must enable two modules in the kernel to get this to work.

The first is in: Device Drivers -> Misc devices -> Realtek PCI-E card reader

The second is in: Device Drivers -> MMC/SD/SDIO card support -> Realtek PCI-E SD/MMC Card Interface Driver

The second depends on the first and will not show up until the first is set to Y or M.

It took me several hours to figure this out as I couldn't find any instructions anywhere.

The device mounts as: 

```
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x00000000

```

Hope this helps someone in the future.

----------

## Bruce

Actually, this helped me.   Thanks for the post.

Bruce

----------

## marziods

nice job!

tnx...

----------

## clytle374

Thanks, you saved me a couple hours

----------

## impiusnex

Thank you for this, saved me a lot of time.

----------

## depontius

A few years back I managed to get the SD reader on my Thinkpad T440P running, at the time I believe I might have snagged a driver off of the web, but I'm not sure.  In the meantime it appears that that driver has gone upstream anyway.

So this isn't working for me, and I believe I've done what's necessary, however I may have done more, and that may be what is stopping me.  Under "Misc devices" I have pcie and usb enabled.  (MISC_RTSX_PCI and MISC_RTSX_USB)  Under "MMC/SD/SDIO card support" I also have both pcie and usb enabled.  (MMC_REALTEK_PCI and MMC_REALTEK_USB)  For loaded modules:

```
# lsmod | grep rtsx

rtsx_pci_sdmmc         32768  0

mmc_core              188416  1 rtsx_pci_sdmmc

rtsx_pci               77824  1 rtsx_pci_sdmmc

mfd_core               16384  2 rtsx_pci,lpc_ich
```

However when I plug in an SD Card, dmesg says nothing.

----------

## tomaszg

Thanks, that was helpful. 

I'll only add that the module MMC block device driver is also needed. Otherwise kernel recognizes the device but doesn't create a device to access it.

----------

## henner989

Hi all,

Could someone kindly explain exactly what I need to do to get these drivers working?  I'm new to Linux and don't want to muck anything up.  Basically, I think this is solution to my non-functioning card reader that works fine when I load Windows, but it doesn't work on Linux.  If someone could explain in layman's terms how to implement the OP's solution, that would be amazing and very, very much appreciated.

All the best

----------

## sebekk23

Thx mate! I have problem with this reader - will try your solution  :Wink: 

Edit: Works!!!! Thx!

----------

## whjeon

You saved another life in 2021  :Smile: 

Also not only card reader made by REALTEK,

The wifi module was loaded successfully!(rtl8822be)

Thanks!

----------

## ahodgson

That was a lot of non-obvious interdependencies. Thanks!

----------

## mario-gar

thanks but somebody can publish the details and steps  of the solution, please.

----------

## Fitap

Thank you !

----------

## richardash1981

To clarify, to make this hardware work you need to have several kernel options selected. For reasons below, you want to build them as modules, not monolithic-ally into the kernel (in the Linux kernel menuconfing, press M. If you don't know how to configure and compile a kernel, consult the Gentoo documentation: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel and https://wiki.gentoo.org/wiki/Kernel).

For the PCIexpress card reader, you need to have the following selected (as per the locations in the first post):

```

CONFIG_MMC

CONFIG_MMC_BLOCK

CONFIG_MMC_REALTEK_PCI

CONFIG_MISC_RTSX_PCI

```

Secondly, there seem to be some issues with the controller not always initialising on boot correctly, which means it doesn't work. Certainly this happens with the RTS522A rev 01 hardware in the HP EliteBook 840 G3. The result is that no block device is created and the card is not visible.

The work-around is fairly simple - remove the modules and re-load them (you do not need to remove the card), and the device will show up and work:

```

sudo modprobe -r rtsx_pci_sdmmc  rtsx_pci

sudo modprobe rtsx_pci

```

----------

