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 81B74228C99; Mon, 2 Jun 2025 14:06:03 +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=1748873163; cv=none; b=iL7ol5FZ16ncwlvYihiIBBFjNckEBTopLtP0HUsbDefau/5gSKlr9Mqk8u3YdO7w4fBCxWN24JYxpZFQT38aw9V20KyA352s11ngup0zps8I/98Xgx/Aq2nBCzWVNBv3jEooFbnr8w939vzV1pXf0P6yWM/UuZdxNW4vN88sxJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748873163; c=relaxed/simple; bh=df012jymOhCaPnGex1f3+zcJhC1GZq5rf1B78IZknCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mUeRBOBnKHJR1J1/RF+5MdDDhVTouzmfl9hUmddFsxYsce/RCdwIkiWi7m7e40+qXMUnd5IYIo2hYCAh4h1eT/OxO8wBWeDK5XIVG0eyw2Od1ZqK95nju13uy/z1YjkUUlWLLGNcMle7mpzzObzztEEOe62i/5x+euiLzkuwZ1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=biwfD01g; 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="biwfD01g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E64B0C4CEEE; Mon, 2 Jun 2025 14:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748873163; bh=df012jymOhCaPnGex1f3+zcJhC1GZq5rf1B78IZknCo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=biwfD01gMUMUsNS3cXF6Y6tp3agNdmdEBqPN8zZQ7ajqJUwFp1tKvTtJhrzQQsXG0 0FlWRUrqjmvVxS+daui1v2IsXGwPIE6rQdQFsxYy15sOw/GvmckZAVgc36Bjg6aF3g VcA449QSs2zPpK9v+yoqj+mNqNCqVM6fEtkQnsro= 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.6 058/444] thermal/drivers/qoriq: Power down TMU on system suspend Date: Mon, 2 Jun 2025 15:42:02 +0200 Message-ID: <20250602134343.281948402@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134340.906731340@linuxfoundation.org> References: <20250602134340.906731340@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.6-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 404f01cca4dab..ff8657afb31d3 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 __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; @@ -370,6 +377,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