From nobody Fri Oct 3 14:29:34 2025 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99D7D27E1AC; Sat, 30 Aug 2025 15:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756569448; cv=none; b=u3qtH70XCbzANZRKpr/aYHSPWxogDFmeU2bOGyDwaT0uwL3dHSt4sUpa5KJRn6hM0xl4U2AADVD/4yuwkp8SpwvG4g7+4a4SrSvg3T0BcmY12Y311cJEzkuUnmwNSFY/vBgtATCSS0bhiNWhS14Q1Fa5J2Q+hJiGikD4/76L0S0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756569448; c=relaxed/simple; bh=wESNMmETSujCZDADuk72y+hfY7Tabce4sDTR2e+7eYk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tPilXwLUgBZsQ6RVa/HW1bRw56O01w6mHn/r4YTI1EmAOvHFGjscUdkTKzzchBYKGsfxbWpp907XD+kvvjYxqz7OdCOD2N97SbsNr+p0kl81/RZFigIc2LMuJrOkHsu6MKhW3VpmuQNV1d/Q7lwLhb6R9UmXIuuHqk6wyEWI6jk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.98.2) (envelope-from ) id 1usNxA-000000007rf-2P6a; Sat, 30 Aug 2025 15:57:20 +0000 Date: Sat, 30 Aug 2025 16:57:17 +0100 From: Daniel Golle To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Matthias Brugger , AngeloGioacchino Del Regno , Daniel Golle , =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado , Greg Kroah-Hartman , Mason Chang , Arnd Bergmann , Frank Wunderlich , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Chad Monroe Subject: [PATCH linux-stable 6.12 3/3] thermal/drivers/mediatek/lvts_thermal: Add mt7988 lvts commands Message-ID: <253c49132453481a74fa3ef59f0b85a51bc9d4c6.1756568900.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mason Chang [ Upstream commit 685a755089f95b7e205c0202567d9a647f9de096 ] These commands are necessary to avoid severely abnormal and inaccurate temperature readings that are caused by using the default commands. Fixes: 585e92e6a79f ("thermal/drivers/mediatek/lvts_thermal: Add mt7988 sup= port") Signed-off-by: Mason Chang Link: https://lore.kernel.org/r/20250526102659.30225-4-mason-cw.chang@media= tek.com Signed-off-by: Daniel Lezcano Signed-off-by: Daniel Golle --- drivers/thermal/mediatek/lvts_thermal.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/medi= atek/lvts_thermal.c index 239476152bab..017191b9f864 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -1421,6 +1421,8 @@ static int lvts_resume(struct device *dev) } =20 static const u32 default_conn_cmds[] =3D { 0xC103FFFF, 0xC502FF55 }; +static const u32 mt7988_conn_cmds[] =3D { 0xC103FFFF, 0xC502FC55 }; + /* * Write device mask: 0xC1030000 */ @@ -1431,6 +1433,12 @@ static const u32 default_init_cmds[] =3D { 0xC10300FC, 0xC103009D, 0xC10300F1, 0xC10300E1 }; =20 +static const u32 mt7988_init_cmds[] =3D { + 0xC1030300, 0xC1030420, 0xC1030500, 0xC10307A6, 0xC1030CFC, + 0xC1030A8C, 0xC103098D, 0xC10308F1, 0xC1030B04, 0xC1030E01, + 0xC10306B8 +}; + /* * The MT8186 calibration data is stored as packed 3-byte little-endian * values using a weird layout that makes sense only when viewed as a 32-b= it @@ -1725,11 +1733,11 @@ static const struct lvts_ctrl_data mt8195_lvts_ap_d= ata_ctrl[] =3D { =20 static const struct lvts_data mt7988_lvts_ap_data =3D { .lvts_ctrl =3D mt7988_lvts_ap_data_ctrl, - .conn_cmd =3D default_conn_cmds, - .init_cmd =3D default_init_cmds, + .conn_cmd =3D mt7988_conn_cmds, + .init_cmd =3D mt7988_init_cmds, .num_lvts_ctrl =3D ARRAY_SIZE(mt7988_lvts_ap_data_ctrl), - .num_conn_cmd =3D ARRAY_SIZE(default_conn_cmds), - .num_init_cmd =3D ARRAY_SIZE(default_init_cmds), + .num_conn_cmd =3D ARRAY_SIZE(mt7988_conn_cmds), + .num_init_cmd =3D ARRAY_SIZE(mt7988_init_cmds), .temp_factor =3D LVTS_COEFF_A_MT7988, .temp_offset =3D LVTS_COEFF_B_MT7988, .gt_calib_bit_offset =3D 24, --=20 2.51.0