mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ludovic Desroches <ludovic.desroches@atmel.com>
To: <jic23@kernel.org>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <nicolas.ferre@atmel.com>,
	Ludovic Desroches <ludovic.desroches@atmel.com>
Subject: [PATCH v2 1/2] iio: core: introduce IIO_CHAN_INFO_SIGNED
Date: Mon, 7 Mar 2016 15:29:56 +0100	[thread overview]
Message-ID: <1457360997-29179-2-git-send-email-ludovic.desroches@atmel.com> (raw)
In-Reply-To: <1457360997-29179-1-git-send-email-ludovic.desroches@atmel.com>

The same channel can be used to perform a signed or an unsigned
conversion. Add a new infomask element to be able to select the type of
conversion wanted: a raw one or a signed raw one.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 Documentation/ABI/testing/sysfs-bus-iio | 10 ++++++++++
 drivers/iio/industrialio-core.c         |  1 +
 include/linux/iio/iio.h                 |  1 +
 3 files changed, 12 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 3c66248..161733c 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -1501,3 +1501,13 @@ Contact:	linux-iio@vger.kernel.org
 Description:
 		Raw (unscaled no offset etc.) pH reading of a substance as a negative
 		base-10 logarithm of hydrodium ions in a litre of water.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_signed
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_signed
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_signed
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_signed
+KernelVersion:	4.7
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Signed (unscaled no bias removal etc.) voltage measurement from
+		channel Y.
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 70cb7eb..fb2ca27 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -147,6 +147,7 @@ static const char * const iio_chan_info_postfix[] = {
 	[IIO_CHAN_INFO_DEBOUNCE_TIME] = "debounce_time",
 	[IIO_CHAN_INFO_CALIBEMISSIVITY] = "calibemissivity",
 	[IIO_CHAN_INFO_OVERSAMPLING_RATIO] = "oversampling_ratio",
+	[IIO_CHAN_INFO_SIGNED] = "signed",
 };
 
 /**
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index b2b1677..6f5eb24 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -46,6 +46,7 @@ enum iio_chan_info_enum {
 	IIO_CHAN_INFO_DEBOUNCE_TIME,
 	IIO_CHAN_INFO_CALIBEMISSIVITY,
 	IIO_CHAN_INFO_OVERSAMPLING_RATIO,
+	IIO_CHAN_INFO_SIGNED,
 };
 
 enum iio_shared_by {
-- 
2.5.0

  reply	other threads:[~2016-03-07 14:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 14:29 [PATCH v2 0/2] iio: add support for signed conversions Ludovic Desroches
2016-03-07 14:29 ` Ludovic Desroches [this message]
2016-03-07 20:09   ` [PATCH v2 1/2] iio: core: introduce IIO_CHAN_INFO_SIGNED Lars-Peter Clausen
2016-03-09 21:04     ` Jonathan Cameron
2016-03-10 13:23       ` Ludovic Desroches
2016-03-07 14:29 ` [PATCH v2 2/2] iio:adc:at91-sama5d2: add support for signed conversion Ludovic Desroches
2016-03-07 20:04   ` Lars-Peter Clausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457360997-29179-2-git-send-email-ludovic.desroches@atmel.com \
    --to=ludovic.desroches@atmel.com \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®