Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp294101pxb; Thu, 14 Jan 2021 06:15:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfLb10pdMHZa7TLlkiiGG2UIqC+ZAR6lf/F60Kfo5OHKnzjWDucZHCRTBDvh5QgKvaXvlu X-Received: by 2002:a17:906:7689:: with SMTP id o9mr5494591ejm.324.1610633720872; Thu, 14 Jan 2021 06:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610633720; cv=none; d=google.com; s=arc-20160816; b=d8jhHTlUi8jz6SZSPXZ8+vozqBOhiLKrPVkYdZpm1dhpU3B7Jgj776z3IaB6Vqa/DI 3Ip278vsFTYVxQS425oVrtZGyOypxZmWymaBgMXtQHUsEWBXXUoA6s708VwkKodcKtJD Z4P4lMljPX+gRwpasfZHg61/Id0E9YcT3oQNIFVlhMGwL3yfbjwFEoFnUbjSfapkstar BDKl4saI3ZX9palg7iJcr7wlqSC973ELVIt/oWTTQniqlCb6mKKQKMVNt04BbG5I4gUV Ch+bT24XInMlZOXSj80gNgFVug51BEEOAE1rX65DhMW/dq4eBSzuU7aoFSr6eV5Ad1YT ieiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=6h5oUPZ53wfO7f92HycjGe1n6yQ3GPM+QRp+J+bOXQU=; b=mhe2Ka9GMQSpxwkSYjEq8c82cnN02mt2czpWfz5BMgrdYavGMBVAvpwTdIxFGX1Vau vpdDhd322+pbVaq3xKP31qTShENIrphp4opskkHpahSqBqZWeLcc2a0CsmjVAawdkRD3 zccvzw2KFneJK8remKO1zn4byK1d2kQFmi4ng3CgfSENk1Zu1PVkDE6hIwhlecxkgz7H yzRKY8dFoetU/Z3fNVZe0mX10w84Ur8Di1rcFTi5DAWhY1T6syiIg3u3uDgmy3+WTDIX McB3hIMZwSgXW747myglO6H5Z+dlFbajjwCIAc1VV0Vt7Rpa8RXXinePqfUzpF2yitfD 4/dA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds13si1991440ejc.180.2021.01.14.06.14.56; Thu, 14 Jan 2021 06:15:20 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727988AbhANOOB (ORCPT + 99 others); Thu, 14 Jan 2021 09:14:01 -0500 Received: from mail-oi1-f169.google.com ([209.85.167.169]:42094 "EHLO mail-oi1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727283AbhANOOB (ORCPT ); Thu, 14 Jan 2021 09:14:01 -0500 Received: by mail-oi1-f169.google.com with SMTP id l200so5990078oig.9; Thu, 14 Jan 2021 06:13:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6h5oUPZ53wfO7f92HycjGe1n6yQ3GPM+QRp+J+bOXQU=; b=Aw59F8cOSQIhRwv5lKO0GGlQfy/4dEkpGqKbi/C7JXxBUhadSXxtx6i/MirgxUeOUT W7RA8t7OWby6GsgnU/bfSxlGKoMgmlyBsXrlCfqx+sqClNuTEwy18pRh9DcTrJyLsqBo 3+5KPtcfQbIzTabSQiG04W3xpWbFvUKLkDybO5h1lszLr86QNYtlaEbQpz6ruaSwRJib I//fatasxgtJYR3zEXCl81atlc2RNzdpJCu8aFbdkiBqMCo5I5TzdjGphT7Cy3OZ8kOK uX+m9VYP8gUDLplZGqgvDHj4q9AqScfCmJvOhcjLGM5QhQc/XNmx/NmnuujzSt2GIpHQ le/A== X-Gm-Message-State: AOAM532RfYz3wTJ3L+rRf9Dpc/TAB166vr99i4pwPZe421rPQm5xv/Bo YzpKgtjFPQNu2TFM85jBMA== X-Received: by 2002:aca:c592:: with SMTP id v140mr2687412oif.10.1610633599393; Thu, 14 Jan 2021 06:13:19 -0800 (PST) Received: from robh.at.kernel.org (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id n13sm1064351otk.58.2021.01.14.06.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 06:13:18 -0800 (PST) Received: (nullmailer pid 2833114 invoked by uid 1000); Thu, 14 Jan 2021 14:13:17 -0000 Date: Thu, 14 Jan 2021 08:13:17 -0600 From: Rob Herring To: Troy Lee Cc: openbmc@lists.ozlabs.org, Jean Delvare , Guenter Roeck , 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" , chiawei_wang@aspeedtech.com, leetroy@gmail.com Subject: Re: [PATCH v2 1/4] dt-bindings: hwmon: Add Aspeed AST2600 PWM/Fan Message-ID: <20210114141317.GA2823834@robh.at.kernel.org> References: <20210113070850.1184506-1-troy_lee@aspeedtech.com> <20210113070850.1184506-2-troy_lee@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210113070850.1184506-2-troy_lee@aspeedtech.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 13, 2021 at 07:08:45AM +0000, Troy Lee wrote: > 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. No need for generic descriptions. That's every 'reg'. What you need is how many entries and what each one is if more than 1. If only 1, then just 'maxItems: 1' > + > + clocks: > + description: > + phandle to clock provider with the clock number in the second cell Same here. > + > + resets: > + description: > + phandle to reset controller with the reset number in the second cell And here. > + > +patternProperties: > + "@[0-9]+$": If every node is a fan and there are up to 16: ^fan@[0-9a-f]$ > + 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. Units? Use a unit suffix and then drop the $ref. > + > + 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 0-255 is already the range of uint8, so drop. > + 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>; > + }; > + }; > +... > -- > 2.25.1 >