From patchwork Thu Jan 25 10:51:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 125794 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1030618ljf; Thu, 25 Jan 2018 03:01:14 -0800 (PST) X-Google-Smtp-Source: AH8x2275pmu9xU8P7jPjzWeLmwt16xVLToi4pDSFV2nCxIMH9YYTctqGbd9y9y8b94lywWAjApPy X-Received: by 10.80.224.5 with SMTP id e5mr29297024edl.218.1516878074399; Thu, 25 Jan 2018 03:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516878074; cv=none; d=google.com; s=arc-20160816; b=F3h60+edibEXVw/7QYs8f6YdK0fvckECI2O2X8Ko+johT/PeNzG7aHbPqlvfq4GrTq EMlZhXM4eFUhGNUmDoTiR+dsFh6NfLHEYMu/EtWNpUf8K6bVZFtqBrMHyG4Up3/J/vxn nrXBUHgFE592rmt9+WuqYxAZ+BIHAHh0EKz/2hDbuEkVNTnxnxrkZbEdrNPMvFwOHx3f nyp0OeIEzNC2OobfwDQL+I1037R8SVtG/kChSotLQPf7yICjyvBA5zlaEqeOLdQuRZlx jnisMaj408HuM35/p5f0kK3xg1BLyu3G4ElaDajuVrHR+XoYcx71NQ3RCoU2Fe8HH6Ep ad3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=kutJl4hc5nhXjNT8TZtHhsq2j8gkZhUt4XOAPpztHtw=; b=RL1M/B3KsRmJAodG8N/EC49B8WXGOYlXUOma1Wd2qOhbA6qrGhYWWQfOXByUCAKd9z BqMm2If+GqdMRhdKjBbOxMiivV/W4wZIer+krnDOZbqu8yY9K8Kr6gNRk33L9vF6WgOA K4V4wulpiWiRz9LKSLiJIlgQwbDWm2dm/t7yq1GZ0hyMS7/ll+2TYlbkc13bXHSwkZyg cVtZhRBK0f3J1KAXaYFVHQau9l/voVGOS7yIp5TIneq6/orTEcfXaneyTHtomO3MAqVb bg1IBTo4SmCodbkXdfOCHqCl8Hi31LBN+MfEpF/BYwuipzpi16J4g24pgqvuwUB3RERi Zntg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=Jir7P/BR; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 90si1240133edy.483.2018.01.25.03.01.14; Thu, 25 Jan 2018 03:01:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=Jir7P/BR; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: by lists.denx.de (Postfix, from userid 105) id E7DB9C223E3; Thu, 25 Jan 2018 10:57:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6220DC223C3; Thu, 25 Jan 2018 10:53:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8C5EBC223F3; Thu, 25 Jan 2018 10:52:23 +0000 (UTC) Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by lists.denx.de (Postfix) with ESMTPS id AD8C1C2237E for ; Thu, 25 Jan 2018 10:52:19 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w0PAqIQu011701; Thu, 25 Jan 2018 04:52:18 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1516877538; bh=ZM6KjZXcQW4KgYmFPG9veVczYJrInLhCgF1g6P2e9JM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Jir7P/BRKwHabp2BarMCg2yt6p1kG0YXvDkd49bHo4mm/jz7uzklxQc/wkTiRNbxr EZtG0NRHfDIOrW5ujv0B44Iz2qwcN2cTAXUOgyZaw03cq/c7mnYMEp6hSczZFb8hKj jhsZilvOKzaSLKEovaTuYQ6uy/zh4ytU2cTFDwLU= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0PAqIaw004849; Thu, 25 Jan 2018 04:52:18 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 25 Jan 2018 04:52:18 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 25 Jan 2018 04:52:18 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0PAqH3R029266; Thu, 25 Jan 2018 04:52:17 -0600 From: Jean-Jacques Hiblot To: , , , Date: Thu, 25 Jan 2018 11:51:42 +0100 Message-ID: <1516877510-14863-17-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516877510-14863-1-git-send-email-jjhiblot@ti.com> References: <1516877510-14863-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 16/24] mmc: omap_hsmmc: allow mmc clock to be gated X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Kishon Vijay Abraham I mmc core has defined a new parameter *clk_disable* to gate the clock. Disable the clock here if *clk_disable* is set. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Jean-Jacques Hiblot --- drivers/mmc/omap_hsmmc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 5eeccfc..6ef3426 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -1207,6 +1207,7 @@ static int omap_hsmmc_set_ios(struct udevice *dev) struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct mmc *mmc = upriv->mmc; #endif + struct hsmmc *mmc_base = priv->base_addr; if (priv->bus_width != mmc->bus_width) omap_hsmmc_set_bus_width(mmc); @@ -1214,6 +1215,11 @@ static int omap_hsmmc_set_ios(struct udevice *dev) if (priv->clock != mmc->clock) omap_hsmmc_set_clock(mmc); + if (mmc->clk_disable) + omap_hsmmc_stop_clock(mmc_base); + else + omap_hsmmc_start_clock(mmc_base); + #if CONFIG_IS_ENABLED(DM_MMC) if (priv->mode != mmc->selected_mode) omap_hsmmc_set_timing(mmc);