Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4216595ybi; Tue, 11 Jun 2019 02:59:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3HwGUsWliS/xcqNqocAaSPQHDYsaEolwpRLcTNXktmFCud+8Ei21GwZjDfkjmKrNbApFj X-Received: by 2002:a63:3c9:: with SMTP id 192mr14126761pgd.90.1560247163467; Tue, 11 Jun 2019 02:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560247163; cv=none; d=google.com; s=arc-20160816; b=nnW5vKYnYz6Ld74x5cmvGBIHGSX/Fgel7jbV8IbNf1AhzsdZnqOdd+oq68Xejs2YWT VaYMFtp5lWbX/cThBsOeJJ+p6Y4phPKadtjRnFDVPthvha6ljmH4VvKhn+TZX8GmrMnf c/40AdOIpEgXi6MjkH2g2WqHoXrgfMWPKWiWbO6WtyuaeUwcO4EK/rrY4tdTCeeFN9w8 ORGwY7Gphf11vItrK2Km+Q6d5mzQweU02V+h5rnWqnK3hjapRr9WhaUzwbEmdr1UfLOR +OZG1EhdUVZo0tWUHwg+afxuOWguG8zFItZx3DHBZ4T9vOL7JFsoe8XEu8WLYkpVqE9p btGw== 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 :message-id:date:subject:cc:to:from; bh=oAEWkb8L0kPz8jC+ir8TdJxP7y6tXfacVftGun1/+eE=; b=Mbcu834UUjGk34+fguCqFLVFjX3g5ucDKP4LS8nzkFYNkKrl7kUg9+USOul6dKdi2B E8WuoPvDDs7WUOZAERPSFrQV911A62FU3/Uh1bcBgEbyNwltFdUnXR9wA/n1zBzNWfFp XAFGpMwL05NSqpBLyojjEnFO/buelYFbtQjRKp/nLpeTk6/MnIEEqQoSkxqaJYV/FbnR PeAdBA7aVgLQJduLd1ctJCXA2LtBVlFGeMIwqeSWFoPp4S55IwAY+BjSMKITRwqBV+77 LQWzm7DiMW0HdlI1Fqeb60s7n6Spxx7cWCKZrSENwG699JxHMd81U2hM8M1s90q4MnDN FbZg== 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 m6si11704650pgv.230.2019.06.11.02.59.08; Tue, 11 Jun 2019 02:59:23 -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 S2404681AbfFKJ5Y (ORCPT + 99 others); Tue, 11 Jun 2019 05:57:24 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:39981 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727641AbfFKJ5W (ORCPT ); Tue, 11 Jun 2019 05:57:22 -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 8856A40016; Tue, 11 Jun 2019 09:57:16 +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 0/3] iio: afe: rescale: Add INFO_PROCESSED support Date: Tue, 11 Jun 2019 11:56:56 +0200 Message-Id: <20190611095659.29845-1-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 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 Hello everyone, You will find a small series that add the support of processed values for iio-rescale driver. Thanks to that, it is possible to read processed values in sysfs instead of getting only raw and scale values. Here is an example for a 3v3 voltage reading: # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_scale 3.791015625 # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_raw 879 # cat /sys/bus/iio/devices/iio\:device1/in_voltage0_input 3332 It is also possible to read directly the processed values using iio-hwmon driver (see example in patch03): # cat /sys/class/hwmon/hwmon0/in1_input 3328 I seperated my series in 3 patches: - Patch01: Move the scale conversion into a function to prepare the support of IIO_CHAN_INFO_PROCESSED. - Patch02: Add the support of IIO_CHAN_INFO_PROCESSED. - Patch03: Add an example of the use of hwmon and voltage-divider nodes in device-tree. If you have any feedbacks on it, I will be pleased to read them! Best regards, Mylène Mylène Josserand (3): iio: afe: rescale: Move scale conversion to new function iio: afe: rescale: Add support of CHAN_INFO_PROCESSED dt-bindings: iio: afe: Add hwmon example .../bindings/iio/afe/voltage-divider.txt | 24 ++++++ drivers/iio/afe/iio-rescale.c | 96 ++++++++++++++++------ 2 files changed, 96 insertions(+), 24 deletions(-) -- 2.11.0