Re: [PATCH v2 2/5] thermal: qcom-spmi-temp-alarm: Add temp alarm data struct based on HW subtype

From: Dmitry Baryshkov
Date: Tue Feb 25 2025 - 16:09:30 EST


On Tue, Feb 25, 2025 at 11:24:26AM -0800, Anjelique Melendez wrote:
> Currently multiple if/else statements are used in functions to decipher
> between SPMI temp alarm Gen 1, Gen 2 and Gen 2 Rev 1 functionality. Instead
> refactor the driver so that SPMI temp alarm chips will have reference to a
> spmi_temp_alarm_data struct which defines data and function callbacks
> based on the HW subtype.
>
> Signed-off-by: Anjelique Melendez <anjelique.melendez@xxxxxxxxxxxxxxxx>
> ---
> drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 103 +++++++++++++-------
> 1 file changed, 68 insertions(+), 35 deletions(-)
> }
>
> /**
> * qpnp_tm_get_temp_stage() - return over-temperature stage
> * @chip: Pointer to the qpnp_tm chip
> *
> - * Return: stage (GEN1) or state (GEN2) on success, or errno on failure.
> + * Return: stage on success, or errno on failure.
> */
> static int qpnp_tm_get_temp_stage(struct qpnp_tm_chip *chip)

-> qpnp_tm_gen1_get_temp_stage()

With that fixed,


Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>


> {

--
With best wishes
Dmitry