Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: > But do you agree with the general stance that we should > give precedence to using iio_read_channel_processed() > and multiply the result with 1000? It should work with > any driver I think. In order to preserve resolution of the microVolt value for existing code, I'd prefer a solution similar to the existing implementation of iio_read_channel_processed. Sans error handling: int uv; if (iio_channel_has_info(chan->channel, IIO_CHAN_INFO_PROCESSED)) { int mv; iio_read_channel_processed(channel, &mv); uv = 1000 * mv; } else { int raw; iio_read_channel_raw(channel, &raw); iio_convert_raw_to_processed(channel, raw, &uv, 1000); } return uv;