From patchwork Thu Jan 15 16:12:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 429507 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E3469140285 for ; Fri, 16 Jan 2015 03:15:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755168AbbAOQO7 (ORCPT ); Thu, 15 Jan 2015 11:14:59 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:54082 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755152AbbAOQO5 (ORCPT ); Thu, 15 Jan 2015 11:14:57 -0500 Received: by mail-wi0-f182.google.com with SMTP id h11so18838146wiw.3; Thu, 15 Jan 2015 08:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=vvR4xD7gadwuy9orSXxM1DR6pBh91nmvK1MSptHVyD8=; b=T0gO5RWLg7EG24Z/DgScaM5efuemjWtI4hRASDAO2PdfeB9VzAeIEqK6levprBqehK xxaWVfM60KRxWsvcj49+FSwYmZPaS5FpADMFpij/LALm7wezWHjkb7nemI5Q9ntZVRPD R/Ms6xZ9Z9IK5vsSr/uG6Nx6GhgFXVn9mRjnBfw32sKbk4kq/AXG4oenZJWjVo5fowEL wQ4U8j8Co9AgmLWI5I8TMoYWQOkQysjAPEuqlrqb83nEGkmGMdkvxlFbe2i+BsVBjcE1 kBCFUvJ8pSY+QCALEjuCM5RECk376hnIHVpqtebn+Qp18lHuKrzoutX77dpuIIToV7ci Hxlg== X-Received: by 10.194.88.228 with SMTP id bj4mr19587160wjb.18.1421338495832; Thu, 15 Jan 2015 08:14:55 -0800 (PST) Received: from cizrna.lan (37-48-32-126.tmcz.cz. [37.48.32.126]) by mx.google.com with ESMTPSA id ej10sm8065695wib.2.2015.01.15.08.14.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jan 2015 08:14:54 -0800 (PST) From: Tomeu Vizoso To: linux-tegra@vger.kernel.org Cc: Javier Martinez Canillas , Dylan Reid , Simon Glass , Ulf Hansson , Tomeu Vizoso , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Chris Ball , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org Subject: [PATCH v2 08/11] mmc: pwrseq_simple: Add support for a delay Date: Thu, 15 Jan 2015 17:12:20 +0100 Message-Id: <1421338359-27467-9-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1421338359-27467-1-git-send-email-tomeu.vizoso@collabora.com> References: <1421338359-27467-1-git-send-email-tomeu.vizoso@collabora.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Tomeu Vizoso --- Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt | 2 ++ drivers/mmc/core/pwrseq_simple.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt b/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt index 6fe0cd6..b353381 100644 --- a/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt +++ b/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt @@ -14,10 +14,12 @@ Required properties: Optional properties: - reset-gpios : contains a list of GPIO specifiers, though currently only one specifier is supported. +- delay : delay to wait after driving the reset gpio active [ms]. Example: sdhci0_pwrseq { compatible = "mmc,pwrseq-simple"; reset-gpios = <&gpio1 12 0>; + delay = <20>; } diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c index 42d9836..3e521cc 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/mmc/core/pwrseq_simple.c @@ -12,14 +12,17 @@ #include #include #include +#include #include +#include "core.h" #include "pwrseq.h" struct mmc_pwrseq_simple { struct mmc_pwrseq pwrseq; struct gpio_desc *reset_gpio; + unsigned int delay_ms; }; static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) @@ -29,6 +32,9 @@ static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) if (!IS_ERR(pwrseq->reset_gpio)) gpiod_set_value_cansleep(pwrseq->reset_gpio, 1); + + if (pwrseq->delay_ms) + mmc_delay(pwrseq->delay_ms); } static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host) @@ -76,6 +82,8 @@ int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev) goto free; } + of_property_read_u32(dev->of_node, "delay", &pwrseq->delay_ms); + pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops; host->pwrseq = &pwrseq->pwrseq;