Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5542676pxb; Wed, 26 Jan 2022 14:36:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxT3mpZhoyqho5KPcd1JhFsoVPOqftX9A4HBLAA6verbb/TP2XKrY+tN8C8CFngrC7kLPBW X-Received: by 2002:aa7:c40a:: with SMTP id j10mr1072986edq.232.1643236577929; Wed, 26 Jan 2022 14:36:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236577; cv=none; d=google.com; s=arc-20160816; b=UPS7H16e6M6QZoDWj/MZIlnxItu9FsFQTPCZmX4mHw9cv8AEQbQOuGe0/5uDU8E/co z8+l2iRdkPTy+250TITAZDPcA/A6zElYDVRyhCVOGbfjIqAojhtsKCNB+meg9Ujlfp66 uvlqFFaEKOPo35CvnNC87b0aZLTa3oneM6yY0lISYkFz/UdaiDDbB6J7MuHBP3n4q3WB U1TfXt8lPp2g4EHNCnNqOYezJBeKfUCHoR3qzhXKJ7B36FIG9I0wx4oUCF0FyRaxV1iR vR04jlr3+ZA4B8Z9IrfbEEHQTWe/5yUmebrh7Qmvp1BELCJ8Tc/2ATzI6yEnnYlUM+qR 23ug== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=RmvNokyx0vYilqgTp4H3XfCKVkPoSuYzvjsHlfClDlc=; b=mThspYqE9bO6BEN3BxIkWzuKomCafAqKpG0T83tImXZy/nGgBawGY0faWQjOqozqz+ vLiKgrBbtuLLJcRGMZ4yfJLgX55Zg2ZGkrbpKKDI0N34TOlgrzHzQTYZKzydJ4yXEqv5 uwIB5xklYIwozHBnWkVziSuS5xz9RQ08154/zSVgGlCOjHOgxarjxf6XJTvVLwgImJ9q 9WoXQSIo6xrzXmKnelOvfB0A7joBaityN7YSsyMBB9VQzwDAbuhf3EzV8xmR7FIL4hiL Dk7AQY/oQooF+HK7CwTAwTV6vuPdqUD5v+8Pj6NWbyF3DQE0acOTNqEtcKw+dE2RlYp9 n8mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=r9RfV5et; 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 b14si248790ede.423.2022.01.26.14.35.52; Wed, 26 Jan 2022 14:36:17 -0800 (PST) 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.20210112.gappssmtp.com header.s=20210112 header.b=r9RfV5et; 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 S229723AbiAZUEA (ORCPT + 99 others); Wed, 26 Jan 2022 15:04:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbiAZUD7 (ORCPT ); Wed, 26 Jan 2022 15:03:59 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7BF0C06161C for ; Wed, 26 Jan 2022 12:03:57 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id u15so949365wrt.3 for ; Wed, 26 Jan 2022 12:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RmvNokyx0vYilqgTp4H3XfCKVkPoSuYzvjsHlfClDlc=; b=r9RfV5etklztoUB/utGzVdnEOWno7SYoZgvb5Kf1ciRTtQweniiF1x/DeY58P1r4j+ W4H9ovHhF0x+uvw1zY9k53VSbT08epZukONJ4n96w4k7lNZ+meJMpK3emgNFSC1YlqrV EqkNNzxaDwVKTzE/TP6Ct6uZOB7jXNFuQuGeHw1nM88kjv7w4X16vM/we0X2nGtLTnZt 7zD99XudsMVBSWOyYVoxdN2eU9HWvRccsLgEY3jZ49moDC9LI8ZSPKwvUyWl7E37gsIA 8vcPiIS7QBLvwUC64MOSoxc72xXJvb31OVRTb4s7daVSoGH6gSfhrKj4s/SE3KAYRZmg kEyg== 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:mime-version :content-transfer-encoding; bh=RmvNokyx0vYilqgTp4H3XfCKVkPoSuYzvjsHlfClDlc=; b=JmwxxTEXnodyzihl+y7oA4zyGChDIzFZQrOtQi4S10h0pdBYV1FjPwhZi8nm5o34mQ C+eMdZtYuGFsS37ECTar/2Dk2nSluCG3cm6dTM6shtATaV7jjHAM75LXXsjBI8pAJQNg Bp5tCxUvR3bfsIfafHeN69Fc9n0mP0GgAQVLNum5DdHvnjHByYUmbcn3rRKMwg4cq/r8 PktrFLsqcfioKpZ5W4H52SVj0KZ6hMVQhZq11VFlyV8oY+rZGG/V2CbF35zONrLxeNSS tH8mCTPrWNxigkglI21I2xZGA4VOnWpCViP7NWOsmrBKiE0M0WSVRXswqjfv0bhi7EXF emBQ== X-Gm-Message-State: AOAM530gSkg8T9SU1RcrRUNf7UHgolzQDkd/Mg4dzP5/mMLrSU875B44 QANtxXJpzUJi4C2b504VseUN01xLcrQDMw== X-Received: by 2002:a5d:47cb:: with SMTP id o11mr149885wrc.718.1643227436461; Wed, 26 Jan 2022 12:03:56 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id n10sm270140wrf.96.2022.01.26.12.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 12:03:55 -0800 (PST) From: Corentin Labbe To: jdelvare@suse.com, linux@roeck-us.net, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH] dt-bindings: hwmon: gpio-fan: convert to YAML Date: Wed, 26 Jan 2022 20:03:50 +0000 Message-Id: <20220126200350.3633576-1-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Converts hwmon/gpio-fan.txt to YAML Signed-off-by: Corentin Labbe --- I didnt found any clear maintainer and since DT yaml mandates a maintainer section, I set devicetree@vger.kernel.org. .../devicetree/bindings/hwmon/gpio-fan.txt | 41 -------- .../devicetree/bindings/hwmon/gpio-fan.yaml | 96 +++++++++++++++++++ 2 files changed, 96 insertions(+), 41 deletions(-) delete mode 100644 Documentation/devicetree/bindings/hwmon/gpio-fan.txt create mode 100644 Documentation/devicetree/bindings/hwmon/gpio-fan.yaml diff --git a/Documentation/devicetree/bindings/hwmon/gpio-fan.txt b/Documentation/devicetree/bindings/hwmon/gpio-fan.txt deleted file mode 100644 index f4cfa350f6a1..000000000000 --- a/Documentation/devicetree/bindings/hwmon/gpio-fan.txt +++ /dev/null @@ -1,41 +0,0 @@ -Bindings for fan connected to GPIO lines - -Required properties: -- compatible : "gpio-fan" - -Optional properties: -- gpios: Specifies the pins that map to bits in the control value, - ordered MSB-->LSB. -- gpio-fan,speed-map: A mapping of possible fan RPM speeds and the - control value that should be set to achieve them. This array - must have the RPM values in ascending order. -- alarm-gpios: This pin going active indicates something is wrong with - the fan, and a udev event will be fired. -- #cooling-cells: If used as a cooling device, must be <2> - Also see: - Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml - min and max states are derived from the speed-map of the fan. - -Note: At least one the "gpios" or "alarm-gpios" properties must be set. - -Examples: - - gpio_fan { - compatible = "gpio-fan"; - gpios = <&gpio1 14 1 - &gpio1 13 1>; - gpio-fan,speed-map = <0 0 - 3000 1 - 6000 2>; - alarm-gpios = <&gpio1 15 1>; - }; - gpio_fan_cool: gpio_fan { - compatible = "gpio-fan"; - gpios = <&gpio2 14 1 - &gpio2 13 1>; - gpio-fan,speed-map = <0 0>, - <3000 1>, - <6000 2>; - alarm-gpios = <&gpio2 15 1>; - #cooling-cells = <2>; /* min followed by max */ - }; diff --git a/Documentation/devicetree/bindings/hwmon/gpio-fan.yaml b/Documentation/devicetree/bindings/hwmon/gpio-fan.yaml new file mode 100644 index 000000000000..15bb5efd3cb4 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/gpio-fan.yaml @@ -0,0 +1,96 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/gpio-fan.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bindings for fan connected to GPIO lines + +maintainers: + - OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS + +properties: + compatible: + const: gpio-fan + + gpios: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: Specifies the pins that map to bits in the control value, + ordered MSB-->LSB. + + gpio-fan,speed-map: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + description: A mapping of possible fan RPM speeds and the + control value that should be set to achieve them. This array + must have the RPM values in ascending order. + + alarm-gpios: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: This pin going active indicates something is wrong with + the fan, and a udev event will be fired. + + "#cooling-cells": + const: 2 + description: If used as a cooling device, must be <2> + Also see Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml + min and max states are derived from the speed-map of the fan. + +anyOf: + - required: + - gpios + - required: + - alarm-gpios + +additionalProperties: False + +examples: + - | + #include + #include + #include + #include + gpio1: gpio@4d000000 { + compatible = "cortina,gemini-gpio", "faraday,ftgpio010"; + reg = <0x4d000000 0x100>; + interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; + resets = <&syscon GEMINI_RESET_GPIO0>; + clocks = <&syscon GEMINI_CLK_APB>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gpio_fan { + compatible = "gpio-fan"; + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <0 0>, + <3000 1>, + <6000 2>; + alarm-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; + }; + - | + #include + #include + #include + #include + gpio2: gpio@4d000000 { + compatible = "cortina,gemini-gpio", "faraday,ftgpio010"; + reg = <0x4d000000 0x100>; + interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; + resets = <&syscon GEMINI_RESET_GPIO0>; + clocks = <&syscon GEMINI_CLK_APB>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gpio_fan_cool: gpio_fan { + compatible = "gpio-fan"; + gpios = <&gpio2 8 GPIO_ACTIVE_HIGH + &gpio2 1 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <0 0 + 3000 1 + 6000 2>; + alarm-gpios = <&gpio2 15 GPIO_ACTIVE_HIGH>; + #cooling-cells = <2>; /* min followed by max */ + }; -- 2.34.1