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: 10313483 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 C92A960383 for ; Wed, 28 Mar 2018 15:14:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B66E12870F for ; Wed, 28 Mar 2018 15:14:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A99F32963B; Wed, 28 Mar 2018 15:14:34 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B125A2870F for ; Wed, 28 Mar 2018 15:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5QYT5IjS5+36KUJ8HyFTHdm6fEcM+OXyP/gwbhAnyV0=; b=QJ7ruY0Dm6t4Cjg9LUbusCP34r +Kr5W8Va5Czk/jVVYFYa/sxvR+ChVsKjaIVOdXAZ43TELHdIgpFkhtzWjUD1zV4u5aaZOHkgezKgb 5NKxgdyF2ac7oMIMWBFrO+fe25B9ADWD5RtGR19jOcIaXGzVlPvPsj/lMVq7qBqVFNyoAqQKhQ0XW 2RgMBClhl64MmAgyLY0YlE0Xoju3zunHLksIwrviQpuFb1Shn6EuegYBHKM6kS1QIQV917Qc8YdVh eiGh9w7lcZ0cggG44vubIdVA8mGHgNx4xxbwx0w2LblrulC50mvrz5SFJQ6z/de7+7taTSDQ7jPUp ytjr6oQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1CmR-0004o0-D9; Wed, 28 Mar 2018 15:14:27 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1CmN-0004la-4h for linux-arm-kernel@lists.infradead.org; Wed, 28 Mar 2018 15:14:24 +0000 Received: by mail-pl0-x243.google.com with SMTP id s24-v6so1763303plq.6 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=oZhK+BByQKBp4IFyvy0TL1+UYGoKdJxAthRCZfd4+0lQs9tO4yQXIrZxHAGywlrHIj sUHCUHnjxiTeWGWBKKVrOpFmkFO8O6IO07vuSrlJossWxiQA+CmbAcmLrc5AkBdKJTTj ScfWekwTusdZEuUVc+UXWrVvuiEKLoHVggSB40Bd4uc1s7GrKc6MRUGh13AqMpErEJb1 S+PM3Z7i6eR9cs7mYRQApGB/1A1RbfOMzeI/UJjwtAQtuMXlHXMfUfGou0/EOYJDX6Dc LjJHm5vwoZQ6OxkVOnS9mgxEoOKYwYwq348ZIg4wIgCSTBAbY0XSiZF2GOyG6Mao2FKq 19+g== X-Gm-Message-State: AElRT7Hl2it1OiEQniqbOhJ9/PsZm68yDsfwTftkbi+LzaOzSvpQas6E VZC95nAPfi+hWL99HhD1QxuZjQ== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180328_081423_208986_9D757DA4 X-CRM114-Status: GOOD ( 16.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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"; + }; + }; + };