From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7C8F023184E; Mon, 2 Jun 2025 14:45:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875505; cv=none; b=BInFD9TjG/FtQNyK6KNdWNgslBpdR1plAm4AY8K6GkLH+uPSDSrsr18KsBuq/syjO81EjoUrYomR2NW3Kuv4y3bHvcjWtuR6gZi9pqxyY+f71prQ6AWcYLVpqG22yba9Dfri3A3U7WKOm1uC6kBTI1mEXfe0b+uKaMuYVL1jWUQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875505; c=relaxed/simple; bh=yAFbNqrzatFuxwSQ6fHBjfhV7PdoD5zc4uSc8GVhk8k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Woprs13RGUiCMjWddfXIIGXpyUr8/Uu7u2gkN71ZLDeojP3YYIja9OhZxaTNsW8wdvIoQha4tDASOH43RFCF4hwlkfY/+7BNdB4eKFnwvQvAon5qfueFTLQf7y+qo4P/8GGS+5kFjaptT1v87KioetID52Bp8QKU0ritXujfwl8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GVE0w6/0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GVE0w6/0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 875B8C4CEEB; Mon, 2 Jun 2025 14:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748875505; bh=yAFbNqrzatFuxwSQ6fHBjfhV7PdoD5zc4uSc8GVhk8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GVE0w6/0XwS4EDU3SGIqUXKlIXhzM2XLdcf1AeJuk0i2lL6dfn7gELukPDf4IDQlE PKp/ncqW0V/gzU3UeTtcuQwIVRl4ySlTsr+e21wwVxyzi+UzEZcup/XSPTljLJ30Pm N9CgMTK7R0g3ggZN+z0TcIcckTOKryMz/Bd9eR+4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alice Guo , Frank Li , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.10 128/270] thermal/drivers/qoriq: Power down TMU on system suspend Date: Mon, 2 Jun 2025 15:46:53 +0200 Message-ID: <20250602134312.461537027@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134307.195171844@linuxfoundation.org> References: <20250602134307.195171844@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alice Guo [ Upstream commit 229f3feb4b0442835b27d519679168bea2de96c2 ] 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 Link: https://lore.kernel.org/r/20241209164859.3758906-2-Frank.Li@nxp.com Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- 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 73049f9bea252..34a5fbcc3d200 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -19,6 +19,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 @@ -345,6 +346,12 @@ static int __maybe_unused 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; @@ -359,6 +366,12 @@ static int __maybe_unused 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); } -- 2.39.5