From patchwork Fri Sep 1 06:37:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13372099 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 86B1DCA0FE6 for ; Fri, 1 Sep 2023 06:38:18 +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: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:In-Reply-To:References: List-Owner; bh=rlbAtsyewa35mSaYggbhSCzF5GpUrDVJ3+QrNTHrjEk=; b=DJRbW4g8Q6r7uk 7OS3sc1b5/wtyI/kKoBhP8RqN9cYLemi8q0KSd4V4zmKv4K7kdbccvtiM2U5G1ZxcrdgtZ81tfOUe Wq/lLzuchfI8kHcaxki3X6x1votI4K36YFFAlhbcrpCRF/RBLM9N/DPdyZ2cGoKGHh4OKXZ5+pyAn CFyRq/YnJIf0ZkC/lAXF4HAvAfSwrc9g5/BewpHKOoOvgexx8DxTIKx2DOi5L4QDCX8W0uZPG/lud /e1XYIhI/ok+CTxNJW/HIypTgGOeDAb65pXznV4vu+rC1wEFsu6ipfkDs7ghr0e5wF+xXMbLYqsqu NoeopxlUZt4PR6E3nwPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbxmv-00GYIO-2p; Fri, 01 Sep 2023 06:37:49 +0000 Received: from mxout2.routing.net ([2a03:2900:1:a::b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbxms-00GYHk-07; Fri, 01 Sep 2023 06:37:47 +0000 Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout2.routing.net (Postfix) with ESMTP id B146A60420; Fri, 1 Sep 2023 06:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1693550260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WYttLDCfhSCFxKufWQTJm+SdWNk8ml/opxZYoHJTyPU=; b=unVnqlJe7L3VtfTscf+t8jVQLTsxeehFoDe6ZgslGkCtSZXYLAyXFa8TeRZARbfTv6D1AV 9Ihq2PpIpKt8BXQ2FpwKBZ8AAVUf31PY22Z7L99q5Kpf3u3HpyvVRAMaBa64c7YS95VeNH nLtAQzRS0c28xbmNKq+XtfvvU6uIQMk= Received: from frank-G5.. (fttx-pool-80.245.79.3.bambit.de [80.245.79.3]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id B01E03602D4; Fri, 1 Sep 2023 06:37:39 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Daniel Lezcano , Amit Kucheria , Zhang Rui , Matthias Brugger , AngeloGioacchino Del Regno , Amjad Ouled-Ameur , Daniel Golle , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org Subject: [RFC] thermal/drivers/mediatek: fix temperature on mt7986 Date: Fri, 1 Sep 2023 08:37:30 +0200 Message-Id: <20230901063730.7577-1-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Mail-ID: 34822b24-5ea6-4a61-a66e-084d6433f5b6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230831_233746_615936_EAFCA1A0 X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. 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 From: Frank Wunderlich Reading thermal sensor on mt7986 devices returns invalid temperature: bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp -274000 Fix this by adding missing members in mtk_thermal_data struct which were used in mtk_thermal_turn_on_buffer after commit 33140e668b10. Cc: stable@vger.kernel.org Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks") Signed-off-by: Frank Wunderlich --- drivers/thermal/mediatek/auxadc_thermal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c index f59d36de20a0..ed08767eaa60 100644 --- a/drivers/thermal/mediatek/auxadc_thermal.c +++ b/drivers/thermal/mediatek/auxadc_thermal.c @@ -691,6 +691,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = { .adcpnp = mt7986_adcpnp, .sensor_mux_values = mt7986_mux_values, .version = MTK_THERMAL_V3, + .apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1, + .apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3), + .apmixed_buffer_ctl_set = BIT(0), }; static bool mtk_thermal_temp_is_valid(int temp)