Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3122127pxb; Mon, 6 Sep 2021 12:55:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzRGSV8ak8sdeefNExdZpOtXm+9w42D+T55h22oyyQAPD9qkta+Pt44kGOFqtQdWfjJXrO X-Received: by 2002:a05:6638:34a6:: with SMTP id t38mr12294204jal.19.1630958123242; Mon, 06 Sep 2021 12:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630958123; cv=none; d=google.com; s=arc-20160816; b=npjW6YqBYYcRvY68hMmhe6d2PC4EOwRl7okaBj1ZwOBcux4UxnFvR+ddZ0/y7YXHyM RL6LSoVoTh8ygSuZIADLsxGJOGB81QQKq7ihxcWhvZzSN05/2NeyCHU5zg23g+nd0LsH ompC4PeHev0tr6R1DISovr0P2pRlzFXrsrPHbbRvb6BKVI+FvQKyPEvPOSx0TIoF8JTG AE+dA0fm3Xb5lxAlUcqKTiXlVEE67ApA8A7nJnVoIGX+/PLhDagtd9klBj6ns3LfRV4+ XABUFprnHJGf248H+yWIffI9mzJcRotu7elgHQyHmpfqkte/AIGvibHXZQsyk53SuJJ4 BpAA== 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=WJPXqkih2bJaRr2yhQLBvi2zA07HJWoA2pkyb7ChylM=; b=mPojdY2q32M2LsiNWDACkJXxZ5CfMIo9wzHf3mNxKfaSsuP83A1Sf0c4PjvN99Njsh K4VgOWKVjwBF2miIAm1MMcMD5ek5hNIRhPFa7/bgHsNQipjgwFcDnw5NraU8x9t/GZul VbbadjALmESpFESddO8U1ahXPOaAgDvtsqxrNLihMCz/l/5Jkuw/PCwUanuHMRT+401A KPQmhNi/ZiNagrjyPKNFxg9G/dkmSyeV0vwTjFiPD9B3EXNDsF674A7UOAgimmNW3zpi vbdP5xOCR0Tf5BbsMOj52mkVlmvxB2wPwTKe4Nmg80AeusoZhj+uindOr59p6qaSpjQX xwFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=bg6lV7sE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si7226411jab.42.2021.09.06.12.55.12; Mon, 06 Sep 2021 12:55:23 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=bg6lV7sE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344005AbhIFTG4 (ORCPT + 99 others); Mon, 6 Sep 2021 15:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343620AbhIFTER (ORCPT ); Mon, 6 Sep 2021 15:04:17 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3976BC0617AD for ; Mon, 6 Sep 2021 12:03:11 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id g138so5227295wmg.4 for ; Mon, 06 Sep 2021 12:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WJPXqkih2bJaRr2yhQLBvi2zA07HJWoA2pkyb7ChylM=; b=bg6lV7sE50Nr2U+QD0uTOfEvW+iyFeHfrLUy47SMYAiUEfu0swzA0ODqEfXnhHffJX WlCINz1Kilq7YW4KUvuT4XxrAd1X+C8MCeXJ9FmzsG+NspGJkJVNh+Ti1+HrCtnM9gua aAjFKyRTzMvE9qjl7yGbZQrrwD2l2hWQBC/bXluE96TTV3XzWG+KKI2buOuqI86N7urt mQ1FUpFgcQHMfHJIJSqBtCkqePC9BHgC9EhU/kvjapkojtMOh00BImptVjvbRc+MwHI/ PxLC6fm0CqXlKAfHwcOv1yKOcdaLT++9vAhneCukLg7mDiplQMPF3yMDbZFRgLeJJvTZ 1AEA== 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=WJPXqkih2bJaRr2yhQLBvi2zA07HJWoA2pkyb7ChylM=; b=oxcoYr2IbpP9vmC7zYAjAfEiOXEMucirMrAdUPNXq7O49DTfoAFJdBzqJOqidAQApi MiZfCOwq4k2WcF9HpzqtE/FWkXbO6Qlm94DKHdD5T5vlGsFEgeoUIqlcz6Wp7ArBb4iZ chNiteWnSf3NbqdvrQSX54YYL2kU+6a/wyUTLvfz8EAe6y4FLThvhA8JDov5EibOd20s Gx8Yh53z+vEnYgqYltoiYaVY5cJucP1FmKIX516D305gTO+em0Ha6QDlWe0qun+2VvEU /71rLxG/MbQwge/x34aBlLMUmOdUQWGY5DjswZU2+aVRF/XDx9JVRMk0cmOTyy/7Z4KA 5Ubg== X-Gm-Message-State: AOAM530jJqadRDkt2CuCU/HLMOfsL+BPIn+KSEonbpKytQOFPBEqNY3P d3ffCImcQ1t4tSV7q4wqM9lk2Q== X-Received: by 2002:a05:600c:1c11:: with SMTP id j17mr531079wms.138.1630954989813; Mon, 06 Sep 2021 12:03:09 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3a81:3690:b885:8dcf:f8c6:7841]) by smtp.gmail.com with ESMTPSA id p4sm324750wmc.11.2021.09.06.12.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 12:03:09 -0700 (PDT) From: Alexandre Bailon To: rui.zhang@intel.com, daniel.lezcano@linaro.org, amitk@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, ben.tseng@mediatek.com, khilman@baylibre.com, gpain@baylibre.com, Alexandre Bailon Subject: [PATCH 1/2] dt-bindings: Add bindings for the virtual thermal sensor Date: Mon, 6 Sep 2021 21:04:53 +0200 Message-Id: <20210906190454.114751-2-abailon@baylibre.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210906190454.114751-1-abailon@baylibre.com> References: <20210906190454.114751-1-abailon@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds the device tree bidings for the virtual thermal sensor. The virtual sensor could be used to a temperature computed from many thermal sensors. Signed-off-by: Alexandre Bailon --- .../thermal/virtual,thermal-sensor.yaml | 67 +++++++++++++++++++ include/dt-bindings/thermal/virtual-sensor.h | 15 +++++ 2 files changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/virtual,thermal-sensor.yaml create mode 100644 include/dt-bindings/thermal/virtual-sensor.h diff --git a/Documentation/devicetree/bindings/thermal/virtual,thermal-sensor.yaml b/Documentation/devicetree/bindings/thermal/virtual,thermal-sensor.yaml new file mode 100644 index 0000000000000..848b5912c79f1 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/virtual,thermal-sensor.yaml @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright 2021 BayLibre +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/thermal-sensor.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Virtual thermal sensor binding + +description: | + The virtual thermal sensor devices provide temperature sensing capabilities + based on hardware thermal sensors. Basically, this could be used to get the + maximum, minimum or average temperature of the hardware thermal sensors. +properties: + "#thermal-sensor-cells": + description: + Used to uniquely identify a thermal sensor instance within an IC. Will be + 0 on sensor nodes with only a single sensor and at least 1 on nodes + containing several internal sensors. + enum: [0, 1] + + type: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Used to select the operations to perform on the sensors to get the virtual + sensor temperature. + enum: + - VIRTUAL_SENSOR_MIN + - VIRTUAL_SENSOR_MAX + - VIRTUAL_SENSOR_AVG + + thermal-sensors: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + The thermal sensor phandle and sensor specifier used to monitor this + thermal zone. + +required: + - "#thermal-sensor-cells" + - type + - thermal-sensors + +additionalProperties: true + +examples: + - | + #include + #include + #include + #include + + lvts: lvts@1100b000 { + compatible = "mediatek,mt6873-lvts"; + reg = <0x1100b000 0x1000>; + clocks = <&infracfg CLK_INFRA_THERM>; + clock-names = "lvts_clk"; + #thermal-sensor-cells = <0>; + interrupts = ; + }; + + soc_max_sensor: soc_max_sensor { + compatible = "virtual,thermal-sensor"; + #thermal-sensor-cells = <1>; + type = ; + thermal-sensors = <&lvts 0>, <&lvts 1>; + }; +... diff --git a/include/dt-bindings/thermal/virtual-sensor.h b/include/dt-bindings/thermal/virtual-sensor.h new file mode 100644 index 0000000000000..b3e4032f6f62b --- /dev/null +++ b/include/dt-bindings/thermal/virtual-sensor.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * This header provides constants for virtual thermal sensor bindings. + * + * Copyright (C) 2021 BayLibre + */ + +#ifndef _DT_BINDINGS_THERMAL_VIRTUAL_SENSOR_H +#define _DT_BINDINGS_THERMAL_VIRTUAL_SENSOR_H + +#define VIRTUAL_SENSOR_MIN 0 +#define VIRTUAL_SENSOR_MAX 1 +#define VIRTUAL_SENSOR_AVG 2 + +#endif /* _DT_BINDINGS_THERMAL_VIRTUAL_SENSOR_H */ -- 2.31.1