From patchwork Wed Sep 1 09:46:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 177702 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Wed, 01 Sep 2010 11:01:12 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1Oqk80-000734-1g for chris@printf.net; Wed, 01 Sep 2010 11:01:12 +0100 Received: by mail.laptop.org (Postfix) id EC06A24807; Wed, 1 Sep 2010 06:00:10 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id B685424550 for ; Wed, 1 Sep 2010 05:59:41 -0400 (EDT) X-ASG-Debug-ID: 1283335171-0b74c9e50001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id jxOeifcHcI2xOqGd for ; Wed, 01 Sep 2010 05:59:31 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182Ab0IAJ7b (ORCPT ); Wed, 1 Sep 2010 05:59:31 -0400 Received: from db3ehsobe001.messaging.microsoft.com ([213.199.154.139]:33087 "EHLO DB3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752571Ab0IAJ7a (ORCPT ); Wed, 1 Sep 2010 05:59:30 -0400 Received: from mail16-db3-R.bigfish.com (10.3.81.249) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 8.1.436.0; Wed, 1 Sep 2010 09:44:24 +0000 Received: from mail16-db3 (localhost.localdomain [127.0.0.1]) by mail16-db3-R.bigfish.com (Postfix) with ESMTP id 71C6D11680EF for ; Wed, 1 Sep 2010 09:52:37 +0000 (UTC) X-SpamScore: -2 X-BigFish: VS-2(zzbb2cKzz1202hzz8275bh1497iz2dh87h2a8h63h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail16-db3 (localhost.localdomain [127.0.0.1]) by mail16-db3 (MessageSwitch) id 1283334757250210_12943; Wed, 1 Sep 2010 09:52:37 +0000 (UTC) Received: from DB3EHSMHS001.bigfish.com (unknown [10.3.81.252]) by mail16-db3.bigfish.com (Postfix) with ESMTP id 3BB6A1080050 for ; Wed, 1 Sep 2010 09:52:37 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by DB3EHSMHS001.bigfish.com (10.3.87.101) with Microsoft SMTP Server (TLS) id 14.0.482.44; Wed, 1 Sep 2010 09:44:23 +0000 Received: from de01smr01.freescale.net (de01smr01.freescale.net [10.208.0.31]) by az33egw02.freescale.net (8.14.3/8.14.3) with ESMTP id o819iLUp001821 for ; Wed, 1 Sep 2010 02:44:21 -0700 (MST) Received: from shlinux1.ap.freescale.net ([10.192.225.216]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id o819w4rE023959 for ; Wed, 1 Sep 2010 04:58:05 -0500 (CDT) Received: by shlinux1.ap.freescale.net (Postfix, from userid 1003) id DD5D84D6001; Wed, 1 Sep 2010 17:46:58 +0800 (CST) From: Richard Zhu To: linux-mmc@vger.kernel.org CC: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Richard Zhu X-ASG-Orig-Subj: [PATCH 2/9] sdhci-2: add host's own get_ro func to support the controller that used it's own WP mechanism Subject: [PATCH 2/9] sdhci-2: add host's own get_ro func to support the controller that used it's own WP mechanism Date: Wed, 1 Sep 2010 17:46:57 +0800 Message-ID: <1283334417-12524-1-git-send-email-r65037@freescale.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 X-Reverse-DNS: az33egw02.freescale.net Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1283335171 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests=MAILTO_TO_SPAM_ADDR X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.39600 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2a93c27..e7e2611 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1213,6 +1213,9 @@ static int sdhci_get_ro(struct mmc_host *mmc) host = mmc_priv(mmc); + if (host->ops->get_ro) + return host->ops->get_ro(host); + spin_lock_irqsave(&host->lock, flags); if (host->flags & SDHCI_DEVICE_DEAD) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index d420b4e..a4db2cc 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -322,6 +322,7 @@ struct sdhci_ops { unsigned int (*get_max_clock)(struct sdhci_host *host); unsigned int (*get_min_clock)(struct sdhci_host *host); unsigned int (*get_timeout_clock)(struct sdhci_host *host); + unsigned int (*get_ro)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS