From patchwork Sun Sep 19 21:46:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 194002 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8JLki6B026033 for ; Sun, 19 Sep 2010 21:46:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241Ab0ISVqn (ORCPT ); Sun, 19 Sep 2010 17:46:43 -0400 Received: from dakia3.marvell.com ([65.219.4.28]:36012 "EHLO dakia3.marvell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751924Ab0ISVqn convert rfc822-to-8bit (ORCPT ); Sun, 19 Sep 2010 17:46:43 -0400 X-ASG-Debug-ID: 1284932802-131ceb3c0001-IEKb4K Received: from SC-OWA01.marvell.com (sc-owa01.marvell.com [10.93.76.21]) by dakia3.marvell.com with ESMTP id ihuADfkWU80zEUc6 (version=TLSv1 cipher=RC4-MD5 bits=128 verify=NO); Sun, 19 Sep 2010 14:46:42 -0700 (PDT) X-Barracuda-Envelope-From: prakity@marvell.com Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by SC-OWA01.marvell.com ([10.93.76.21]) with mapi; Sun, 19 Sep 2010 14:46:42 -0700 From: Philip Rakity X-Barracuda-BBL-IP: 10.93.76.133 X-Barracuda-RBL-IP: 10.93.76.133 To: Adrian Hunter , "linux-mmc@vger.kernel.org" CC: Mark Brown Date: Sun, 19 Sep 2010 14:46:40 -0700 X-ASG-Orig-Subj: [PATCH] sdhci: add quirk for controllers that don't support write only detect Subject: [PATCH] sdhci: add quirk for controllers that don't support write only detect Thread-Topic: [PATCH] sdhci: add quirk for controllers that don't support write only detect Thread-Index: ActYRCWCw1x0Ip/qTuy7PkBivt/obg== Message-ID: References: <43E4817426ED174AA81263BCECB4351D131745CF98@sc-vexch3.marvell.com> <53E1B390-48DD-4E33-B51F-1B039AFD13A2@marvell.com> <4B9DEAE2.3030707@nokia.com> <3A9599CE-49EE-4A18-89E0-22B17090CA43@marvell.com> <4BA72971.1070804@nokia.com> <639D1595-D908-473C-9A41-71B493DCD0C0@marvell.com> <4BB052F6.5080808@nokia.com> In-Reply-To: <4BB052F6.5080808@nokia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-Barracuda-Connect: sc-owa01.marvell.com[10.93.76.21] X-Barracuda-Start-Time: 1284932802 X-Barracuda-Encrypted: RC4-MD5 X-Barracuda-URL: http://dakia3.marvell.com:80/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at marvell.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 19 Sep 2010 21:46:44 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 401527d..e2b1f32 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1213,6 +1213,8 @@ static int sdhci_get_ro(struct mmc_host *mmc) if (host->flags & SDHCI_DEVICE_DEAD) present = 0; + else if (host->quirks & SDHCI_NO_SUPPORT_FOR_WRITE_PROTECT) + present = SDHCI_WRITE_PROTECT; else present = sdhci_readl(host, SDHCI_PRESENT_STATE); diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index d316bc7..290b5a8 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -247,6 +247,8 @@ struct sdhci_host { #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) +/* Controller does not have write protect signal */ +#define SDHCI_NO_SUPPORT_FOR_WRITE_PROTECT (1<<30) int irq; /* Device IRQ */ void __iomem * ioaddr; /* Mapped address */