Re: [PATCH v5 4/5] thermal: qcom-spmi-temp-alarm: add support for GEN2 rev 2 PMIC peripherals
From: Konrad Dybcio
Date: Sat Jun 21 2025 - 05:52:32 EST
On 6/20/25 2:19 AM, Anjelique Melendez wrote:
> Add support for TEMP_ALARM GEN2 PMIC peripherals with digital major
> revision 2. This revision utilizes individual temp DAC registers
> to set the threshold temperature for over-temperature stages 1 (warning),
> 2 (system shutdown), and 3 (emergency shutdown) instead of a single
> register to specify a set of thresholds.
>
> Signed-off-by: David Collins <david.collins@xxxxxxxxxxxxxxxx>
A lone s-o-b from a non-author, without a c-d-b or similar is
ambiguous
[...]
> /*
> * This function intializes the internal temp value based on only the
> * current thermal stage and threshold.
> @@ -486,6 +620,8 @@ static int qpnp_tm_probe(struct platform_device *pdev)
> chip->subtype = subtype;
> if (subtype == QPNP_TM_SUBTYPE_GEN1)
> chip->data = &spmi_temp_alarm_data;
> + else if (subtype == QPNP_TM_SUBTYPE_GEN2 && dig_major >= 2)
> + chip->data = &spmi_temp_alarm_gen2_rev2_data;
> else if (subtype == QPNP_TM_SUBTYPE_GEN2 && dig_major >= 1)
> chip->data = &spmi_temp_alarm_gen2_rev1_data;
how about:
if (subtype == ..GEN1)
...
else if (subtype == GEN2 && dig_major == 0)
...
else if (subtype == GEN2 && dig_major == 1)
...
else if (subtype == GEN2 && dig_major == (>=?) 2)
...
else
ENODEV
Konrad