Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1186774rwb; Wed, 28 Sep 2022 14:38:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kJj05FK6y3J1PmVrEXuCrxVabJT/PXuN+5HRw4IITkVpmNPFewIzsdN/ctRXb0fnwSC7G X-Received: by 2002:a05:6a00:16c4:b0:535:890:d4a with SMTP id l4-20020a056a0016c400b0053508900d4amr36868034pfc.0.1664401109113; Wed, 28 Sep 2022 14:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664401109; cv=none; d=google.com; s=arc-20160816; b=pxJV3rc1TpKypsTAsf+TxHiKaCyeZzcRzMj4BdMj3cKnz+MbRkrh8H/34tEuL4xJXx FJGKK/T2tUGLbOL4lBYmVrVH/gYJO0vRdZePo4B4cCrbMc0DSUimARAexitxfPrQbn2J tYJvXBrbze9wxAzpTi32Gx8C09RCt0ZYm+LaCpQwSlfVbXxiLMgwHrJtxADgcE3Z19lc OIQb8msFTLMkhU6f1H3GxMcfxP0+LRWfSy2IWVX1DP9sAQgk6FR7J8MShz8XE31cHQkm csLUUMcIL3XupL39oqiC0t8COnpvX/xJPK+IF/XuLwmt5xXBcm3OInnktCh+azhQKe0q Z+KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RuOkdBUevpNwOF5uxKYPUxVuiSYnY/XeiYrwbyLTKVs=; b=lu5UL03SNhy055mx2lK0GVItHVyfLD3/+cDovjqP/vm1tZV7Owt8/dIy/hRuMB4TQS WDi1eMkV1bKOxC/woWGiU1tF2lm2LCsLRzbP9+6+ijtUSUZ2u67xH2H8PMNv2C5O0xx+ WlRFTwnLec3/pqYPWJIHQ1RadHd46Y/GkuvEE6H46ZpcyvmP7ZdCu8sceB80qGeJsKnl O6eg5ifiopqYp2LCTtRFMWZlCEoPBZXcZisBDsL/DjyiC855e3qT3pyZAm/W4ONtsIcB hpkTgnBsI5qGNewoHmcU8c7Wl0Hj1Ial5N1yzK4AIPIujmUCZBjkn8qM0Si42Rj23yuh xsvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hqaXXqN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp6-20020a17090b4a8600b001fafaf2e8fesi3657773pjb.104.2022.09.28.14.38.18; Wed, 28 Sep 2022 14:38:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hqaXXqN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234788AbiI1VHC (ORCPT + 99 others); Wed, 28 Sep 2022 17:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234616AbiI1VFu (ORCPT ); Wed, 28 Sep 2022 17:05:50 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB64E1721 for ; Wed, 28 Sep 2022 14:02:26 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id i203-20020a1c3bd4000000b003b3df9a5ecbso2063794wma.1 for ; Wed, 28 Sep 2022 14:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=RuOkdBUevpNwOF5uxKYPUxVuiSYnY/XeiYrwbyLTKVs=; b=hqaXXqN+LKRNvJKkZu7aOBx5d81yVwi64omWlLlJp8RGbv82BIith/Bzi7b/BxSdoB SgrLyDg0HBXTEnWe39OsfOqJr3ZFkDDCQVjIjr4jkiFpM3rc2ID+rh67QJCFbaR29ePS m1oEM5x4diIX0cBA+ZLJOaqExQ3E1Eaw2KOekRfNKNnp7nSW/wA6LSCbYNCUYBRJZZ2o MtL+SPnfwkHpR1Ladxwd7PyVn+N0JpV71TG5FuHtIoAH3S+Vew2fyMgJ/TRB0Kpmz06P amd763iNocjmqbYQhv/jrV+Huf1+t8720OVnJDLi6i3DV5440yODBtvNaC+qPDI4Tc/y z9uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=RuOkdBUevpNwOF5uxKYPUxVuiSYnY/XeiYrwbyLTKVs=; b=3Ko52fFU3W8w11xYBtICiyGrpALaHvjwRJdBvF0wKrJ6mCH5dbVvZQm4J4mURJgnGv oJCgu1iI3wqAKGMoSvpN61o4tr/32thLXIJnDytJq7UjI/GhmhbXbFdN99zMlS0c1RFm Is3oG8VylaReFMXPc7tpcau5Gonavt7cJAQvSIhs7TA2JyStfCAUxL47rsdHN8aHlxnq Ln2X6LT1yQk/IhEwXFiPQLbTSV3XAjFW99vsdJ5lOEoqAsHGv4z2lKvxyWUkEFfu+T+T CrouSxZ0RaL7AaqsJRtycdXGtmX83jbD6HsUHrFlVYerk2nW8gad9i+WPP2DYtAgjo5m 5j1g== X-Gm-Message-State: ACrzQf1jq2xarCczCrwtTLa9pegEhh3fLLPXCS/spxpTyWg8rmvdXACm 9yffeZGAcHqdQMk7qcz54cmKFw== X-Received: by 2002:a05:600c:2212:b0:3b4:9ab8:b24e with SMTP id z18-20020a05600c221200b003b49ab8b24emr8216162wml.127.1664398945068; Wed, 28 Sep 2022 14:02:25 -0700 (PDT) Received: from mai.. ([2a05:6e02:1041:c10:48a2:39eb:9d1b:8b8d]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003b4931eb435sm2874300wmq.26.2022.09.28.14.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 14:02:24 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Raju Rangoju , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Peter Kaestle , Hans de Goede , Mark Gross , Miquel Raynal , Amit Kucheria , Nicolas Saenz Julienne , Broadcom Kernel Team , Florian Fainelli , Ray Jui , Scott Branden , Support Opensource , Lukasz Luba , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Thara Gopinath , Andy Gross , Bjorn Andersson , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , Jonathan Hunter , Eduardo Valentin , Keerthy , Kunihiko Hayashi , Masami Hiramatsu , Antoine Tenart , Srinivas Pandruvada , Dmitry Osipenko , netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v7 23/29] thermal/drivers/broadcom: Use generic thermal_zone_get_trip() function Date: Wed, 28 Sep 2022 23:00:53 +0200 Message-Id: <20220928210059.891387-24-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220928210059.891387-1-daniel.lezcano@linaro.org> References: <20220928210059.891387-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 2c67841a1115..5485e59d03a9 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; -- 2.34.1