2 * AD5504 SPI DAC driver
4 * Copyright 2011 Analog Devices Inc.
6 * Licensed under the GPL-2.
12 #define AD5505_BITS 12
13 #define AD5504_RES_MASK ((1 << (AD5505_BITS)) - 1)
15 #define AD5504_CMD_READ (1 << 15)
16 #define AD5504_CMD_WRITE (0 << 15)
17 #define AD5504_ADDR(addr) ((addr) << 12)
20 #define AD5504_ADDR_NOOP 0
21 #define AD5504_ADDR_DAC(x) ((x) + 1)
22 #define AD5504_ADDR_ALL_DAC 5
23 #define AD5504_ADDR_CTRL 7
25 /* Control Register */
26 #define AD5504_DAC_PWR(ch) ((ch) << 2)
27 #define AD5504_DAC_PWRDWN_MODE(mode) ((mode) << 6)
28 #define AD5504_DAC_PWRDN_20K 0
29 #define AD5504_DAC_PWRDN_3STATE 1
32 * TODO: struct ad5504_platform_data needs to go into include/linux/iio
35 struct ad5504_platform_data
{
40 * struct ad5446_state - driver instance specific data
42 * @reg: supply regulator
43 * @vref_mv: actual reference voltage used
44 * @pwr_down_mask power down mask
45 * @pwr_down_mode current power down mode
49 struct spi_device
*spi
;
50 struct regulator
*reg
;
51 unsigned short vref_mv
;
52 unsigned pwr_down_mask
;
53 unsigned pwr_down_mode
;
57 * ad5504_supported_device_ids:
60 enum ad5504_supported_device_ids
{
65 #endif /* SPI_AD5504_H_ */