Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3653886pxb; Mon, 24 Jan 2022 14:31:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbb9vsVUd41zXc4/XSGUeyJwlRXZlmQ7gvt4iWmw32zKivXHId2ioOV/pGvKoqS3+sZW9T X-Received: by 2002:a17:902:a603:b0:14a:d5f6:3489 with SMTP id u3-20020a170902a60300b0014ad5f63489mr16214639plq.55.1643063511928; Mon, 24 Jan 2022 14:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063511; cv=none; d=google.com; s=arc-20160816; b=uqDm9h8fWiswAlhP80Aa78n8mJDqS1y6eznYuNLsohuzlgM22aQ4KIxfNa9ThEK72G P4aIULLNXhwJ1al9B/Oz0eBjuaBTo2curpAB4R2FlBuweH4pa3KQbujBNcmpTTwf7H8o 4Sb/iI0RVhoF4M0VQTFVMxShM2SISXmdgsWksIzqaxUI5usSWOw/A5p1OqZ29aR4EN0w e1dIpu8/tlHJGP3lYSdz+4LWmlxwyTah+BL0Oa7jwCBa0p2B5FybxmH8KxdyP7/g2sdI VDFdYJcelSpBKeGWeU245TuhixogAwE3I3nGxx98Wo7UCd7xcg0gf5QRuW2NpAELU34q pEnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=shwu2zzlSPpkxEhTKo7nWq6yM6LS+i8QPAO9OGTyJ3I=; b=c3vxUHuD0m0Nza1CWvo+F5HAdWzYvhFy32NJKpZlQtEnyD4RWAS/zYaAg8d4MeVPnS Hy2w/R0NQ+/1rbMBmQwAPhOHpA34NETPkq31iFNKWKJKCrUHrSsCpuNBX/JLd2jV3WiO ZNdT8ySXq0K7wYK8Z/NP/EqCNWEzlutPogE3Olxr+GTYabFI61+BmCjWCoWmjjor9msA X8y5bvKxSvgBc6rVzz8fkz8v0zJlP0rw15ML/1fotv8bZdAbB79gb6Z7/KuVZS97jb4g b1s1dRNMMv0Z0GBrtO28VoyjuyZ4KD3zC3EzeEk8CwsbXM2cQXOXq7yhLP6kr4ZgLAE2 dJcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bM/I6KqE"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si7017380pfs.286.2022.01.24.14.31.39; Mon, 24 Jan 2022 14:31:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bM/I6KqE"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1584369AbiAXWUy (ORCPT + 99 others); Mon, 24 Jan 2022 17:20:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377826AbiAXV3S (ORCPT ); Mon, 24 Jan 2022 16:29:18 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D228EC0AD194; Mon, 24 Jan 2022 12:19:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 53E3CB81229; Mon, 24 Jan 2022 20:19:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CE95C340E5; Mon, 24 Jan 2022 20:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055555; bh=m3XBgkr5Z/eZ+k0EKJIVJa2TImDNP6ACO8ML6NlEFfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bM/I6KqEuK879SFWOOtXkxPEezHsXY+6MDIY8pEk0b0OCFCUGOgLkMds4JEXRq0jh 7lUvLgXeb+Tx2RYYf/ZEmn3wvEHTVqQLo5JLVHXtsfD1ZPBsLUlD1JD39LB+obNMOn kl8lhqLkTgdgpo8C59gpfNFU81ZL2po5UtQpwzxA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Gerber , Alexander Stein , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.15 182/846] thermal/drivers/imx8mm: Enable ADC when enabling monitor Date: Mon, 24 Jan 2022 19:34:59 +0100 Message-Id: <20220124184107.256945987@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Gerber [ Upstream commit 3de89d8842a2b5d3dd22ebf97dd561ae0a330948 ] The i.MX 8MP has a ADC_PD bit in the TMU_TER register that controls the operating mode of the ADC: * 0 means normal operating mode * 1 means power down mode When enabling/disabling the TMU, the ADC operating mode must be set accordingly. i.MX 8M Mini & Nano are lacking this bit. Signed-off-by: Paul Gerber Signed-off-by: Alexander Stein Fixes: 2b8f1f0337c5 ("thermal: imx8mm: Add i.MX8MP support") Link: https://lore.kernel.org/r/20211122114225.196280-1-alexander.stein@ew.tq-group.com Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/thermal/imx8mm_thermal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c index 7442e013738f8..af666bd9e8d4d 100644 --- a/drivers/thermal/imx8mm_thermal.c +++ b/drivers/thermal/imx8mm_thermal.c @@ -21,6 +21,7 @@ #define TPS 0x4 #define TRITSR 0x20 /* TMU immediate temp */ +#define TER_ADC_PD BIT(30) #define TER_EN BIT(31) #define TRITSR_TEMP0_VAL_MASK 0xff #define TRITSR_TEMP1_VAL_MASK 0xff0000 @@ -113,6 +114,8 @@ static void imx8mm_tmu_enable(struct imx8mm_tmu *tmu, bool enable) val = readl_relaxed(tmu->base + TER); val = enable ? (val | TER_EN) : (val & ~TER_EN); + if (tmu->socdata->version == TMU_VER2) + val = enable ? (val & ~TER_ADC_PD) : (val | TER_ADC_PD); writel_relaxed(val, tmu->base + TER); } -- 2.34.1