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: adc: adi-axi-adc: add num lanes support

Add support for setting the number of lanes enabled.

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

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
569ddc41 d2ca659c

+15
+15
drivers/iio/adc/adi-axi-adc.c
··· 44 44 #define ADI_AXI_ADC_REG_CONFIG_CMOS_OR_LVDS_N BIT(7) 45 45 46 46 #define ADI_AXI_ADC_REG_CTRL 0x0044 47 + #define ADI_AXI_ADC_CTRL_NUM_LANES_MSK GENMASK(12, 8) 47 48 #define ADI_AXI_ADC_CTRL_SYNC_MSK BIT(3) 48 49 #define ADI_AXI_ADC_CTRL_DDR_EDGESEL_MASK BIT(1) 49 50 ··· 439 438 1, timeout_us); 440 439 } 441 440 441 + static int axi_adc_num_lanes_set(struct iio_backend *back, 442 + unsigned int num_lanes) 443 + { 444 + struct adi_axi_adc_state *st = iio_backend_get_priv(back); 445 + 446 + if (!num_lanes) 447 + return -EINVAL; 448 + 449 + return regmap_update_bits(st->regmap, ADI_AXI_ADC_REG_CTRL, 450 + ADI_AXI_ADC_CTRL_NUM_LANES_MSK, 451 + FIELD_PREP(ADI_AXI_ADC_CTRL_NUM_LANES_MSK, num_lanes)); 452 + } 453 + 442 454 static struct iio_buffer *axi_adc_request_buffer(struct iio_backend *back, 443 455 struct iio_dev *indio_dev) 444 456 { ··· 642 628 .data_sample_trigger = axi_adc_data_sample_trigger, 643 629 .filter_type_set = axi_adc_ad408x_filter_type_set, 644 630 .interface_data_align = axi_adc_ad408x_interface_data_align, 631 + .num_lanes_set = axi_adc_num_lanes_set, 645 632 .debugfs_reg_access = iio_backend_debugfs_ptr(axi_adc_reg_access), 646 633 .debugfs_print_chan_status = iio_backend_debugfs_ptr(axi_adc_debugfs_print_chan_status), 647 634 };