From patchwork Tue Apr 28 09:40:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 6287401 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1172B9F326 for ; Tue, 28 Apr 2015 09:51:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31EB020304 for ; Tue, 28 Apr 2015 09:51:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E32EC201ED for ; Tue, 28 Apr 2015 09:51:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932657AbbD1JvX (ORCPT ); Tue, 28 Apr 2015 05:51:23 -0400 Received: from smtp-out-223.synserver.de ([212.40.185.223]:1068 "EHLO smtp-out-223.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932454AbbD1JvX (ORCPT ); Tue, 28 Apr 2015 05:51:23 -0400 X-Greylist: delayed 659 seconds by postgrey-1.27 at vger.kernel.org; Tue, 28 Apr 2015 05:51:22 EDT Received: (qmail 30774 invoked by uid 0); 28 Apr 2015 09:40:21 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 30640 Received: from p4fde67af.dip0.t-ipconnect.de (HELO lars-adi-laptop.analog.com) [79.222.103.175] by 217.119.54.87 with SMTP; 28 Apr 2015 09:40:21 -0000 From: Lars-Peter Clausen To: Ulf Hansson Cc: Mike Looijmans , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, Lars-Peter Clausen , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala Subject: [PATCH 2/2] mmc: sdhci: DT: Allow to specify that no write protect signal is present Date: Tue, 28 Apr 2015 11:40:20 +0200 Message-Id: <1430214020-16816-2-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1430214020-16816-1-git-send-email-lars@metafoo.de> References: <1430214020-16816-1-git-send-email-lars@metafoo.de> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow to specify in the device-tree that no physical write-protect signal is connected to a particular instance of a SDHCI controller. This allows a driver to ignore potential bogus values of the SDHCI_WRITE_PROTECT bit in the SDHCI_PRESENT_STATE register if it is aware that no write-protect signal is connected. The name for the new property is 'disable-wp' and was chosen based on the property with the same function from the Synopsys designware mobile storage host controller DT bindings specification. Signed-off-by: Lars-Peter Clausen Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Ian Campbell Cc: Kumar Gala --- Documentation/devicetree/bindings/mmc/mmc.txt | 1 + drivers/mmc/host/sdhci-pltfm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt index 438899e..b068549 100644 --- a/Documentation/devicetree/bindings/mmc/mmc.txt +++ b/Documentation/devicetree/bindings/mmc/mmc.txt @@ -21,6 +21,7 @@ Optional properties: below for the case, when a GPIO is used for the CD line - wp-inverted: when present, polarity on the WP line is inverted. See the note below for the case, when a GPIO is used for the WP line +- disable-wp: When set no physical WP line is present - max-frequency: maximum operating clock frequency - no-1-8-v: when present, denotes that 1.8v card voltage is not supported on this system, even if the controller claims it is. diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index a207f5a..aa4d343 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -86,6 +86,9 @@ void sdhci_get_of_property(struct platform_device *pdev) if (sdhci_of_wp_inverted(np)) host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT; + if (of_property_read_bool(np, "disable-wp")) + host->quirks2 |= SDHCI_QUIRK2_DISABLE_WRITE_PROTECT; + if (of_get_property(np, "broken-cd", NULL)) host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;