Commit 97ffae1d authored by Thomas Betker's avatar Thomas Betker Committed by Jonathan Cameron

iio: adc: xilinx: Fix VREFN sign

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: default avatarThomas Betker <thomas.betker@rohde-schwarz.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 00db4e52
...@@ -997,7 +997,7 @@ static const struct iio_event_spec xadc_voltage_events[] = { ...@@ -997,7 +997,7 @@ static const struct iio_event_spec xadc_voltage_events[] = {
.num_event_specs = (_alarm) ? ARRAY_SIZE(xadc_voltage_events) : 0, \ .num_event_specs = (_alarm) ? ARRAY_SIZE(xadc_voltage_events) : 0, \
.scan_index = (_scan_index), \ .scan_index = (_scan_index), \
.scan_type = { \ .scan_type = { \
.sign = 'u', \ .sign = ((_addr) == XADC_REG_VREFN) ? 's' : 'u', \
.realbits = 12, \ .realbits = 12, \
.storagebits = 16, \ .storagebits = 16, \
.shift = 4, \ .shift = 4, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment