From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7D9D42DC33B; Tue, 2 Sep 2025 13:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756820101; cv=none; b=t1Kjk3c3KBRlRXLZneAp+8LYA6a1VTHN21JTZJ8fzWe4rvgyC2jcBx+zViibDa0vQYr0ZfXeue4o4pqKohHhFXawITqVAbvxSsp/jGxZtFPRd5VwSnNU4uJwtNC+hBpnaZIdh+lHrProh8TEIfsVCRO0JXRx6sOb1R1ASOqAIes= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756820101; c=relaxed/simple; bh=f3PQIW/5Cc5ZQS2qf+tQTIY2PM2L1Mo084vHu3q50kg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lvv3tJCXg5jBE5JnDfcVuyqmULE2kMJ7SSuWgAw52/9FZ46oZ9NmBS5EZYXyzE8jpbhLKOGVJ5latwcGCZKms7NUkwuzOlzZxKv0qIr1tVCsISLowZbQE4DaXc6fMjiAVZXYTkngaB/NVPp5xUCqswexvCWBBfA2ddOiqTrhnVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LDBM4eOT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="LDBM4eOT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2810C4CEED; Tue, 2 Sep 2025 13:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756820101; bh=f3PQIW/5Cc5ZQS2qf+tQTIY2PM2L1Mo084vHu3q50kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LDBM4eOTvH4YeKB+qimRpSJe2vm8Uo/+MX47jQtVIqWVPfg8IeUNDFr3EJGGkl1QP yy+xEo+/8YGqnfg1kP4bd4TAAy1RqksoVC18EbqMXwDcT2gyRIWm3baCnrSQrGYKoM jq9U8uK7qY0rN8zeb+erO4GuLm0fHYhnuHvXK4s8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mason Chang , Daniel Lezcano , Daniel Golle Subject: [PATCH 6.12 93/95] thermal/drivers/mediatek/lvts_thermal: Change lvts commands array to static const Date: Tue, 2 Sep 2025 15:21:09 +0200 Message-ID: <20250902131943.170396960@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250902131939.601201881@linuxfoundation.org> References: <20250902131939.601201881@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mason Chang commit c5d5a72c01f7faabe7cc0fd63942c18372101daf upstream. Change the LVTS commands array to static const in preparation for adding different commands. Signed-off-by: Mason Chang Link: https://lore.kernel.org/r/20250526102659.30225-2-mason-cw.chang@mediatek.com Signed-off-by: Daniel Lezcano Signed-off-by: Daniel Golle Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/mediatek/lvts_thermal.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -92,6 +92,17 @@ #define LVTS_MINIMUM_THRESHOLD 20000 +static const u32 default_conn_cmds[] = { 0xC103FFFF, 0xC502FF55 }; +/* + * Write device mask: 0xC1030000 + */ +static const u32 default_init_cmds[] = { + 0xC1030E01, 0xC1030CFC, 0xC1030A8C, 0xC103098D, 0xC10308F1, + 0xC10307A6, 0xC10306B8, 0xC1030500, 0xC1030420, 0xC1030300, + 0xC1030030, 0xC10300F6, 0xC1030050, 0xC1030060, 0xC10300AC, + 0xC10300FC, 0xC103009D, 0xC10300F1, 0xC10300E1 +}; + static int golden_temp = LVTS_GOLDEN_TEMP_DEFAULT; static int golden_temp_offset; @@ -880,7 +891,7 @@ static void lvts_ctrl_monitor_enable(str * 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; @@ -963,9 +974,9 @@ static int lvts_ctrl_set_enable(struct l static int lvts_ctrl_connect(struct device *dev, struct lvts_ctrl *lvts_ctrl) { - u32 id, cmds[] = { 0xC103FFFF, 0xC502FF55 }; + u32 id; - lvts_write_config(lvts_ctrl, cmds, ARRAY_SIZE(cmds)); + lvts_write_config(lvts_ctrl, default_conn_cmds, ARRAY_SIZE(default_conn_cmds)); /* * LVTS_ID : Get ID and status of the thermal controller @@ -984,17 +995,7 @@ static int lvts_ctrl_connect(struct devi static int lvts_ctrl_initialize(struct device *dev, struct lvts_ctrl *lvts_ctrl) { - /* - * Write device mask: 0xC1030000 - */ - u32 cmds[] = { - 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_cmds)); return 0; }