Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ad7266.c File Reference
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/platform_data/ad7266.h>

Go to the source code of this file.

Data Structures

struct  ad7266_state
 
struct  ad7266_chan_info
 

Macros

#define AD7266_CHAN(_chan, _sign)
 
#define AD7266_DECLARE_SINGLE_ENDED_CHANNELS(_name, _sign)
 
#define AD7266_DECLARE_SINGLE_ENDED_CHANNELS_FIXED(_name, _sign)
 
#define AD7266_CHAN_DIFF(_chan, _sign)
 
#define AD7266_DECLARE_DIFF_CHANNELS(_name, _sign)
 
#define AD7266_DECLARE_DIFF_CHANNELS_FIXED(_name, _sign)
 
#define AD7266_CHAN_INFO_INDEX(_differential, _signed, _fixed)   (((_differential) << 2) | ((_signed) << 1) | ((_fixed) << 0))
 

Functions

 MODULE_DEVICE_TABLE (spi, ad7266_id)
 
 module_spi_driver (ad7266_driver)
 
 MODULE_AUTHOR ("Lars-Peter Clausen <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD7266/65 ADC")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define AD7266_CHAN (   _chan,
  _sign 
)
Value:
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.channel = (_chan), \
.address = (_chan), \
.scan_index = (_chan), \
.scan_type = { \
.sign = (_sign), \
.realbits = 12, \
.storagebits = 16, \
.shift = 2, \
.endianness = IIO_BE, \
}, \
}

Definition at line 200 of file ad7266.c.

#define AD7266_CHAN_DIFF (   _chan,
  _sign 
)
Value:
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.channel = (_chan) * 2, \
.channel2 = (_chan) * 2 + 1, \
.address = (_chan), \
.scan_index = (_chan), \
.scan_type = { \
.sign = _sign, \
.realbits = 12, \
.storagebits = 16, \
.shift = 2, \
.endianness = IIO_BE, \
}, \
.differential = 1, \
}

Definition at line 247 of file ad7266.c.

#define AD7266_CHAN_INFO_INDEX (   _differential,
  _signed,
  _fixed 
)    (((_differential) << 2) | ((_signed) << 1) | ((_fixed) << 0))

Definition at line 325 of file ad7266.c.

#define AD7266_DECLARE_DIFF_CHANNELS (   _name,
  _sign 
)
Value:
const struct iio_chan_spec ad7266_channels_diff_##_name[] = { \
AD7266_CHAN_DIFF(0, (_sign)), \
AD7266_CHAN_DIFF(1, (_sign)), \
AD7266_CHAN_DIFF(2, (_sign)), \
AD7266_CHAN_DIFF(3, (_sign)), \
AD7266_CHAN_DIFF(4, (_sign)), \
AD7266_CHAN_DIFF(5, (_sign)), \
IIO_CHAN_SOFT_TIMESTAMP(6), \
}

Definition at line 267 of file ad7266.c.

#define AD7266_DECLARE_DIFF_CHANNELS_FIXED (   _name,
  _sign 
)
Value:
const struct iio_chan_spec ad7266_channels_diff_fixed_##_name[] = { \
AD7266_CHAN_DIFF(0, (_sign)), \
AD7266_CHAN_DIFF(1, (_sign)), \
IIO_CHAN_SOFT_TIMESTAMP(2), \
}

Definition at line 281 of file ad7266.c.

#define AD7266_DECLARE_SINGLE_ENDED_CHANNELS (   _name,
  _sign 
)
Value:
const struct iio_chan_spec ad7266_channels_##_name[] = { \
AD7266_CHAN(0, (_sign)), \
AD7266_CHAN(1, (_sign)), \
AD7266_CHAN(2, (_sign)), \
AD7266_CHAN(3, (_sign)), \
AD7266_CHAN(4, (_sign)), \
AD7266_CHAN(5, (_sign)), \
AD7266_CHAN(6, (_sign)), \
AD7266_CHAN(7, (_sign)), \
AD7266_CHAN(8, (_sign)), \
AD7266_CHAN(9, (_sign)), \
AD7266_CHAN(10, (_sign)), \
AD7266_CHAN(11, (_sign)), \
IIO_CHAN_SOFT_TIMESTAMP(13), \
}

Definition at line 218 of file ad7266.c.

#define AD7266_DECLARE_SINGLE_ENDED_CHANNELS_FIXED (   _name,
  _sign 
)
Value:
const struct iio_chan_spec ad7266_channels_##_name##_fixed[] = { \
AD7266_CHAN(0, (_sign)), \
AD7266_CHAN(1, (_sign)), \
IIO_CHAN_SOFT_TIMESTAMP(2), \
}

Definition at line 235 of file ad7266.c.

Function Documentation

MODULE_AUTHOR ( "Lars-Peter Clausen <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD7266/65 ADC )
MODULE_DEVICE_TABLE ( spi  ,
ad7266_id   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( ad7266_driver  )