2 * AD7792/AD7793 SPI ADC driver
4 * Copyright 2011 Analog Devices Inc.
6 * Licensed under the GPL-2.
8 #ifndef __LINUX_PLATFORM_DATA_AD7793_H__
9 #define __LINUX_PLATFORM_DATA_AD7793_H__
12 * enum ad7793_clock_source - AD7793 clock source selection
13 * @AD7793_CLK_SRC_INT: Internal 64 kHz clock, not available at the CLK pin.
14 * @AD7793_CLK_SRC_INT_CO: Internal 64 kHz clock, available at the CLK pin.
15 * @AD7793_CLK_SRC_EXT: Use external clock.
16 * @AD7793_CLK_SRC_EXT_DIV2: Use external clock divided by 2.
18 enum ad7793_clock_source
{
20 AD7793_CLK_SRC_INT_CO
,
22 AD7793_CLK_SRC_EXT_DIV2
,
26 * enum ad7793_bias_voltage - AD7793 bias voltage selection
27 * @AD7793_BIAS_VOLTAGE_DISABLED: Bias voltage generator disabled
28 * @AD7793_BIAS_VOLTAGE_AIN1: Bias voltage connected to AIN1(-).
29 * @AD7793_BIAS_VOLTAGE_AIN2: Bias voltage connected to AIN2(-).
30 * @AD7793_BIAS_VOLTAGE_AIN3: Bias voltage connected to AIN3(-).
31 * Only valid for AD7795/AD7796.
33 enum ad7793_bias_voltage
{
34 AD7793_BIAS_VOLTAGE_DISABLED
,
35 AD7793_BIAS_VOLTAGE_AIN1
,
36 AD7793_BIAS_VOLTAGE_AIN2
,
37 AD7793_BIAS_VOLTAGE_AIN3
,
41 * enum ad7793_refsel - AD7793 reference voltage selection
42 * @AD7793_REFSEL_REFIN1: External reference applied between REFIN1(+)
44 * @AD7793_REFSEL_REFIN2: External reference applied between REFIN2(+) and
45 * and REFIN1(-). Only valid for AD7795/AD7796.
46 * @AD7793_REFSEL_INTERNAL: Internal 1.17 V reference.
49 AD7793_REFSEL_REFIN1
= 0,
50 AD7793_REFSEL_REFIN2
= 1,
51 AD7793_REFSEL_INTERNAL
= 2,
55 * enum ad7793_current_source_direction - AD7793 excitation current direction
56 * @AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2: Current source IEXC1 connected to pin
57 * IOUT1, current source IEXC2 connected to pin IOUT2.
58 * @AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1: Current source IEXC2 connected to pin
59 * IOUT1, current source IEXC1 connected to pin IOUT2.
60 * @AD7793_IEXEC1_IEXEC2_IOUT1: Both current sources connected to pin IOUT1.
61 * Only valid when the current sources are set to 10 uA or 210 uA.
62 * @AD7793_IEXEC1_IEXEC2_IOUT2: Both current sources connected to Pin IOUT2.
63 * Only valid when the current ources are set to 10 uA or 210 uA.
65 enum ad7793_current_source_direction
{
66 AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2
= 0,
67 AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1
= 1,
68 AD7793_IEXEC1_IEXEC2_IOUT1
= 2,
69 AD7793_IEXEC1_IEXEC2_IOUT2
= 3,
73 * enum ad7793_excitation_current - AD7793 excitation current selection
74 * @AD7793_IX_DISABLED: Excitation current Disabled.
75 * @AD7793_IX_10uA: Enable 10 micro-ampere excitation current.
76 * @AD7793_IX_210uA: Enable 210 micro-ampere excitation current.
77 * @AD7793_IX_1mA: Enable 1 milli-Ampere excitation current.
79 enum ad7793_excitation_current
{
80 AD7793_IX_DISABLED
= 0,
87 * struct ad7793_platform_data - AD7793 platform data
88 * @clock_src: Clock source selection
89 * @burnout_current: If set to true the 100nA burnout current is enabled.
90 * @boost_enable: Enable boost for the bias voltage generator.
91 * @buffered: If set to true configure the device for buffered input mode.
92 * @unipolar: If set to true sample in unipolar mode, if set to false sample in
94 * @refsel: Reference voltage selection
95 * @bias_voltage: Bias voltage selection
96 * @exitation_current: Excitation current selection
97 * @current_source_direction: Excitation current direction selection
99 struct ad7793_platform_data
{
100 enum ad7793_clock_source clock_src
;
101 bool burnout_current
;
106 enum ad7793_refsel refsel
;
107 enum ad7793_bias_voltage bias_voltage
;
108 enum ad7793_excitation_current exitation_current
;
109 enum ad7793_current_source_direction current_source_direction
;
112 #endif /* IIO_ADC_AD7793_H_ */