Skip to content

Commit

Permalink
drivers: iio: ad9361: Fix out_volatge_hardwaregain_available readings
Browse files Browse the repository at this point in the history
The AD9361 user space API refers attenuation as negative gain.
Fix hardwaregain_available attribute to conform to the notation
of [start, increment, stop].

Signed-off-by: Michael Hennerich <[email protected]>
  • Loading branch information
mhennerich authored and commodo committed Jul 16, 2018
1 parent c3138bd commit f307784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/ad9361.c
Original file line number Diff line number Diff line change
Expand Up @@ -7862,7 +7862,7 @@ static int ad9361_phy_read_avail(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_HARDWAREGAIN:
if (chan->output) {
static const int tx_hw_gain[3] = {0, 250, 89750};
static const int tx_hw_gain[3] = {-89750, 250, 0};
*vals = tx_hw_gain;
*type = IIO_VAL_INT;
return IIO_AVAIL_RANGE;
Expand Down

0 comments on commit f307784

Please sign in to comment.