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: 3873461 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 8DA509F370 for ; Fri, 21 Mar 2014 12:15:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA8C62026C for ; Fri, 21 Mar 2014 12:15:22 +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 D31E120268 for ; Fri, 21 Mar 2014 12:15:21 +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 1WQyM2-0006fi-M5; Fri, 21 Mar 2014 12:15:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQyM0-0003IC-3V; Fri, 21 Mar 2014 12:15:16 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQyLv-0003Fq-DJ for linux-arm-kernel@lists.infradead.org; Fri, 21 Mar 2014 12:15:12 +0000 Received: by mail-lb0-f174.google.com with SMTP id u14so1566432lbd.5 for ; Fri, 21 Mar 2014 05:14:49 -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=mbQqOO/xSQwvgbQr7EP/Dw8KvNnID3oAdk04g42j5Hg=; b=adXkWa9eadgRpjOiaxGe6bDDYPVK36Q4eTfkAWS5wDZBtyTwJdiquIkpgulPP8J206 NQi8LT8mr8JaZJZ5AZcvfHhNLwvafIvnKYdx5Hb1Ze3UlBoDZHRNjHV1CJOEYYAjqtLP 4+AkRieSpuO3tKuqxUZWvp1dsTDJXbNFlagjlXgNvAQv0phEGw6WUZ1/NnJSckKDtsaZ eYQR5FmF5dBASyj7aiUcC75g/UaorEcZ/0fSMy1KTSshrkSGofOzZtq5C7DGTEl32d/n 94YNUZrKy75xEdr9DayCC6UFMbj/tIW+7ABQQKN9hHh1mtPCAjNUatnNhC9D++oU8HN/ saMg== X-Gm-Message-State: ALoCoQkWoMtVJtIRDady7R8uqCSqPoimz3c9wzDdSdTBOUkt0QCyv0dPSy31iQ+Xa3jdKJsUX3Zk 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140321_081511_623067_4395FDD9 X-CRM114-Status: GOOD ( 12.28 ) X-Spam-Score: -2.6 (--) Cc: devicetree@vger.kernel.org, Ulf Hansson 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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);