On Tue, 2024-06-18 at 18:08 +0200, Olivier Moysan wrote: > Add iio_backend_read_raw() service to support attributes read > from an IIO backend. > > Signed-off-by: Olivier Moysan <olivier.moysan@xxxxxxxxxxx> > --- Small note. With it: Reviewed-by: Nuno Sa <nuno.sa@xxxxxxxxxx> > drivers/iio/industrialio-backend.c | 16 ++++++++++++++++ > include/linux/iio/backend.h | 3 +++ > 2 files changed, 19 insertions(+) > > diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio- > backend.c > index 929aff4040ed..b950e30018ca 100644 > --- a/drivers/iio/industrialio-backend.c > +++ b/drivers/iio/industrialio-backend.c > @@ -357,6 +357,22 @@ int devm_iio_backend_request_buffer(struct device *dev, > } > EXPORT_SYMBOL_NS_GPL(devm_iio_backend_request_buffer, IIO_BACKEND); > > +/** > + * iio_backend_read_raw - Request a value from the backend. > + * @back: Backend device > + * @val: First element of the returned value > + * @val2: Second element of the returned value > + * @mask: Specify value to retrieve > + * > + * RETURNS: > + * 0 on success, negative error number on failure. > + */ > +int iio_backend_read_raw(struct iio_backend *back, int *val, int *val2, long mask) > +{ > + return iio_backend_op_call(back, read_raw, val, val2, mask); > +} > +EXPORT_SYMBOL_NS_GPL(iio_backend_read_raw, IIO_BACKEND); > + I would completely mimic the IIO API (only change being indio_dev -> back). Meaning that 'struct iio_chan_spec const *chan' is missing. - Nuno Sá