Commit 0cc97f2e authored by Beniamin Bia's avatar Beniamin Bia Committed by Jonathan Cameron

iio: amplifiers: ad8366: Add write_raw_get_fmt function

This patch add write_raw_get_fmt function to specify conversion for
hardware gain.
Signed-off-by: default avatarBeniamin Bia <beniamin.bia@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent b8528224
...@@ -180,9 +180,22 @@ static int ad8366_write_raw(struct iio_dev *indio_dev, ...@@ -180,9 +180,22 @@ static int ad8366_write_raw(struct iio_dev *indio_dev,
return ret; return ret;
} }
static int ad8366_write_raw_get_fmt(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
long mask)
{
switch (mask) {
case IIO_CHAN_INFO_HARDWAREGAIN:
return IIO_VAL_INT_PLUS_MICRO_DB;
default:
return -EINVAL;
}
}
static const struct iio_info ad8366_info = { static const struct iio_info ad8366_info = {
.read_raw = &ad8366_read_raw, .read_raw = &ad8366_read_raw,
.write_raw = &ad8366_write_raw, .write_raw = &ad8366_write_raw,
.write_raw_get_fmt = &ad8366_write_raw_get_fmt,
}; };
#define AD8366_CHAN(_channel) { \ #define AD8366_CHAN(_channel) { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment