Skip to content

Commit

Permalink
staging:iio:ad7192: Mark channels as unsigned
Browse files Browse the repository at this point in the history
The values reported by the AD7793 are unsigned.
	In uniploar mode:
			0x000000 is zeroscale
			0xffffff is fullscale
	In bipolar mode:
			0x000000 is negative fullscale
			0x800000 is zeroscale
			0xffffff is positive fullscale

In bipolar mode there is a binary offset, but the values are still unsigned.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Aug 16, 2012
1 parent 74aa933 commit a684a0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/iio/adc/ad7192.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ static const struct iio_info ad7195_info = {
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)}
.scan_type = IIO_ST('u', 24, 32, 0)}

#define AD7192_CHAN(_chan, _address, _si) \
{ .type = IIO_VOLTAGE, \
Expand All @@ -955,7 +955,7 @@ static const struct iio_info ad7195_info = {
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)}
.scan_type = IIO_ST('u', 24, 32, 0)}

#define AD7192_CHAN_TEMP(_chan, _address, _si) \
{ .type = IIO_TEMP, \
Expand All @@ -965,7 +965,7 @@ static const struct iio_info ad7195_info = {
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)}
.scan_type = IIO_ST('u', 24, 32, 0)}

static struct iio_chan_spec ad7192_channels[] = {
AD7192_CHAN_DIFF(1, 2, NULL, AD7192_CH_AIN1P_AIN2M, 0),
Expand Down

0 comments on commit a684a0c

Please sign in to comment.