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 3EE801D63EF; Tue, 27 May 2025 16:50:16 +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=1748364616; cv=none; b=gSS9p1A+HghxR2FYmJyxDpXzJtfrjtFzansvtflE+2kFldU87SLGS8nebA3DQulEichafuybVshWC4PacYeqSLOEU5sc/SSMDsHCLQ8y6CrAybUVqjQ52BwE1OEaTF8CVs17gVdoqX89mmlqAK+hap/71m88Jha8FRr1oA0i1XQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748364616; c=relaxed/simple; bh=9P5Uv767KU/eK4roLUAB44eyaGo7D92Nky2GGdbDMzc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DKfbiJz/4Q48g8iAQcoiHW7qer4muCXDdsaSxdSqrIZyvqI3h6o4G9RXm9JHFYyY+zcqRjgQVaYDbK5IDtxZq5J9GyFat+hPm7e8pVz4n6pilk4Cs6JDECEhQimYnT1P/ws5QNBqvaBHRVkOUp63DUK+VzNBVil0pWPzQ9giLuc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qkuato6s; 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="qkuato6s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 833E0C4CEE9; Tue, 27 May 2025 16:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748364616; bh=9P5Uv767KU/eK4roLUAB44eyaGo7D92Nky2GGdbDMzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qkuato6sfz/vSdmv48q3i3njGxM2gatzyEqqTvOU2BheD3UxcFMMTttJ5jOnQogPB wa1GU1GR7Md+3IyqYpyqJX/ufFfxdJ7ecyYsgGnCe6Z04uOzMdpZZE9vkMjrw9ExaO ZJdEEzT32et6bsjADG5A01NTU1uNg8s9cuTpturk= 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 6.12 081/626] thermal/drivers/qoriq: Power down TMU on system suspend Date: Tue, 27 May 2025 18:19:34 +0200 Message-ID: <20250527162448.339634171@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@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 6.12-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 52e26be8c53df..aed2729f63d06 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 @@ -356,6 +357,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; @@ -370,6 +377,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); } -- 2.39.5