Skip to contentSkip to conversation

ricoh_mmc: port from driver to pci quirk

PATCH New [email protected] 1 participant 1 message Mar 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 92/160 ricoh_mmc: port from driver to pci quirk

From: Maxim Levitsky <[email protected]>

This patch solves nasty problem original driver has.

Original goal of the ricoh_mmc was to disable this device because then, mmc cards can be read using standard SDHCI controller, thus avoiding writing of yet another driver.

However, the act of disablement, makes other pci functions that belong to this controller (xD and memstick) shift up one level, thus pci core has now wrong idea about these devices.

To fix this issue, this patch moves the driver into the pci quirk section, thus it is executes before the pci is enumerated, and therefore solving that issue, also same sequence of commands is performed on resume for same reasons.

Also regardless of the above, this way is cleaner. You still need to set CONFIG_MMC_RICOH_MMC to enable this quirk

---

 drivers/mmc/host/Kconfig     |   10 -
 drivers/mmc/host/Makefile    |    1 
 drivers/mmc/host/ricoh_mmc.c |  262 ---------------------------------
 drivers/pci/quirks.c         |   85 ++++++++++
 4 files changed, 88 insertions(+), 270 deletions(-)
drivers/mmc/host/Kconfig renamed from drivers/mmc/host/Kconfig~ricoh_mmc-port-from-driver-to-pci-quirk +3 -7
diff -puN drivers/mmc/host/Kconfig~ricoh_mmc-port-from-driver-to-pci-quirk drivers/mmc/host/Kconfig
@@ -69,20 +69,16 @@ config MMC_SDHCI_PCI
 	  If unsure, say N.
 
 config MMC_RICOH_MMC
-	tristate "Ricoh MMC Controller Disabler  (EXPERIMENTAL)"
+	bool "Ricoh MMC Controller Disabler  (EXPERIMENTAL)"
 	depends on MMC_SDHCI_PCI
 	help
-	  This selects the disabler for the Ricoh MMC Controller. This
+	  This adds a pci quirk to disable Ricoh MMC Controller. This
 	  proprietary controller is unnecessary because the SDHCI driver
 	  supports MMC cards on the SD controller, but if it is not
 	  disabled, it will steal the MMC cards away - rendering them
-	  useless. It is safe to select this driver even if you don't
+	  useless. It is safe to select this even if you don't
 	  have a Ricoh based card reader.
 
-
-	  To compile this driver as a module, choose M here:
-	  the module will be called ricoh_mmc.
-
 	  If unsure, say Y.
 
 config MMC_SDHCI_OF
drivers/mmc/host/Makefile renamed from drivers/mmc/host/Makefile~ricoh_mmc-port-from-driver-to-pci-quirk +0 -1
diff -puN drivers/mmc/host/Makefile~ricoh_mmc-port-from-driver-to-pci-quirk drivers/mmc/host/Makefile
@@ -12,7 +12,6 @@ obj-$(CONFIG_MMC_IMX)		+= imxmmc.o
 obj-$(CONFIG_MMC_MXC)		+= mxcmmc.o
 obj-$(CONFIG_MMC_SDHCI)		+= sdhci.o
 obj-$(CONFIG_MMC_SDHCI_PCI)	+= sdhci-pci.o
-obj-$(CONFIG_MMC_RICOH_MMC)	+= ricoh_mmc.o
 obj-$(CONFIG_MMC_SDHCI_PLTFM)	+= sdhci-pltfm.o
 obj-$(CONFIG_MMC_SDHCI_S3C)	+= sdhci-s3c.o
 obj-$(CONFIG_MMC_WBSD)		+= wbsd.o
drivers/mmc/host/ricoh_mmc.c deleted +0 -262

262 lines not on this page · raw message

drivers/pci/quirks.c renamed from drivers/pci/quirks.c~ricoh_mmc-port-from-driver-to-pci-quirk +85 -0

91 lines not on this page · raw message

_