Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
spear_adc.c File Reference
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/completion.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  adc_regs_spear3xx
 
struct  chan_data
 
struct  adc_regs_spear6xx
 
struct  spear_adc_info
 

Macros

#define SCAN_RATE_LO(x)   ((x) & 0xFFFF)
 
#define SCAN_RATE_HI(x)   (((x) >> 0x10) & 0xFFFF)
 
#define CLK_LOW(x)   (((x) & 0xf) << 0)
 
#define CLK_HIGH(x)   (((x) & 0xf) << 4)
 
#define START_CONVERSION   (1 << 0)
 
#define CHANNEL_NUM(x)   ((x) << 1)
 
#define ADC_ENABLE   (1 << 4)
 
#define AVG_SAMPLE(x)   ((x) << 5)
 
#define VREF_INTERNAL   (1 << 9)
 
#define DATA_MASK   0x03ff
 
#define DATA_BITS   10
 
#define MOD_NAME   "spear-adc"
 
#define ADC_CHANNEL_NUM   8
 
#define CLK_MIN   2500000
 
#define CLK_MAX   20000000
 
#define SPEAR_ADC_CHAN(idx)
 

Functions

 MODULE_DEVICE_TABLE (of, spear_adc_dt_ids)
 
 module_platform_driver (spear_adc_driver)
 
 MODULE_AUTHOR ("Stefan Roese <sr@denx.de>")
 
 MODULE_DESCRIPTION ("SPEAr ADC driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ADC_CHANNEL_NUM   8

Definition at line 46 of file spear_adc.c.

#define ADC_ENABLE   (1 << 4)

Definition at line 37 of file spear_adc.c.

#define AVG_SAMPLE (   x)    ((x) << 5)

Definition at line 38 of file spear_adc.c.

#define CHANNEL_NUM (   x)    ((x) << 1)

Definition at line 36 of file spear_adc.c.

#define CLK_HIGH (   x)    (((x) & 0xf) << 4)

Definition at line 32 of file spear_adc.c.

#define CLK_LOW (   x)    (((x) & 0xf) << 0)

Definition at line 31 of file spear_adc.c.

#define CLK_MAX   20000000

Definition at line 49 of file spear_adc.c.

#define CLK_MIN   2500000

Definition at line 48 of file spear_adc.c.

#define DATA_BITS   10

Definition at line 42 of file spear_adc.c.

#define DATA_MASK   0x03ff

Definition at line 41 of file spear_adc.c.

#define MOD_NAME   "spear-adc"

Definition at line 44 of file spear_adc.c.

#define SCAN_RATE_HI (   x)    (((x) >> 0x10) & 0xFFFF)

Definition at line 30 of file spear_adc.c.

#define SCAN_RATE_LO (   x)    ((x) & 0xFFFF)

Definition at line 29 of file spear_adc.c.

#define SPEAR_ADC_CHAN (   idx)
Value:
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.channel = idx, \
.scan_type = { \
.sign = 'u', \
.storagebits = 16, \
}, \
}

Definition at line 180 of file spear_adc.c.

#define START_CONVERSION   (1 << 0)

Definition at line 35 of file spear_adc.c.

#define VREF_INTERNAL   (1 << 9)

Definition at line 39 of file spear_adc.c.

Function Documentation

MODULE_AUTHOR ( "Stefan Roese <sr@denx.de>"  )
MODULE_DESCRIPTION ( "SPEAr ADC driver )
MODULE_DEVICE_TABLE ( of  ,
spear_adc_dt_ids   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( spear_adc_driver  )