Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4215793ybi; Tue, 11 Jun 2019 02:58:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxM04HKTcpjgWmYcX/6Wo3BKfUEKR3RpWjWTG31Tso9yjxJlIAe49AizzQaqCPXR3s///zV X-Received: by 2002:a17:90a:2247:: with SMTP id c65mr25119134pje.24.1560247101976; Tue, 11 Jun 2019 02:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560247101; cv=none; d=google.com; s=arc-20160816; b=ci2vQfKNQVksMz50gR5/gvd5sOl3xHFvElgow/UL49G4K4dBLMM2g1bhEoMBHTEA+t HnLOKR+/RXz9fkePLEszi3kw3jPlpdWrPSGlgKREj/3ZORIJ5Pdx5pu1sZmzYS4HojQw OTFJcT9HEeWKiBmFsrQDkKG2isIfE+lAM8X5lu9Y5vi3O8IbvsMYeSaBR7hj62asSjag UOdzL3PYUJLd1+204ZBBaQSAfblAVeBxO6IGeEsn/uNQ60brVc6Zat32O0rVw7rr+xfd KxPoQzcOy9giIKpLGDhE/7lD38uBBC/3XG2FWDSKT8wXJItFlCieQkb5WfbhOQqcDxIQ 84SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bCabrfrglmyTj+7f73RkWnWyICaTiQ4R+tbfG8JN3eY=; b=CeQeb8LmzNVXvUotbt2tKBDMrM3uWKK+wDayA/JXWQT7tZ0l5fbDNGonbt8Rc9fIDO iOIAp1JR23JUuCZDrsVpWUgHqbXx8ZOF0Fy3m7po/5gEqQNAWqmoDX9Wnt7Js571F1mc mqojJPah3MKeqFLuJNJN6MJ4YtKwrzsw1gCdqlHT2kDS0ulowHyiNRsSaLtdb0E90VkJ 3k+xryeN7IZ7syjqUCRf97w4c2DiNIg6iS0aqNxQEs639iJCueekGwPQ3g2I5tDjLGaj gRe5FxIAAdr1SHQp5gDqful2gLb5MpGE/OTlZgk76zI125VG6dn7WsqyDCWbMOxskOLm 2b+w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si4497054plq.140.2019.06.11.02.58.07; Tue, 11 Jun 2019 02:58:21 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405143AbfFKJ5e (ORCPT + 99 others); Tue, 11 Jun 2019 05:57:34 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:60623 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405130AbfFKJ5c (ORCPT ); Tue, 11 Jun 2019 05:57:32 -0400 X-Originating-IP: 90.88.159.246 Received: from dell-desktop.home (aaubervilliers-681-1-40-246.w90-88.abo.wanadoo.fr [90.88.159.246]) (Authenticated sender: mylene.josserand@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 32F5240019; Tue, 11 Jun 2019 09:57:29 +0000 (UTC) From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?= To: peda@axentia.se, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, mylene.josserand@bootlin.com Subject: [PATCH v1 3/3] dt-bindings: iio: afe: Add hwmon example Date: Tue, 11 Jun 2019 11:56:59 +0200 Message-Id: <20190611095659.29845-4-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190611095659.29845-1-mylene.josserand@bootlin.com> References: <20190611095659.29845-1-mylene.josserand@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the support of CHAN_INFO_PROCESSED in voltage-divider, it is possible to read the processed values directly from iio's sysfs entries or by using iio-hwmon. Add an example for this last use case. Signed-off-by: Mylène Josserand --- .../bindings/iio/afe/voltage-divider.txt | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt b/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt index b452a8406107..f7e1c7cb2744 100644 --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt @@ -51,3 +51,27 @@ sysv { spi-max-frequency = <1000000>; }; }; + +It is also possible to retrieve the processed values using hwmon node: + +div0: div0 { + compatible = "voltage-divider"; + io-channels = <&adc0 0>; /* Channel 0 of the ADC */ + output-ohms = <47>; /* R2 */ + full-ohms = <73>; /* R1 (26) + R2 (47) */ + #io-channel-cells = <1>; +}; + +div1: div1 { + compatible = "voltage-divider"; + io-channels = <&adc0 1>; /* Channel 1 of the ADC */ + output-ohms = <47>; /* R2 */ + full-ohms = <115>; /* R1 (68) + R2 (47) */ + #io-channel-cells = <1>; +}; + +iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&div0 0>, <&div1 0>; + io-channel-names = "3v3", "usb"; +}; -- 2.11.0