From patchwork Thu May 4 00:48:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13230695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFCA7C7EE25 for ; Thu, 4 May 2023 00:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZqdTK0VQs+mzIY3OMPexIVOXLqz1YVtIC4/X4asIMgc=; b=ZSVfACroXuC5ur teKGx+9rKod4qxTeB9KG1IeQcNJ8P3lsb7zw8HCMZk9SlxmcUgyaTS8qCxFF1krJL6GMoe1YWko71 vZVnylHMYSdK+F3t1ifNHiMhxX5WLrpMI1Old7Sd1k9qyhGqpbxpY/Vf+dhy6BXt1IQct1vf6nDlP EWc+Ukm7zr5615Ibgtinu+5OHlfv6/dONWbV1W6XPyLXO3F15lUsBTGhlat4GPlu0+uvfNBCowBEu /DmY2uX8JBfYsyM8VSPdmVm53vQlx0Q1whwvj1QfVD569muSIolQMrKOyyt9hWCmtBDtDl8Ujtkii w7G+7CYh4N+WbtxB/p7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1puN9p-006Cl7-05; Thu, 04 May 2023 00:49:17 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1puN9h-006Cgc-0k; Thu, 04 May 2023 00:49:10 +0000 Received: from notapiano.myfiosgateway.com (unknown [IPv6:2600:4041:5b1a:cd00:524d:e95d:1a9c:492a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 6BBDB66056D3; Thu, 4 May 2023 01:49:06 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1683161348; bh=fUbhCmf/dHoaIVYSRbcBKyqxRL18aThvwys52J7Sof4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XO0QnBwxs1nPLJgCIV47WtMAG8DY0dla4Prw+kZid1soRupcf5YJwSplZSQxhuvNm F9gXSbXjDrlkWG4X12kx5WNxxGzGSorf9hcyqgTBh6goy9aAkCh1+99XU4PXBprHRb S0e5W5zzAByw7+PVwf4yOYpiBe4zO8Pm1dLlQzDwrLlidTf8FyR2v1DzPV+HENRrCU gH0yxiktMs99Ud0YaSSSofPjN7+13dlFFp85BGPWbvP6vqacwb6+56jYxSAY1MAYmc +ROQ/vWzw8qj0XURF0uH5VE/kaQwG9L3nNddYty/Y8CqU1Dyamy9rsACqetaGPsDoX yarrPnHigK4gg== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Daniel Lezcano Cc: kernel@collabora.com, Alexandre Mergnat , Balsam CHIHI , Chen-Yu Tsai , Alexandre Bailon , AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Amit Kucheria , Matthias Brugger , "Rafael J. Wysocki" , Zhang Rui , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH v2 4/6] thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts Date: Wed, 3 May 2023 20:48:50 -0400 Message-Id: <20230504004852.627049-5-nfraprado@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230504004852.627049-1-nfraprado@collabora.com> References: <20230504004852.627049-1-nfraprado@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230503_174909_404900_72D93C45 X-CRM114-Status: GOOD ( 12.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Out of the many interrupts supported by the hardware, the only ones of interest to the driver currently are: * The temperature went over the high offset threshold, for any of the sensors * The temperature went below the low offset threshold, for any of the sensors * The temperature went over the stage3 threshold These are the only thresholds configured by the driver through the OFFSETH, OFFSETL, and PROTTC registers, respectively. The current interrupt mask in LVTS_MONINT_CONF, enables many more interrupts, including data ready on sensors for both filtered and immediate mode. These are not only not handled by the driver, but they are also triggered too often, causing unneeded overhead. Disable these unnecessary interrupts. The meaning of each bit can be seen in the comment describing LVTS_MONINTST in the IRQ handler. Fixes: f5f633b18234 ("thermal/drivers/mediatek: Add the Low Voltage Thermal Sensor driver") Signed-off-by: NĂ­colas F. R. A. Prado --- Changes in v2: - Reworded commit and changed flag to use offset interrupts instead drivers/thermal/mediatek/lvts_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 8449ba6ca90e..efd1e938e1c2 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -63,7 +63,7 @@ #define LVTS_HW_FILTER 0x2 #define LVTS_TSSEL_CONF 0x13121110 #define LVTS_CALSCALE_CONF 0x300 -#define LVTS_MONINT_CONF 0x9FBF7BDE +#define LVTS_MONINT_CONF 0x8300318C #define LVTS_INT_SENSOR0 0x0009001F #define LVTS_INT_SENSOR1 0x001203E0