Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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, \