[1/4] dt-bindings: thermal: mediatek: Add AP domain to LVTS thermal controllers for mt8195
Message ID | 20230307154524.118541-2-bchihi@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:570d:b0:a1:2e52:cf23 with SMTP id h13csp1992036dyk; Tue, 7 Mar 2023 08:12:08 -0800 (PST) X-Google-Smtp-Source: AK7set9YjID6QCivqvkon0GuONweNUbMxy5q+oxpgqDNOCjF1VQItVxWSifd1bxvUcZqfUyjxnK7 X-Received: by 2002:a05:6402:383:b0:4ac:bd84:43d8 with SMTP id o3-20020a056402038300b004acbd8443d8mr14045271edv.8.1678205528615; Tue, 07 Mar 2023 08:12:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678205528; cv=none; d=google.com; s=arc-20160816; b=E0ajhhS4kvwduddAKvz3evX1ruPJsZcRaCUASITrr2/8YjDkE1gngosZ2H4gP3iTid h9OFNgMTT/XybssHKdLopG5r2QZvcp3EwW0aW44w5oP3CzW437yEmWFwGYPcO3yN1lSV owCpceZpZhhX7CK9GUtZHtvLEtPqZ9u4zuC0Iebw2HoYErykAZOeSN6GLgDPGqzb3bf0 5f1dMtdQwA7TJ1IJ3MmhhM9JZyQFJcgqkpkoLf6pZmMmZ9pd/Y/vTdexr5IAfTiZ1ZnN TXsPCm5rSzMhWjGlmx3hkvnGwRHZetrkrxXzS2XAADvzlzaWjwF5FRx6V/R7KK50/Pti 4iZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+OFCWs6sMvmcACVP359vGdpDLS8nF6pX77Um/B5ZzBQ=; b=EIGpb6gTOBTAe2Fronsu2axx+FSOawfAidOsF7/7RGC++doyvyYTX0Eb9n3bDZtp3v z5+NM3lha1qCHORkDlkTD9sEPsYCcqr95KuQlu8LgJeJ6a0s/FSbLsIRo06T6lop6a2b l1EgjrXlvBwbIz/mz7q1ZWMZ0vfB7jLindygI6FHBLR9IWMtMRJeDKcOPvEw6iZSm0ii bY1jfX/X+BaChScHDOOyhiHR0d0QHoj4e0FKNKpvTQxocLPzfGzMZn0jJfxlXTerHvLp VOuvIFTYy5g7cHWyjc9Tap45dgnAWYMbgqcbOj1QTDAJsqxM04J+L5j8XxfnBXKgu2t4 +QUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=I4Km7Kvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020a056402515000b004c0e68fc53csi11831481edd.267.2023.03.07.08.11.44; Tue, 07 Mar 2023 08:12:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=I4Km7Kvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbjCGPpi (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 7 Mar 2023 10:45:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjCGPpc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 7 Mar 2023 10:45:32 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E443E4ECC2 for <linux-kernel@vger.kernel.org>; Tue, 7 Mar 2023 07:45:29 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id r18so12595299wrx.1 for <linux-kernel@vger.kernel.org>; Tue, 07 Mar 2023 07:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1678203928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+OFCWs6sMvmcACVP359vGdpDLS8nF6pX77Um/B5ZzBQ=; b=I4Km7KvrsZJjag+t2OnVfY3qj3nEqw18rDA/g/UnXtDjeMVyd4k+jsQmwXhiEHzOOo kus9JATGqXhXUaxRpv72NOs1h97nszn7FihQqNJoWCZ4lJ2nBUxLH8V90eL0TPDQu0QI QnkjKYyyNt80BDehpoieSDTVidG4vOfOz8QARoAuzl0FpUgYUQFqaeYZtm8H+1GNymNh e/F9JasTMspKNjy0jKFrRUHz1uU3XzRE/rshBmRHo6TedQ2ljZi4b5ko1viqH4ExiODT mezb4sGJN4y4TEdKqBJ9b97gThmeClR1kvXXs5KWMhrroBsc9N/cws97ENwz8+QX6NQ7 CQ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+OFCWs6sMvmcACVP359vGdpDLS8nF6pX77Um/B5ZzBQ=; b=3jtb7oA2rAyM/rjEDBpDgnqEml5Q481v8tfdJCA9YKCr8ZXx2osOxuKvK7Xd3r0nzt UlTCdByui4MqT1aWuHETt0U1pcn94N+fiMaPWDOdWTjFXSqlpjICQTa5J4vkIakFYtiF EQ9rkbT+KvVV5LOhBMSOe30ZpYENo5C970L2CLabMsBL7CH03IdmUhTKb4NJXJ/Dvp7D 9Xgj1evzNnEXiLE7/GCe0JAQgbR0kfDvbcupoSUgExv984oX2lhaoRWh2tYJpwZ+OIa3 VYOxyK+HOk5cYCK3/zfAi4NbktKQ8w9LgA76rl08kRdj56Tt1eZ/PHqXK5HezQ1F7Ea4 5fuA== X-Gm-Message-State: AO0yUKUKz1PQwljy/OerA6Vbs3XJmW8kHAMNVaomqINSyPW6jrvP85dy 7MDjLJvU1BSQmovAdP52Y1zMIQ== X-Received: by 2002:a5d:4089:0:b0:2c7:3ee7:a44c with SMTP id o9-20020a5d4089000000b002c73ee7a44cmr8371471wrp.65.1678203928444; Tue, 07 Mar 2023 07:45:28 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-248-155.w90-24.abo.wanadoo.fr. [90.24.137.155]) by smtp.gmail.com with ESMTPSA id f2-20020a5d50c2000000b002c704271b05sm12697905wrt.66.2023.03.07.07.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:45:28 -0800 (PST) From: bchihi@baylibre.com To: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, khilman@baylibre.com, james.lo@mediatek.com, rex-bc.chen@mediatek.com Subject: [PATCH 1/4] dt-bindings: thermal: mediatek: Add AP domain to LVTS thermal controllers for mt8195 Date: Tue, 7 Mar 2023 16:45:21 +0100 Message-Id: <20230307154524.118541-2-bchihi@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307154524.118541-1-bchihi@baylibre.com> References: <20230307154524.118541-1-bchihi@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759726040692948917?= X-GMAIL-MSGID: =?utf-8?q?1759726040692948917?= |
Series |
Add LVTS's AP thermal domain support for mt8195
|
|
Commit Message
Balsam CHIHI
March 7, 2023, 3:45 p.m. UTC
From: Balsam CHIHI <bchihi@baylibre.com> Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> --- include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
Comments
Il 07/03/23 16:45, bchihi@baylibre.com ha scritto: > From: Balsam CHIHI <bchihi@baylibre.com> > > Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. > > Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
On Wed, Mar 8, 2023 at 12:46 AM <bchihi@baylibre.com> wrote: > > From: Balsam CHIHI <bchihi@baylibre.com> > > Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. > > Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> > --- > include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/dt-bindings/thermal/mediatek,lvts-thermal.h > index c09398920468..8fa5a46675c4 100644 > --- a/include/dt-bindings/thermal/mediatek,lvts-thermal.h > +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h > @@ -16,4 +16,14 @@ > #define MT8195_MCU_LITTLE_CPU2 6 > #define MT8195_MCU_LITTLE_CPU3 7 > > +#define MT8195_AP_VPU0 8 Can't this start from 0? This is a different hardware block. The index namespace is separate. Same question for MT8192. ChenYu > +#define MT8195_AP_VPU1 9 > +#define MT8195_AP_GPU0 10 > +#define MT8195_AP_GPU1 11 > +#define MT8195_AP_VDEC 12 > +#define MT8195_AP_IMG 13 > +#define MT8195_AP_INFRA 14 > +#define MT8195_AP_CAM0 15 > +#define MT8195_AP_CAM1 16 > + > #endif /* __MEDIATEK_LVTS_DT_H */ > -- > 2.34.1 > >
On 09/03/2023 05:40, Chen-Yu Tsai wrote: > On Wed, Mar 8, 2023 at 12:46 AM <bchihi@baylibre.com> wrote: >> >> From: Balsam CHIHI <bchihi@baylibre.com> >> >> Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. >> >> Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> >> --- >> include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/dt-bindings/thermal/mediatek,lvts-thermal.h >> index c09398920468..8fa5a46675c4 100644 >> --- a/include/dt-bindings/thermal/mediatek,lvts-thermal.h >> +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h >> @@ -16,4 +16,14 @@ >> #define MT8195_MCU_LITTLE_CPU2 6 >> #define MT8195_MCU_LITTLE_CPU3 7 >> >> +#define MT8195_AP_VPU0 8 > > Can't this start from 0? This is a different hardware block. The index > namespace is separate. Same question for MT8192. The ID is used to differentiate the thermal zone identifier in the device tree from the driver. + vpu0-thermal { + polling-delay = <0>; + polling-delay-passive = <0>; + thermal-sensors = <&lvts_ap MT8195_AP_VPU0>; + + trips { + vpu0_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; If MT8195_AP_VPU0 is 0, then the code won't be able to differentiate MT8195_AP_VPU0 and MT8195_MCU_BIG_CPU0 The LVTS driver will call devm_thermal_of_zone_register() with the sensor id. If MT8195_MCU_BIG_CPU0 and MT8195_AP_VPU0 have the same id, then at the moment of registering the MT8195_AP_VPU0, the underlying OF thermal framework code will use MT8195_MCU_BIG_CPU0 description instead because it will be the first to be find in the DT. If MT8195_AP_VPU0 is described in DT before, then the same will happen when registering MT8195_MCU_BIG_CPU0, MT8195_AP_VPU0 will be registered instead. IOW all ids must be different. The namespace is already described by the macro name AFAICS, so whatever the values, we see only the macro names and those IDs are private the kernel implementation. If the numbering is really important, may be something like: #define MT8195_MCU_BIG_CPU0 00 #define MT8195_MCU_BIG_CPU1 01 #define MT8195_MCU_BIG_CPU2 02 #define MT8195_MCU_BIG_CPU3 03 #define MT8195_MCU_LITTLE_CPU0 04 #define MT8195_MCU_LITTLE_CPU1 05 #define MT8195_MCU_LITTLE_CPU2 06 #define MT8195_MCU_LITTLE_CPU3 07 #define MT8195_AP_VPU1 10 #define MT8195_AP_GPU0 11 #define MT8195_AP_GPU1 12 #define MT8195_AP_VDEC 13 #define MT8195_AP_IMG 14 #define MT8195_AP_INFRA 15 #define MT8195_AP_CAM0 16 #define MT8195_AP_CAM1 17 But I would suggest considering this change as a separate patch after the AP domain is added.
On Thu, Mar 9, 2023 at 6:39 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote: > > On 09/03/2023 05:40, Chen-Yu Tsai wrote: > > On Wed, Mar 8, 2023 at 12:46 AM <bchihi@baylibre.com> wrote: > >> > >> From: Balsam CHIHI <bchihi@baylibre.com> > >> > >> Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. > >> > >> Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> > >> --- > >> include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ > >> 1 file changed, 10 insertions(+) > >> > >> diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/dt-bindings/thermal/mediatek,lvts-thermal.h > >> index c09398920468..8fa5a46675c4 100644 > >> --- a/include/dt-bindings/thermal/mediatek,lvts-thermal.h > >> +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h > >> @@ -16,4 +16,14 @@ > >> #define MT8195_MCU_LITTLE_CPU2 6 > >> #define MT8195_MCU_LITTLE_CPU3 7 > >> > >> +#define MT8195_AP_VPU0 8 > > > > Can't this start from 0? This is a different hardware block. The index > > namespace is separate. Same question for MT8192. > > The ID is used to differentiate the thermal zone identifier in the > device tree from the driver. > > + vpu0-thermal { > + polling-delay = <0>; > + polling-delay-passive = <0>; > + thermal-sensors = <&lvts_ap MT8195_AP_VPU0>; > + > + trips { > + vpu0_crit: trip-crit { > + temperature = <100000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + }; > > If MT8195_AP_VPU0 is 0, then the code won't be able to differentiate > MT8195_AP_VPU0 and MT8195_MCU_BIG_CPU0 > > The LVTS driver will call devm_thermal_of_zone_register() with the > sensor id. If MT8195_MCU_BIG_CPU0 and MT8195_AP_VPU0 have the same id, > then at the moment of registering the MT8195_AP_VPU0, the underlying OF > thermal framework code will use MT8195_MCU_BIG_CPU0 description instead > because it will be the first to be find in the DT. > > If MT8195_AP_VPU0 is described in DT before, then the same will happen > when registering MT8195_MCU_BIG_CPU0, MT8195_AP_VPU0 will be registered > instead. > > IOW all ids must be different. I see. I didn't realize the lookup namespace covered the whole platform. In that case, please ignore my request. ChenYu > The namespace is already described by the macro name AFAICS, so whatever > the values, we see only the macro names and those IDs are private the > kernel implementation. > > If the numbering is really important, may be something like: > > #define MT8195_MCU_BIG_CPU0 00 > #define MT8195_MCU_BIG_CPU1 01 > #define MT8195_MCU_BIG_CPU2 02 > #define MT8195_MCU_BIG_CPU3 03 > #define MT8195_MCU_LITTLE_CPU0 04 > #define MT8195_MCU_LITTLE_CPU1 05 > #define MT8195_MCU_LITTLE_CPU2 06 > #define MT8195_MCU_LITTLE_CPU3 07 > > #define MT8195_AP_VPU1 10 > #define MT8195_AP_GPU0 11 > #define MT8195_AP_GPU1 12 > #define MT8195_AP_VDEC 13 > #define MT8195_AP_IMG 14 > #define MT8195_AP_INFRA 15 > #define MT8195_AP_CAM0 16 > #define MT8195_AP_CAM1 17 > > But I would suggest considering this change as a separate patch after > the AP domain is added. > > > -- > <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs > > Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | > <http://twitter.com/#!/linaroorg> Twitter | > <http://www.linaro.org/linaro-blog/> Blog >
On Thu, Mar 09, 2023 at 11:39:13AM +0100, Daniel Lezcano wrote: > On 09/03/2023 05:40, Chen-Yu Tsai wrote: > > On Wed, Mar 8, 2023 at 12:46 AM <bchihi@baylibre.com> wrote: > > > > > > From: Balsam CHIHI <bchihi@baylibre.com> > > > > > > Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. > > > > > > Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> > > > --- > > > include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ > > > 1 file changed, 10 insertions(+) > > > > > > diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/dt-bindings/thermal/mediatek,lvts-thermal.h > > > index c09398920468..8fa5a46675c4 100644 > > > --- a/include/dt-bindings/thermal/mediatek,lvts-thermal.h > > > +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h > > > @@ -16,4 +16,14 @@ > > > #define MT8195_MCU_LITTLE_CPU2 6 > > > #define MT8195_MCU_LITTLE_CPU3 7 > > > > > > +#define MT8195_AP_VPU0 8 > > > > Can't this start from 0? This is a different hardware block. The index > > namespace is separate. Same question for MT8192. > > The ID is used to differentiate the thermal zone identifier in the device > tree from the driver. > > + vpu0-thermal { > + polling-delay = <0>; > + polling-delay-passive = <0>; > + thermal-sensors = <&lvts_ap MT8195_AP_VPU0>; > + > + trips { > + vpu0_crit: trip-crit { > + temperature = <100000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + }; > > If MT8195_AP_VPU0 is 0, then the code won't be able to differentiate > MT8195_AP_VPU0 and MT8195_MCU_BIG_CPU0 > > The LVTS driver will call devm_thermal_of_zone_register() with the sensor > id. If MT8195_MCU_BIG_CPU0 and MT8195_AP_VPU0 have the same id, then at the > moment of registering the MT8195_AP_VPU0, the underlying OF thermal > framework code will use MT8195_MCU_BIG_CPU0 description instead because it > will be the first to be find in the DT. > > If MT8195_AP_VPU0 is described in DT before, then the same will happen when > registering MT8195_MCU_BIG_CPU0, MT8195_AP_VPU0 will be registered instead. > > IOW all ids must be different. That's broken for how producer/consumer phandle+args bindings work. Rob
On Tue, 07 Mar 2023 16:45:21 +0100, bchihi@baylibre.com wrote: > From: Balsam CHIHI <bchihi@baylibre.com> > > Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. > > Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> > --- > include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > Acked-by: Rob Herring <robh@kernel.org>
Hi Rob, On 16/03/2023 23:35, Rob Herring wrote: > On Thu, Mar 09, 2023 at 11:39:13AM +0100, Daniel Lezcano wrote: >> On 09/03/2023 05:40, Chen-Yu Tsai wrote: >>> On Wed, Mar 8, 2023 at 12:46 AM <bchihi@baylibre.com> wrote: >>>> >>>> From: Balsam CHIHI <bchihi@baylibre.com> >>>> >>>> Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. >>>> >>>> Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> >>>> --- >>>> include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ >>>> 1 file changed, 10 insertions(+) >>>> >>>> diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/dt-bindings/thermal/mediatek,lvts-thermal.h >>>> index c09398920468..8fa5a46675c4 100644 >>>> --- a/include/dt-bindings/thermal/mediatek,lvts-thermal.h >>>> +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h >>>> @@ -16,4 +16,14 @@ >>>> #define MT8195_MCU_LITTLE_CPU2 6 >>>> #define MT8195_MCU_LITTLE_CPU3 7 >>>> >>>> +#define MT8195_AP_VPU0 8 >>> >>> Can't this start from 0? This is a different hardware block. The index >>> namespace is separate. Same question for MT8192. >> >> The ID is used to differentiate the thermal zone identifier in the device >> tree from the driver. >> >> + vpu0-thermal { >> + polling-delay = <0>; >> + polling-delay-passive = <0>; >> + thermal-sensors = <&lvts_ap MT8195_AP_VPU0>; >> + >> + trips { >> + vpu0_crit: trip-crit { >> + temperature = <100000>; >> + hysteresis = <2000>; >> + type = "critical"; >> + }; >> + }; >> + }; >> >> If MT8195_AP_VPU0 is 0, then the code won't be able to differentiate >> MT8195_AP_VPU0 and MT8195_MCU_BIG_CPU0 >> >> The LVTS driver will call devm_thermal_of_zone_register() with the sensor >> id. If MT8195_MCU_BIG_CPU0 and MT8195_AP_VPU0 have the same id, then at the >> moment of registering the MT8195_AP_VPU0, the underlying OF thermal >> framework code will use MT8195_MCU_BIG_CPU0 description instead because it >> will be the first to be find in the DT. >> >> If MT8195_AP_VPU0 is described in DT before, then the same will happen when >> registering MT8195_MCU_BIG_CPU0, MT8195_AP_VPU0 will be registered instead. >> >> IOW all ids must be different. > > That's broken for how producer/consumer phandle+args bindings work. Do you mean this is broken for thermal zone description in the DT in general ? What would be the correct approach ?
On 07/03/2023 16:45, bchihi@baylibre.com wrote: > From: Balsam CHIHI <bchihi@baylibre.com> > > Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. > > Signed-off-by: Balsam CHIHI <bchihi@baylibre.com> > --- Applied, thanks
diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/dt-bindings/thermal/mediatek,lvts-thermal.h index c09398920468..8fa5a46675c4 100644 --- a/include/dt-bindings/thermal/mediatek,lvts-thermal.h +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h @@ -16,4 +16,14 @@ #define MT8195_MCU_LITTLE_CPU2 6 #define MT8195_MCU_LITTLE_CPU3 7 +#define MT8195_AP_VPU0 8 +#define MT8195_AP_VPU1 9 +#define MT8195_AP_GPU0 10 +#define MT8195_AP_GPU1 11 +#define MT8195_AP_VDEC 12 +#define MT8195_AP_IMG 13 +#define MT8195_AP_INFRA 14 +#define MT8195_AP_CAM0 15 +#define MT8195_AP_CAM1 16 + #endif /* __MEDIATEK_LVTS_DT_H */