[3.16.y-ckt stable] Patch "iio: adc: xilinx: Fix VREFN sign" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu May 28 10:56:10 UTC 2015


This is a note to let you know that I have just added a patch titled

    iio: adc: xilinx: Fix VREFN sign

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt13.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 784414120d345df93a3fc3989a23a45f9ec84dad Mon Sep 17 00:00:00 2001
From: Thomas Betker <thomas.betker at rohde-schwarz.com>
Date: Wed, 15 Apr 2015 21:11:50 +0200
Subject: iio: adc: xilinx: Fix VREFN sign

commit 97ffae1d30c3f6ceee67d5b0d3e540c08c13c744 upstream.

The VREFN channel is bipolar, not unipolar. Small negative values do
occur (e.g., -1mV), and unsigned conversion maps them incorrectly to
large positive values (about +1V), so fix this.

Signed-off-by: Thomas Betker <thomas.betker at rohde-schwarz.com>
Signed-off-by: Jonathan Cameron <jic23 at kernel.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/iio/adc/xilinx-xadc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 4976aed06344..c7637716fa8f 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -997,7 +997,7 @@ static const struct iio_event_spec xadc_voltage_events[] = {
 	.num_event_specs = (_alarm) ? ARRAY_SIZE(xadc_voltage_events) : 0, \
 	.scan_index = (_scan_index), \
 	.scan_type = { \
-		.sign = 'u', \
+		.sign = ((_addr) == XADC_REG_VREFN) ? 's' : 'u', \
 		.realbits = 12, \
 		.storagebits = 16, \
 		.shift = 4, \




More information about the kernel-team mailing list