Skip to content

Commit

Permalink
iio: adc: xilinx: Fix VREFN sign
Browse files Browse the repository at this point in the history
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>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Thomas Betker authored and Jonathan Cameron committed Apr 19, 2015
1 parent 00db4e5 commit 97ffae1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/xilinx-xadc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down

0 comments on commit 97ffae1

Please sign in to comment.