Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2560194rwb; Mon, 3 Oct 2022 02:34:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6mqOhRehMGzjcojMfkOEgoGBbg7XYlQantrSGla5vTcdH0kuaOwExPOHCWgCr8MeW5SnAe X-Received: by 2002:aa7:d39a:0:b0:458:a612:f805 with SMTP id x26-20020aa7d39a000000b00458a612f805mr9540068edq.49.1664789655137; Mon, 03 Oct 2022 02:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664789655; cv=none; d=google.com; s=arc-20160816; b=dnMyOaeu8U0FW8ozc1rdHiIaGu90WiQdD5NfjyTzfmQ3Cwuh7nxxkIzqCVXOau2Jp5 5jqJpqnRNxwK9odb0RNGyJcObfdhhCZfIoFXCnIwY0cL3brYsom+E02yWvrDa2EQW5Tq PNlF7sA0rFOy/6HR2/y5MqZMQAfRsXnG+3MdK6WoCI0dXNMRriNGxdb5X3NOUWaIp00z vqhw1PdT8ioyf6UTnoBn3Bv8skbV8fucVu6kOQi4VDtSG9RvkJIGvKwW40qBaw8pGYTE BErCrCgxSnO7hIjZHBeEP+tFb0qlyEjDOPBsNpKNbVBuvciiIuI4anzB1Hk8ceg1XaLx /5yg== 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=J+pEXgOt+cgMtZrCTotGHOpvWkavFX9TrPtsCSEPZdo=; b=O529owiI93EPtbvpkl515htHjlAWdco3PGAEMTkAMrA78LVxozGPqEywRswZB4MmvJ dZnamYdUX60rgtFkEJ7Jnw5P0kkhB4x5JdxBkfRV7nHK1QGIlvhoway8gam3IO1MUc44 t3ibFZ7ObyZKMaU5koBwhpmIEvQLuGdu3CtJLaGwuqnskkeIXKsH70S9kJUOCBpnxYvg P+auZ4wpsGRYrwwgyz7oV+kAXUO6pfmTaQUz4tHqwSNvn6d51IkIT8aOFbGDIIhcpvgh QLcA7CDleur/cq87dluioijCNiUP483wUSYcRe+fCh2UtsonOLILt6xWg3LmQxU+MSnC gh1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DoG130ud; 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 b19-20020a056402279300b0045903f0af98si1995546ede.128.2022.10.03.02.33.49; Mon, 03 Oct 2022 02:34:15 -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=DoG130ud; 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 S231562AbiJCJcn (ORCPT + 99 others); Mon, 3 Oct 2022 05:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbiJCJbI (ORCPT ); Mon, 3 Oct 2022 05:31:08 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 807355467D for ; Mon, 3 Oct 2022 02:27:57 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id a3so3520875wrt.0 for ; Mon, 03 Oct 2022 02:27:57 -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=J+pEXgOt+cgMtZrCTotGHOpvWkavFX9TrPtsCSEPZdo=; b=DoG130udwrokD2lCxDGaDzPB6lcQ7nevCUiIIu4I3y6/sp1WeqUCHUzgGedlWsHZq1 cKjUfSXZ0fuvvWy6yorcPYZrjCxfcGsvGGCSFF1v7+eURRY7IZ96UM6m3PAdFWoQRSlx WTiqfUnTwRp4vpISYK9eLmtnC2b8JedB+3ECRzm7rR4wSWBKm6R7chmqwUiIhwx0ZSmQ RR8GWnFUj74CmFBsWnsyYNQYDu6IToSTIXrmLN+Z+MYAij7Q3dLbr5mMyOseDgXiL77k 74aeLplTHPQo4Y9eNJdwd2Foqq6ly8FHEE98Nl4VACEa1KZWFcvrXS3twXPO6YD8OaGh lFPg== 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=J+pEXgOt+cgMtZrCTotGHOpvWkavFX9TrPtsCSEPZdo=; b=0UC/RYhIj3ZPfG+Jba1WFmGm2vPREquZHFiY/XD6gAzkKtqWjE38PZYyOp9TFnlAye tLuEz7yuw6RH2trV3qc7jK1+ghDsnHyFQJwVQXLFjJytVACObmDTWncMc7hzhVxIxTjL CX1XV5AHGpLadnGvPet8CFb+v5RKsihxgHUkdeMkPHOia1tuiZYb17+qmkqgqyfySrqI 5yKR/OuOl2gSPP2LPBWJKxi0Hz49am9/SXeyzv5IJ4RjQcdO/yYvAXmc1aBrk51yIp3F xZza01ecszZ7XbB5WczRkhwTtO/+xuss86oTewWkW/3i1NWDgXJ9Y1wW5eFnCuU7G/Rs 1feQ== X-Gm-Message-State: ACrzQf2cRwIfgj56VyDGcrFRpuezozWfGLZCRBvEut14GxOlaYb5jmy1 kXkSyal4wDekqn+mraTKgZstUQ== X-Received: by 2002:a05:6000:1110:b0:22e:327d:c146 with SMTP id z16-20020a056000111000b0022e327dc146mr5306166wrw.453.1664789251314; Mon, 03 Oct 2022 02:27:31 -0700 (PDT) Received: from mai.. ([2a05:6e02:1041:c10:f3a:9f5e:1605:a75a]) by smtp.gmail.com with ESMTPSA id ay3-20020a5d6f03000000b0022cc157bf26sm9707520wrb.85.2022.10.03.02.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 02:27:30 -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 v8 23/29] thermal/drivers/broadcom: Use generic thermal_zone_get_trip() function Date: Mon, 3 Oct 2022 11:25:56 +0200 Message-Id: <20221003092602.1323944-24-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221003092602.1323944-1-daniel.lezcano@linaro.org> References: <20221003092602.1323944-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 Acked-by: Florian Fainelli --- 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