From patchwork Mon Mar 31 15:18:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3916871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 56CB69F2B6 for ; Mon, 31 Mar 2014 17:22:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78DE220220 for ; Mon, 31 Mar 2014 17:22:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6ED2320219 for ; Mon, 31 Mar 2014 17:22:01 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WUeY1-0003Pr-3K; Mon, 31 Mar 2014 15:54:54 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WUeWv-0006eK-P7; Mon, 31 Mar 2014 15:53:45 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WUeUk-0006S4-MG for linux-arm-kernel@merlin.infradead.org; Mon, 31 Mar 2014 15:51:30 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WUdzI-0007yd-3t for linux-arm-kernel@lists.infradead.org; Mon, 31 Mar 2014 15:19:02 +0000 Received: by mail-wi0-f172.google.com with SMTP id hi2so2072373wib.17 for ; Mon, 31 Mar 2014 08:18:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KOzbXP4xJbp/dgHO4ZAj24OpRxUGpON4eLncH++j+mc=; b=Zr30z21BEXPdbJOfK74TWroX7wV9got8czf+rT2eFqA+9M7vzv0EJDnXXTrc2HGuIH 8S6DRvYRRvMfO0IuiW1IaYqhi2bRZE2ddRS1mBQlGOcF1muQ/7/aN6BIL3VB+h+FmA6E czw4iWf4IYcYx3kK07vukwXxRkP5JDE08q27TEDd3pCH90mxqtoTeR/5eI2AO/5AyKhc fIhhQT+clW/y1ksu1EZi7jCVqtNbBSPD00dd48Gn2LFh9vWuFgO2N2f3TeCU3/qNT3Hq OPTisc7r6sRBcQeFadVnTaEG8WlYkbfTdfGmtAUAOc2XFex0f6bneRc01P8FpwmqzDEV z8Lw== X-Gm-Message-State: ALoCoQlpkQfU1BxRVAOWIbtC6Bna/TSViB+z+sNaYyov4ltKy9I1/EOpQncTh8mFjVSACpEpQsUi X-Received: by 10.194.110.100 with SMTP id hz4mr6640342wjb.50.1396279114601; Mon, 31 Mar 2014 08:18:34 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id wl6sm13547488wjb.3.2014.03.31.08.18.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:18:33 -0700 (PDT) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Russell King , Linus Walleij Subject: [PATCH V2 04/19] mmc: mmci: Add DT bindings for signal direction Date: Mon, 31 Mar 2014 17:18:05 +0200 Message-Id: <1396279100-2920-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396279100-2920-1-git-send-email-ulf.hansson@linaro.org> References: <1396279100-2920-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140331_081900_295282_5206DE87 X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -0.7 (/) Cc: devicetree@vger.kernel.org, Ulf Hansson , Rob Herring X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Some variants have support for indicating the bus signal directions, which currently are configured through platform data. Add corresponding DT bindings to enable us to move away from using the platform data. Signed-off-by: Ulf Hansson Reviewed-by: Linus Walleij --- Documentation/devicetree/bindings/mmc/mmci.txt | 11 ++++++++++- drivers/mmc/host/mmci.c | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt index ff233d1..9bd2ffa 100644 --- a/Documentation/devicetree/bindings/mmc/mmci.txt +++ b/Documentation/devicetree/bindings/mmc/mmci.txt @@ -4,7 +4,8 @@ The ARM PrimeCell MMCI PL180 and PL181 provides an interface for reading and writing to MultiMedia and SD cards alike. This file documents differences between the core properties described -by mmc.txt and the properties used by the mmci driver. +by mmc.txt and the properties used by the mmci driver. Using "st" as +the prefix for a property, indicates support by the ST Micro variant. Required properties: - compatible : contains "arm,pl18x", "arm,primecell". @@ -18,6 +19,11 @@ Optional properties: - mmc-cap-sd-highspeed : indicates whether SD is high speed capable. - vqmmc-supply : phandle to the regulator device tree node, mentioned as the VCCQ/VDD_IO supply in the eMMC/SD specs. +- st,sig-dir-dat0 : bus signal direction pin used for DAT[0]. +- st,sig-dir-dat2 : bus signal direction pin used for DAT[2]. +- st,sig-dir-dat31 : bus signal direction pin used for DAT[3] and DAT[1]. +- st,sig-dir-dat74 : bus signal direction pin used for DAT[4] to DAT[7]. +- st,sig-dir-cmd : cmd signal direction pin used for CMD. Example: @@ -38,6 +44,9 @@ sdi0_per1@80126000 { mmc-cap-sd-highspeed; mmc-cap-mmc-highspeed; cd-gpios = <&gpio2 31 0x4>; // 95 + st,sig-dir-dat0; + st,sig-dir-dat2; + st,sig-dir-cmd; vmmc-supply = <&ab8500_ldo_aux3_reg>; vqmmc-supply = <&vmmci>; diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index d6f20ba..c99ec88 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1392,6 +1392,17 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np, { int bus_width = 0; + if (of_get_property(np, "st,sig-dir-dat0", NULL)) + pdata->sigdir |= MCI_ST_DATA0DIREN; + if (of_get_property(np, "st,sig-dir-dat2", NULL)) + pdata->sigdir |= MCI_ST_DATA2DIREN; + if (of_get_property(np, "st,sig-dir-dat31", NULL)) + pdata->sigdir |= MCI_ST_DATA31DIREN; + if (of_get_property(np, "st,sig-dir-dat74", NULL)) + pdata->sigdir |= MCI_ST_DATA74DIREN; + if (of_get_property(np, "st,sig-dir-cmd", NULL)) + pdata->sigdir |= MCI_ST_CMDDIREN; + pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0); pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0);