File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 45
45
#define ADI_AXI_ADC_REG_CTRL 0x0044
46
46
#define ADI_AXI_ADC_CTRL_DDR_EDGESEL_MASK BIT(1)
47
47
48
+ #define ADI_AXI_ADC_REG_CNTRL_3 0x004c
49
+
48
50
/* ADC Channel controls */
49
51
50
52
#define ADI_AXI_REG_CHAN_CTRL (c ) (0x0400 + (c) * 0x40)
@@ -255,6 +257,24 @@ static int axi_adc_interface_type_get(struct iio_backend *back,
255
257
return 0 ;
256
258
}
257
259
260
+ static int axi_adc_data_size_set (struct iio_backend * back ,
261
+ ssize_t size )
262
+ {
263
+ struct adi_axi_adc_state * st = iio_backend_get_priv (back );
264
+ unsigned int val ;
265
+
266
+ if (size <= 20 )
267
+ val = 0 ;
268
+ else if (size <= 24 )
269
+ val = 1 ;
270
+ else if (size <= 32 )
271
+ val = 3 ;
272
+ else
273
+ return - EINVAL ;
274
+
275
+ return regmap_write (st -> regmap , ADI_AXI_ADC_REG_CNTRL_3 , val );
276
+ }
277
+
258
278
static struct iio_buffer * axi_adc_request_buffer (struct iio_backend * back ,
259
279
struct iio_dev * indio_dev )
260
280
{
@@ -292,6 +312,7 @@ static const struct iio_backend_ops adi_axi_adc_generic = {
292
312
.test_pattern_set = axi_adc_test_pattern_set ,
293
313
.chan_status = axi_adc_chan_status ,
294
314
.interface_type_get = axi_adc_interface_type_get ,
315
+ .data_size_set = axi_adc_data_size_set ,
295
316
};
296
317
297
318
static int adi_axi_adc_probe (struct platform_device * pdev )
You can’t perform that action at this time.
0 commit comments