mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manoj Iyer <manoj.iyer@canonical.com>
To: linux-kernel@vger.kernel.org
Cc: jbarnes@virtuousgeek.org, cjb@laptop.org,
	matsumur@nts.ricoh.co.jp, linux-pci@vger.kernel.org
Subject: [PATCH] mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency
Date: Mon, 11 Jul 2011 16:28:35 -0500	[thread overview]
Message-ID: <1310419715-13254-2-git-send-email-manoj.iyer@canonical.com> (raw)
In-Reply-To: <1310419715-13254-1-git-send-email-manoj.iyer@canonical.com>

Ricoh 1180:e823 does not recognize certain types of SD/MMC cards.
Lowering the SD base clock frequency from 200Mhz to 50Mhz fixes
this issue. This solution was suggest by Koji Matsumuro, Ricoh
Company,Ltd.

BugLink: http://launchpad.net/bugs/773524
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Tested-by: Daniel Manrique <daniel.manrique@canonical.com>
Cc: Koji Matsumuro <matsumur@nts.ricoh.co.jp>
---
 drivers/pci/quirks.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 02145e9..fe5bffa 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2758,6 +2758,30 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
 
 	dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n");
 	dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n");
+
+	/* 
+	 * RICOH 0xe823 SD/MMC card reader fails to recognize 
+	 * certain types of SD/MMC cards. Lowering the SD base
+	 * clock frequency from 200Mhz to 50Mhz fixes this issue.
+	 *
+	 * 0x150 - SD2.0 mode enable for changing base clock 
+	 *	   frequency to 50Mhz
+	 * 0xe1  - Base clock frequency
+	 * 0x32  - 50Mhz new clock frequency
+	 * 0xf9  - Key register for 0x150
+	 * 0xfc  - key register for 0xe1
+	 */
+	if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
+		pci_write_config_byte(dev, 0xf9, 0xfc);
+		pci_write_config_byte(dev, 0x150, 0x10);
+		pci_write_config_byte(dev, 0xf9, 0x00);
+		pci_write_config_byte(dev, 0xfc, 0x01);
+		pci_write_config_byte(dev, 0xe1, 0x32);
+		pci_write_config_byte(dev, 0xfc, 0x00);
+
+		dev_notice(&dev->dev, "Controller base frequency changed to 50Mhz)\n");
+	}
+
 }
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
-- 
1.7.4.1


  reply	other threads:[~2011-07-11 21:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-11 21:28 [Patch 0/1] " Manoj Iyer
2011-07-11 21:28 ` Manoj Iyer [this message]
2011-07-11 21:53   ` [PATCH] " Chris Ball
2011-07-11 22:55     ` Manoj Iyer
2011-07-12 16:01     ` Manoj Iyer
2011-07-12 16:20       ` Chris Ball
2011-07-12 17:09         ` Manoj Iyer
2011-07-12 17:30           ` Chris Ball
2011-07-12 18:00             ` Arnd Bergmann
2011-07-13 14:45               ` Chris Ball
2011-07-13 15:42                 ` Manoj Iyer
2011-07-13 16:35                   ` Arnd Bergmann
2011-07-13 16:46                     ` Manoj Iyer
2011-07-13 16:55                       ` Chris Ball
2011-07-13 17:02                         ` Manoj Iyer
2011-07-13 17:08                           ` Chris Ball
2011-07-18 20:36                             ` Manoj Iyer
2011-07-18 20:40                               ` Chris Ball
2011-07-18 20:47                                 ` Manoj Iyer
2011-07-18 21:05                                   ` Chris Ball
2011-07-18 21:12                                     ` Manoj Iyer
2011-07-19 19:43                                     ` Manoj Iyer
2012-11-22  0:29                                   ` Chris Ball
2012-11-26 16:42                                     ` Manoj Iyer
2012-11-26 16:57                                       ` Chris Ball
2011-07-13 16:50                     ` Chris Ball
2011-07-13 16:54                       ` Manoj Iyer
2011-07-18 23:27                         ` Jesse Barnes

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=1310419715-13254-2-git-send-email-manoj.iyer@canonical.com \
    --to=manoj.iyer@canonical.com \
    --cc=cjb@laptop.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matsumur@nts.ricoh.co.jp \
    /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

all inboxes | Powered by JetHome®