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 4275222F744; Mon, 2 Jun 2025 14:52:34 +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=1748875954; cv=none; b=qNW6tm8f6RjJ4KUoNGEFRJB1cbilJCfiqutdYfNtS0/tcncqLDpJAiZvjuhRc1wRMxuHma6DHxmlBa+DZubylckbYrRSsjBQPLgSEvxfpDi8ci8F2IvMAUpS/AjN/d1QCLuy5mfznCpn5AAIoiosGJx7ECxYL7wpCOdrlWjSXdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875954; c=relaxed/simple; bh=5LinlyfpFaGC0EBTYVQuDNHqcqB/CJlaMElXIAHxtsM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=duaAEmS7MSCV1zR5ZLdMdxlhYR7BEixmR6vVfmGrKXvgXBk3MskylM3hbFEzQZzpOAm9poxl7ta/wOHJWCBoHKn3En+Tb0q8tM8GkEBxqId1NprpOeq20M5m0qgrHn1hfVwQauR8Xb1M6b/+wL8+wQz6aIuQt9W+MKGxhpRyuaQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cG5xPtSo; 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="cG5xPtSo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7831C4CEEB; Mon, 2 Jun 2025 14:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748875954; bh=5LinlyfpFaGC0EBTYVQuDNHqcqB/CJlaMElXIAHxtsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cG5xPtSo8dsry6+70+rCakTJqDf8XvKbI3Z/IQM9AcAw2uAsh025n6h/QSo/LLLNb jeP6VD0AyExHBJ6R+b3MWebfYvyyWqsJKne+hOmPa21QDL87vl2AHhOm2QFar4rWqn HQl5oTz/wPnGZPeycWEJKa3v7lOh60JG6VHErmXg= 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.15 018/207] thermal/drivers/qoriq: Power down TMU on system suspend Date: Mon, 2 Jun 2025 15:46:30 +0200 Message-ID: <20250602134259.484402418@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134258.769974467@linuxfoundation.org> References: <20250602134258.769974467@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.15-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