From patchwork Tue Jun 4 08:14:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 165710 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5523054ili; Tue, 4 Jun 2019 01:14:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqypNXuH7r5KfFJ+z+41ETL+rwhzFyt0aqQgM/nXUwiFy+52pBZRtmqo3JGpwOuE2VUWMrgW X-Received: by 2002:a63:158:: with SMTP id 85mr34276301pgb.101.1559636099725; Tue, 04 Jun 2019 01:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636099; cv=none; d=google.com; s=arc-20160816; b=c2vAT3F3a9M+HHo3MA4nsJkHgMJNTbsssxesUsBW7K/AafkB4WtsbM7cE8h/GoJMvi A+x4uNFk0lBYva0Mi12GSd3ymHuyVydFJtkdP0ygX5KVlW3UbVx3GoA2safeCnIXEekW guDfLTAoK6OhY7JjRb594GSpLmx4dxb9nHrcSITJD8UyFHAjKEVIW9O+/0Q2IRsnH5na UFCS1QWBZrs4JOFLHCT84B4VymHSqXvpD6TeekIljNlT2gRxREBLpIYZv/+5aObiLvNp KOnJKKpwAuxdjH66b//38U00ylWGAwatzFubV92JC316E06qwvZP+WC5aZNRWsJ2myrD O32Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=e4QisK5dlRTGLzT7/Rg8a2odjBOSln7PHE3O27n2JN8=; b=u9yo8jQBAwtcaxPKIFwwOFdqOD47kwQ9T4vKYfYBiJa3CFGHMsUuX81NCVctecIX80 q+dV3wfzjHYS0PCpWWpUwkhjbWWYCDGkE5xBoelRRC46X+YuOtfvDsfm+cTqrYDrBy5T kdkX+up72wzLD6K+DYNLED9gNYUaGb/oqZoBsjal2e5pCojdbU7IqwpNMKgK/mnR0dty 5WLcPTtHIfG4d+FgOYAXsEpZeVf40Lp4WiUog53NKUSkIML72zqbWfdAZTYfosOUWFgH 5VJUaSYCiTi8BNboo7RrM6S6vPQTrcStKoeJOzq7V8OVP/aaT+p1KZouqgPVQ9QEhPo5 XWog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=trbg0frb; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si24203565plh.398.2019.06.04.01.14.59; Tue, 04 Jun 2019 01:14:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=@linaro.org header.s=google header.b=trbg0frb; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727017AbfFDIO7 (ORCPT + 5 others); Tue, 4 Jun 2019 04:14:59 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38492 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbfFDIO6 (ORCPT ); Tue, 4 Jun 2019 04:14:58 -0400 Received: by mail-pg1-f194.google.com with SMTP id v11so9895817pgl.5 for ; Tue, 04 Jun 2019 01:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=e4QisK5dlRTGLzT7/Rg8a2odjBOSln7PHE3O27n2JN8=; b=trbg0frb5Fm6WDCdwfgr0zwTekzKj6RqswMPjQMJ99rO6iHuS2rMNYCBGuDZBGGJSL VXvzRWgev366dHO4Ju+XgTk8mr53kJtOrWff7OR0VQAnJN/emszpnUFXpteaSuwy+3RD 6Qwkhht7EOwDAPmNItBNdWldGbu7b/081rTHGBXxhn6QNbTtdri4hBkShVXhnufArVvu iSA9g2TY1ReSSUCGk0krgRSecKARonkhd1Vixw60KDRizzeRGhnvZdMNjC2Kzv9Jwicj ujsONmhW4MXoIptsfzomXNoWz5qdGXjZlDUflQJBSlx/unwniaY+PBYp8Xh3aBF1cjOg 0YAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=e4QisK5dlRTGLzT7/Rg8a2odjBOSln7PHE3O27n2JN8=; b=PkMU+27lIN2zY3AYB04jeh25eAuzPM2X9xAE63eUOwI4En7mCprlts3Yk26aKkW+sb 1D29ZSRe3BoCYCtk3NBcRN+bglIME1jThqE7XrMLd2bLjJ2kBg/pLtT7k94dvGuIKdsI KOHwG4wyC4uudL6Es8Fw+lzi0S2qehp5e07s/WagxgAUn1rywW7wLGXXJoBKOL0XpT3F 1b2NzHzIe7VVZGEL/rH7a9r9HLyxHNqdaysRCQfPRT1vtyAmeLwAZ9IP4SBRucnQ7X2o VXj2AHDEsuibGr/pt9c3fw8jbzG3kHzH0Xci2K9oo0gNALTt2I6Ebj7y9tHu1jMe4ylK 4fPA== X-Gm-Message-State: APjAAAVjaurzqvAmydVKXEfQbzX7C8MDsw90o3hBkrajZxjbNmAbFZ3R QBGpkRtl6Qri2zqsRPA2BQd5MG47uxJ9YQ== X-Received: by 2002:a62:d149:: with SMTP id t9mr14481108pfl.173.1559636097966; Tue, 04 Jun 2019 01:14:57 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j4sm14818804pgc.56.2019.06.04.01.14.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jun 2019 01:14:57 -0700 (PDT) From: Baolin Wang To: adrian.hunter@intel.com, ulf.hansson@linaro.org, zhang.lyra@gmail.com, orsonzhai@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, olof@lixom.net Cc: baolin.wang@linaro.org, vincent.guittot@linaro.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/9] dt-bindings: mmc: sprd: Add another optional clock documentation Date: Tue, 4 Jun 2019 16:14:22 +0800 Message-Id: <84abb6b282b1fbce0c39ebd2b42ca4c18118f863.1559635435.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org For some Spreadtrum platforms like SC9860 platform, we should enable another gate clock '2x_enable' to make the SD host controller work well. Thus add documentation for this optional clock. Signed-off-by: Baolin Wang --- .../devicetree/bindings/mmc/sdhci-sprd.txt | 1 + 1 file changed, 1 insertion(+) -- 1.7.9.5 diff --git a/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt b/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt index 45c9978..a285c77 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt @@ -14,6 +14,7 @@ Required properties: - clock-names: Should contain the following: "sdio" - SDIO source clock (required) "enable" - gate clock which used for enabling/disabling the device (required) + "2x_enable" - gate clock controlling the device for some special platforms (optional) Optional properties: - assigned-clocks: the same with "sdio" clock From patchwork Tue Jun 4 08:14:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 165711 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5523130ili; Tue, 4 Jun 2019 01:15:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRp4Ie2JcvQa0V/WTub6W3n1SG3UHJKRdBP4e5k9lER5Q8ea8lCf8ICxdeqFN7IokElQK+ X-Received: by 2002:a17:90a:9382:: with SMTP id q2mr35663389pjo.131.1559636104620; Tue, 04 Jun 2019 01:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636104; cv=none; d=google.com; s=arc-20160816; b=Csye0qQd65oJFMBEuwV+JyN0Kbr6uUdWkHf+3G5BNlHC2/07k4Mso0nU/DbOEQ4xjt NK8MNvHv9MI3VXDOMc2lD8665wkRl00ZuwvLkEY/i9WEhihBjF0PI0pP3EbNiqegZlF3 JRBvCC8V2//qObldxmaD3xDZ9PJiuVfe577WngJ7KK7P89gl60TdMAncH7ieDm+gS/j9 Q7imegElZ3p/R8dTNdseMQ2wAxXjxcEOjt0coziBE3uNk7sWeZKujPgx9MGaqAmXQ4eR 5Fo79WXyh+DtK4eF+ywxbLcF7faj9669XT30ppxePMJn7AVSItbR+/HRkKWmtkatcbNr 6zWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=FdrxifC9VKJDfmhJlZCtT+SJXQU8nyEdMzYOjCE23wE=; b=GGgXWEX7kwgwTWixpzVrwHDimlT7nQrz08zqsBTeKJ4NXsiAnqo33D4YjN59yl09kv RYBDSD3E061a586B9XZK9J7uwopfvj8sM7J74NxJzNO6vmM5nzTVgMxdaMBbFW/BMHUn W79ZSOKnYtTnejKtXPU/KefgLTrnfWpaMOIqtD8sRMIqqUvOhcfq2Ux/PGRmyLTtvQRm x9XL8M7DFRt/eEbRybqF6mfIxTPrc8mZ85iTX75ewBR5aNNY84Gno3xCh15I4D7YQEjb Eg9qSYfpq8UmHvAZrt8+3Sozgy0EUVg62bAxMtYMDgArwYppXQmXPIr2B2yXLXkqw2PQ SQig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O+2GCVHo; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j68si2110813pje.10.2019.06.04.01.15.04; Tue, 04 Jun 2019 01:15:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=@linaro.org header.s=google header.b=O+2GCVHo; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727055AbfFDIPD (ORCPT + 5 others); Tue, 4 Jun 2019 04:15:03 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39423 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727061AbfFDIPD (ORCPT ); Tue, 4 Jun 2019 04:15:03 -0400 Received: by mail-pl1-f195.google.com with SMTP id g9so8032480plm.6 for ; Tue, 04 Jun 2019 01:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=FdrxifC9VKJDfmhJlZCtT+SJXQU8nyEdMzYOjCE23wE=; b=O+2GCVHo8+jdVe0br2gCJmuVnoyN4ac5Q7dhggvalzYPiUr+vQUkbbNC7rkfnG/DMc Po9EnLA2txYJNYbCrgFTev4bagodznF/DhZ9ndevRxjnCflMa2CwWoR1iVBRqmrNGZhr 6ajDgOfmCMYdyDcsNoyNSHvDeqsSB9N7tBPXRUpbID/7kXrqXOAlXM6/ujiDUcHeJ1Na Cl2K8MyOB4vbDBYM0Cg/SoLMUchkU1OA+KdEsjrCfciLpldwdMyZVr/j/L9QG5gSdY64 bnykp/4rdv3o9rQoqFm+Y7Mzq++0RgDOJOy74UVZSB378K3GAr+Sh03UEiXRAIYzVGUE iGEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=FdrxifC9VKJDfmhJlZCtT+SJXQU8nyEdMzYOjCE23wE=; b=ZbwjC/iiGjVr6FjQQqurWitN/AhvWiOe0wPrsoaCV7jEOEC9nB9oFKo83U/8CtlTsg 52XDZzBNG/W75Rx4uGBWnBQttCHtGOqDeYIOwXlcYm72gBVLWwOcWpCXdvm6OVaIlQuT s+Sbk8aMA/7a5tCj3NfKGuwFbXgK9DwtsUl4JHtSrVtsf/Vci6Wg1BlLVIvzLquFECXw JZqbI6a7BOb5SHEfqbtLP4ntWhqYZIuEvaw2xyFT3om2VQ4rJ7PbB8ry4VrFrGC3r4df li8Zu4bKXObCcQlsSs6Q7ga+x0IXIAr3p24DPlNPbL+mvJvC5Pyifi5KQm+wORlzMT6K g04w== X-Gm-Message-State: APjAAAVnxdEtu7NBJCVyHwsqxsy2hfadurSJq5GKkJ1KyV/z1KkSEdpK d5uh+PmKv7BHmCmehUe0EWJ8fg== X-Received: by 2002:a17:902:7e0e:: with SMTP id b14mr9660980plm.257.1559636102504; Tue, 04 Jun 2019 01:15:02 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j4sm14818804pgc.56.2019.06.04.01.14.58 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jun 2019 01:15:02 -0700 (PDT) From: Baolin Wang To: adrian.hunter@intel.com, ulf.hansson@linaro.org, zhang.lyra@gmail.com, orsonzhai@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, olof@lixom.net Cc: baolin.wang@linaro.org, vincent.guittot@linaro.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 3/9] mmc: sdhci-sprd: Add optional gate clock support Date: Tue, 4 Jun 2019 16:14:23 +0800 Message-Id: <3bd7f5b0d4c78b75f8c4067a34f79396b4fd0a5c.1559635435.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org For the Spreadtrum SC9860 platform, we should enable another gate clock '2x_enable' to make the SD host controller work well. Signed-off-by: Baolin Wang Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-sprd.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) -- 1.7.9.5 diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index e741491..31ba7d6 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -60,6 +60,7 @@ struct sdhci_sprd_host { u32 version; struct clk *clk_sdio; struct clk *clk_enable; + struct clk *clk_2x_enable; u32 base_rate; int flags; /* backup of host attribute */ }; @@ -364,6 +365,10 @@ static int sdhci_sprd_probe(struct platform_device *pdev) } sprd_host->clk_enable = clk; + clk = devm_clk_get(&pdev->dev, "2x_enable"); + if (!IS_ERR(clk)) + sprd_host->clk_2x_enable = clk; + ret = clk_prepare_enable(sprd_host->clk_sdio); if (ret) goto pltfm_free; @@ -372,6 +377,10 @@ static int sdhci_sprd_probe(struct platform_device *pdev) if (ret) goto clk_disable; + ret = clk_prepare_enable(sprd_host->clk_2x_enable); + if (ret) + goto clk_disable2; + sdhci_sprd_init_config(host); host->version = sdhci_readw(host, SDHCI_HOST_VERSION); sprd_host->version = ((host->version & SDHCI_VENDOR_VER_MASK) >> @@ -408,6 +417,9 @@ static int sdhci_sprd_probe(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); + clk_disable_unprepare(sprd_host->clk_2x_enable); + +clk_disable2: clk_disable_unprepare(sprd_host->clk_enable); clk_disable: @@ -427,6 +439,7 @@ static int sdhci_sprd_remove(struct platform_device *pdev) mmc_remove_host(mmc); clk_disable_unprepare(sprd_host->clk_sdio); clk_disable_unprepare(sprd_host->clk_enable); + clk_disable_unprepare(sprd_host->clk_2x_enable); mmc_free_host(mmc); @@ -449,6 +462,7 @@ static int sdhci_sprd_runtime_suspend(struct device *dev) clk_disable_unprepare(sprd_host->clk_sdio); clk_disable_unprepare(sprd_host->clk_enable); + clk_disable_unprepare(sprd_host->clk_2x_enable); return 0; } @@ -459,19 +473,28 @@ static int sdhci_sprd_runtime_resume(struct device *dev) struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host); int ret; - ret = clk_prepare_enable(sprd_host->clk_enable); + ret = clk_prepare_enable(sprd_host->clk_2x_enable); if (ret) return ret; + ret = clk_prepare_enable(sprd_host->clk_enable); + if (ret) + goto clk_2x_disable; + ret = clk_prepare_enable(sprd_host->clk_sdio); - if (ret) { - clk_disable_unprepare(sprd_host->clk_enable); - return ret; - } + if (ret) + goto clk_disable; sdhci_runtime_resume_host(host); - return 0; + +clk_disable: + clk_disable_unprepare(sprd_host->clk_enable); + +clk_2x_disable: + clk_disable_unprepare(sprd_host->clk_2x_enable); + + return ret; } #endif From patchwork Tue Jun 4 08:14:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 165712 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5523206ili; Tue, 4 Jun 2019 01:15:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+V/v4ZwVThjJ9j4r1rUKcMgM1pDWbHVOAb2eOECF6X9vwxs94/j6fYxTn0AqLS3wuPmpq X-Received: by 2002:a62:2643:: with SMTP id m64mr35576257pfm.46.1559636109912; Tue, 04 Jun 2019 01:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636109; cv=none; d=google.com; s=arc-20160816; b=WHTTiqII4jPrgZqQkWc+TX0G3/Rvk9A+4/RFaTudFY+J+5wX9H5FFYDqYJowbC7qNK dM4r0U8nhzgFjYWtZU4ARzt7y2ece5vY/ucnc9cToS9UWynA2FplNKktJ+Tm86xiuc3Y e819AmQiyd0kIoWhrUtI5D/qjcJXzMWP22BeFd5Aap4jWwD17Ax9CkcFJWplv1FC7a0j 0+yd92AHuNFOIHw+RNbjVKKfM73b5IbdLMmJ7GXfigxeM5dW3snAQ8ZseiSzw571YWos 09OFlV8LnDOo7PnvyNgERgXlKkHVoIW1TuP7tfMU2aCeivlBrEsYLgK5cAGt1Nwev3H1 Ub3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=628ZQKD9jdSHtWmvRCzFbwR4o1BOUbgB+F8276Myxy8=; b=gqxiYGpCDYRyGlPBP0BnrILJqRsnSTzGi0oUOyiU2/OWE3I7/3UlFwtgfzDAal+8mh 8orLfxwnCYLvrKo83KEFoDu4BDGbgRscu5NC+Hz1ZeD2FYKuwC8bzIMTn2NMcmeIAn9G 8DR4trlHZEFmNdtm+HEePuQBorX10CYWdIY28M6rpp5cfhNBBRtH9YEGRE5zY7RK9AVb HSJbzFYnQ43AAqZgv3pgXbbgwZOQMZIVETl2lTa3zSXf2x51F4hQsHAHPr8mLwcJg6TI QuHuALLCk+aXK19o5RYWq9hSo6hos7kYqmshHirAv+L5Apea1W/8znfx75d36fs2JtKi 411w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gzhVSfX/"; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si19304023pla.322.2019.06.04.01.15.09; Tue, 04 Jun 2019 01:15:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=@linaro.org header.s=google header.b="gzhVSfX/"; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbfFDIPI (ORCPT + 5 others); Tue, 4 Jun 2019 04:15:08 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35960 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727058AbfFDIPI (ORCPT ); Tue, 4 Jun 2019 04:15:08 -0400 Received: by mail-pf1-f196.google.com with SMTP id u22so12218813pfm.3 for ; Tue, 04 Jun 2019 01:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=628ZQKD9jdSHtWmvRCzFbwR4o1BOUbgB+F8276Myxy8=; b=gzhVSfX/Bn6qb7Bn5lG6vK47YR/iVsd/HdMBg0jqihRl1oIgJUL0n2Rcr/GT6ZSNuc 1aRUNkfNasPsc40XFopW34wVB0wEY9EGrsslh+r78Eawvrq0LxdAUUimuOx4t+msvwLO uBqkjXbfx5Mxq2ZNzGt1nrr5C31jEDWO0kJeY6FO2Wj6WlshAoCOuxW1W0CrPlnaO526 4So3Zm816GJgnVCMXFd2e19o3Ri7YmIrdFWkj0M4eZv3qQDUzvU3oBm66fGUFJM2acQn My9WcvNPZLHe5Q0ufI3CEyUnhMO2419UK0hNaGZL5gajope7z52/G4Mpd9Wq0AWz0APz haGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=628ZQKD9jdSHtWmvRCzFbwR4o1BOUbgB+F8276Myxy8=; b=hMnYUCCQ+2Ui/FlukKp3GjaJ8Gw8vTFOgEz/dspGug9bNnSZmfBaHiZAw6q/zvmtSV Givues5+Tv3Tp1nhtLkAec+JhohH2nyjs0iupBMJLueOEe1Dt6/C+kxCt+d9Xf9Jc53H fbqCzN2h8o58VcAolVOAxeRK167hDhNuMYSHspBu4hhK4hCkNyv9TIqNeBw4DjKVecUA 05Rrf0hY65guiQsw9CCn3yvihYfhKC35dRySpvHJM0UoR6R1hXT7432ceY/FJZXz47Hf jh3O8q5aGK11UL4+Pck+gRTEek60qc+CdiQXEujf1IJdzD3ulFdLXmkTv5PsEX1DfjQ6 OLmw== X-Gm-Message-State: APjAAAWr2SAJmnR4ziXMfDH46JTqfwsACThFD7u/9UIlREYAKmFZKwnD ZAp8fIvqGcKrDkghkEz4U3JOwg== X-Received: by 2002:a17:90b:d83:: with SMTP id bg3mr21126762pjb.63.1559636107639; Tue, 04 Jun 2019 01:15:07 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j4sm14818804pgc.56.2019.06.04.01.15.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jun 2019 01:15:06 -0700 (PDT) From: Baolin Wang To: adrian.hunter@intel.com, ulf.hansson@linaro.org, zhang.lyra@gmail.com, orsonzhai@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, olof@lixom.net Cc: baolin.wang@linaro.org, vincent.guittot@linaro.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 4/9] mmc: sdhci-sprd: Implement the get_max_timeout_count() interface Date: Tue, 4 Jun 2019 16:14:24 +0800 Message-Id: <37b15ac756f9fca7c1f9382deb57648890bb141c.1559635435.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Implement the get_max_timeout_count() interface to set the Spredtrum SD host controller actual maximum timeout count. Signed-off-by: Baolin Wang Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-sprd.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.7.9.5 diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 31ba7d6..d91281d 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -285,6 +285,12 @@ static void sdhci_sprd_hw_reset(struct sdhci_host *host) usleep_range(300, 500); } +static unsigned int sdhci_sprd_get_max_timeout_count(struct sdhci_host *host) +{ + /* The Spredtrum controller actual maximum timeout count is 1 << 31 */ + return 1 << 31; +} + static struct sdhci_ops sdhci_sprd_ops = { .read_l = sdhci_sprd_readl, .write_l = sdhci_sprd_writel, @@ -296,6 +302,7 @@ static void sdhci_sprd_hw_reset(struct sdhci_host *host) .reset = sdhci_reset, .set_uhs_signaling = sdhci_sprd_set_uhs_signaling, .hw_reset = sdhci_sprd_hw_reset, + .get_max_timeout_count = sdhci_sprd_get_max_timeout_count, }; static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq)