The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Swati Agarwal <swati.agarwal@amd.com>
To: <adrian.hunter@intel.com>, <michal.simek@xilinx.com>,
	<ulf.hansson@linaro.org>
Cc: <linux-mmc@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <git@amd.com>
Subject: [PATCH] mmc: sdhci-of-arasan: Add support to request the "gate" clock
Date: Thu, 23 Feb 2023 19:44:02 +0530	[thread overview]
Message-ID: <20230223141402.23979-1-swati.agarwal@amd.com> (raw)

Add support to read the optional "gate" clock property and request the
clock which will be used to ungate the DLL clock.

For Xilinx platforms which has DLL module, dll clock must be
ungated/enabled when SD controller operates at higher frequencies like 50
MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate
clock from the driver.

Signed-off-by: Swati Agarwal <swati.agarwal@amd.com>
---
 drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 4eebbf801b41..1fd7528c14fc 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -1870,6 +1870,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 	int ret;
 	struct device_node *node;
 	struct clk *clk_xin;
+	struct clk *clk_dll;
 	struct sdhci_host *host;
 	struct sdhci_pltfm_host *pltfm_host;
 	struct device *dev = &pdev->dev;
@@ -1943,6 +1944,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 		goto clk_dis_ahb;
 	}
 
+	clk_dll = devm_clk_get_optional_enabled(dev, "gate");
+	if (IS_ERR(clk_dll)) {
+		ret = dev_err_probe(dev, PTR_ERR(clk_dll), "failed to get dll clk\n");
+		goto clk_disable_all;
+	}
+
 	if (of_property_read_bool(np, "xlnx,fails-without-test-cd"))
 		sdhci_arasan->quirks |= SDHCI_ARASAN_QUIRK_FORCE_CDTEST;
 
-- 
2.17.1


             reply	other threads:[~2023-02-23 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 14:14 Swati Agarwal [this message]
2023-02-27  8:16 ` [PATCH] mmc: sdhci-of-arasan: Add support to request the "gate" clock Michal Simek
2023-02-27 14:56 ` Ulf Hansson
2023-02-27 15:09   ` Michal Simek
2023-02-27 15:31     ` Ulf Hansson
2023-03-02 11:09 ` Adrian Hunter
2023-03-09 15:02 ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230223141402.23979-1-swati.agarwal@amd.com \
    --to=swati.agarwal@amd.com \
    --cc=adrian.hunter@intel.com \
    --cc=git@amd.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox