From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Frank Wunderlich <linux@fw-web.de>, linux-mediatek@lists.infradead.org
Cc: Frank Wunderlich <frank-w@public-files.de>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/4] thermal/drivers/mediatek/lvts_thermal: add mt7988 support
Date: Thu, 21 Sep 2023 13:17:08 +0200 [thread overview]
Message-ID: <fb716cdf-12eb-8d85-3b9d-b1d5e5aee212@collabora.com> (raw)
In-Reply-To: <F68F7C77-BB1E-4D9F-B760-9B35DE3693C5@fw-web.de>
Il 21/09/23 12:39, Frank Wunderlich ha scritto:
> Am 21. September 2023 09:54:35 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:
>> Il 20/09/23 19:50, Frank Wunderlich ha scritto:
>>> From: Frank Wunderlich <frank-w@public-files.de>
>
>>> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
>>> index c2669f405a94..8fd1dc5adb16 100644
>>> --- a/drivers/thermal/mediatek/lvts_thermal.c
>>> +++ b/drivers/thermal/mediatek/lvts_thermal.c
>>> @@ -82,6 +82,8 @@
>>> #define LVTS_GOLDEN_TEMP_DEFAULT 50
>>> #define LVTS_COEFF_A_MT8195 -250460
>>> #define LVTS_COEFF_B_MT8195 250460
>>> +#define LVTS_COEFF_A_MT7988 -204650
>>> +#define LVTS_COEFF_B_MT7988 204650
>>> #define LVTS_MSR_IMMEDIATE_MODE 0
>>> #define LVTS_MSR_FILTERED_MODE 1
>>> @@ -89,6 +91,7 @@
>>> #define LVTS_MSR_READ_TIMEOUT_US 400
>>> #define LVTS_MSR_READ_WAIT_US (LVTS_MSR_READ_TIMEOUT_US / 2)
>>> +#define LVTS_HW_SHUTDOWN_MT7988 105000
>>
>> I would simply reuse the definition of LVTS_HW_SHUTDOWN_MT8195....
>
> Hi angelo,
> thanks for review.
>
> Imho it should be separated...if someone thinks it needs to be changed later it will be changed not only for mt8195...a generic name can also cause problems if the next soc has different value.
>
Okay, I don't really have strong opinions against that anyway.
Cheers
Angelo
>>> #define LVTS_HW_SHUTDOWN_MT8195 105000
>>> #define LVTS_MINIMUM_THRESHOLD 20000
>>> @@ -1269,6 +1272,41 @@ static int lvts_remove(struct platform_device *pdev)
>>> return 0;
>>> }
>>> +/*
>>> + * LVTS MT7988
>>> + */
>>> +
>>
>> Please remove this big comment block, that's not needed.
>
> Ok,i drop the comments (maybe except the wed one where the name in technical document (i used for constants) does not point to wed function.
>
>>> +static const struct lvts_ctrl_data mt7988_lvts_ap_data_ctrl[] = {
>>> + {
>>> + .cal_offset = { 0x00, 0x04, 0x08, 0x0c }, //918,91C,920,924
>>
>> This 918,91c,etc comment is not necessary
>>
>>> + .lvts_sensor = {
>>> + { .dt_id = MT7988_CPU_0 }, // CPU 0,1
>>
>> If you want to retain those comments, you shall use the right style.
>>
>> { .dt_id = MT7988_CPU_0 }, /* CPU 0,1 */
>> { .. } /* CPU 2,3 */
>> { .. } /* Internal 2.5G PHY 1 */
>>
>> etc
>>
>>> + { .dt_id = MT7988_CPU_1 }, // CPU 2,3
>>> + { .dt_id = MT7988_ETH2P5G_0 }, // internal 2.5G Phy 1
>>> + { .dt_id = MT7988_ETH2P5G_1 } // internal 2.5G Phy 2
>>> + },
>>> + .num_lvts_sensor = 4,
>>> + .offset = 0x0,
>>> + .hw_tshut_temp = LVTS_HW_SHUTDOWN_MT7988,
>>> + },
>>> + {
>>> + .cal_offset = { 0x14, 0x18, 0x1c, 0x20 }, //92C,930,934,938
>>
>> comment not needed
>>
>>> + .lvts_sensor = {
>>> + { .dt_id = MT7988_TOPS_0}, // TOPS > + { .dt_id = MT7988_TOPS_1}, // TOPS
>>
>> The dt_id definition already says "TOPS", this comment is not needed.
>>
>>> + { .dt_id = MT7988_ETHWARP_0}, // WED 1
>>> + { .dt_id = MT7988_ETHWARP_1} // WED 2
>>
>> Same comment about the format; /* WED 1 */
>>
>>> + },
>>> + .num_lvts_sensor = 4,
>>> + .offset = 0x100,
>>> + .hw_tshut_temp = LVTS_HW_SHUTDOWN_MT7988,
>>> + }
>>> +};
>>> +
>>> +/*
>>> + * LVTS MT8195
>>> + */
>>
>> Please also remove this big comment block, it's not needed.
>>
>> Apart from that, this patch looks good; v3 will be the golden one :-)
>>
>> Cheers,
>> Angelo
>>
>
> regards Frank
prev parent reply other threads:[~2023-09-21 20:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 17:49 [PATCH v2 0/4] add LVTS support for mt7988 Frank Wunderlich
2023-09-20 17:49 ` [PATCH v2 1/4] dt-bindings: thermal: mediatek: add mt7988 lvts compatible Frank Wunderlich
2023-09-21 7:55 ` AngeloGioacchino Del Regno
2023-09-21 10:06 ` Krzysztof Kozlowski
2023-09-20 17:49 ` [PATCH v2 2/4] dt-bindings: thermal: mediatek: Add LVTS thermal sensors for mt7988 Frank Wunderlich
2023-09-21 7:55 ` AngeloGioacchino Del Regno
2023-09-21 9:16 ` Conor Dooley
2023-09-20 17:50 ` [PATCH v2 3/4] thermal/drivers/mediatek/lvts_thermal: make coeff configurable Frank Wunderlich
2023-09-21 7:54 ` AngeloGioacchino Del Regno
2023-09-20 17:50 ` [PATCH v2 4/4] thermal/drivers/mediatek/lvts_thermal: add mt7988 support Frank Wunderlich
2023-09-21 7:54 ` AngeloGioacchino Del Regno
2023-09-21 10:39 ` Frank Wunderlich
2023-09-21 11:17 ` AngeloGioacchino Del Regno [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb716cdf-12eb-8d85-3b9d-b1d5e5aee212@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=amitk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=frank-w@public-files.de \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@fw-web.de \
--cc=matthias.bgg@gmail.com \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome