From patchwork Wed Jan 13 07:08:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Lee X-Patchwork-Id: 1425627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DFzCD0xjTz9sVs for ; Wed, 13 Jan 2021 18:11:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DFzCB2lw1zDqx6 for ; Wed, 13 Jan 2021 18:11:50 +1100 (AEDT) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=fail (SPF fail - not authorized) smtp.mailfrom=aspeedtech.com (client-ip=211.20.114.71; helo=twspam01.aspeedtech.com; envelope-from=troy_lee@aspeedtech.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DFz9P11wjzDqvp; Wed, 13 Jan 2021 18:10:13 +1100 (AEDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 10D73vAU005374; Wed, 13 Jan 2021 15:03:57 +0800 (GMT-8) (envelope-from troy_lee@aspeedtech.com) Received: from localhost.localdomain (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 13 Jan 2021 15:08:57 +0800 From: Troy Lee To: , Jean Delvare , "Guenter Roeck" , Rob Herring , Joel Stanley , Andrew Jeffery , Jonathan Corbet , Philipp Zabel , Ryan Chen , "open list:HARDWARE MONITORING" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list , "open list:DOCUMENTATION" Subject: [PATCH v2 1/4] dt-bindings: hwmon: Add Aspeed AST2600 PWM/Fan Date: Wed, 13 Jan 2021 07:08:45 +0000 Message-ID: <20210113070850.1184506-2-troy_lee@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210113070850.1184506-1-troy_lee@aspeedtech.com> References: <20210113070850.1184506-1-troy_lee@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 10D73vAU005374 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chiawei_wang@aspeedtech.com, troy_lee@aspeedtech.com, leetroy@gmail.com Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" We add binding for supporting a new AST2600 PWM/Fan hwmon driver. Changes since v1: - dt binding with DT schema format Signed-off-by: Troy Lee --- .../hwmon/aspeed,ast2600-pwm-tachometer.yaml | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/aspeed,ast2600-pwm-tachometer.yaml diff --git a/Documentation/devicetree/bindings/hwmon/aspeed,ast2600-pwm-tachometer.yaml b/Documentation/devicetree/bindings/hwmon/aspeed,ast2600-pwm-tachometer.yaml new file mode 100644 index 000000000000..b84076a4a338 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/aspeed,ast2600-pwm-tachometer.yaml @@ -0,0 +1,137 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/hwmon/aspeed,ast2600-pwm-tachometer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASPEED AST2600 PWM and Fan Tacho controller device driver + +maintainers: + - Ryan Chen + +description: | + The ASPEED PWM controller can support upto 16 PWM outputs. The ASPEED Fan Tacho + controller can support upto 16 Fan tachometer inputs. + There can be upto 16 fans supported. Each fan can have one PWM output and + one Fan tach inputs. + +properties: + compatible: + const: aspeed,ast2600-pwm-tachometer + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + "#cooling-cells": + const: 2 + + reg: + description: + Address and length of the register set for the device. + + clocks: + description: + phandle to clock provider with the clock number in the second cell + + resets: + description: + phandle to reset controller with the reset number in the second cell + +patternProperties: + "@[0-9]+$": + type: object + description: + Under fan subnode there can upto 16 child nodes, with each child node + representing a fan. There are 16 fans each fan can have one PWM port and one + Fan tach inputs. + For PWM port can be configured cooling-levels to create cooling device. + Cooling device could be bound to a thermal zone for the thermal control. + + properties: + reg: + minimum: 0 + maximum: 15 + description: + This property identify the PWM control channel of this fan. + + fan-tach-ch: + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 0 + maximum: 15 + description: + This property identify the fan tach input channel. + + pulses-per-revolution: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 2 + minimum: 1 + description: + Specify tacho pulse per revolution of the fan. + + cooling-levels: + description: + PWM duty cycle values in a range from 0 to 255 + which correspond to thermal cooling states. + + aspeed,pwm-freq: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 25000 + minimum: 24 + maximum: 780000 + description: + Specify the frequency of PWM. + + aspeed,inverse-pin: + type: boolean + description: + Inverse PWM output signal. + + aspeed,falling-point: + $ref: /schemas/types.yaml#/definitions/uint8 + default: 10 + minimum: 0 + maximum: 255 + description: + Initialize the pulse width. + + required: + - fan-tach-ch + - reg + + additionalProperties: true + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + pwm_tacho: pwm-tacho-controller@1e610000 { + compatible = "aspeed,ast2600-pwm-tachometer"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x1e610000 0x100>; + + fan@1 { + reg = <0x00>; + aspeed,pwm-freq = <25000>; + cooling-levels = /bits/ 8 <125 151 177 203 229 255>; + fan-tach-ch = /bits/ 8 <0x00>; + pulses-per-revolution = <2>; + }; + + fan@2 { + reg = <0x01>; + aspeed,pwm-freq = <25000>; + cooling-levels = /bits/ 8 <125 151 177 203 229 255>; + fan-tach-ch = /bits/ 8 <0x01>; + pulses-per-revolution = <2>; + }; + }; +...