mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux PM <linux-pm@vger.kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Amit Kucheria <amitk@kernel.org>,
	Thara Gopinath <thara.gopinath@gmail.com>,
	linux-arm-msm@vger.kernel.org
Subject: Re: [RESEND][PATCH v1 3/8] thermal: qcom: Use thermal_zone_get_crit_temp() in qpnp_tm_init()
Date: Fri, 2 Aug 2024 10:37:01 +0100	[thread overview]
Message-ID: <ec9bc4c6-914c-4f84-8992-9604620a104b@arm.com> (raw)
In-Reply-To: <7712228.EvYhyI6sBW@rjwysocki.net>



On 7/29/24 16:58, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Modify qpnp_tm_init() to use thermal_zone_get_crit_temp() to get the
> critical trip temperature instead of iterating over trip indices and
> using thermal_zone_get_trip() to get a struct thermal_trip pointer
> from a trip index until it finds the critical one.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> This patch does not depend on the previous patch(es) in the series.
> 
> ---
>   drivers/thermal/qcom/qcom-spmi-temp-alarm.c |   22 +++-------------------
>   1 file changed, 3 insertions(+), 19 deletions(-)
> 
> Index: linux-pm/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
> +++ linux-pm/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
> @@ -291,24 +291,6 @@ static irqreturn_t qpnp_tm_isr(int irq,
>   	return IRQ_HANDLED;
>   }
>   
> -static int qpnp_tm_get_critical_trip_temp(struct qpnp_tm_chip *chip)
> -{
> -	struct thermal_trip trip;
> -	int i, ret;
> -
> -	for (i = 0; i < thermal_zone_get_num_trips(chip->tz_dev); i++) {
> -
> -		ret = thermal_zone_get_trip(chip->tz_dev, i, &trip);
> -		if (ret)
> -			continue;
> -
> -		if (trip.type == THERMAL_TRIP_CRITICAL)
> -			return trip.temperature;
> -	}
> -
> -	return THERMAL_TEMP_INVALID;
> -}
> -
>   /*
>    * This function initializes the internal temp value based on only the
>    * current thermal stage and threshold. Setup threshold control and
> @@ -343,7 +325,9 @@ static int qpnp_tm_init(struct qpnp_tm_c
>   
>   	mutex_unlock(&chip->lock);
>   
> -	crit_temp = qpnp_tm_get_critical_trip_temp(chip);
> +	ret = thermal_zone_get_crit_temp(chip->tz_dev, &crit_temp);
> +	if (ret)
> +		crit_temp = THERMAL_TEMP_INVALID;
>   
>   	mutex_lock(&chip->lock);
>   
> 
> 
> 


Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

  reply	other threads:[~2024-08-02  9:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 15:50 [RESEND][PATCH v1 0/8] thermal: Use trip pointers in thermal driver interface Rafael J. Wysocki
2024-07-29 15:53 ` [RESEND][PATCH v1 1/8] thermal: broadcom: Use thermal_zone_get_crit_temp() in bcm2835_thermal_probe() Rafael J. Wysocki
2024-07-29 21:54   ` Florian Fainelli
2024-08-02  9:36   ` Lukasz Luba
2024-07-29 15:56 ` [RESEND][PATCH v1 2/8] thermal: hisi: Use thermal_zone_for_each_trip() in hisi_thermal_register_sensor() Rafael J. Wysocki
2024-08-02  9:35   ` Lukasz Luba
2024-07-29 15:58 ` [RESEND][PATCH v1 3/8] thermal: qcom: Use thermal_zone_get_crit_temp() in qpnp_tm_init() Rafael J. Wysocki
2024-08-02  9:37   ` Lukasz Luba [this message]
2024-08-14  5:09   ` Amit Kucheria
2024-07-29 16:02 ` [RESEND][PATCH v1 4/8] thermal: tegra: Introduce struct trip_temps for critical and hot trips Rafael J. Wysocki
2024-08-02  9:40   ` Lukasz Luba
2024-07-29 16:05 ` [RESEND][PATCH v1 5/8] thermal: tegra: Use thermal_zone_for_each_trip() for walking trip points Rafael J. Wysocki
2024-08-02  9:47   ` Lukasz Luba
2024-07-29 16:06 ` [RESEND][PATCH v1 6/8] thermal: helpers: Drop get_thermal_instance() Rafael J. Wysocki
2024-08-02  9:53   ` Lukasz Luba
2024-07-29 16:11 ` [PATCH v2 7/8] thermal: trip: Get rid of thermal_zone_get_num_trips() Rafael J. Wysocki
2024-07-30 10:37   ` Niklas Söderlund
2024-08-02  9:55   ` Lukasz Luba
2024-07-29 16:12 ` [RESEND][PATCH v1 8/8] thermal: trip: Drop thermal_zone_get_trip() Rafael J. Wysocki
2024-08-02  9:56   ` Lukasz Luba

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=ec9bc4c6-914c-4f84-8992-9604620a104b@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=thara.gopinath@gmail.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

all inboxes | Powered by JetHome®