--- /dev/null
+What:          /sys/bus/iio/devices/iio:deviceX/buffer/length_align_bytes
+KernelVersion: 5.4
+Contact:       linux-iio@vger.kernel.org
+Description:
+               DMA buffers tend to have a alignment requirement for the
+               buffers. If this alignment requirement is not met samples might
+               be dropped from the buffer.
+
+               This property reports the alignment requirements in bytes.
+               This means that the buffer size in bytes needs to be a integer
+               multiple of the number reported by this file.
+
+               The alignment requirements in number of sample sets will depend
+               on the enabled channels and the bytes per channel. This means
+               that the alignment requirement in samples sets might change
+               depending on which and how many channels are enabled. Whereas
+               the alignment requirement reported in bytes by this property
+               will remain static and does not depend on which channels are
+               enabled.
 
 #include <linux/module.h>
 
 #include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
 #include <linux/iio/buffer.h>
 #include <linux/iio/buffer_impl.h>
 #include <linux/iio/buffer-dma.h>
        .abort = iio_dmaengine_buffer_abort,
 };
 
+static ssize_t iio_dmaengine_buffer_get_length_align(struct device *dev,
+       struct device_attribute *attr, char *buf)
+{
+       struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+       struct dmaengine_buffer *dmaengine_buffer =
+               iio_buffer_to_dmaengine_buffer(indio_dev->buffer);
+
+       return sprintf(buf, "%u\n", dmaengine_buffer->align);
+}
+
+static IIO_DEVICE_ATTR(length_align_bytes, 0444,
+                      iio_dmaengine_buffer_get_length_align, NULL, 0);
+
+static const struct attribute *iio_dmaengine_buffer_attrs[] = {
+       &iio_dev_attr_length_align_bytes.dev_attr.attr,
+       NULL,
+};
+
 /**
  * iio_dmaengine_buffer_alloc() - Allocate new buffer which uses DMAengine
  * @dev: Parent device for the buffer
 
        iio_dma_buffer_init(&dmaengine_buffer->queue, chan->device->dev,
                &iio_dmaengine_default_ops);
+       iio_buffer_set_attrs(&dmaengine_buffer->queue.buffer,
+               iio_dmaengine_buffer_attrs);
 
        dmaengine_buffer->queue.buffer.access = &iio_dmaengine_buffer_ops;