Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp909664imk; Sun, 3 Jul 2022 11:56:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v8rEcIh+EX7oJ1YvstadUGrafFWBS21L7e/nGkjQN/Ds2mhXJpenADlZBLHQh4C6gRqvoD X-Received: by 2002:a50:eb45:0:b0:437:7686:6048 with SMTP id z5-20020a50eb45000000b0043776866048mr34810350edp.264.1656874610828; Sun, 03 Jul 2022 11:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656874610; cv=none; d=google.com; s=arc-20160816; b=YKjEsGYdWh7TZ7g7ruzAkYlcFIBzzQpmlq1kHW6+MC0g3qqlue4N5Paof6Jw/wzEnC Dbcu+bF4Ns4kSs3tIv//k5onq6FsEwc2jsfhAowinJ0HiQ2CjCRO9qqaetCUgpIlzyxs PA9E7m5uORkQ0kXR8dZ05XPuWjjRrpfMefc6o4phgiKoUuwmU0wkLHkUWYxLWvwdFcVV nHB2QRHfebOaBAFKKM6Zx+Ma7BqmGlpvSe/Y3G9120mi96VpC7PXA7c4s9XYhHdxgWGE zRz79M1YaDYdyG1TS4qmiR4aMCPs+x3Rqd0d979JkcxPwMxA3HO+t37K94Z1Ej8qKmdY dNyA== 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=ytk6hZOc5k3XFHtzqogPt/m0wTJUPnrDdEaPU5N3m1I=; b=nm97OogIxN8eq7cqT8lmi90J7UZjZltbjLrgb+oXUMLWSSO+zgyhnMPntNt6R4bFcW Aug+70eudrk9xyk+XjkQ1bYohWQMMFu9cJghaxMZE7kU0JMfESd1cnFYqIRVARIK2D4T /V8hNir/3HZXp7efciCi+SY9FOuLk15uWenwl02WtZN7hVBwI6CrOVkofdfKO5jDL7AZ KbSZh6BtmHxiCdYjmmGAa4GP+V+oVjfXuYs7yzrD+UuK/2LfUKml/9dG+iDHsGtw7f7C AlnjDsjlBtNH3cAPhk3rc0wKoKkDIPL8iAQR/hnF1JxLaIhjV6hUJW0fOQ91r4knQ908 t/CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=hlAaqbH6; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh39-20020a1709076ea700b007122fed3491si3078149ejc.909.2022.07.03.11.56.25; Sun, 03 Jul 2022 11:56:50 -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=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=hlAaqbH6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232607AbiGCSb7 (ORCPT + 99 others); Sun, 3 Jul 2022 14:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232801AbiGCSbp (ORCPT ); Sun, 3 Jul 2022 14:31:45 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7704D62D4 for ; Sun, 3 Jul 2022 11:31:39 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id l68so4194849wml.3 for ; Sun, 03 Jul 2022 11:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ytk6hZOc5k3XFHtzqogPt/m0wTJUPnrDdEaPU5N3m1I=; b=hlAaqbH6ItL1iLN4ikMGRagc4T4JnVFXvMOzDusKYjf/mf1kJ7erKSoSVP763gF9JQ fgBnKpoSMuTDgbtxYzO3qgqJyeHupWvNoWjim22brZDIzfJw9+S7pPJy5nAcufl8h/OA DyxIznZYtNs71l1kpyhFQehkSJ2Cm41aI6TZc57t4SiyV2Qx2Qx/DqqmXCWB6HruQ5Zx ikuc66nJfKk87Tpe1rSer+Y0Wireku1mAgTl/58XdJeYk0dmLiiqW9eynxm2mFnUi6OU dcOlfdqBpzrTUBH7ch2Wd+ShssewDANeJbDgSi6i0uHUsa+27d3U5uwpkp/2iRVDhvW1 /thA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ytk6hZOc5k3XFHtzqogPt/m0wTJUPnrDdEaPU5N3m1I=; b=M+w1KVT8Fwtc/v04LSqm2DI2Zv0sw+gmf4BE8f1tllm2Y6BzNXb0oQG+MIvMD5EbPv BgxlvNLf+w6/U2oTGx61pNjjfTV4ivOTY/CWAiDajoqj291YpUXYMxdkM3u8FybNj3lG 5Ksfm+/dO3id7BCuVsIpPN57amVLBuib4yklnPTIMrKZ4vfHrp8H6G0IXofG9wlrr+rJ qI0EWybt/LWGhHczCx3HMcduD6WC4oegb/eSrUgObImo9pUPvgG/4/3oxmGY2Kyo2cxE 51vnESwgNJQKUg+suxFlAu6wPHUO2sQGYDfagD29PwYR1Lvb7ZrJk+23yNrClgfvfJoJ h5lw== X-Gm-Message-State: AJIora+oVj8bkd859/aQUkz8QgHlnWNFPdhE7Xa0LXdgFt2hoOCAnLrs 36N9tdky0vR8c5ATcadttZbXxw== X-Received: by 2002:a05:600c:3ac3:b0:3a0:45b6:7efb with SMTP id d3-20020a05600c3ac300b003a045b67efbmr28626507wms.183.1656873099008; Sun, 03 Jul 2022 11:31:39 -0700 (PDT) Received: from localhost.localdomain (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id x10-20020a5d54ca000000b0021b85664636sm27504258wrv.16.2022.07.03.11.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 11:31:38 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, abailon@baylibre.com, Amit Kucheria , Zhang Rui Subject: [PATCH v3 08/12] thermal/core: Add thermal_trip in thermal_zone Date: Sun, 3 Jul 2022 20:30:55 +0200 Message-Id: <20220703183059.4133659-9-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220703183059.4133659-1-daniel.lezcano@linexp.org> References: <20220703183059.4133659-1-daniel.lezcano@linexp.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 trip points are properties of a thermal zone and the different sub systems should be able to save them in the thermal zone structure instead of having their own definition. Give the opportunity to the drivers to create a thermal zone with thermal trips which will be accessible directly from the thermal core framework. Cc: Alexandre Bailon Cc: Kevin Hilman Cc; Eduardo Valentin Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 10 ++++++++++ include/linux/thermal.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index c991bb290512..84e341c1e0fc 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -113,6 +113,16 @@ int thermal_build_list_of_policies(char *buf); /* Helpers */ void thermal_zone_set_trips(struct thermal_zone_device *tz); +static inline struct thermal_trip *thermal_zone_get_trips(struct thermal_zone *tz) +{ + return tz->trips; +} + +static inline int thermal_zone_get_ntrips(struct thermal_zone *tz) +{ + return tz->ntrips; +} + /* sysfs I/F */ int thermal_zone_create_device_groups(struct thermal_zone_device *, int); void thermal_zone_destroy_device_groups(struct thermal_zone_device *); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 3a57878a2a6c..3733e23b6359 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -179,6 +179,7 @@ struct thermal_zone_device { struct thermal_zone_device_ops *ops; struct thermal_zone_params *tzp; struct thermal_governor *governor; + struct thermal_trip *trips; void *governor_data; struct list_head thermal_instances; struct ida ida; -- 2.25.1