From patchwork Sat Dec 1 20:37:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 1829751 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A0944DF264 for ; Sat, 1 Dec 2012 20:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753336Ab2LAUhl (ORCPT ); Sat, 1 Dec 2012 15:37:41 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:60916 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752898Ab2LAUhk (ORCPT ); Sat, 1 Dec 2012 15:37:40 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so1179893pbc.19 for ; Sat, 01 Dec 2012 12:37:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=SsX7g7Bp4aKMPw+NHQAZZmf1zSWokknR+Q0Xd1tDIgk=; b=lODY8xsVoXRTRu29yXkrm46lm9gkfTo/znJNLsRraqVORTa718lW5g4HAuH802zGW+ y2DOM4M6WE9tpwD9rk+EO11EN5juxZZ5UsnWEHou6eArCiW8MF8tM9v+opKkLxLKBcya BNRDLn/MYm2mXWVAJWvqTpe/o5tKp8fMRhl17pSCPghwLn/WHaQ7Ggji12pPUXE/O1eT 9etbEOMQx/sKCIp5WlbhgC730+3o65QV+FKuxfNjk2JZqcryckxMJ2mpgfqukcm4jBO2 q70rzMNHhgAdeJGlTlNK/B9INwuziGGuGr77rezBh3eBxM1eYWU40Dfk0U2Uk4ZIZcAg B3YQ== Received: by 10.66.87.133 with SMTP id ay5mr13734831pab.59.1354394260193; Sat, 01 Dec 2012 12:37:40 -0800 (PST) Received: from localhost ([2001:5a8:4:83c0:cf1:9cbe:3e5d:b879]) by mx.google.com with ESMTPS id m4sm5146598pav.17.2012.12.01.12.37.38 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 01 Dec 2012 12:37:39 -0800 (PST) From: Andy Lutomirski To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Chris Ball , Andy Lutomirski , linux-mmc@vger.kernel.org, Manoj Iyer , Subject: [PATCH] pci: Add a quirk for the Ricoh 0xe22 SD card reader Date: Sat, 1 Dec 2012 12:37:20 -0800 Message-Id: <33c411da9bb44eae8a5f9e0609f8eb0aa4eda601.1354385950.git.luto@amacapital.net> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <33c411da9bb44eae8a5f9e0609f8eb0aa4eda600.1354385950.git.luto@amacapital.net> References: <33c411da9bb44eae8a5f9e0609f8eb0aa4eda600.1354385950.git.luto@amacapital.net> X-Gm-Message-State: ALoCoQlqx+osmWAasSmgIfHJCkXkqKEm+Sd8CCus+p1LNTQi4T/eSDIalFsi5ae6JPUDnf6iG2Rd Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Otherwise it fails like this on cards like the Transcend 16GB SDHC card: mmc0: new SDHC card at address b368 mmcblk0: mmc0:b368 SDC 15.0 GiB mmcblk0: error -110 sending status command, retrying mmcblk0: error -84 transferring data, sector 0, nr 8, cmd respons e 0x900, card status 0xb0 Tested on my Lenovo x200 laptop. Signed-off-by: Andy Lutomirski Acked-by: Chris Ball Cc: linux-mmc@vger.kernel.org Cc: Manoj Iyer Cc: --- drivers/pci/quirks.c | 7 +++++-- include/linux/pci_ids.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 7a451ff..7165f2a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2686,7 +2686,7 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev) if (PCI_FUNC(dev->devfn)) return; /* - * RICOH 0xe823 SD/MMC card reader fails to recognize + * RICOH 0xe822 and 0xe823 SD/MMC card readers fails to recognize * certain types of SD/MMC cards. Lowering the SD base * clock frequency from 200Mhz to 50Mhz fixes this issue. * @@ -2697,7 +2697,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev) * 0xf9 - Key register for 0x150 * 0xfc - key register for 0xe1 */ - if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) { + if (dev->device == PCI_DEVICE_ID_RICOH_R5CE822 || + 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); @@ -2724,6 +2725,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev) } 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); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832); +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832); #endif /*CONFIG_MMC_RICOH_MMC*/ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 9d36b82..d16ad56 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1568,6 +1568,7 @@ #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 #define PCI_DEVICE_ID_RICOH_R5C822 0x0822 +#define PCI_DEVICE_ID_RICOH_R5CE822 0xe822 #define PCI_DEVICE_ID_RICOH_R5CE823 0xe823 #define PCI_DEVICE_ID_RICOH_R5C832 0x0832 #define PCI_DEVICE_ID_RICOH_R5C843 0x0843