From ee158d065f8e3dec49114e8ef8ec8ff13734e3ed Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Wed, 11 May 2022 12:51:14 +0530 Subject: [PATCH] mmc: sdhci-msm: configure sdcc clocks core memory This change configures sdcc core and ice clock memory state when clock is turned off. For ice clock, core mem needs to be retained to allow retaining crypto configuration (including keys) when ice clock is turned off. Change-Id: Id67c887ce5d5f6b6242b3267aeceebaa574c587b Signed-off-by: Sayali Lokhande Signed-off-by: Sachin Gupta --- drivers/mmc/host/sdhci-msm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 263b56c5126a..ed520c3e2c56 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "sdhci-pltfm.h" #include "cqhci.h" @@ -4392,7 +4393,16 @@ static int sdhci_msm_probe(struct platform_device *pdev) msm_host->bulk_clks); if (ret) goto bus_clk_disable; - + ret = qcom_clk_set_flags(msm_host->bulk_clks[0].clk, + CLKFLAG_NORETAIN_MEM); + if (ret) + dev_err(&pdev->dev, "Failed to set core clk NORETAIN_MEM: %d\n", + ret); + ret = qcom_clk_set_flags(msm_host->bulk_clks[2].clk, + CLKFLAG_RETAIN_MEM); + if (ret) + dev_err(&pdev->dev, "Failed to set ice clk RETAIN_MEM: %d\n", + ret); /* * xo clock is needed for FLL feature of cm_dll. * In case if xo clock is not mentioned in DT, warn and proceed.