Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ad5686.c File Reference
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/regulator/consumer.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  ad5686_chip_info
 
struct  ad5686_state
 

Macros

#define AD5686_DAC_CHANNELS   4
 
#define AD5686_ADDR(x)   ((x) << 16)
 
#define AD5686_CMD(x)   ((x) << 20)
 
#define AD5686_ADDR_DAC(chan)   (0x1 << (chan))
 
#define AD5686_ADDR_ALL_DAC   0xF
 
#define AD5686_CMD_NOOP   0x0
 
#define AD5686_CMD_WRITE_INPUT_N   0x1
 
#define AD5686_CMD_UPDATE_DAC_N   0x2
 
#define AD5686_CMD_WRITE_INPUT_N_UPDATE_N   0x3
 
#define AD5686_CMD_POWERDOWN_DAC   0x4
 
#define AD5686_CMD_LDAC_MASK   0x5
 
#define AD5686_CMD_RESET   0x6
 
#define AD5686_CMD_INTERNAL_REFER_SETUP   0x7
 
#define AD5686_CMD_DAISY_CHAIN_ENABLE   0x8
 
#define AD5686_CMD_READBACK_ENABLE   0x9
 
#define AD5686_LDAC_PWRDN_NONE   0x0
 
#define AD5686_LDAC_PWRDN_1K   0x1
 
#define AD5686_LDAC_PWRDN_100K   0x2
 
#define AD5686_LDAC_PWRDN_3STATE   0x3
 
#define AD5868_CHANNEL(chan, bits, shift)
 

Enumerations

enum  ad5686_supported_device_ids { ID_AD5684, ID_AD5685, ID_AD5686 }
 

Functions

 MODULE_DEVICE_TABLE (spi, ad5686_id)
 
 module_spi_driver (ad5686_driver)
 
 MODULE_AUTHOR ("Michael Hennerich <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD5686/85/84 DAC")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define AD5686_ADDR (   x)    ((x) << 16)

Definition at line 24 of file ad5686.c.

#define AD5686_ADDR_ALL_DAC   0xF

Definition at line 28 of file ad5686.c.

#define AD5686_ADDR_DAC (   chan)    (0x1 << (chan))

Definition at line 27 of file ad5686.c.

#define AD5686_CMD (   x)    ((x) << 20)

Definition at line 25 of file ad5686.c.

#define AD5686_CMD_DAISY_CHAIN_ENABLE   0x8

Definition at line 38 of file ad5686.c.

#define AD5686_CMD_INTERNAL_REFER_SETUP   0x7

Definition at line 37 of file ad5686.c.

#define AD5686_CMD_LDAC_MASK   0x5

Definition at line 35 of file ad5686.c.

#define AD5686_CMD_NOOP   0x0

Definition at line 30 of file ad5686.c.

#define AD5686_CMD_POWERDOWN_DAC   0x4

Definition at line 34 of file ad5686.c.

#define AD5686_CMD_READBACK_ENABLE   0x9

Definition at line 39 of file ad5686.c.

#define AD5686_CMD_RESET   0x6

Definition at line 36 of file ad5686.c.

#define AD5686_CMD_UPDATE_DAC_N   0x2

Definition at line 32 of file ad5686.c.

#define AD5686_CMD_WRITE_INPUT_N   0x1

Definition at line 31 of file ad5686.c.

#define AD5686_CMD_WRITE_INPUT_N_UPDATE_N   0x3

Definition at line 33 of file ad5686.c.

#define AD5686_DAC_CHANNELS   4

Definition at line 22 of file ad5686.c.

#define AD5686_LDAC_PWRDN_100K   0x2

Definition at line 43 of file ad5686.c.

#define AD5686_LDAC_PWRDN_1K   0x1

Definition at line 42 of file ad5686.c.

#define AD5686_LDAC_PWRDN_3STATE   0x3

Definition at line 44 of file ad5686.c.

#define AD5686_LDAC_PWRDN_NONE   0x0

Definition at line 41 of file ad5686.c.

#define AD5868_CHANNEL (   chan,
  bits,
  shift 
)
Value:
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
.channel = chan, \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = AD5686_ADDR_DAC(chan), \
.scan_type = IIO_ST('u', bits, 16, shift), \
.ext_info = ad5686_ext_info, \
}

Definition at line 279 of file ad5686.c.

Enumeration Type Documentation

ad5686_supported_device_ids:

Enumerator:
ID_AD5684 
ID_AD5685 
ID_AD5686 

Definition at line 90 of file ad5686.c.

Function Documentation

MODULE_AUTHOR ( "Michael Hennerich <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD5686/85/84 DAC )
MODULE_DEVICE_TABLE ( spi  ,
ad5686_id   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( ad5686_driver  )