Re: [PATCH 1/3] drivers/misc: Add realtek card reader core driver

From: wwang
Date: Mon Jul 23 2012 - 21:21:59 EST


Hi Borislav:

Realtek card reader supports not only SDMMC card, but also Memory stick. This part is the common code, so it is located in drivers/misc. There is also SDMMC-relevant code under CONFIG_MMC. And in the future, Memstick-relevant code will be added under CONFIG_MEMSTICK.

BR,
wwang

ä 2012å07æ24æ 00:33, Borislav Petkov åé:
On Mon, Jul 23, 2012 at 05:42:38PM +0800, wei_wang@xxxxxxxxxxxxxx wrote:
From: Wei WANG <wei_wang@xxxxxxxxxxxxxx>

Realtek card reader core driver is the bus driver for Realtek
driver-based card reader, which supplies adapter layer to
be used by lower-level pci/usb card reader and upper-level
sdmmc/memstick host driver.

Signed-off-by: Wei WANG <wei_wang@xxxxxxxxxxxxxx>
---
Documentation/misc-devices/realtek_cr.txt | 27 ++
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/realtek_cr/Kconfig | 26 ++
drivers/misc/realtek_cr/Makefile | 7 +
drivers/misc/realtek_cr/core/Kconfig | 6 +
drivers/misc/realtek_cr/core/Makefile | 1 +
drivers/misc/realtek_cr/core/rtsx_core.c | 492 +++++++++++++++++++++++++++++
include/linux/rtsx_core.h | 183 +++++++++++
9 files changed, 744 insertions(+)
create mode 100644 Documentation/misc-devices/realtek_cr.txt
create mode 100644 drivers/misc/realtek_cr/Kconfig
create mode 100644 drivers/misc/realtek_cr/Makefile
create mode 100644 drivers/misc/realtek_cr/core/Kconfig
create mode 100644 drivers/misc/realtek_cr/core/Makefile
create mode 100644 drivers/misc/realtek_cr/core/rtsx_core.c
create mode 100644 include/linux/rtsx_core.h

diff --git a/Documentation/misc-devices/realtek_cr.txt b/Documentation/misc-devices/realtek_cr.txt
new file mode 100644
index 0000000..b4e6fbe
--- /dev/null
+++ b/Documentation/misc-devices/realtek_cr.txt
@@ -0,0 +1,27 @@
+Realtek Driver-based Card Reader
+================================
+
+Supported chips:
+RTS5209
+RTS5229
+
+Contact Email:
+pc_sw_linux@xxxxxxxxxxxxxx
+
+
+Description
+-----------
+
+Realtek driver-based card reader supports access to many types of memory cards,
+such as Memory Stick, Memory Stick Pro, Secure Digital and MultiMediaCard.
+
+
+udev rules
+----------
+
+In order to modprobe Realtek SD/MMC interface driver automatically, the following rule
+should be added to the udev rules file:
+
+SUBSYSTEM=="rtsx_cr", ENV{RTSX_CARD_TYPE}=="SD", RUN+="/sbin/modprobe -bv rtsx_sdmmc"
+
+Typically, we may edit /lib/udev/rules.d/80-drivers.rules and copy the rule into it in Ubuntu.
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 2661f6e..09ce905 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -517,4 +517,5 @@ source "drivers/misc/lis3lv02d/Kconfig"
source "drivers/misc/carma/Kconfig"
source "drivers/misc/altera-stapl/Kconfig"
source "drivers/misc/mei/Kconfig"
+source "drivers/misc/realtek_cr/Kconfig"
endmenu
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 456972f..c09f147 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -51,3 +51,4 @@ obj-y += carma/
obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o
obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/
obj-$(CONFIG_INTEL_MEI) += mei/
+obj-$(CONFIG_REALTEK_CR_SUPPORT) += realtek_cr/
diff --git a/drivers/misc/realtek_cr/Kconfig b/drivers/misc/realtek_cr/Kconfig
new file mode 100644
index 0000000..303d98a
--- /dev/null
+++ b/drivers/misc/realtek_cr/Kconfig
@@ -0,0 +1,26 @@
+#
+# Realtek driver-based card reader
+#
+
+menuconfig REALTEK_CR_SUPPORT
+ tristate "Realtek driver-based card reader"
+ help
+ Realtek driver-based card reader supports access to many types of
+ memory cards, such as Memory Stick, Memory Stick Pro, Secure Digital
+ and MultiMediaCard.
+
+ If you want to use Realtek driver-based card reader, enable this
+ option and other options below.
+
+config REALTEK_CR_DEBUG
+ bool "Realtek driver-based card reader debugging"
+ depends on REALTEK_CR_SUPPORT != n
+ help
+ This is an option for use by developers; most people should
+ say N here. This enables Realtek card reader driver debugging.
+
+if REALTEK_CR_SUPPORT
+
+source "drivers/misc/realtek_cr/core/Kconfig"
+
+endif
Ok, maybe I'm a newbie here but this is a card reader driver and AFAICT
it should be placed under CONFIG_MMC. Why is it under drivers/misc?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/