Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ad5764.c File Reference
#include <linux/device.h>
#include <linux/err.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  ad5764_chip_info
 
struct  ad5764_state
 

Macros

#define AD5764_REG_SF_NOP   0x0
 
#define AD5764_REG_SF_CONFIG   0x1
 
#define AD5764_REG_SF_CLEAR   0x4
 
#define AD5764_REG_SF_LOAD   0x5
 
#define AD5764_REG_DATA(x)   ((2 << 3) | (x))
 
#define AD5764_REG_COARSE_GAIN(x)   ((3 << 3) | (x))
 
#define AD5764_REG_FINE_GAIN(x)   ((4 << 3) | (x))
 
#define AD5764_REG_OFFSET(x)   ((5 << 3) | (x))
 
#define AD5764_NUM_CHANNELS   4
 
#define AD5764_CHANNEL(_chan, _bits)
 
#define DECLARE_AD5764_CHANNELS(_name, _bits)
 

Enumerations

enum  ad5764_type { ID_AD5744, ID_AD5744R, ID_AD5764, ID_AD5764R }
 

Functions

 MODULE_DEVICE_TABLE (spi, ad5764_ids)
 
 module_spi_driver (ad5764_driver)
 
 MODULE_AUTHOR ("Lars-Peter Clausen <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD5744/AD5744R/AD5764/AD5764R DAC")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define AD5764_CHANNEL (   _chan,
  _bits 
)
Value:
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
.channel = (_chan), \
.address = (_chan), \
IIO_CHAN_INFO_OFFSET_SHARED_BIT | \
IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | \
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT, \
.scan_type = IIO_ST('u', (_bits), 16, 16 - (_bits)) \
}

Definition at line 75 of file ad5764.c.

#define AD5764_NUM_CHANNELS   4

Definition at line 31 of file ad5764.c.

#define AD5764_REG_COARSE_GAIN (   x)    ((3 << 3) | (x))

Definition at line 27 of file ad5764.c.

#define AD5764_REG_DATA (   x)    ((2 << 3) | (x))

Definition at line 26 of file ad5764.c.

#define AD5764_REG_FINE_GAIN (   x)    ((4 << 3) | (x))

Definition at line 28 of file ad5764.c.

#define AD5764_REG_OFFSET (   x)    ((5 << 3) | (x))

Definition at line 29 of file ad5764.c.

#define AD5764_REG_SF_CLEAR   0x4

Definition at line 24 of file ad5764.c.

#define AD5764_REG_SF_CONFIG   0x1

Definition at line 23 of file ad5764.c.

#define AD5764_REG_SF_LOAD   0x5

Definition at line 25 of file ad5764.c.

#define AD5764_REG_SF_NOP   0x0

Definition at line 22 of file ad5764.c.

#define DECLARE_AD5764_CHANNELS (   _name,
  _bits 
)
Value:
const struct iio_chan_spec _name##_channels[] = { \
AD5764_CHANNEL(0, (_bits)), \
AD5764_CHANNEL(1, (_bits)), \
AD5764_CHANNEL(2, (_bits)), \
AD5764_CHANNEL(3, (_bits)), \
};

Definition at line 89 of file ad5764.c.

Enumeration Type Documentation

Enumerator:
ID_AD5744 
ID_AD5744R 
ID_AD5764 
ID_AD5764R 

Definition at line 68 of file ad5764.c.

Function Documentation

MODULE_AUTHOR ( "Lars-Peter Clausen <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD5744/AD5744R/AD5764/AD5764R DAC )
MODULE_DEVICE_TABLE ( spi  ,
ad5764_ids   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( ad5764_driver  )