public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Salt <linux@youmustbejoking.demon.co.uk>
To: drzeus-mmc@drzeus.cx
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.20-rc2] Add a quirk to allow at least some ENE PCI SD card readers to work again
Date: Sun, 31 Dec 2006 03:10:50 +0000	[thread overview]
Message-ID: <4E9DA5E8EB%linux@youmustbejoking.demon.co.uk> (raw)

Add a quirk to allow at least some ENE PCI SD card readers to work again

Support for these devices was broken for 2.6.18-rc1 and later by commit
146ad66eac836c0b976c98f428d73e1f6a75270d, which added voltage level support.

This restores the previous behaviour for these devices (PCI ID 1524:0550).

Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>

diff -ur linux-2.6.20-rc.orig/drivers/mmc/sdhci.c linux-2.6.20-rc/drivers/mmc/sdhci.c
--- linux-2.6.20-rc.orig/drivers/mmc/sdhci.c	2006-12-30 15:34:11.000000000 +0000
+++ linux-2.6.20-rc/drivers/mmc/sdhci.c	2006-12-31 02:46:48.000000000 +0000
@@ -37,6 +37,7 @@
 #define SDHCI_QUIRK_FORCE_DMA				(1<<1)
 /* Controller doesn't like some resets when there is no card inserted. */
 #define SDHCI_QUIRK_NO_CARD_NO_RESET			(1<<2)
+#define SDHCI_QUIRK_FORCE_POWER				(1<<3)
 
 static const struct pci_device_id pci_ids[] __devinitdata = {
 	{
@@ -65,6 +66,14 @@
 		.driver_data	= SDHCI_QUIRK_FORCE_DMA,
 	},
 
+	{
+		.vendor		= PCI_VENDOR_ID_ENE,
+		.device		= PCI_DEVICE_ID_ENE_CB712_SD,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= SDHCI_QUIRK_FORCE_POWER,
+	},
+
 	{	/* Generic SD host controller */
 		PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)
 	},
@@ -671,6 +680,12 @@
 {
 	u8 pwr;
 
+	if (host->chip->quirks & SDHCI_QUIRK_FORCE_POWER) {
+		writeb((power != (unsigned short) -1) ? 0xFF : 0,
+			host->ioaddr + SDHCI_POWER_CONTROL);
+		goto out;
+	}
+
 	if (host->power == power)
 		return;
 
diff -ur linux-2.6.20-rc.orig/include/linux/pci_ids.h linux-2.6.20-rc/include/linux/pci_ids.h
--- linux-2.6.20-rc.orig/include/linux/pci_ids.h	2006-12-30 15:34:21.000000000 +0000
+++ linux-2.6.20-rc/include/linux/pci_ids.h	2006-12-31 02:46:48.000000000 +0000
@@ -1968,6 +1968,7 @@
 #define PCI_DEVICE_ID_TOPIC_TP560	0x0000
 
 #define PCI_VENDOR_ID_ENE		0x1524
+#define PCI_DEVICE_ID_ENE_CB712_SD	0x0550
 #define PCI_DEVICE_ID_ENE_1211		0x1211
 #define PCI_DEVICE_ID_ENE_1225		0x1225
 #define PCI_DEVICE_ID_ENE_1410		0x1410

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Buy local produce. Try to walk or cycle. TRANSPORT CAUSES GLOBAL WARMING.

I think therefore I create bugs.

             reply	other threads:[~2006-12-31  4:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-31  3:10 Darren Salt [this message]
2006-12-31 12:05 ` [PATCH 2.6.20-rc2] Add a quirk to allow at least some ENE PCI SD card readers to work again Pierre Ossman
2006-12-31 15:10   ` Darren Salt
2006-12-31 17:08     ` [PATCH 2.6.20-rc2] Add a quirk to allow " Darren Salt
2006-12-31 18:23       ` Darren Salt
2007-01-27 13:08       ` Pierre Ossman
2007-02-02  7:54       ` [Sdhci-devel] " Pierre Ossman
2007-02-02 20:21         ` [Sdhci-devel] [PATCH 2.6.20-rc2] Add a quirk to allow ENE PCI SD Darren Salt
2007-02-02 21:57           ` Pierre Ossman
2007-01-01  1:33     ` [PATCH 2.6.20-rc2] Add a quirk to allow at least some ENE PCI SD card readers to work again Pierre Ossman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E9DA5E8EB%linux@youmustbejoking.demon.co.uk \
    --to=linux@youmustbejoking.demon.co.uk \
    --cc=drzeus-mmc@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox