Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp107368pxk; Wed, 16 Sep 2020 20:33:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8gD5C14kMAFRch909/Mbh1c6n6sM2Wj9lzYXCeVtDW4OgNkcFaXrszcEJ4g2oUw49SXfz X-Received: by 2002:a17:906:b7c1:: with SMTP id fy1mr28167090ejb.342.1600313584964; Wed, 16 Sep 2020 20:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600313584; cv=none; d=google.com; s=arc-20160816; b=cEjq8D43QXvbx9IMylNOxPvdwOy9WN61aecEx/RK7uZFSLw7GYSNGRDsL0oGPjD4ev gfVIbBHXNZRBw8WBFcCPqR7qsP9hzc81v2H8XBNOk3GTdotD4sKIyy2Mv8ZONYX+Eg0+ D6+hVIUx1PK6mI/Qo4GAx96zwReAhOlPXc8hfYQj+gjVd4vMVHnlkZyCeDB0J2M52Tki nwdK1q/JZI6tF8YP9GKpCjAYVQkosK5MrDp9QXqsM2MMzDSGgg24WN+J5cL4Rtp5Dj6u FDu8Q1ufbZwDCC9sQzcrKdasOv2nWKey/SCsC1snXaQZSk6FNAKO448AxtsKzBz9fhgY PHKw== 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=myxUO6gc+lFpyY6bxPaw2oxrXJNbpjbu9J+ggDGNP1Q=; b=zmJO/bfQT5MsV20QSRDbDxMFbfPLj0NK7izvMV4d1jqib0P8tDc93r1BQjyURrRCeM XSJuGj/d6N79GYpp2s8mVjUGoXuX+pJEc2mcZQFMmGwkXx3u9nJd3Brbt+4b9pI881dA Y+NJy8GeS/0Fl7TMMfJESyOy7kLTC6PmXU70z3+qfEjaRmK6FfRLZEanQ9qr9IQDNOXW MrRbSaDoCBbr+uuhygJXjhjNqEhXDHTVihjKmqoMQh1RbYWKjRmpMLdkxQ5M/KdgD9RL mJTxvIY3qhAUVDUrR5vau+d5HVg4iarZL0zpuUf+lloBKjMtXOH96Hb9qWQpXZlc56Ys 6Tww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iYF9saol; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si10031513edx.167.2020.09.16.20.32.42; Wed, 16 Sep 2020 20:33:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iYF9saol; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726139AbgIQD2C (ORCPT + 99 others); Wed, 16 Sep 2020 23:28:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbgIQD2B (ORCPT ); Wed, 16 Sep 2020 23:28:01 -0400 X-Greylist: delayed 330 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Sep 2020 23:28:01 EDT Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB81C061352 for ; Wed, 16 Sep 2020 20:22:30 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id q5so886402qkc.2 for ; Wed, 16 Sep 2020 20:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=myxUO6gc+lFpyY6bxPaw2oxrXJNbpjbu9J+ggDGNP1Q=; b=iYF9saol7Uya9S+s+a5H00YbWk1vk/5ld+bL+/IoAQzNJ84leuLdIk4WZKQoc3IjJ7 458Luy1hzBiiGiPzkWs+JegOxXStBqnEASvcNydckoGa7tcJ7F3c14FGQttP7joLwjfZ qw1Eohni5Xmwr8EyOfpZyf2VSI2daffRU4FDuOU+ocHwwIEy8SsNZ8E3bJqTDd9NxNKz N1zHygoqOkMvs+n02vrxFKxNZrzLWawNw/FjF74zU0xzcGLt7BkPLhyCZ0MY8D39DkVl xia9YMQcIYE6ykJstBekisdhdf0vr588cfSuqVv09iHwjh9ydJg5kh0OXIX+1akr4yqs kD+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=myxUO6gc+lFpyY6bxPaw2oxrXJNbpjbu9J+ggDGNP1Q=; b=dqoiJV1qfi+0MIdrr9pbb89w0qXfa1fDzfx//Wc31t+5FicJ9JvJ9/7luSdzNp1+w2 K8fXMOQW6ZNYVQL7ZvhIjnS9yd5eBihYCbAvudp5NMjNsQMCPqH+VMM26+5a4yba/gm1 niG3Y1hhlRcncnpyyHTTH5L2mp7GADaCrV5ekRauXhM1MA19SAgNGSo95q3ExVRob4a6 QP2/rS9PpFUv/iO4ovbi1jOGiqFd+Unw4AMTtc7BbuJ4H5EueZ49kUyYvmOM7YuCYN1x 1pvTqobBDNAJwpXQMrhXKsF0ujdPeCqpYsQTCPcLDwPGv47JQnoJwyVOGfDFdFitw2ko JSPw== X-Gm-Message-State: AOAM531xBIVabjs0KWggIY4VyagT/vopJJMg++QsSNZ2sB/i28bfSGDC u5YChrnT2JI4KiyN2od89EjDZQ== X-Received: by 2002:ae9:c310:: with SMTP id n16mr11085776qkg.318.1600312949899; Wed, 16 Sep 2020 20:22:29 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id g45sm21370801qtb.60.2020.09.16.20.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 20:22:29 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, daniel.lezcano@linaro.org, robh+dt@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, lukasz.luba@arm.com, amitk@kernel.org Subject: [PATCH RFC 2/8] thermal: Introduce new property monitor_type for trip point. Date: Wed, 16 Sep 2020 23:22:20 -0400 Message-Id: <20200917032226.820371-3-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200917032226.820371-1-thara.gopinath@linaro.org> References: <20200917032226.820371-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thermal trip points can be defined to indicate whether a temperature rise or a temperature fall is to be monitored. This property can now be defined in the DT bindings for a trip point. To support this following three changes are introduced to thermal core and sysfs code. 1. Define a new variable in thermal_trip to capture the monitor rising/falling information from trip point DT bindings. 2. Define a new ops in thermal_zone_device_ops that can be populated to indicate whether a trip is being monitored for rising or falling temperature. If the ops is not populated or if the binding is missing in the DT, it is assumed that the trip is being monitored for rising temperature. (default behavior today) Signed-off-by: Thara Gopinath --- drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 2 ++ include/uapi/linux/thermal.h | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index e00fc5585ea8..c56addfe2284 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -77,12 +77,14 @@ int power_actor_set_power(struct thermal_cooling_device *cdev, * @temperature: temperature value in miliCelsius * @hysteresis: relative hysteresis in miliCelsius * @type: trip point type + * @monitor_type: trip point monitor type */ struct thermal_trip { struct device_node *np; int temperature; int hysteresis; enum thermal_trip_type type; + enum thermal_trip_monitor_type monitor_type; }; int get_tz_trend(struct thermal_zone_device *tz, int trip); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 42ef807e5d84..a50ed958d0bd 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -72,6 +72,8 @@ struct thermal_zone_device_ops { int (*set_trip_temp) (struct thermal_zone_device *, int, int); int (*get_trip_hyst) (struct thermal_zone_device *, int, int *); int (*set_trip_hyst) (struct thermal_zone_device *, int, int); + int (*get_trip_mon_type)(struct thermal_zone_device *, int, + enum thermal_trip_monitor_type *); int (*get_crit_temp) (struct thermal_zone_device *, int *); int (*set_emul_temp) (struct thermal_zone_device *, int); int (*get_trend) (struct thermal_zone_device *, int, diff --git a/include/uapi/linux/thermal.h b/include/uapi/linux/thermal.h index c105054cbb57..d3bb4e4fad69 100644 --- a/include/uapi/linux/thermal.h +++ b/include/uapi/linux/thermal.h @@ -16,6 +16,11 @@ enum thermal_trip_type { THERMAL_TRIP_CRITICAL, }; +enum thermal_trip_monitor_type { + THERMAL_TRIP_MONITOR_RISING = 0, + THERMAL_TRIP_MONITOR_FALLING +}; + /* Adding event notification support elements */ #define THERMAL_GENL_FAMILY_NAME "thermal" #define THERMAL_GENL_VERSION 0x01 -- 2.25.1