Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3169710pxb; Sat, 9 Oct 2021 03:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIrCDlBUZkDQuPXgjQo34SMkbx49FvtuT2cV46aygnYt21xKV7N6yMVoOcii+8jW1gzf0j X-Received: by 2002:aa7:8891:0:b0:44c:255d:391f with SMTP id z17-20020aa78891000000b0044c255d391fmr15380536pfe.26.1633776417404; Sat, 09 Oct 2021 03:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633776417; cv=none; d=google.com; s=arc-20160816; b=K1zn6RUKL49zhh4uP0WhSxuQt+dzhVtuYkNxArSTKMROe8wiDjWl7IkZ80/Leq2DSF t3h4IP5cXQMCENjtSQLXYLsSCoOi/VUB06vtjcTzLQ7ECi67OzR9UAhf5MRS2PMagsJs Hg9V1ckwhnAXtG7pjl4/Oy7vNkQhEtxiT02whQCT38xrWr1pqwr5FfN2be3oz/mIeMUh 7gx9V3bvgQ+E3uTV5sK4WZTN1q07bRwm4/rXTBbAvVjykHid9rq0lnvHnbrlIaoQr9Ug u91rmjzkqWEPCdRLzn3lO/d08P5bn66PqjiDjLacFADIY8lW0zVuESDiBZ4SHueQbRCJ zojQ== 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=s131/szhZQJcT42zguyRZMn4H+/xcH/hdWtFJwYz2wM=; b=hv8u7gRVIa8EbdKTVOMdUeSnF8zrQS8V8AfktiRFVdLFg6kjjU5S8AS+rZ56r8y9hj Tx76nffwu1XmK/+rEnAmlIK3CcT50GiJ5MMSouNUF1ardNACp3OFpRd8f+PlgyPO9tu4 F3X583bV/XKigX2AwqQ+PdmeGJeBTGj4qXg5P5ebAikpqP7rZR8KyW7EQN68oEkTZGGK uRlDEJXjQgw1g3BNsiEGmlxzoPpqoi1lDwk4ft461vqh2v6ThVKL0PefogOwlNHEWnxi ynJwq0gVQyLjFvL4THA/9cK46oYUXh0M3eCH8rX2GG7Vkp/6vWwm208cHLiI5A1rm6Om 1E/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ixit.cz header.s=dkim header.b=IVjXIfoP; 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=REJECT dis=NONE) header.from=ixit.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k8si2384749pff.368.2021.10.09.03.46.44; Sat, 09 Oct 2021 03:46:57 -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=@ixit.cz header.s=dkim header.b=IVjXIfoP; 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=REJECT dis=NONE) header.from=ixit.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244655AbhJIKqi (ORCPT + 99 others); Sat, 9 Oct 2021 06:46:38 -0400 Received: from ixit.cz ([94.230.151.217]:41654 "EHLO ixit.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244544AbhJIKqe (ORCPT ); Sat, 9 Oct 2021 06:46:34 -0400 Received: from localhost.localdomain (ip-89-176-96-70.net.upcbroadband.cz [89.176.96.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ixit.cz (Postfix) with ESMTPSA id AEA0420064; Sat, 9 Oct 2021 12:44:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ixit.cz; s=dkim; t=1633776274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=s131/szhZQJcT42zguyRZMn4H+/xcH/hdWtFJwYz2wM=; b=IVjXIfoPDUx3s9ZIJzF8H6DZPht0ohiIk2KPyZjZA1nZ4w3/VEKHpcw0I0rbLAp6nhBd23 8JuCsTaJ+D+VB1rcCXhbzNpHll4UVWMkfF7Pa8q+7Z1nbzNIU1buNlbVPJaccPo0/PLU+Q vLjqxSRB4wm+eMuHZKDcnUrvK38dLCQ= From: David Heidelberg To: Rob Herring , Guenter Roeck , Jean Delvare Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~okias/devicetree@lists.sr.ht, David Heidelberg Subject: [PATCH] WIP: dt-bindings: arm: hwmon: gpio-fan: Convert txt bindings to yaml Date: Sat, 9 Oct 2021 12:43:09 +0200 Message-Id: <20211009104309.45117-1-david@ixit.cz> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert fan devices connected to GPIOs to the YAML syntax. Signed-off-by: David Heidelberg --- .../devicetree/bindings/hwmon/gpio-fan.txt | 41 ----------- .../devicetree/bindings/hwmon/gpio-fan.yaml | 69 +++++++++++++++++++ 2 files changed, 69 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..e2db65d58a92 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/gpio-fan.yaml @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: (GPL-2.0 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: + - Rob Herring + +properties: + compatible: + const: gpio-fan + + gpios: + 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-array + minItems: 4 + maxItems: 254 + 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: + description: | + This pin going active indicates something is wrong with + the fan, and a udev event will be fired. + + '#cooling-cells': + const: 2 + +required: + - compatible + - gpio-fan,speed-map + +anyOf: + - required: [gpios] + - required: [alarm-gpios] + +additionalProperties: false + +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 */ + }; -- 2.33.0