Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2643480ybf; Mon, 2 Mar 2020 12:50:37 -0800 (PST) X-Google-Smtp-Source: ADFU+vudukhj2Pm0CLq7jJ+nIsBfalK7IweahelLJN5fVKTi16JywPwfLlQVj+V1XlwJSvNbITBz X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr856898otc.186.1583182237054; Mon, 02 Mar 2020 12:50:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583182237; cv=none; d=google.com; s=arc-20160816; b=xCOsvPS3EMv4/E/dr66hHtM+VXm/Rc+V3Ie75XN4IRhHVfU7WfRP3a2GoYq5845Y3Y VfRmPOA3sZp+95qQP82Xqex47DoT6/JbBEQWrWWokytY6uFgnGv5v66792Dgxg0JkI64 UN4lUkGOWy+5RlW5mby0U95uyC9SH2lsg8EuXHOCYG8YUBfyP8b86PLA13bF3Nd5JdY3 rvPgrKEowJT0IgCwFisRHdH6m/j8qI9LTaskhOesCXx2xtHFyIyApKr7OP0AIP1K5gOQ pROKSwFoURRhIjj7PAlcEUXBnBR4ryxGfRY3rF6JXcg8o/W323P0wTLWcPXLqRB8wi+T 5NcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qssGF9qFB2gzSIbry+qMVppu5nTfK3/hDKpshcwFd+Q=; b=l8gsNCetZsvP/MEy+ulRGtJnUW1vmBcjQwXkcI+hFf2hub5d7+QmgkLp0xK9YaB7oO iaE7W+exUgQ7su0P8GihisOpku6AHra9dDwRSj8BhLvUwB6MsdeKeqtOZeZraWJnUCED zSucMM4P7df6Dx6GazHJCKo8tnfmio3lXX8PWuLZbSPPZ9PcNXHX48BSHgCtV5wKzK/n h2Z5a/HRsaDRdnPDhuxw6wlwcv9oEynlD1e8BYKS3ZODKu1mpHuVuCXhAnlrsWkVzCw6 ql9r7NjN0qYpA64uT7sXtrcfIVciM6xt3NPfk11GqQ508DiOGufNlq8VlXF7iJ7enElq q0OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a123si778273oii.169.2020.03.02.12.50.24; Mon, 02 Mar 2020 12:50:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727059AbgCBUtw (ORCPT + 99 others); Mon, 2 Mar 2020 15:49:52 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:39324 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbgCBUtv (ORCPT ); Mon, 2 Mar 2020 15:49:51 -0500 Received: by mail-ot1-f68.google.com with SMTP id x97so702160ota.6; Mon, 02 Mar 2020 12:49:51 -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:user-agent; bh=qssGF9qFB2gzSIbry+qMVppu5nTfK3/hDKpshcwFd+Q=; b=mksnkTzBcXT/eRpzg/ri87qeKmNK01PXYoxCco0HHCK2F5KQxPvyvCAVjMY9mYD4uY x91OUizkJ/Ovsu2d32KE+IOJYGgbV/g4iR4rGh/TZR++lp624n41IhvRJxtlDQ0vFbar aRv4yW3YOr0HLoQJ0rp1j/0iZ/+4FfRa2TefAHytEgKlQfSTh9WqnUVTvUOT1lwI8Oue ic4bQ0/0MTA9b/RL2YUc9Rp61jvJZ9qsPbnh+A9jqH9H7rHftnwkMHVb9wLflEX7nrSt KuOTjq5h+yaFbaSDlCLUmRk12h42JQiPOiUeO+CWOnvQm8Yh9CFMvjn8X9lYaeUEYGVN e7mQ== X-Gm-Message-State: ANhLgQ3pGlEA0UnU/QZsqoZDafgRr/Zo8RuhFWzW1mXQn4yMtf5EsiUh vB8ALtNR4UK+iWIYAc2+vQ== X-Received: by 2002:a05:6830:1290:: with SMTP id z16mr828272otp.231.1583182190727; Mon, 02 Mar 2020 12:49:50 -0800 (PST) Received: from rob-hp-laptop (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id s12sm6698704oic.31.2020.03.02.12.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 12:49:50 -0800 (PST) Received: (nullmailer pid 5728 invoked by uid 1000); Mon, 02 Mar 2020 20:49:49 -0000 Date: Mon, 2 Mar 2020 14:49:49 -0600 From: Rob Herring To: Tim Harvey Cc: Lee Jones , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Jones Subject: Re: [PATCH v5 1/3] dt-bindings: mfd: Add Gateworks System Controller bindings Message-ID: <20200302204949.GA6649@bogus> References: <1582577665-13554-1-git-send-email-tharvey@gateworks.com> <1582577665-13554-2-git-send-email-tharvey@gateworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1582577665-13554-2-git-send-email-tharvey@gateworks.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2020 at 12:54:23PM -0800, Tim Harvey wrote: > This patch adds documentation of device-tree bindings for the > Gateworks System Controller (GSC). > > Signed-off-by: Tim Harvey > --- > v5: > - resolve dt_binding_check issues > > v4: > - move to using pwm_auto_point_{pwm,temp} for FAN PWM > - remove unncessary resolution/scaling properties for ADCs > - update to yaml > - remove watchdog > > v3: > - replaced _ with - > - remove input bindings > - added full description of hwmon > - fix unit address of hwmon child nodes > --- > .../devicetree/bindings/mfd/gateworks-gsc.yaml | 158 +++++++++++++++++++++ > 1 file changed, 158 insertions(+) > create mode 100644 Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml > > diff --git a/Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml b/Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml > new file mode 100644 > index 00000000..f7c1a05 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml > @@ -0,0 +1,158 @@ > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mfd/gateworks-gsc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Gateworks System Controller multi-function device > + > +description: | > + The GSC is a Multifunction I2C slave device with the following submodules: > + - Watchdog Timer > + - GPIO > + - Pushbutton controller > + - Hardware Monitore with ADC's for temperature and voltage rails and typo > + fan controller > + > +maintainers: > + - Tim Harvey > + - Robert Jones > + > +properties: > + $nodename: > + pattern: "gsc@[0-9a-f]{1,2}" > + compatible: > + const: gw,gsc That's not very specific. > + > + reg: > + description: I2C device address > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + interrupt-controller: true > + > + "#interrupt-cells": > + const: 1 > + description: The IRQ number description is wrong. You can just drop it. > + > + hwmon: 'hwmon' is a Linux thing. I'm suspicious... > + type: object > + description: Optional Hardware Monitoring module > + > + properties: > + compatible: > + const: gw,gsc-hwmon > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > + gw,fan-base: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: The fan controller base address Shouldn't this be described as a node in the DT or be implied by the compatible? > + > + patternProperties: > + "^adc@[0-2]$": There's only one number space at any level. So if you ever need anything else at this level, it can't have an address. Just something to consider. > + type: object > + description: | > + Properties for a single ADC which can report cooked values > + (ie temperature sensor based on thermister), raw values > + (ie voltage rail with a pre-scaling resistor divider). > + > + properties: > + reg: > + description: Register of the ADC > + maxItems: 1 > + > + label: > + description: Name of the ADC input > + > + type: Very generic property name, but it's not generic. Needs a vendor prefix at least. > + description: | > + temperature in C*10 (temperature), > + pre-scaled voltage value (voltage), > + or scaled based on an optional resistor divider and optional > + offset (voltage-raw) > + enum: > + - temperature > + - voltage > + - voltage-raw > + > + gw,voltage-divider: > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32-array > + description: values of resistors for divider on raw ADC input > + items: > + - description: R1 > + - description: R2 Needs a standard unit suffix. With that, you can drop the type reference. > + > + gw,voltage-offset: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | > + A positive uV voltage offset to apply to a raw ADC > + (ie to compensate for a diode drop). Needs a unit suffix. > + > + required: > + - type > + - reg > + - label > + > + required: > + - compatible > + - "#address-cells" > + - "#size-cells" > + > +required: > + - compatible > + - reg > + - interrupts > + - interrupt-controller > + - "#interrupt-cells" > + > +examples: > + - | > + #include > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + gsc@20 { > + compatible = "gw,gsc"; > + reg = <0x20>; > + interrupt-parent = <&gpio1>; > + interrupts = <4 GPIO_ACTIVE_LOW>; > + interrupt-controller; > + #interrupt-cells = <1>; > + > + hwmon { > + compatible = "gw,gsc-hwmon"; > + #address-cells = <1>; > + #size-cells = <0>; > + gw,fan-base = <0x2c>; > + > + adc@0 { /* A0: Board Temperature */ > + type = "temperature"; > + reg = <0x00>; > + label = "temp"; > + }; > + > + adc@2 { /* A1: Input Voltage (raw ADC) */ > + type = "voltage-raw"; > + reg = <0x02>; > + label = "vdd_vin"; > + gw,voltage-divider = <22100 1000>; > + gw,voltage-offset = <800000>; > + }; > + > + adc@b { /* A2: Battery voltage */ > + type = "voltage"; > + reg = <0x0b>; > + label = "vdd_bat"; > + }; > + }; > + }; > + }; > -- > 2.7.4 >