Skip to content

Commit

Permalink
iio: adc: cf_axi_adc: Add macros and struct field
Browse files Browse the repository at this point in the history
This adds ADI_REG_CHAN_RAW_DATA and ADI_SOFTSPAN macros for channel raw
data and softspan registers and add resolution field in axiadc_chip_info
struct to store the ADC resolution.

Signed-off-by: Kim Seer Paller <[email protected]>
  • Loading branch information
kseerp authored and nunojsa committed Jul 26, 2023
1 parent 4589294 commit cff6cc5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/iio/adc/cf_axi_adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
#define ADI_PN_OOS (1 << 1)
#define ADI_OVER_RANGE (1 << 0)

#define ADI_REG_CHAN_RAW_DATA(c) (0x0408 + (c) * 0x40)

#define ADI_REG_CHAN_CNTRL_1(c) (0x0410 + (c) * 0x40)
#define ADI_DCFILT_OFFSET(x) (((x) & 0xFFFF) << 16)
#define ADI_TO_DCFILT_OFFSET(x) (((x) >> 16) & 0xFFFF)
Expand All @@ -141,6 +143,8 @@
#define ADI_ADC_DATA_SEL(x) (((x) & 0xF) << 0)
#define ADI_TO_ADC_DATA_SEL(x) (((x) >> 0) & 0xF)

#define ADI_SOFTSPAN(c) (0x0428 + (c) * 0x40)

enum adc_pn_sel {
ADC_PN9 = 0,
ADC_PN23A = 1,
Expand Down Expand Up @@ -198,6 +202,7 @@ struct axiadc_chip_info {
const unsigned long *scan_masks;
const int (*scale_table)[2];
int num_scales;
int resolution;
int max_testmode;
unsigned long max_rate;
struct iio_chan_spec channel[AXIADC_MAX_CHANNEL];
Expand Down

0 comments on commit cff6cc5

Please sign in to comment.