@@ -1982,6 +1982,18 @@ void iio_buffer_put(struct iio_buffer *buffer)
}
EXPORT_SYMBOL_GPL(iio_buffer_put);
+/**
+ * iio_buffer_set_dir() - Set the buffer direction
+ * @buffer: The buffer to set the direction
+ * @direction: The direction
+ */
+void iio_buffer_set_dir(struct iio_buffer *buffer,
+ enum iio_buffer_direction direction)
+{
+ buffer->direction = direction;
+}
+EXPORT_SYMBOL(iio_buffer_set_dir);
+
/**
* iio_device_attach_buffer - Attach a buffer to a IIO device
* @indio_dev: The device the buffer should be attached to
@@ -55,4 +55,7 @@ bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
int iio_device_attach_buffer(struct iio_dev *indio_dev,
struct iio_buffer *buffer);
+void iio_buffer_set_dir(struct iio_buffer *buffer,
+ enum iio_buffer_direction direction);
+
#endif /* _IIO_BUFFER_GENERIC_H_ */