From patchwork Sat Jul 16 00:18:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 9232937 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 B39F860868 for ; Sat, 16 Jul 2016 00:20:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5E22212DB for ; Sat, 16 Jul 2016 00:20:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 999452522B; Sat, 16 Jul 2016 00:20:47 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 564E5212DB for ; Sat, 16 Jul 2016 00:20:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bODK9-00065w-8Q; Sat, 16 Jul 2016 00:19:17 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bODJs-0005yD-4n for linux-arm-kernel@lists.infradead.org; Sat, 16 Jul 2016 00:19:02 +0000 Received: by mail-pf0-x242.google.com with SMTP id t190so7148033pfb.2 for ; Fri, 15 Jul 2016 17:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=X/ibknEk093VUvC9LBuaNpKDwEt4X7TL/eoILy0jquQ=; b=ikwa86LQ0ZR+Jhzpnbpn99IyEGcciLweQjIhyWjATfvQGyrjp7ojZpJgfR2Q3o1UuF zlygxkCsDtOtrs6KxyF4PAbBaNOAfPqRe5Oe9EZfbEjDX703LpzjpZJK1TnpJBdbKAs0 A9wNf3gn83fuNT1C+C5lEqe00ntEsHjUV63TF1pESYddG+nZ/YBop10xc//NVVUOvf9U V85Bzdnpi9SYtnGcXgmPoF7eOYOaO/LxaNUJhXxJ9evXcM2OCIz4mDZZbV5I3BKMCpMc yNrNWe1O+X56x5/4q/wa7Lc2EPPvFczpK6zt54+kECizKt0XoAM1QIVkwcPpK32CjdYz s3BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=X/ibknEk093VUvC9LBuaNpKDwEt4X7TL/eoILy0jquQ=; b=kp2V5PH5m6ba+Up4Vjj2xzx+kZQidvjyC3xUaCII/MXDwq6//wyezOorwnogz9Hy2G CW+00a3w2G7ypTmoscvatQY5O9Cxh35gwgptaGjJHsG+B51aVUMx2jT0jeBQH+HsENE1 p6s2pU/e3lA55sNcGvJm1f/8+BJjIgVKQDq2/NpLP19Qe78OIbt6pTzVn8RvZ3r15yas EIJ4Zc3vJgzi/w6c/sbhaR3dVYhbIIMlZRGZjYEqc4TFKzkvCIih1tmO2lExaeDXV06v Aft8uQEfW7MmNP9IDXZGiegYZ4vD1CV4733lDMuhJc/hVu6oWl53YewRKcmxsFoCWnmH mjyw== X-Gm-Message-State: ALyK8tJHGJ538acy+TNz633FIQ5dCSwDhm2d5gJ6ZPHZRDkagnyFxCREjmKDplEzpjqHXQ== X-Received: by 10.98.104.71 with SMTP id d68mr15400120pfc.163.1468628319728; Fri, 15 Jul 2016 17:18:39 -0700 (PDT) Received: from localhost.localdomain (68-185-59-186.static.knwc.wa.charter.com. [68.185.59.186]) by smtp.gmail.com with ESMTPSA id d1sm7077531pas.48.2016.07.15.17.18.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Jul 2016 17:18:38 -0700 (PDT) From: Joshua Clayton To: Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Fabio Estevam , Russell King , Jean Delvare , Guenter Roeck , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org Subject: [RCF 2/3] hwmon: Document bindings for ads1118 adc driver Date: Fri, 15 Jul 2016 17:18:22 -0700 Message-Id: <49eddbb75c677db62701e229330f0f5c35983130.1468626668.git.stillcompiling@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160715_171900_386798_1CCA43B9 X-CRM114-Status: GOOD ( 15.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joshua Clayton 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 ads1118 is a 4 input 16 bit adc with a buit-in temperature gauge Signed-off-by: Joshua Clayton --- .../devicetree/bindings/hwmon/ads1118.txt | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/ads1118.txt diff --git a/Documentation/devicetree/bindings/hwmon/ads1118.txt b/Documentation/devicetree/bindings/hwmon/ads1118.txt new file mode 100644 index 0000000..41c66dc --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/ads1118.txt @@ -0,0 +1,81 @@ +ADS1118 (SPI) + +The ADS1118 is 16-bit analog to digital converter with 4 inputs and a +temperature sensor. +The ADS1018 is a 12-bit version of the chip. + +The inputs can be single ended or differential pair combinations. + +Each channel, 0 - 4 may be configured as a single ended adc input. +Channel 0 may be configured differentially with channel 1. +Channels 0, 1, or 2 may be configured differentially with channel 3. + +To set up a differential pair, the lower channel should be have +the ti,differential-endpoint property set to the higher channel in the pair. + +Each channel can be configured individually: + - fullscale voltage range values are +/- microvolts + 6144000, 4096000, 2048000, 1024000, 512000, or 256000 + + - data_rate in samples per second + - for the ads1018: + 128, 250, 490, 920, 1600, 2400, or 3300 + - for the ads1118: + 8, 16, 32, 64, 128, 250, or 860 + +The sensor contains an internal pullup register to keep the data output +high when not in use. This may be disabled, but is enabled by default. + +1) The /ads1118 node + + Required properties: + + - compatible : must be "ti,ads1018" or "ti,ads1118" + - spi-cpha : spi phase set to 1 (spi polarity is 0) + - reg : the spi chipselect address + - #address-cells : must be <1> + - #size-cells : must be <0> + + Optional properties: + + - ti,tempsensor: enable the temperature sensor + - ti,pullup-disable: disable the internal pullup resistor + + The node contains child nodes for each channel that the platform uses. + +2) channel nodes + + Required properties: + + - reg : the channel number (0, 1, 2, or 3) + + Optional properties: + + - ti,differential-endpoint: differential second endpoint. + - ti,fullscale: fullscale range in +/- microvolts + - ti,datarate : the converter data rate in samples / second + + Example ADS1118 node: + + ads1118@0 { + compatible = "ti,ads1118"; + spi-max-frequency = <2450000>; + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + ti,tempsensor; + voltage0@0 { + reg = <0>; + ti,fullscale = <6144000>; + ti,datarate = <860>; + ti,differential-endpoint = <1>; + }; + voltage1@3 { + reg = <3>; + ti,fullscale = <6144000>; + ti,datarate = <475>; + }; + }; + +For the above example, The temperature sensor is enabled as well as +channels 0 and 1 in differential mode, and channel 3 single ended.