From patchwork Tue Apr 2 03:25:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 13613307 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 3D952CD1294 for ; Tue, 2 Apr 2024 03:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GtvZdTKnencwKn/zILnP1aAaV3EYRH94qY12tDmOvFE=; b=T2zRgfaWaSPr/+IQ6vd9R0Mazq 2cfAVVVHZwxSQ9MDx2hSaVEQQv1ohBoE/6zPG6/qbAT0FO1d5+dAALGD0ET2Bk6oS4YzyrxPv8SyA JoKiN7O/0BRyih8POxUEumzn549qM7iKxKA+6OhmUCCuHP3gE8qmC3bBlNFZzqvfuIPU5WaqO2mmn XDTlknLk+J/iGGzhps/VIyJa6E0dWpMYG8QcHTdxl3t67pAyZfQhsCKVxbxmIXXojwvf2qiBCd9co jb/6ENWRRlBe1Eudlv9f/CHLfyrR6mYnHgw6DBNgNm5ZgIX/ZPpPunKbxJtH0iuIaapFK7PGEp4R6 XqUhRIQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrUob-00000009ZSv-2ysu; Tue, 02 Apr 2024 03:28:01 +0000 Received: from pb-smtp21.pobox.com ([173.228.157.53]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrUoX-00000009ZPq-2TCp for linux-mediatek@lists.infradead.org; Tue, 02 Apr 2024 03:27:59 +0000 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 8D9C8219D9; Mon, 1 Apr 2024 23:27:50 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=wTzEj69iJ8UoY4X2yX7ncL39y AKgdIL2Ul1L8AhX++A=; b=fd0iWhvyntza8TapvhppInXFDp22mCSrVIgm1458c p3rHiOcjLW/76tBSLHQSwzwzyZIBsnceBqBcrEvvb8L4UjfxRBa9/jE1UBjQ2bws QuPuMHO7pmPAVRiDl3Je652M2Pn7Hu+KDuVb8/PZa8aNKBRw5SWioYkgtK0RK7Lq XU= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 86018219D8; Mon, 1 Apr 2024 23:27:50 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=2016-12.pbsmtp; bh=8mS5L7XcBU/PWbB5RoWRI1Hd7hvWa++aPqY1Xp/FvFM=; b=lodCUTZqTeLxV9bFpo8dQkPwCV7hx0oO7MSNhGyP16hG+6uxc3i+Mn+AIgEPJdmgGqmQZWxIet7+tp53rg/OpaTX/5cuIv5VQBoLX4dfqiJ/pMSDslPzQD5Dz6qu+oAjmyHJr3uA9b1OjecMGuXpjaP7YfCNbjUKLp4XrXRiRps= Received: from yoda.fluxnic.net (unknown [24.201.101.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 85C76219D1; Mon, 1 Apr 2024 23:27:46 -0400 (EDT) (envelope-from nico@fluxnic.net) Received: from xanadu.lan (OpenWrt.lan [192.168.1.1]) by yoda.fluxnic.net (Postfix) with ESMTPSA id 58CF1C1CEC7; Mon, 1 Apr 2024 23:27:44 -0400 (EDT) From: Nicolas Pitre To: Daniel Lezcano , linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org Cc: Nicolas Pitre , AngeloGioacchino Del Regno Subject: [PATCH v2 01/15] thermal/drivers/mediatek/lvts_thermal: retrieve all calibration bytes Date: Mon, 1 Apr 2024 23:25:35 -0400 Message-ID: <20240402032729.2736685-2-nico@fluxnic.net> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402032729.2736685-1-nico@fluxnic.net> References: <20240402032729.2736685-1-nico@fluxnic.net> MIME-Version: 1.0 X-Pobox-Relay-ID: F9744980-F0A0-11EE-AAD3-A19503B9AAD1-78420484!pb-smtp21.pobox.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240401_202757_905590_BAF8D7BD X-CRM114-Status: GOOD ( 13.01 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Nicolas Pitre Calibration values are 24-bit wide. Those values so far appear to span only 16 bits but let's not push our luck. Found while looking at the original Mediatek driver code. Signed-off-by: Nicolas Pitre --- 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 98d9c80bd4..8aa6a8675b 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -679,7 +679,7 @@ static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl for (i = 0; i < lvts_ctrl_data->num_lvts_sensor; i++) memcpy(&lvts_ctrl->calibration[i], - efuse_calibration + lvts_ctrl_data->cal_offset[i], 2); + efuse_calibration + lvts_ctrl_data->cal_offset[i], 3); return 0; }