Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2261999pja; Thu, 26 Mar 2020 12:14:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vueVbYsjwZCs///0t4pP33KK+n2yUvA268b2dDrCMcbynPOuNqPQoxt5Rxb0/ijvD7z0RUX X-Received: by 2002:a05:6808:2c7:: with SMTP id a7mr1355462oid.149.1585250055237; Thu, 26 Mar 2020 12:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585250055; cv=none; d=google.com; s=arc-20160816; b=A+Cn++dQCxuFpFTXBVQh3gxpfcZk2IigVJdGxJ27kQSIb0HaegG0Wxzh3euEct29/7 Pfl3fDWAIOwdwFALXqghx50y3VHenqNRa9XQIDe57bHfdFdqglkoev2/Z1HoKtRHPxIw 7zfbQJnO1W8/UJ6/MUKWtCJyxDJHpaVVwMKa3g0iC62jElRQiEHb860T+kVGaNb6bPpR jhcywsKnhB4ipVe7PVXIT9M9DhyXmcxhd6iNgjqbaOvOMpivIJRe5MuQpRzkqwLrpEB5 2C/2KMJW2GKoMmhdar6vRArk/ReBnGVPdpyjH0cO0o+znfMgXCF94g/Ta9yWgtI018h5 PSuw== 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=lV2UHAI4DrIYW6rSj3tPA5hIszzj928pZD3nBI8/xbM=; b=NAXZuBDKPmi/QpvjXrLGxYjeKhB1KNThdhzO1+k3i3hRESccbBNpaMFCFh5zlH/QqY N+XjeGcytXhsoGkPEmowCvMEewI7BXrNwEZb2gG2i9nTg09l6ik4CxGZj4xorTbFV30c tbAVRHZSVqiaB9a4pszIpok5vZVPCPtLDooIdF2MJ8NapE2RpKJS8K3Zti9ynpXoSG0A A1qXrYwONOioC92Lj8k8qdkeUCE7s6GTDhbeX4dIyEbAPMuvwXT4ycGS1BU4TIG7xBuk yOXC5DZWvIHNZvH7t/mJSDg6bZtObs0mweMuwOkvuWJdaBCo10osHnsm0bX2+Q22GPLp mn2g== 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 d13si1348585oij.140.2020.03.26.12.14.00; Thu, 26 Mar 2020 12:14:15 -0700 (PDT) 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 S1727851AbgCZTNc (ORCPT + 99 others); Thu, 26 Mar 2020 15:13:32 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:34322 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbgCZTNb (ORCPT ); Thu, 26 Mar 2020 15:13:31 -0400 Received: by mail-io1-f65.google.com with SMTP id h131so7319362iof.1; Thu, 26 Mar 2020 12:13:30 -0700 (PDT) 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=lV2UHAI4DrIYW6rSj3tPA5hIszzj928pZD3nBI8/xbM=; b=JXIB1gFjcX/3TDOnLuf+TAXf9iUCxsGcSZUxKJlxEqhZcJ35GS+6U/dw4W44+pyKii YGzGi9swrRcv8RtqbWnWjlHzY4pq0Y5cAj2nzxd/4s85CR8DjHI6CMX1CIkZXcrTFqRH 8KWkIkyCN8EhOJjyjsbodkW3ftC1kkR4BrR8Ksn9oUq4yf95gddpNnlO0O5XH8psTNki CekaHCt75Fn5g8LR798uJ79f0wT5HL9UAX2vS8NeA9Q+6/Tdh33qhO9PKuhEqoM7nKWZ QjhP++v/L6vjCw/8TojBtnvldCam/uL8dfnna4QEzDL6yNqBWX7ch++zvizosZpeZhoM Gz6g== X-Gm-Message-State: ANhLgQ2TK32TFeoDMe+UyBQAAxWMHBhhGjM8GY1I4EutNe1gh1y6dElq sfeq94jeK6/pX7M4XzpAyg== X-Received: by 2002:a5d:84d0:: with SMTP id z16mr8987488ior.88.1585250010123; Thu, 26 Mar 2020 12:13:30 -0700 (PDT) Received: from rob-hp-laptop ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id j18sm1091552ila.56.2020.03.26.12.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:13:28 -0700 (PDT) Received: (nullmailer pid 32104 invoked by uid 1000); Thu, 26 Mar 2020 19:13:27 -0000 Date: Thu, 26 Mar 2020 13:13:27 -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 v7 1/3] dt-bindings: mfd: Add Gateworks System Controller bindings Message-ID: <20200326191327.GA27256@bogus> References: <1584736550-7520-1-git-send-email-tharvey@gateworks.com> <1584736550-7520-2-git-send-email-tharvey@gateworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1584736550-7520-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 Fri, Mar 20, 2020 at 01:35:48PM -0700, Tim Harvey wrote: > This patch adds documentation of device-tree bindings for the > Gateworks System Controller (GSC). > > Signed-off-by: Tim Harvey > --- > v7: > - change divider from mili-ohms to ohms > - add constraints for voltage divider and offset > - remove unnecessary ref for offset > - renamed fan to fan-controller and changed base prop to reg > > v6: > - fix typo > - drop invalid description from #interrupt-cells property > - fix adc pattern property > - add unit suffix > - replace hwmon/adc with adc/channel > - changed adc type to mode and enum int > - add unit suffix and drop ref for voltage-divider > - moved fan to its own subnode with base register > > 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 | 173 +++++++++++++++++++++ > 1 file changed, 173 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..0457137 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml > @@ -0,0 +1,173 @@ > +# 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 Monitor with ADC's for temperature and voltage rails and > + fan controller > + > +maintainers: > + - Tim Harvey > + - Robert Jones > + > +properties: > + $nodename: > + pattern: "gsc@[0-9a-f]{1,2}" > + compatible: > + const: gw,gsc > + > + reg: > + description: I2C device address > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + interrupt-controller: true > + > + "#interrupt-cells": > + const: 1 > + > + adc: > + type: object > + description: Optional Hardware Monitoring module > + > + properties: > + compatible: > + const: gw,gsc-adc > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > + patternProperties: > + "^channel@[0-9]+$": > + 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 > + > + gw,mode: > + description: | > + conversion mode: > + 0 - temperature, in C*10 > + 1 - pre-scaled voltage value > + 2 - scaled voltage based on an optional resistor divider > + and optional offset > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32 > + enum: [0, 1, 2] > + > + gw,voltage-divider-ohms: > + description: values of resistors for divider on raw ADC input > + maxItems: 2 > + items: > + minimum: 1000 > + maximum: 1000000 > + > + gw,voltage-offset-microvolt: > + description: | > + A positive voltage offset to apply to a raw ADC > + (ie to compensate for a diode drop). > + minimum: 0 > + maximum: 1000000 > + > + required: > + - gw,mode > + - reg > + - label > + > + required: > + - compatible > + - "#address-cells" > + - "#size-cells" > + > + fan-controller: > + type: object > + description: Optional FAN controller > + > + properties: > + compatible: > + const: gw,gsc-fan > + > + reg: > + description: The fan controller base address > + maxItems: 1 > + > + required: > + - compatible > + - reg > + > +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>; > + > + adc { > + compatible = "gw,gsc-adc"; > + #address-cells = <1>; > + #size-cells = <0>; > + > + channel@0 { /* A0: Board Temperature */ > + reg = <0x00>; > + label = "temp"; > + gw,mode = <0>; > + }; > + > + channel@2 { /* A1: Input Voltage (raw ADC) */ > + reg = <0x02>; > + label = "vdd_vin"; > + gw,mode = <1>; > + gw,voltage-divider-ohms = <22100 1000>; > + gw,voltage-offset-microvolt = <800000>; > + }; > + > + channel@b { /* A2: Battery voltage */ > + reg = <0x0b>; > + label = "vdd_bat"; > + gw,mode = <1>; > + }; > + }; > + > + fan-controller { fan-controller@2c (and the schema will need to be changed either to the above or a pattern) With that, Reviewed-by: Rob Herring > + compatible = "gw,gsc-fan"; > + reg = <0x2c>; > + }; > + }; > + }; > -- > 2.7.4 >