Skip to content

Commit

Permalink
iio: adc: ad9361: Fix out_voltage0_hardwaregain_available reading
Browse files Browse the repository at this point in the history
The hardwaregain_available attribute should read the values in dB, the
same way writing expects them.

[-89.750000 0.250000 0.000000]


Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
  • Loading branch information
mhennerich committed Nov 5, 2018
1 parent 6827f3d commit c726813
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/iio/adc/ad9361.c
Original file line number Diff line number Diff line change
Expand Up @@ -7880,9 +7880,10 @@ 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] = {-89750, 250, 0};
static const int tx_hw_gain[] =
{89, -750000, 0, 250000, 0, 0};
*vals = tx_hw_gain;
*type = IIO_VAL_INT;
*type = IIO_VAL_INT_PLUS_MICRO;
return IIO_AVAIL_RANGE;
} else {
st->rx_gain_avail[0] = phy->gt_info[ad9361_gt(phy)].abs_gain_tbl[0];
Expand Down

1 comment on commit c726813

@mhennerich
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups ... My intention was to push this to a branch and create a PR ... anyways it's here now.
If someone has any objections - please let me know.

Please sign in to comment.