From patchwork Fri Dec 9 15:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "tip-bot2 for Kirill A. Shutemov" X-Patchwork-Id: 13069792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF0C5C4167B for ; Fri, 9 Dec 2022 15:27:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230394AbiLIP1Q (ORCPT ); Fri, 9 Dec 2022 10:27:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230449AbiLIP0n (ORCPT ); Fri, 9 Dec 2022 10:26:43 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DA9990770 for ; Fri, 9 Dec 2022 07:26:37 -0800 (PST) Date: Fri, 09 Dec 2022 15:26:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670599593; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yp5wxpyEjPYr7Q/nsZyPAr2AcYHhyh4u665nj3QlHWE=; b=Bj9W1g8vC6yEegr2nroscLna5i9PmZwkPPlh+W0dQ0b55kLmfEHCLxhV1mdYxD91WbuoM6 xaOejhgtua5xMBODVa71zwRqDp2kuIxVBudxoraaF/xjNJ/EAUmkxfGWGv+LoGNo6qUcHm S+pEtAvf3Iq0OVf/EVhkEycIZOIwdi7zrmD6MLCIN1f/p7CRFWHbCjbhqesCd3CM5zBEWc sTftf/gi4Ru+CYL95nZgztj/YWP/tkKYcF1wwzVlM1ohPcvTIRLmhYyPJD9DjaTA4MhgUZ VoxJu0V7M1mei2aZcUr0YUxtlav6t2cT1QcTBYXwsb2qH4GFjw0xsS4io288Sw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670599593; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yp5wxpyEjPYr7Q/nsZyPAr2AcYHhyh4u665nj3QlHWE=; b=hQgoNf/JHW/RNLdiF8S3zaOT6mg5nvsmC6gn95O/ZAH+iwNbqg1KZ0n7cts0BRvyBD9oKY iiT6mTXfURAs6gCg== From: "thermal-bot for Daniel Lezcano" Sender: tip-bot2@linutronix.de Reply-to: linux-pm@vger.kernel.org To: linux-pm@vger.kernel.org Subject: [thermal: thermal/next] thermal/drivers/broadcom: Use generic thermal_zone_get_trip() function Cc: Daniel Lezcano , Florian Fainelli , rui.zhang@intel.com, amitk@kernel.org In-Reply-To: <20221003092602.1323944-24-daniel.lezcano@linaro.org> References: <20221003092602.1323944-24-daniel.lezcano@linaro.org> MIME-Version: 1.0 Message-ID: <167059959298.4906.6439354441043067914.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The following commit has been merged into the thermal/next branch of thermal: Commit-ID: d5a96a90b513e0378cc504d09324bed945db8842 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//d5a96a90b513e0378cc504d09324bed945db8842 Author: Daniel Lezcano AuthorDate: Mon, 03 Oct 2022 11:25:56 +02:00 Committer: Daniel Lezcano CommitterDate: Thu, 08 Dec 2022 14:30:43 +01:00 thermal/drivers/broadcom: Use generic thermal_zone_get_trip() function The thermal framework gives the possibility to register the trip points with the thermal zone. When that is done, no get_trip_* ops are needed and they can be removed. Convert ops content logic into generic trip points and register them with the thermal zone. Signed-off-by: Daniel Lezcano Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20221003092602.1323944-24-daniel.lezcano@linaro.org --- drivers/thermal/broadcom/bcm2835_thermal.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c index 2c67841..5485e59 100644 --- a/drivers/thermal/broadcom/bcm2835_thermal.c +++ b/drivers/thermal/broadcom/bcm2835_thermal.c @@ -18,6 +18,7 @@ #include #include +#include "../thermal_core.h" #include "../thermal_hwmon.h" #define BCM2835_TS_TSENSCTL 0x00 @@ -224,7 +225,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) */ val = readl(data->regs + BCM2835_TS_TSENSCTL); if (!(val & BCM2835_TS_TSENSCTL_RSTB)) { - int trip_temp, offset, slope; + struct thermal_trip trip; + int offset, slope; slope = thermal_zone_get_slope(tz); offset = thermal_zone_get_offset(tz); @@ -232,7 +234,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) * For now we deal only with critical, otherwise * would need to iterate */ - err = tz->ops->get_trip_temp(tz, 0, &trip_temp); + err = thermal_zone_get_trip(tz, 0, &trip); if (err < 0) { dev_err(&pdev->dev, "Not able to read trip_temp: %d\n", @@ -249,7 +251,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) val |= (0xFE << BCM2835_TS_TSENSCTL_RSTDELAY_SHIFT); /* trip_adc value from info */ - val |= bcm2835_thermal_temp2adc(trip_temp, + val |= bcm2835_thermal_temp2adc(trip.temperature, offset, slope) << BCM2835_TS_TSENSCTL_THOLD_SHIFT;