Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ad5624r.h
Go to the documentation of this file.
1 /*
2  * AD5624R SPI DAC driver
3  *
4  * Copyright 2010-2011 Analog Devices Inc.
5  *
6  * Licensed under the GPL-2.
7  */
8 #ifndef SPI_AD5624R_H_
9 #define SPI_AD5624R_H_
10 
11 #define AD5624R_DAC_CHANNELS 4
12 
13 #define AD5624R_ADDR_DAC0 0x0
14 #define AD5624R_ADDR_DAC1 0x1
15 #define AD5624R_ADDR_DAC2 0x2
16 #define AD5624R_ADDR_DAC3 0x3
17 #define AD5624R_ADDR_ALL_DAC 0x7
18 
19 #define AD5624R_CMD_WRITE_INPUT_N 0x0
20 #define AD5624R_CMD_UPDATE_DAC_N 0x1
21 #define AD5624R_CMD_WRITE_INPUT_N_UPDATE_ALL 0x2
22 #define AD5624R_CMD_WRITE_INPUT_N_UPDATE_N 0x3
23 #define AD5624R_CMD_POWERDOWN_DAC 0x4
24 #define AD5624R_CMD_RESET 0x5
25 #define AD5624R_CMD_LDAC_SETUP 0x6
26 #define AD5624R_CMD_INTERNAL_REFER_SETUP 0x7
27 
28 #define AD5624R_LDAC_PWRDN_NONE 0x0
29 #define AD5624R_LDAC_PWRDN_1K 0x1
30 #define AD5624R_LDAC_PWRDN_100K 0x2
31 #define AD5624R_LDAC_PWRDN_3STATE 0x3
32 
40  const struct iio_chan_spec *channels;
42 };
43 
55 struct ad5624r_state {
56  struct spi_device *us;
58  struct regulator *reg;
59  unsigned short vref_mv;
60  unsigned pwr_down_mask;
61  unsigned pwr_down_mode;
62 };
63 
77 };
78 
79 #endif /* SPI_AD5624R_H_ */