From patchwork Wed Mar 28 15:14:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 10313501 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4446360353 for ; Wed, 28 Mar 2018 15:15:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32B3B29614 for ; Wed, 28 Mar 2018 15:15:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 276FF29628; Wed, 28 Mar 2018 15:15:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8865286C4 for ; Wed, 28 Mar 2018 15:15:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753861AbeC1PPg (ORCPT ); Wed, 28 Mar 2018 11:15:36 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:35796 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753864AbeC1POM (ORCPT ); Wed, 28 Mar 2018 11:14:12 -0400 Received: by mail-pl0-f68.google.com with SMTP id p9-v6so1773498pls.2 for ; Wed, 28 Mar 2018 08:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cgLPgFFwh+ptiCbzT18n+lNgmyxp39RkAFsjZej8wVY=; b=rbA7iKyLcriLix+Jd0/DBZkkzQHmYIVGveSGrTTySDcvTos2LzGa1+XHLn0BiOVaDV dwIccLfC7LEWq8z3bVz9ztK3koBe/UuRDWXTtkDFmFDnLRhPSmr2cB5HPwX0udDbXfaI 7onqwrHyxEwPTFmvqVDQaEJzblYXOQjvh9sHZ5LOepcxOEPvPFzazx7CuAk2Ox2PrnBq eYVWXLIGlqjy2rgX+aKXoo/xMjP+DDg7q9Xi6/7GwG0PgfTqRsoTKv4Ea++sQfGX9XxF Tlt9/O5NieoN2C3jNdkDJOk6a1JkcBwvgtCIa80VW1tD9xrhiiT8mHQ/1fElYwdma9xW Ygcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cgLPgFFwh+ptiCbzT18n+lNgmyxp39RkAFsjZej8wVY=; b=FMsNcJdMtH87CvWouErj16O7pVRRG/85PEKCqSTsguvxxpE4t9BKXj8GuvTdszNqc9 vBL6swuB8IcdsFberTMmvwdXcW/6CH+fpmmp5uUWS0GtzFWTnfVAr88wtAdmFcPQNbiJ PZ88hi+MhgTsUXavXDk4QuvvgCLTav2qTf4Crcqf3fIcgCSmjIvhAbci8T+9kJoWEF95 ldCQFel/p+uEJ4T1XGywrrtiNfzR5qXR46QNgzUh5k9TZ6DSVu5h7xlvxWBF0cl8yrkd +XaEQoF4hOW0X7ue/GVJ800o2FRjLTFkOQLZBNpBOYcptGJPrG5jrfIcSmWOx4w7oLYF 6nxw== X-Gm-Message-State: AElRT7GZfp9v2D17kbtQp9WRRZ81LUNkNOjDB9PnQOYy/aU9PTqoJT0Y VJhyXeMJxIYw27wUF5YX+daF8A== X-Google-Smtp-Source: AIpwx49pcYH9sagSmtbV54SHOr5lucdloe65P897ylkOP64KHzcFrJVSgomzNouVIDh4K83FhRiyJg== X-Received: by 2002:a17:902:127:: with SMTP id 36-v6mr4255391plb.194.1522250052022; Wed, 28 Mar 2018 08:14:12 -0700 (PDT) Received: from tharvey.pdc.gateworks.com (68-189-91-139.static.snlo.ca.charter.com. [68.189.91.139]) by smtp.gmail.com with ESMTPSA id n8sm8204786pff.131.2018.03.28.08.14.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Mar 2018 08:14:11 -0700 (PDT) From: Tim Harvey To: Lee Jones , Rob Herring , Mark Rutland , Mark Brown , Dmitry Torokhov , Wim Van Sebroeck , Guenter Roeck Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-input@vger.kernel.org, linux-watchdog@vger.kernel.org Subject: [PATCH v3 1/4] dt-bindings: mfd: Add Gateworks System Controller bindings Date: Wed, 28 Mar 2018 08:14:00 -0700 Message-Id: <1522250043-8065-2-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522250043-8065-1-git-send-email-tharvey@gateworks.com> References: <1522250043-8065-1-git-send-email-tharvey@gateworks.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds documentation of device-tree bindings for the Gateworks System Controller (GSC). Signed-off-by: Tim Harvey --- v3: - replaced _ with - - remove input bindings - added full description of hwmon - fix unit address of hwmon child nodes --- .../devicetree/bindings/mfd/gateworks-gsc.txt | 135 +++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/gateworks-gsc.txt diff --git a/Documentation/devicetree/bindings/mfd/gateworks-gsc.txt b/Documentation/devicetree/bindings/mfd/gateworks-gsc.txt new file mode 100644 index 0000000..8f530ed --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/gateworks-gsc.txt @@ -0,0 +1,135 @@ +Gateworks System Controller multi-function device + +The GSC is a Multifunction I2C slave device with the following submodules: +- WDT +- GPIO +- Pushbutton controller +- HWMON + +Required properties: +- compatible : Must be "gw,gsc" +- reg: I2C address of the device +- interrupts: interrupt triggered by GSC_IRQ# signal +- interrupt-parent: Interrupt controller GSC is connected to +- #interrupt-cells: should be <1>, index of the interrupt within the + controller, in accordance with the "one cell" variant of + + +Optional nodes: +* watchdog: +The GSC provides a Watchdog monitor which can power cycle the board's +primary power supply on most board models when tripped. + +Required watchdog properties: +- compatible: must be "gw,gsc-watchdog" + +* hwmon: +The GSC provides a set of Analog to Digitcal Converter (ADC) pins used for +temperature and/or voltage monitoring. + +Required hwmon properties: +- compatible: must be "gw,gsc-hwmon" + +Optional hwmon properties: +- gw,reference-voltage: ADC reference voltage (mV) used in scaling raw ADCs +- gw,resolution: ADC resolution (ie 4096) used in scaling raw ADCs + +Each hwmon child node defines an ADC input on the chip which the GSC may +report cooked values (ie temperature sensor based on thermister), raw values, +(ie voltage rail with a pre-scaling resistor divider), or a fan controller +setpoint. + +Required hwmon child properties: +- type: one of the following ADC types: + "gw,hwmon-temperature" - reports temperature in C*10 + "gw,hwmon-voltage" - reports a pre-scaled voltage value + "gw,hwmon-voltage-raw" - reports a raw ADC that is scaled with + vreference, resolution, and optional resistor divider + "gw,hwmon-fan" - a fan temperature setpoint in C*10 +- reg: offset of the ADC register +- label: name of the ADC input or FAN setpoint + +Optional hwmon child properties: +- gw,voltage-divider: An array of two integers containing the resistor + values R1 and R2 of the optinal resistor divider on a raw ADC +- gw,voltage-offset: a mV voltage offset to apply to a raw ADC (ie to + compensate for a diode drop) + +Example: + + gsc: gsc@20 { + compatible = "gw,gsc"; + reg = <0x20>; + interrupt-parent = <&gpio1>; + interrupts = <4 GPIO_ACTIVE_LOW>; + interrupt-controller; + #interrupt-cells = <1>; + + watchdog { + compatible = "gw,gsc-watchdog"; + }; + + hwmon { + compatible = "gw,gsc-hwmon"; + #address-cells = <1>; + #size-cells = <0>; + gw,reference-voltage = <2500>; + gw,resolution = <4096>; + + hwmon@0 { /* A0: Board Temperature */ + type = "gw,hwmon-temperature"; + reg = <0x00>; + label = "temp"; + }; + + hwmon@2 { /* A1: Input Voltage (raw ADC) */ + type = "gw,hwmon-voltage-raw"; + reg = <0x02>; + label = "vdd_vin"; + gw,voltage-divider = <22100 1000>; + gw,voltage-offset = <800>; + }; + + hwmon@b { /* A2: Battery voltage */ + type = "gw,hwmon-voltage"; + reg = <0x0b>; + label = "vdd_bat"; + }; + + hwmon@2c { /* fan temperature setpoint for 50% duty */ + type = "gw,hwmon-fan"; + reg = <0x2c>; + label = "fan_50p"; + }; + + hwmon@2e { /* fan1 */ + type = "gw,hwmon-fan"; + reg = <0x2e>; + label = "fan_60p"; + }; + + hwmon@30 { /* fan2 */ + type = "gw,hwmon-fan"; + reg = <0x30>; + label = "fan_70p"; + }; + + hwmon@32 { /* fan3 */ + type = "gw,hwmon-fan"; + reg = <0x32>; + label = "fan_80p"; + }; + + hwmon@34 { /* fan4 */ + type = "gw,hwmon-fan"; + reg = <0x34>; + label = "fan_90p"; + }; + + hwmon@36 { /* fan5 */ + type = "gw,hwmon-fan"; + reg = <0x36>; + label = "fan_100p"; + }; + }; + };