From nobody Fri Oct 3 14:34:19 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 7BAE524EA90; Sat, 30 Aug 2025 15:57:06 +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=1756569428; cv=none; b=UFSm3+PgGDQomC0t0hOPjFugQRjTy7rqDB5maIfDy7EQ7bKu1fJvRNiA+QXIb4lcyz6dZdNQ0fsuJyT+OcjOONTcBNBuA1+uTs1FNBgxoKlgT+1VBjALALJS0A4yPz0nOJhH+LdXYtGosm5xFu5C6dZHs2nEeVEez3faXq2fDew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756569428; c=relaxed/simple; bh=TR3dYiXJaEpl0M5QPz3NRcBIUcRMr2+x6i8Z5eZSKvw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R2FsMLtH7LthueBLxD3vM/kqgcA6/yRVh+9BrWy/CPTu3jntFwocr0vlk5mBibl2WhvMLYxtNuvVRpM04JJyxvjuQJebtBPSVsMK7O9215XkU0BJB+SwUUhuwQWEFpVAp7MrzB7qYKzo9B22rfU/yOsGeIyXIXK3HayBYEoqFqk= 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 1usNwq-000000007q1-1HU3; Sat, 30 Aug 2025 15:57:00 +0000 Date: Sat, 30 Aug 2025 16:56:56 +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 1/3] thermal/drivers/mediatek/lvts_thermal: Change lvts commands array to static const Message-ID: 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 c5d5a72c01f7faabe7cc0fd63942c18372101daf ] Change the LVTS commands array to static const in preparation for adding different 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-2-mason-cw.chang@media= tek.com Signed-off-by: Daniel Lezcano Signed-off-by: Daniel Golle --- drivers/thermal/mediatek/lvts_thermal.c | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/medi= atek/lvts_thermal.c index ae063d1bc95f..c24b76bcd18a 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -92,6 +92,17 @@ =20 #define LVTS_MINIMUM_THRESHOLD 20000 =20 +static const u32 default_conn_cmds[] =3D { 0xC103FFFF, 0xC502FF55 }; +/* + * Write device mask: 0xC1030000 + */ +static const u32 default_init_cmds[] =3D { + 0xC1030E01, 0xC1030CFC, 0xC1030A8C, 0xC103098D, 0xC10308F1, + 0xC10307A6, 0xC10306B8, 0xC1030500, 0xC1030420, 0xC1030300, + 0xC1030030, 0xC10300F6, 0xC1030050, 0xC1030060, 0xC10300AC, + 0xC10300FC, 0xC103009D, 0xC10300F1, 0xC10300E1 +}; + static int golden_temp =3D LVTS_GOLDEN_TEMP_DEFAULT; static int golden_temp_offset; =20 @@ -880,7 +891,7 @@ static void lvts_ctrl_monitor_enable(struct device *dev= , struct lvts_ctrl *lvts_ * each write in the configuration register must be separated by a * delay of 2 us. */ -static void lvts_write_config(struct lvts_ctrl *lvts_ctrl, u32 *cmds, int = nr_cmds) +static void lvts_write_config(struct lvts_ctrl *lvts_ctrl, const u32 *cmds= , int nr_cmds) { int i; =20 @@ -963,9 +974,9 @@ static int lvts_ctrl_set_enable(struct lvts_ctrl *lvts_= ctrl, int enable) =20 static int lvts_ctrl_connect(struct device *dev, struct lvts_ctrl *lvts_ct= rl) { - u32 id, cmds[] =3D { 0xC103FFFF, 0xC502FF55 }; + u32 id; =20 - lvts_write_config(lvts_ctrl, cmds, ARRAY_SIZE(cmds)); + lvts_write_config(lvts_ctrl, default_conn_cmds, ARRAY_SIZE(default_conn_c= mds)); =20 /* * LVTS_ID : Get ID and status of the thermal controller @@ -984,17 +995,7 @@ static int lvts_ctrl_connect(struct device *dev, struc= t lvts_ctrl *lvts_ctrl) =20 static int lvts_ctrl_initialize(struct device *dev, struct lvts_ctrl *lvts= _ctrl) { - /* - * Write device mask: 0xC1030000 - */ - u32 cmds[] =3D { - 0xC1030E01, 0xC1030CFC, 0xC1030A8C, 0xC103098D, 0xC10308F1, - 0xC10307A6, 0xC10306B8, 0xC1030500, 0xC1030420, 0xC1030300, - 0xC1030030, 0xC10300F6, 0xC1030050, 0xC1030060, 0xC10300AC, - 0xC10300FC, 0xC103009D, 0xC10300F1, 0xC10300E1 - }; - - lvts_write_config(lvts_ctrl, cmds, ARRAY_SIZE(cmds)); + lvts_write_config(lvts_ctrl, default_init_cmds, ARRAY_SIZE(default_init_c= mds)); =20 return 0; } --=20 2.51.0