From patchwork Fri Dec 6 22:56:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 847997 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011038.outbound.protection.outlook.com [52.101.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5237E1FCD18; Fri, 6 Dec 2024 22:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733525818; cv=fail; b=b8aeJhiCloGMg+2BIBbYU4E+oPoUnpcBZhn52jDAp8uwVAKc+3iXKZoLNFOg6n5DE8zC3Uv5KtBlFCiwm8uEAyoKL2RB1f57OIPo6z5EPfJXzU5DdVFdduYLMjN2bOBhM6gvnliyGPIWgGIaW2tR4RLYMLT37azAYA2igC5vNfI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733525818; c=relaxed/simple; bh=TEa9fpG06MCn2xXpnGSOftT79fDHkx5qEClt9npvHEI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=cBO/BQUsOR0bob3WtSXOUw2Ms1Qbm5tD3ZMxAApshpSI9/fVINJ1eJ918XzvqKpXREqFvNGY5B9C+uN9+pzIx3rY4UeCfsrLjXOO29dpmGBNVkzX8pXgIx5wSw5v2IeImFQuCfRg/ZLOvXQgFQjCEOEfmmAtlxVnw+As51U8weQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=O57G1RTs; arc=fail smtp.client-ip=52.101.65.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="O57G1RTs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rPpiys0ZyUVkhktIIP5jYeOptJaqoJDkJLnGqAK0vB9NkKpg3aoHPl47J71IaCoEO/LgqS4+DFUspK81J72L5Fqor1WK81JIRQUmrBD+5HJ9bY8SRHRURLpWPjxk9y69OMsSdBcbgiXWn6N+Yq4TzoMfcHdwXTUe+ICw0+Hiy/t9NuxCPIip0DZoxfHGqN4nVT7ldQnDvjteMsh/6MWp8nALjDyE0VIHR46NpMPM6hmz5sfKAIFwh/SYVlAObUNFty6duHNxh14xdlptn6K52JZuKCFgRlYE7n6/KH+HUxXtmxTVTPed64aKL8AVJ8B6s8FMxll8gq+OKPxhaj6j1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u7tO3a7IIm4SWWKLlTCppg9aJ4XfFcJLOY9+xpMscs4=; b=VLB+wSpQUmapweDWNYqNLkWfvK4aFh3/cHd6Ex99kRCxvnIq3dE0NJbPOSRv9D69XG27eubrXbaEhvVA9yhefPW1OubBfYJfd8L2472j7plI4q4JpA1P+EOf/X7f/+KibwU1mIFpIzyWDLcoHyydDtLrmA2GQKLfcIW1BG6oG1nZ6f5ZyCkm0nK2b7iQrZyIMCfciDakj5MsPzSij3bfjGiDm+ZQTObjIm7fcl9kg5P30jrp0mH6+ia3zGrKSLuhSqcwmeZPXTWy2Sr8PthULI4ECIxomdwsS8gqTcT3Gtfx40uyMvsOtPZ4L03CasHNstmtjWn16Crz+6QiqsR+nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u7tO3a7IIm4SWWKLlTCppg9aJ4XfFcJLOY9+xpMscs4=; b=O57G1RTsxyjlT8HtbIBrO7LGRVMQmHtWrl7QsUM5qPkQxQUsRNsa1hKz6O8xd2/lybUIOLYRowR8k/LC7/uge5L2QSWiV+nPHfKk3BEdVMEN5Os/sRtdAemNmQOx+8bVPJ5oG+at0YxjHGgfBCt3KpBqGguC7RkIgUoxJmfCNf1bkBOLIVpMjo9wEoZe5BnUVZsCkVOSHD7YIZYKwDi38NksCKsSktNN859kTALEqphpC5UYbK1EaDAF8MWwCBCydnuuNTeVShlG9THasdHyFGSXMXPKN4+5yNxxkWG26YUDMgQ4YpWOcwux3JlzYuNdNCAwccEE9gDHG1OI9tOrGA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VI0PR04MB10709.eurprd04.prod.outlook.com (2603:10a6:800:262::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Fri, 6 Dec 2024 22:56:52 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.8230.010; Fri, 6 Dec 2024 22:56:52 +0000 From: Frank Li To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] thermal/drivers/qoriq: Power down TMU on system suspend Date: Fri, 6 Dec 2024 17:56:22 -0500 Message-Id: <20241206225624.3744880-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241206225624.3744880-1-Frank.Li@nxp.com> References: <20241206225624.3744880-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0007.namprd07.prod.outlook.com (2603:10b6:a03:505::12) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VI0PR04MB10709:EE_ X-MS-Office365-Filtering-Correlation-Id: 80893bb5-070f-4d38-0077-08dd1649463a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: FWdvtBVthSXb1TkwIXCHIzoj35QAtEepVyvDKtMRGRZBRBNZP0ZxSPZo0jHfsJVILnfXsZM/YCzpU2wmX/XnwIRTf+Oc4C5NynBS2ucBL6NaoRD8/hBD+rBnZu/7suIzzvGxCW5C4joLPGxaX8YnrRQotMiPuGhnnXrAAkOdbvmP9pptJkbFHdOh0ba3O7ylINPWPFXJO93jdz8OQIGGuwx7i6RQ7iXSGyLhkOSb4hdbs94yW3myHkaZiQq0ugTHNv313jHQMcoyhYgXLv4Q37MvFAjOhX90Gw3GPXBnUFH4kHDuhT4vmc4o3o/prCGINlUKR3B4taZCgC+TAhh579jvBrqVTLS9Uzx0m7dKZlHwMMHJDNzC/z1UIDbMhB4/zxuAc6zYA33vndubkyd14SF7KoOUCaXY8zUir5baWx2bUypDo5x8PuiGxCMd92QURY+HSb4/uoklcY+Cf+q3kh2G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13230040)(1800799024)(376014)(52116014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7fnqMsxwiJpgFMzCAZrSCTXHteGO7pWPMGzUnDDpuuJ27FLnOmD3XzV0lVydYGstqnZ+UAQCVevPSQx8FotS5UrFfV8EDzgvDof4TIeOrn+Ud6IQFxko+GPuZhYnuCxc8YlKcJm7QcWZgpqbbfjO2wJlOXn/H66KEUypeUXFvQhTENzjpXTXchq7xvfZTH9tMuK8ISqxfokiKpi5tHT8jMIaCeRqeN1P3o1wsTCV5CVc4QrFLIxrnU6GJzNJOhC6RXMhSJFUrUu3aCGJRvUnymTYcluOlfItYNLqO5ihNNFDKUDsAblgEKStpMQy9xqkogwjZ2mk0JxxCorZL4MEEXO4Q5bfT0skOknXLY0cuqlGZ5KgQYYIjlFonQ1eUatsNLaTMDUXPKJNICyUqWss68Mf9O3RN5KNY731VvGnCYSQG/sHkkLSL1RlMobMBytMVcQ4HO6kL40JrD5KBBaB5QxyDl3Sv1DoakxH/sh0J/kbwd1uKClOPMtqmaoTSGy8oLM61ZkEriEh4Y7dytcfaShmA5hMp6OcXECMGrvCl1zu1XujOSTrwy20rKCFizFcjj8QuFJKW41i86Bl1TWW3QhvSsCP82J+2q4ANLGWa+LKeRo/k3Zzs6SVBOCQzE/y3FmkTFjV0QiKk8y8ygCO1C5lIABWZ5w/aN31QB/rbp+xBO/MDooUqOd7wzdIJKSvFZaDcDpK4JMIS6oTxdYq0Bg1shyj9XpzS53I0zdP9eq78fHj/uaC4+l90P7VTwgeDpx06KfUbKqNBpQi5rpxQ+tqMk7uhcahwKuCxXkR8DOFniXuO8BLNw6sNv6YnY2crsZMWrpbDixG5JeyIR7yERBh7TyZuwuLawsGRDNZtKjztpmI7Po0MH4PeJkdSU8eLZFpkfUBe8e5b/+bAAlUQOz7JkdEtWY7aJjV6mjZi7PPNb0Yyuiq3hL3ywRD02vkQ4ld1YBXGMmwT5ijBXpWzPzNpMZVO3pLa/runqbBmOhvO8+MWP9e6zJg774R0CSoIQ0wEhM6OK9KVGayJK2kdnMRXChSOA/AgRuXe1lyPP6IW4KKqoCfOwfffNh6hEf3UChj1P3khaNSa6+Xu7eP9mKOKJr3YesRqmM9TeieLiHMbqHcy/FT5DwBd66UJSyZ0fGKy8OwzLrxlyKRQPlXnQnEVUfDlDPhhWlG+7aSYhVmd6npRuIiNmHmdeHvyiuNMiGD2bLTni7Q7CsdAB9iJLMOVHhtqjuNEtjvYMMRbz8AyRU+1ryIB2IRa3KNZ06Mz9aLVrPRoho4Vf3Ki6rz2buuBXHsXDg9newQIvl1OA8xB9OSOLfQSCZhWFtNcDMfGeMyGVVnmc50Sj/ixCtgBV+csjyEgi6Gx+3GC3U21KrYv54UKnJ7QbezRDwRUoMwOKBzozeNiumUEMjZyFiWAtxd0zP1qNURcQ8aqvb+uCyuD6eJMbbG3+14qoMyQiRfChnee06h8jtPmH1RkL6FnZx7Gzo29hghkA44roUbVh637g/17tjOjxlu48A4SM3N6L2v7h6+HsTPFrXr8rCnphUqOOSK1oz93sv6oWOlmfUGguC3HVTRtCuuEdnxn1OV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80893bb5-070f-4d38-0077-08dd1649463a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2024 22:56:52.4496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LUfJhNH0Xs09Qo8423VvOpUZH1ji761jsbQJ7z4hErgeJzbaMamSTTAoX7H/eqPnP1j6aTwZZilZGo0QNtJRTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10709 From: Alice Guo Enable power-down of TMU (Thermal Management Unit) for TMU version 2 during system suspend to save power. Save approximately 4.3mW on VDD_ANA_1P8 on i.MX93 platforms. Signed-off-by: Alice Guo Signed-off-by: Frank Li --- drivers/thermal/qoriq_thermal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index baf1b75b97cbe..d95e949321ce3 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -18,6 +18,7 @@ #define SITES_MAX 16 #define TMR_DISABLE 0x0 #define TMR_ME 0x80000000 +#define TMR_CMD BIT(29) #define TMR_ALPF 0x0c000000 #define TMR_ALPF_V2 0x03000000 #define TMTMIR_DEFAULT 0x0000000f @@ -343,6 +344,12 @@ static int qoriq_tmu_suspend(struct device *dev) if (ret) return ret; + if (data->ver > TMU_VER1) { + ret = regmap_set_bits(data->regmap, REGS_TMR, TMR_CMD); + if (ret) + return ret; + } + clk_disable_unprepare(data->clk); return 0; @@ -357,6 +364,12 @@ static int qoriq_tmu_resume(struct device *dev) if (ret) return ret; + if (data->ver > TMU_VER1) { + ret = regmap_clear_bits(data->regmap, REGS_TMR, TMR_CMD); + if (ret) + return ret; + } + /* Enable monitoring */ return regmap_update_bits(data->regmap, REGS_TMR, TMR_ME, TMR_ME); }