From patchwork Fri Jun 16 12:45:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 105737 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1258343obh; Fri, 16 Jun 2017 05:48:39 -0700 (PDT) X-Received: by 10.99.104.199 with SMTP id d190mr11362672pgc.185.1497617319814; Fri, 16 Jun 2017 05:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497617319; cv=none; d=google.com; s=arc-20160816; b=VxQf2v7pFirx3AQLHdYpnFE3cac9X3iFjkO7fFaXUPe/tXo9P42ACPqYZ35T/Yc8Ep oCQlRviYfbsFsnfyXwRvAHml6xB1KfqWsARORexVActh2TpyL0v0ylpK/AWORWdpagjc tN0/Cq1fbOv53UBdAH3LqNvFNWoAjudENmt3uoHCS49+6cvc/JhYinQgp3+NZv0R1YaR lPdzexs8+ZnZna5+lZMTg2P7H7+xhI0hOJ2GMs5jnDxV+z9BQFUMJANhrAc5k+j7Gl33 pWlPNq4NrDLXVZjLI74Ud/4flkVSvILqJrls5QyOFRXlAr+S9q+3Om5B4eeVlh3Zwy0u l0Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=do36C2hY+w4m8hEMNWrasYR2Xh1g8C1ne10OstGx+HY=; b=Hiljc9l8jC5aXddY1rk3DwFxQ/m5mlLhghRRlyi9XE6e7Uw1qdLuYLoFXEHyUp1Az2 QgHfJgs9jXwQ3sdF0IHPREWPmlv03IwJ379MSuBIoZVtwJrlO0OmRFj8mWFXRriwG3dv e3bIS02xAorLxC7hsBWbxH7BzLuRTyhYV9yLLMAtR61pwNO8JggN6duLYaJ3dY6IGUE+ IZvUkCMaCJYMW1gcO2zcA9oLQp1qG9ck1n3/wLG+WAMzWHUiIUCe9T0nms1WIyfgSDNA zrzIq8jRF+ObDvKCeGRw1GxQx9XqrW6hSGN/8/eDUYJgEp0/HqRvNDDuG6O5ZEW3SUAs gM/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.b=SXyjS1Gl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u192si1913812pgb.96.2017.06.16.05.48.39; Fri, 16 Jun 2017 05:48:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.b=SXyjS1Gl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521AbdFPMsI (ORCPT + 25 others); Fri, 16 Jun 2017 08:48:08 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:38610 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753013AbdFPMsF (ORCPT ); Fri, 16 Jun 2017 08:48:05 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v5GCkKYh022325; Fri, 16 Jun 2017 07:46:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1497617180; bh=VxMBX3BfAVVZ4ReUPZeeIbJk1encEl/ARsaQxXrrsuE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SXyjS1Gl9Fz6guoXTRO0wb1YWGd8arOV1zb6c2K+7PjPv2XyUu8IISsBZJ1IZSwc6 mvLKiZmyd28Cil5Y8vgGZ6KtZUcar+tudjeWrPuB11uSJjye/nSxeB9FNLhwk4kv6v nujmlPofOU47ns8n7rJue/651WOYu9dXXKC6Ov6E= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v5GCkF3O012587; Fri, 16 Jun 2017 07:46:15 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Fri, 16 Jun 2017 07:46:14 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v5GCjjBh000652; Fri, 16 Jun 2017 07:46:10 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Rob Herring , Tony Lindgren , CC: Russell King , Ravikumar Kattekola , , , , , , Subject: [PATCH 05/16] mmc: host: omap_hsmmc: Set clk rate to the max frequency Date: Fri, 16 Jun 2017 18:15:33 +0530 Message-ID: <20170616124544.15046-6-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170616124544.15046-1-kishon@ti.com> References: <20170616124544.15046-1-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set the clock rate of the functional clock to the max frequency that is passed to the driver either using pdata or dt. Also remove unnecessary setting of host->fclk to NULL. This is in preparation for supporting high frequency modes of operation. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sekhar Nori --- drivers/mmc/host/omap_hsmmc.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) -- 2.11.0 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 680934d50919..3ca18e28be01 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2153,22 +2153,29 @@ static int omap_hsmmc_probe(struct platform_device *pdev) mmc->ops = &omap_hsmmc_ops; - mmc->f_min = OMAP_MMC_MIN_CLOCK; - - if (pdata->max_freq > 0) - mmc->f_max = pdata->max_freq; - else if (mmc->f_max == 0) - mmc->f_max = OMAP_MMC_MAX_CLOCK; - spin_lock_init(&host->irq_lock); host->fclk = devm_clk_get(&pdev->dev, "fck"); if (IS_ERR(host->fclk)) { ret = PTR_ERR(host->fclk); - host->fclk = NULL; goto err1; } + mmc->f_min = OMAP_MMC_MIN_CLOCK; + if (pdata->max_freq) + mmc->f_max = pdata->max_freq; + + if (mmc->f_max) { + ret = clk_set_rate(host->fclk, mmc->f_max); + if (ret) { + dev_err(&pdev->dev, "failed to set clock to %d\n", + mmc->f_max); + goto err1; + } + } else { + mmc->f_max = OMAP_MMC_MAX_CLOCK; + } + if (host->pdata->controller_flags & OMAP_HSMMC_BROKEN_MULTIBLOCK_READ) { dev_info(&pdev->dev, "multiblock reads disabled due to 35xx erratum 2.1.1.128; MMC read performance may suffer\n"); omap_hsmmc_ops.multi_io_quirk = omap_hsmmc_multi_io_quirk;