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_DAC0 1
22 #define AD5504_ADDR_DAC1 2
23 #define AD5504_ADDR_DAC2 3
24 #define AD5504_ADDR_DAC3 4
25 #define AD5504_ADDR_ALL_DAC 5
26 #define AD5504_ADDR_CTRL 7
28 /* Control Register */
29 #define AD5504_DAC_PWR(ch) ((ch) << 2)
30 #define AD5504_DAC_PWRDWN_MODE(mode) ((mode) << 6)
31 #define AD5504_DAC_PWRDN_20K 0
32 #define AD5504_DAC_PWRDN_3STATE 1
35 * TODO: struct ad5504_platform_data needs to go into include/linux/iio
38 struct ad5504_platform_data
{
43 * struct ad5446_state - driver instance specific data
45 * @reg: supply regulator
46 * @vref_mv: actual reference voltage used
47 * @pwr_down_mask power down mask
48 * @pwr_down_mode current power down mode
52 struct spi_device
*spi
;
53 struct regulator
*reg
;
54 unsigned short vref_mv
;
55 unsigned pwr_down_mask
;
56 unsigned pwr_down_mode
;
60 * ad5504_supported_device_ids:
63 enum ad5504_supported_device_ids
{
68 #endif /* SPI_AD5504_H_ */