Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: backend: add support for data alignment

Add backend support for staring the capture synchronization.
When activated, it initates a proccess that aligns the sample's most
significant bit (MSB) based solely on the captured data, without
considering any other external signals.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://patch.msgid.link/20250516082630.8236-3-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
995fd6e0 dc384418

+26
+23
drivers/iio/industrialio-backend.c
··· 827 827 EXPORT_SYMBOL_NS_GPL(iio_backend_filter_type_set, "IIO_BACKEND"); 828 828 829 829 /** 830 + * iio_backend_interface_data_align - Perform the data alignment process. 831 + * @back: Backend device 832 + * @timeout_us: Timeout value in us. 833 + * 834 + * When activated, it initates a proccess that aligns the sample's most 835 + * significant bit (MSB) based solely on the captured data, without 836 + * considering any other external signals. 837 + * 838 + * The timeout_us value must be greater than 0. 839 + * 840 + * RETURNS: 841 + * 0 on success, negative error number on failure. 842 + */ 843 + int iio_backend_interface_data_align(struct iio_backend *back, u32 timeout_us) 844 + { 845 + if (!timeout_us) 846 + return -EINVAL; 847 + 848 + return iio_backend_op_call(back, interface_data_align, timeout_us); 849 + } 850 + EXPORT_SYMBOL_NS_GPL(iio_backend_interface_data_align, "IIO_BACKEND"); 851 + 852 + /** 830 853 * iio_backend_ddr_enable - Enable interface DDR (Double Data Rate) mode 831 854 * @back: Backend device 832 855 *
+3
include/linux/iio/backend.h
··· 110 110 * @debugfs_print_chan_status: Print channel status into a buffer. 111 111 * @debugfs_reg_access: Read or write register value of backend. 112 112 * @filter_type_set: Set filter type. 113 + * @interface_data_align: Perform the data alignment process. 113 114 * @ddr_enable: Enable interface DDR (Double Data Rate) mode. 114 115 * @ddr_disable: Disable interface DDR (Double Data Rate) mode. 115 116 * @data_stream_enable: Enable data stream. ··· 165 164 unsigned int writeval, unsigned int *readval); 166 165 int (*filter_type_set)(struct iio_backend *back, 167 166 enum iio_backend_filter_type type); 167 + int (*interface_data_align)(struct iio_backend *back, u32 timeout_us); 168 168 int (*ddr_enable)(struct iio_backend *back); 169 169 int (*ddr_disable)(struct iio_backend *back); 170 170 int (*data_stream_enable)(struct iio_backend *back); ··· 210 208 struct iio_dev *indio_dev); 211 209 int iio_backend_filter_type_set(struct iio_backend *back, 212 210 enum iio_backend_filter_type type); 211 + int iio_backend_interface_data_align(struct iio_backend *back, u32 timeout_us); 213 212 int iio_backend_ddr_enable(struct iio_backend *back); 214 213 int iio_backend_ddr_disable(struct iio_backend *back); 215 214 int iio_backend_data_stream_enable(struct iio_backend *back);