Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ad5504.c File Reference
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/device.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/module.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/events.h>
#include <linux/iio/dac/ad5504.h>

Go to the source code of this file.

Data Structures

struct  ad5504_state
 

Macros

#define AD5505_BITS   12
 
#define AD5504_RES_MASK   ((1 << (AD5505_BITS)) - 1)
 
#define AD5504_CMD_READ   (1 << 15)
 
#define AD5504_CMD_WRITE   (0 << 15)
 
#define AD5504_ADDR(addr)   ((addr) << 12)
 
#define AD5504_ADDR_NOOP   0
 
#define AD5504_ADDR_DAC(x)   ((x) + 1)
 
#define AD5504_ADDR_ALL_DAC   5
 
#define AD5504_ADDR_CTRL   7
 
#define AD5504_DAC_PWR(ch)   ((ch) << 2)
 
#define AD5504_DAC_PWRDWN_MODE(mode)   ((mode) << 6)
 
#define AD5504_DAC_PWRDN_20K   0
 
#define AD5504_DAC_PWRDN_3STATE   1
 
#define AD5504_CHANNEL(_chan)
 

Enumerations

enum  ad5504_supported_device_ids { ID_AD5504, ID_AD5501 }
 

Functions

 MODULE_DEVICE_TABLE (spi, ad5504_id)
 
 module_spi_driver (ad5504_driver)
 
 MODULE_AUTHOR ("Michael Hennerich <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD5501/AD5501 DAC")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define AD5504_ADDR (   addr)    ((addr) << 12)

Definition at line 29 of file ad5504.c.

#define AD5504_ADDR_ALL_DAC   5

Definition at line 34 of file ad5504.c.

#define AD5504_ADDR_CTRL   7

Definition at line 35 of file ad5504.c.

#define AD5504_ADDR_DAC (   x)    ((x) + 1)

Definition at line 33 of file ad5504.c.

#define AD5504_ADDR_NOOP   0

Definition at line 32 of file ad5504.c.

#define AD5504_CHANNEL (   _chan)
Value:
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
.channel = (_chan), \
.address = AD5504_ADDR_DAC(_chan), \
.scan_type = IIO_ST('u', 12, 16, 0), \
.ext_info = ad5504_ext_info, \
}

Definition at line 261 of file ad5504.c.

#define AD5504_CMD_READ   (1 << 15)

Definition at line 27 of file ad5504.c.

#define AD5504_CMD_WRITE   (0 << 15)

Definition at line 28 of file ad5504.c.

#define AD5504_DAC_PWR (   ch)    ((ch) << 2)

Definition at line 38 of file ad5504.c.

#define AD5504_DAC_PWRDN_20K   0

Definition at line 40 of file ad5504.c.

#define AD5504_DAC_PWRDN_3STATE   1

Definition at line 41 of file ad5504.c.

#define AD5504_DAC_PWRDWN_MODE (   mode)    ((mode) << 6)

Definition at line 39 of file ad5504.c.

#define AD5504_RES_MASK   ((1 << (AD5505_BITS)) - 1)

Definition at line 25 of file ad5504.c.

#define AD5505_BITS   12

Definition at line 24 of file ad5504.c.

Enumeration Type Documentation

ad5504_supported_device_ids:

Enumerator:
ID_AD5504 
ID_AD5501 

Definition at line 64 of file ad5504.c.

Function Documentation

MODULE_AUTHOR ( "Michael Hennerich <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD5501/AD5501 DAC )
MODULE_DEVICE_TABLE ( spi  ,
ad5504_id   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( ad5504_driver  )