1
2
3
4
5
6
7
8#ifndef __ADI_AXI_ADC_H__
9#define __ADI_AXI_ADC_H__
10
11struct device;
12struct iio_chan_spec;
13
14
15
16
17
18
19
20
21
22
23
24struct adi_axi_adc_chip_info {
25 const char *name;
26 unsigned int id;
27
28 const struct iio_chan_spec *channels;
29 unsigned int num_channels;
30
31 const unsigned int (*scale_table)[2];
32 int num_scales;
33
34 unsigned long max_rate;
35};
36
37
38
39
40
41
42
43
44
45struct adi_axi_adc_conv {
46 const struct adi_axi_adc_chip_info *chip_info;
47
48 int (*preenable_setup)(struct adi_axi_adc_conv *conv);
49 int (*reg_access)(struct adi_axi_adc_conv *conv, unsigned int reg,
50 unsigned int writeval, unsigned int *readval);
51 int (*read_raw)(struct adi_axi_adc_conv *conv,
52 struct iio_chan_spec const *chan,
53 int *val, int *val2, long mask);
54 int (*write_raw)(struct adi_axi_adc_conv *conv,
55 struct iio_chan_spec const *chan,
56 int val, int val2, long mask);
57};
58
59struct adi_axi_adc_conv *devm_adi_axi_adc_conv_register(struct device *dev,
60 size_t sizeof_priv);
61
62void *adi_axi_adc_conv_priv(struct adi_axi_adc_conv *conv);
63
64#endif
65