[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <078ce0ba-63d4-4d04-9ac0-2344ca176fe5@arm.com>
Date: Fri, 2 Aug 2024 10:36:20 +0100
From: Lukasz Luba <lukasz.luba@....com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux PM <linux-pm@...r.kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>,
LKML <linux-kernel@...r.kernel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>
Subject: Re: [RESEND][PATCH v1 1/8] thermal: broadcom: Use
thermal_zone_get_crit_temp() in bcm2835_thermal_probe()
On 7/29/24 16:53, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Modify the bcm2835 thermal driver to use thermal_zone_get_crit_temp() in
> bcm2835_thermal_probe() instead of relying on the assumption that the
> critical trip index will always be 0.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> drivers/thermal/broadcom/bcm2835_thermal.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> Index: linux-pm/drivers/thermal/broadcom/bcm2835_thermal.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/broadcom/bcm2835_thermal.c
> +++ linux-pm/drivers/thermal/broadcom/bcm2835_thermal.c
> @@ -208,8 +208,7 @@ static int bcm2835_thermal_probe(struct
> */
> val = readl(data->regs + BCM2835_TS_TSENSCTL);
> if (!(val & BCM2835_TS_TSENSCTL_RSTB)) {
> - struct thermal_trip trip;
> - int offset, slope;
> + int offset, slope, crit_temp;
>
> slope = thermal_zone_get_slope(tz);
> offset = thermal_zone_get_offset(tz);
> @@ -217,7 +216,7 @@ static int bcm2835_thermal_probe(struct
> * For now we deal only with critical, otherwise
> * would need to iterate
> */
> - err = thermal_zone_get_trip(tz, 0, &trip);
> + err = thermal_zone_get_crit_temp(tz, &crit_temp);
> if (err < 0) {
> dev_err(dev, "Not able to read trip_temp: %d\n", err);
> return err;
> @@ -232,7 +231,7 @@ static int bcm2835_thermal_probe(struct
> val |= (0xFE << BCM2835_TS_TSENSCTL_RSTDELAY_SHIFT);
>
> /* trip_adc value from info */
> - val |= bcm2835_thermal_temp2adc(trip.temperature,
> + val |= bcm2835_thermal_temp2adc(crit_temp,
> offset,
> slope)
> << BCM2835_TS_TSENSCTL_THOLD_SHIFT;
>
>
>
Reviewed-by: Lukasz Luba <lukasz.luba@....com>
Powered by blists - more mailing lists