From patchwork Fri Mar 21 12:14:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 26810 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3F70203AB for ; Fri, 21 Mar 2014 12:14:51 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf7851645ieb.5 for ; Fri, 21 Mar 2014 05:14:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=mbQqOO/xSQwvgbQr7EP/Dw8KvNnID3oAdk04g42j5Hg=; b=ddwXO4Zcfnww88SrxjB40A60x2/t224cSSNAe2rgZZ/7mQBxP+2x9Or/2ldrae1gwg vPcX8weqAGl9pmBVYGOy4wHajvbhNyJGp1SHYpe2puLSIryzz1AdvDK0NPTBuLhDR1LK wD7WdWKwVnIU//uyxB6jY0Z7eNxKkerD7NUZ4WJvGrgrihRC79br6rDizlWmmlzB5b33 Z3lkU0qtDC1Jv0go6z0yW3ZoSFAWlqAM4pWBbJNctaWe+934G690gCx5rjm9ycrGS88r /1nJLvxqAo+J6/rfIvG/sOlN6dtfKKubQQm5R0aDtp87TeQhxCxjA+A6y6AUgvqSqhA9 mpkQ== X-Gm-Message-State: ALoCoQkCOuBnd7sygzYGMa/rae7ync490Y3oFF/s4BOjzVef6l2wxEj7QLaBVDX/SWPjjkgOKEej X-Received: by 10.50.33.101 with SMTP id q5mr1038558igi.3.1395404091262; Fri, 21 Mar 2014 05:14:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.40 with SMTP id y37ls389829qgy.10.gmail; Fri, 21 Mar 2014 05:14:51 -0700 (PDT) X-Received: by 10.221.61.210 with SMTP id wx18mr8289579vcb.27.1395404091162; Fri, 21 Mar 2014 05:14:51 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id us10si1067333vcb.167.2014.03.21.05.14.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 05:14:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so2445990veb.29 for ; Fri, 21 Mar 2014 05:14:51 -0700 (PDT) X-Received: by 10.58.154.10 with SMTP id vk10mr37323454veb.18.1395404091091; Fri, 21 Mar 2014 05:14:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp25966vck; Fri, 21 Mar 2014 05:14:50 -0700 (PDT) X-Received: by 10.153.8.135 with SMTP id dk7mr33894648lad.18.1395404089739; Fri, 21 Mar 2014 05:14:49 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by mx.google.com with ESMTPS id h8si3904553lam.74.2014.03.21.05.14.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 05:14:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.176 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id 10so1583554lbg.35 for ; Fri, 21 Mar 2014 05:14:49 -0700 (PDT) X-Received: by 10.152.2.131 with SMTP id 3mr33713281lau.20.1395404089080; Fri, 21 Mar 2014 05:14:49 -0700 (PDT) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id tq9sm3255263lbb.10.2014.03.21.05.14.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 05:14:48 -0700 (PDT) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Russell King , Linus Walleij Cc: devicetree@vger.kernel.org, Ulf Hansson Subject: [PATCH 05/20] mmc: mmci: Add DT bindings for signal direction Date: Fri, 21 Mar 2014 13:14:02 +0100 Message-Id: <1395404057-27835-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1395404057-27835-1-git-send-email-ulf.hansson@linaro.org> References: <1395404057-27835-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- Documentation/devicetree/bindings/mmc/mmci.txt | 4 ++++ drivers/mmc/host/mmci.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt index d167562..eb9ad86 100644 --- a/Documentation/devicetree/bindings/mmc/mmci.txt +++ b/Documentation/devicetree/bindings/mmc/mmci.txt @@ -15,6 +15,7 @@ Optional properties: - mmc-cap-mmc-highspeed : indicates whether MMC is high speed capable. - mmc-cap-sd-highspeed : indicates whether SD is high speed capable. - vqmmc-supply : phandle to the regulator device tree node. +- signal-direction : a bit pattern, indicating bus signals directions. Example: @@ -37,6 +38,9 @@ sdi0_per1@80126000 { mmc-cap-mmc-highspeed; cd-gpios = <&gpio2 31 0x4>; // 95 + signal-direction = <(MCI_ST_DATA2DIREN | MCI_ST_CMDDIREN | + MCI_ST_DATA0DIREN | MCI_ST_FBCLKEN)>; + 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..76e41ba 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1390,8 +1390,15 @@ static struct mmc_host_ops mmci_ops = { static void mmci_dt_populate_generic_pdata(struct device_node *np, struct mmci_platform_data *pdata) { + u32 sigdir = 0; int bus_width = 0; + if (!of_property_read_u32(np, "signal-direction", &sigdir)) { + sigdir &= MCI_ST_DATA2DIREN|MCI_ST_CMDDIREN|MCI_ST_DATA0DIREN| + MCI_ST_DATA31DIREN|MCI_ST_FBCLKEN|MCI_ST_DATA74DIREN; + pdata->sigdir = sigdir; + } + pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0); pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0);