Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ad5360.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  ad5360_chip_info
 
struct  ad5360_state
 

Macros

#define AD5360_CMD(x)   ((x) << 22)
 
#define AD5360_ADDR(x)   ((x) << 16)
 
#define AD5360_READBACK_TYPE(x)   ((x) << 13)
 
#define AD5360_READBACK_ADDR(x)   ((x) << 7)
 
#define AD5360_CHAN_ADDR(chan)   ((chan) + 0x8)
 
#define AD5360_CMD_WRITE_DATA   0x3
 
#define AD5360_CMD_WRITE_OFFSET   0x2
 
#define AD5360_CMD_WRITE_GAIN   0x1
 
#define AD5360_CMD_SPECIAL_FUNCTION   0x0
 
#define AD5360_REG_SF_NOP   0x0
 
#define AD5360_REG_SF_CTRL   0x1
 
#define AD5360_REG_SF_OFS(x)   (0x2 + (x))
 
#define AD5360_REG_SF_READBACK   0x5
 
#define AD5360_SF_CTRL_PWR_DOWN   BIT(0)
 
#define AD5360_READBACK_X1A   0x0
 
#define AD5360_READBACK_X1B   0x1
 
#define AD5360_READBACK_OFFSET   0x2
 
#define AD5360_READBACK_GAIN   0x3
 
#define AD5360_READBACK_SF   0x4
 
#define AD5360_CHANNEL(bits)
 

Enumerations

enum  ad5360_type {
  ID_AD5360, ID_AD5361, ID_AD5362, ID_AD5363,
  ID_AD5370, ID_AD5371, ID_AD5372, ID_AD5373
}
 

Functions

 MODULE_DEVICE_TABLE (spi, ad5360_ids)
 
 module_spi_driver (ad5360_driver)
 
 MODULE_AUTHOR ("Lars-Peter Clausen <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD5360/61/62/63/70/71/72/73 DAC")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define AD5360_ADDR (   x)    ((x) << 16)

Definition at line 23 of file ad5360.c.

#define AD5360_CHAN_ADDR (   chan)    ((chan) + 0x8)

Definition at line 28 of file ad5360.c.

#define AD5360_CHANNEL (   bits)
Value:
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \
IIO_CHAN_INFO_OFFSET_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 101 of file ad5360.c.

#define AD5360_CMD (   x)    ((x) << 22)

Definition at line 22 of file ad5360.c.

#define AD5360_CMD_SPECIAL_FUNCTION   0x0

Definition at line 33 of file ad5360.c.

#define AD5360_CMD_WRITE_DATA   0x3

Definition at line 30 of file ad5360.c.

#define AD5360_CMD_WRITE_GAIN   0x1

Definition at line 32 of file ad5360.c.

#define AD5360_CMD_WRITE_OFFSET   0x2

Definition at line 31 of file ad5360.c.

#define AD5360_READBACK_ADDR (   x)    ((x) << 7)

Definition at line 26 of file ad5360.c.

#define AD5360_READBACK_GAIN   0x3

Definition at line 46 of file ad5360.c.

#define AD5360_READBACK_OFFSET   0x2

Definition at line 45 of file ad5360.c.

#define AD5360_READBACK_SF   0x4

Definition at line 47 of file ad5360.c.

#define AD5360_READBACK_TYPE (   x)    ((x) << 13)

Definition at line 25 of file ad5360.c.

#define AD5360_READBACK_X1A   0x0

Definition at line 43 of file ad5360.c.

#define AD5360_READBACK_X1B   0x1

Definition at line 44 of file ad5360.c.

#define AD5360_REG_SF_CTRL   0x1

Definition at line 37 of file ad5360.c.

#define AD5360_REG_SF_NOP   0x0

Definition at line 36 of file ad5360.c.

#define AD5360_REG_SF_OFS (   x)    (0x2 + (x))

Definition at line 38 of file ad5360.c.

#define AD5360_REG_SF_READBACK   0x5

Definition at line 39 of file ad5360.c.

#define AD5360_SF_CTRL_PWR_DOWN   BIT(0)

Definition at line 41 of file ad5360.c.

Enumeration Type Documentation

Enumerator:
ID_AD5360 
ID_AD5361 
ID_AD5362 
ID_AD5363 
ID_AD5370 
ID_AD5371 
ID_AD5372 
ID_AD5373 

Definition at line 90 of file ad5360.c.

Function Documentation

MODULE_AUTHOR ( "Lars-Peter Clausen <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD5360/61/62/63/70/71/72/73 DAC )
MODULE_DEVICE_TABLE ( spi  ,
ad5360_ids   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( ad5360_driver  )