Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1157482 > unrolled thread

[PATCH 4.0 039/148] iio: adc: xilinx: Fix VREFN sign

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2015-06-03 14:30 +0200
Last post2015-06-03 14:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.0 039/148] iio: adc: xilinx: Fix VREFN sign Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 14:30 +0200

#1157482 — [PATCH 4.0 039/148] iio: adc: xilinx: Fix VREFN sign

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-06-03 14:30 +0200
Subject[PATCH 4.0 039/148] iio: adc: xilinx: Fix VREFN sign
Message-ID<pxfY0-SD-57@gated-at.bofh.it>
4.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Betker <thomas.betker@rohde-schwarz.com>

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@rohde-schwarz.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/xilinx-xadc-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 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_
 	.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, \


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web