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: 13372096 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 C2BA3CA0FE1 for ; Fri, 1 Sep 2023 06:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WYttLDCfhSCFxKufWQTJm+SdWNk8ml/opxZYoHJTyPU=; b=BthxG9FPc1Jec0 gklSAxp29Udd5YyTKMTh5DRTl2C10DBbuiQgozPlz+/kN2uzsLisDtKjqEAMSzS6YOiIFDVrTAHXX ZECuO0nnB3IBG42xkD711ZnwL8T/fep4gyytlxDdWrBCX11LoyyKKAwnuGnxSOMqdEV91kjcZhcNL wxV3CL2ljK1/ShgTMg5Jeb0YQQRCAr7/KDzvG3muTkvIHLMjsIKtsQbPPTP+Mlp4xN5c4cO9zz+az lL0IYhAFrd2glVUi7xQGuJR01FC3ADCygcGVpXevy7u9GPdbGc14LsUc3Ncd7MUK0rmJbWq3pGEzd s57hZK64UCRuQO+tdRnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbxmw-00GYIV-1n; Fri, 01 Sep 2023 06:37:50 +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 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-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Lezcano , linux-pm@vger.kernel.org, Amit Kucheria , Daniel Golle , stable@vger.kernel.org, linux-kernel@vger.kernel.org, Amjad Ouled-Ameur , Matthias Brugger , Zhang Rui , linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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)