From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 139031DAC4A; Fri, 2 Aug 2024 09:35:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722591353; cv=none; b=LIiFdT0EWUqIYi+4LWXynymIamUe+eNbmFAtHiEi9QGAoaYZHTtY1k/5s7ioKlOnKfCJ/CNWc2MyNugy5rcRXgYnDZPn4ooaj+ennaCdukeqhQdAa+Xho4Y8te7dO6BfKXHm9Qi/OhkfrF/l87kksiXLZFyw6Zw0264ykq8rQbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722591353; c=relaxed/simple; bh=dk3AkEexnpfCj7aRF0eLLUhA3VvcUM8ph8xsoYphiw0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rBV5MW0gqooSYpqYDWadGiaXtciceAT7/0+xjOwsrBfma6EcUo88hbkjuP9bzg7inJh+EnWCt4MHt6JE+rl6OYxK/htlitSMHo3FDpxs/uaVR6JyARuHP90ceOFKb/JRhOyP7vVwHN3b7JM7HeG1joUAUU3h7lAt49OlDoBjv+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 08E741007; Fri, 2 Aug 2024 02:36:17 -0700 (PDT) Received: from [10.57.12.204] (unknown [10.57.12.204]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D52EF3F766; Fri, 2 Aug 2024 02:35:49 -0700 (PDT) Message-ID: <078ce0ba-63d4-4d04-9ac0-2344ca176fe5@arm.com> Date: Fri, 2 Aug 2024 10:36:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND][PATCH v1 1/8] thermal: broadcom: Use thermal_zone_get_crit_temp() in bcm2835_thermal_probe() To: "Rafael J. Wysocki" , Linux PM Cc: Daniel Lezcano , LKML , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden References: <2211925.irdbgypaU6@rjwysocki.net> <3322893.aeNJFYEL58@rjwysocki.net> Content-Language: en-US From: Lukasz Luba In-Reply-To: <3322893.aeNJFYEL58@rjwysocki.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/29/24 16:53, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > 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 > --- > 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