From patchwork Mon Oct 10 20:30:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Solanki X-Patchwork-Id: 613941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1D2BC433FE for ; Mon, 10 Oct 2022 20:33:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbiJJUdG (ORCPT ); Mon, 10 Oct 2022 16:33:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbiJJUco (ORCPT ); Mon, 10 Oct 2022 16:32:44 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7CCB7E305 for ; Mon, 10 Oct 2022 13:31:21 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id qw20so26635262ejc.8 for ; Mon, 10 Oct 2022 13:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2+BbBMg9bnq3BnSRdXRrSGALWvNpVdpy4Oqu9ZYTa7I=; b=UuaHM/XrDgeZhid/He2mkMqaHHs6TQku9LAwIUCrEpIJiwZ1ZCyhiOBIZfb+c+qQp9 yzU+DBg10dcrEiNUM1LV+Y8quV6p+htp1wQSyBO4VBUjTkOLVVUJa50M5tivk+iw3yR8 akHznF0ddDKMAAFv+f92ZIEJ0d+oxm5hY01bqB0gFnecIMM3lClvub+EYuObYvfBqznn Vmm+BzjaaW/4+DyftrupLX2Nexb8BlHPQATryce5Y+cURqYYxNkJgjZgPfn5N0ubg2EL JIvP0JL/B7Ulq7fqCffJvikjH5e/dl+VAuNG9foeegDkhpIaTdSpj1/ynvkosbZv95+s FScQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2+BbBMg9bnq3BnSRdXRrSGALWvNpVdpy4Oqu9ZYTa7I=; b=R4IV5ZiOGlUneCHR35OR38Fp+fax8L/+++d9xYnJxEBycSJctd+nTZH7EvxLnBSjcP HQrdjZ4qBmUoEUX4RQ1mu14U65jQhSRVe0KaF+a/07AhujFQl0aUkJzu6eNYsgd3BXQw qEnSdlImNYsydd/f3mrVH/rQ/k29/wgrRnBG9xVOY1xBXP0IGEoRoIHbAkFGFka0VLWB nRunoXBWy4p2aGIAq71J6eLYwHWdlCwNWj1eeLWQhv2eacEMWEjkADuoluUYFwOd7LUC A6LJ2ID6LMEmgpyXsr04NKWUfMDMmUC6VB3ubdBDU2gb7qrg0Rs6Xj7QAJ76kgXcDfDS Nw7w== X-Gm-Message-State: ACrzQf1qH/V1Gl2joO2GytaryJckE91LoJa73MjljJcbLo9wN74SsW3z 5M1YMRrlrZJKjltMk/6rMJupyWbNi/pfpHgj X-Google-Smtp-Source: AMsMyM7Nxe4Irn+b842+31H5rOc53pLt8QjGwVXtUg24lnAx5C5B9uiRbIEKiYSDXLUsV8GddDd5Yw== X-Received: by 2002:a17:907:8a24:b0:78d:cd60:1022 with SMTP id sc36-20020a1709078a2400b0078dcd601022mr2651222ejc.384.1665433881074; Mon, 10 Oct 2022 13:31:21 -0700 (PDT) Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id c18-20020aa7d612000000b0045720965c7asm7670385edr.11.2022.10.10.13.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 13:31:20 -0700 (PDT) From: Naresh Solanki X-Google-Original-From: Naresh Solanki To: devicetree@vger.kernel.org, Guenter Roeck , Jean Delvare , Rob Herring , Krzysztof Kozlowski Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Patrick Rudolph , Naresh Solanki Subject: [PATCH 1/3] dt-bindings: hwmon: fan: Add fan binding to schema Date: Mon, 10 Oct 2022 22:30:44 +0200 Message-Id: <20221010203046.3673663-2-Naresh.Solanki@9elements.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221010203046.3673663-1-Naresh.Solanki@9elements.com> References: <20221010203046.3673663-1-Naresh.Solanki@9elements.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add common fan properties bindings to a schema. Bindings for fan controllers can reference the common schema for the fan child nodes: patternProperties: "^fan@[0-2]": type: object allOf: - $ref: fan-common.yaml# Signed-off-by: Naresh Solanki --- .../devicetree/bindings/hwmon/fan-common.yaml | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/fan-common.yaml diff --git a/Documentation/devicetree/bindings/hwmon/fan-common.yaml b/Documentation/devicetree/bindings/hwmon/fan-common.yaml new file mode 100644 index 000000000000..6bb990f00e94 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/fan-common.yaml @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/fan-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common fan properties + +properties: + max-rpm: + description: + Max RPM supported by fan + $ref: /schemas/types.yaml#/definitions/uint32 + + pulse-per-revolution: + description: + The number of pulse from fan sensor per revolution. + $ref: /schemas/types.yaml#/definitions/uint32 + + target-rpm: + description: + Target RPM the fan should be configured during driver probe. + $ref: /schemas/types.yaml#/definitions/uint32 + + pwm-frequency: + description: + PWM frequency for fan. + $ref: /schemas/types.yaml#/definitions/uint32 + + pwm-polarity-inverse: + description: + PWM polarity for fan. + type: boolean + + label: + description: + Optional fan label + $ref: /schemas/types.yaml#/definitions/string + +additionalProperties: true + +examples: + - | + + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + fan-controller@30 { + compatible = "maxim,max6639"; + reg = <0x30>; + #address-cells = <1>; + #size-cells = <0>; + + fan@0 { + reg = <0>; + label = "CPU0_Fan"; + max-rpm = <32000>; + pulse-per-revolution = <2>; + target-rpm = <2000>; + pwm-frequency = <25000>; + }; + + fan@1 { + reg = <1>; + label = "PCIe0_Fan"; + max-rpm = <32000>; + pulse-per-revolution = <2>; + target-rpm = <2000>; + pwm-frequency = <25000>; + }; + + }; + }; + +... From patchwork Mon Oct 10 20:30:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Solanki X-Patchwork-Id: 613940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2678DC4332F for ; Mon, 10 Oct 2022 20:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbiJJUd2 (ORCPT ); Mon, 10 Oct 2022 16:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbiJJUc4 (ORCPT ); Mon, 10 Oct 2022 16:32:56 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463E07E815 for ; Mon, 10 Oct 2022 13:31:25 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id bj12so27148447ejb.13 for ; Mon, 10 Oct 2022 13:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XJXaub8jNOSU8CZBAJmxK76v0+6+Br/qqh6c+RTPcf0=; b=fdejB9q/hoveZSTuzuWDGHSiMM4dX/rh5rrYrHgLf9gsTdMMWBd5wDrVD6n1veEtf3 FhOT2tD6k+eLwou2s7WJuVO5P49L4V7qAOzUCHVvGJTSWxYMcWciVfUM3mDizMSNvCui 9E+M0t/8cNkgGubCS8xJKS7JKtklpAHkQuLkJz09yOUoH0/VTbEzu1LE9AZsepW48GC5 44qc5MTolNBoVeZbxFlKOziqOi8VUDUBIe5kEt7juny4M6wVBAl3CAMAmOeeO4Qkd8lU JL7GtK8pkuij0FTp+5p9TD2q0eEd/Zn/aOS50sB7qu7ONU1lRy2GTZcezar3N5Jreaam VV+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XJXaub8jNOSU8CZBAJmxK76v0+6+Br/qqh6c+RTPcf0=; b=0St3WiiS2Zc7OqXP6y9aCd+J+JfcIunAAzpqTHjEd41DqdCtxhHhTiVppJzgIitAZ6 t3/QF0zcQW/pUMzwiuOT8PJ6Vkh+AjlsBRWG1MMXNM7ezKEb7fY01AyHnKhJrJv/dSCM nU8TipjdrlPUkKOynuIE0Ez5CNvgfccrZ7NDsx1uBhJVG54WMWgLJ8ba3VzC7npvMIzA fYsrcEZ1ItNFpZlM/MmQzbz4q5z5Vw/X0DS2kVKrPwXoE/wLjezAjNo58mwkwrwQREz2 COTP03Q919c0HsJd3CWghVfvUIzzMVVH5CbDBeEZhG7Zgg+mXKyNDP/xhdXaoXaQPmV2 iH9A== X-Gm-Message-State: ACrzQf019oH7MFEhS33rLZMKhnf4xob/VCaq2EUNLPuSXcyiKnAodwb1 jbmLAUEJfeJDZ1theBCyg3FmLBKIRcb3uUA3 X-Google-Smtp-Source: AMsMyM7Usu159PqLfj1xM/5xl+Binkd9NYvzTw9uyFy4+kF/J4CVO6dHrIZ3VjJgw4hXPzeXRp7M2g== X-Received: by 2002:a17:907:7f13:b0:782:9f6f:edbc with SMTP id qf19-20020a1709077f1300b007829f6fedbcmr16230778ejc.544.1665433883968; Mon, 10 Oct 2022 13:31:23 -0700 (PDT) Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id c18-20020aa7d612000000b0045720965c7asm7670385edr.11.2022.10.10.13.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 13:31:23 -0700 (PDT) From: Naresh Solanki X-Google-Original-From: Naresh Solanki To: devicetree@vger.kernel.org, Guenter Roeck , Jean Delvare , Rob Herring , Krzysztof Kozlowski , Roland Stigge Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Patrick Rudolph , Marcello Sylvester Bauer , Naresh Solanki Subject: [PATCH 2/3] dt-bindings: hwmon: Add binding for max6639 Date: Mon, 10 Oct 2022 22:30:45 +0200 Message-Id: <20221010203046.3673663-3-Naresh.Solanki@9elements.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221010203046.3673663-1-Naresh.Solanki@9elements.com> References: <20221010203046.3673663-1-Naresh.Solanki@9elements.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Marcello Sylvester Bauer Add Devicetree binding documentation for Maxim MAX6639 temperature monitor with PWM fan-speed controller. Signed-off-by: Marcello Sylvester Bauer Signed-off-by: Naresh Solanki --- .../bindings/hwmon/maxim,max6639.yaml | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/maxim,max6639.yaml diff --git a/Documentation/devicetree/bindings/hwmon/maxim,max6639.yaml b/Documentation/devicetree/bindings/hwmon/maxim,max6639.yaml new file mode 100644 index 000000000000..bbefb0a57ab3 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/maxim,max6639.yaml @@ -0,0 +1,116 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/hwmon/maxim,max6639.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim max6639 + +maintainers: + - Roland Stigge + +description: | + The MAX6639 is a 2-channel temperature monitor with dual, automatic, PWM + fan-speed controller. It monitors its own temperature and one external + diode-connected transistor or the temperatures of two external diode-connected + transistors, typically available in CPUs, FPGAs, or GPUs. + + Datasheets: + https://datasheets.maximintegrated.com/en/ds/MAX6639-MAX6639F.pdf + +properties: + compatible: + enum: + - maxim,max6639 + + reg: + maxItems: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + +required: + - compatible + - reg + +patternProperties: + "^ot[0-1]_indication$": + type: boolean + default: false + description: + If true then enable OT pin indication. + + "^therm[0-1]_indication$": + type: boolean + default: false + description: + If true then enable THERM pin indication. + + "^fan@[0-1]$": + type: object + description: | + Represents the two fans and their specific configuration. + + $ref: fan-common.yaml# + + properties: + reg: + description: | + The fan number. + items: + minimum: 0 + maximum: 1 + + maxim,fan-spin-up: + type: boolean + description: + If true then whnever the fan starts up from zero drive, it + is driven with 100% duty cycle for 2s to ensure that it + starts. + + maxim,full-speed-on-therm: + type: boolean + description: + If true then force fan to full speed if THERM pin goes low. + + maxim,fanfail_indication: + type: boolean + description: + If true then enable fanfail pin indication. + required: + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + max6639@10 { + compatible = "maxim,max6639"; + reg = <0x10>; + #address-cells = <1>; + #size-cells = <0>; + + fan@0 { + reg = <0x0>; + pulses-per-revolution = <2>; + max-rpm = <4000>; + pwm-frequency = <25000>; + }; + + fan@1 { + reg = <0x1>; + pulses-per-revolution = <2>; + max-rpm = <32000>; + pwm-frequency = <25000>; + }; + }; + }; +...