nidas  v1.2-1520
Macros | Functions | Variables
dmd_mmat.c File Reference
#include "dmd_mmat.h"
#include <linux/types.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/workqueue.h>
#include <linux/poll.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <asm/io.h>
#include <nidas/linux/Revision.h>
#include <nidas/linux/ver_macros.h>
#include <nidas/linux/klog.h>
#include <nidas/linux/isa_bus.h>
#include <nidas/linux/filters/short_filters_kernel.h>

Macros

#define IRQF_SHARED   SA_SHIRQ
 
#define REPO_REVISION   "unknown"
 
#define REPORT_UNDER_OVERFLOWS
 

Functions

 module_param_array (ioports, int, numboards, 0)
 
 module_param_array (irqs, int, numirqs, 0)
 
 module_param_array (types, int, numtypes, 0)
 
 module_param_array (d2aconfig, int, numd2aconfig, 0)
 
 MODULE_AUTHOR ("Gordon Maclean <maclean@ucar.edu>")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_DESCRIPTION ("Driver for Diamond DMM analog cards")
 
 MODULE_VERSION (REPO_REVISION)
 
static void setTimerClock (struct DMMAT *brd, int clock, int mode, unsigned short val)
 Set counter value in a 82C54 clock. More...
 
static unsigned int readLatchedTimer (struct DMMAT *brd, int clock)
 Read counter value in a 82C54 clock. More...
 
static int div_10 (unsigned int x, unsigned int y, int prec, int *fp)
 
static int setClock1InputRate_MM16AT (struct DMMAT *brd, int rate)
 
static int setClock1InputRate_MM32AT (struct DMMAT *brd, int rate)
 
static int setupClock12 (struct DMMAT *brd, int inputRate, int outputRate)
 
static void releaseClock12 (struct DMMAT *brd)
 
const char * getA2DDeviceName (struct DMMAT_A2D *a2d)
 
static int getNumA2DChannelsMM16AT (struct DMMAT_A2D *a2d)
 Determine number of available channels - depends on single-ended vs differential jumpering. More...
 
static int getNumA2DChannelsMM32XAT (struct DMMAT_A2D *a2d)
 Determine number of available channels - depends on single-ended vs differential jumpering. More...
 
static int selectA2DChannelsMM16AT (struct DMMAT_A2D *a2d)
 returns: 0: ok, -EINVAL: channels out of range. More...
 
static int selectA2DChannelsMM32XAT (struct DMMAT_A2D *a2d)
 returns: 0: ok, -EINVAL: channels out of range. More...
 
static int getConvRateMM16AT (struct DMMAT_A2D *a2d, unsigned char *val)
 
static int getConvRateMM32XAT (struct DMMAT_A2D *a2d, unsigned char *val)
 
static int getGainSettingMM16AT (struct DMMAT_A2D *a2d, int gain, int bipolar, unsigned char *val)
 
static int getGainSettingMM32XAT (struct DMMAT_A2D *a2d, int gain, int bipolar, unsigned char *val)
 
static int getFifoLevelMM16AT (struct DMMAT_A2D *a2d)
 
static int getFifoLevelMM32XAT (struct DMMAT_A2D *a2d)
 
static void resetFifoMM16AT (struct DMMAT_A2D *a2d)
 
static void resetFifoMM32XAT (struct DMMAT_A2D *a2d)
 
static void waitForA2DSettleMM16AT (struct DMMAT_A2D *a2d)
 
static void waitForA2DSettleMM32XAT (struct DMMAT_A2D *a2d)
 
static void freeA2DFilters (struct DMMAT_A2D *a2d)
 
static void resetA2D_processing (struct DMMAT_A2D *a2d)
 Reset state of data processing. More...
 
static int configA2D (struct DMMAT_A2D *a2d, struct nidas_a2d_config *cfg)
 
static int addA2DSampleConfig (struct DMMAT_A2D *a2d, struct nidas_a2d_sample_config *cfg)
 
static irqreturn_t dmmat_a2d_handler (struct DMMAT_A2D *a2d)
 
static irqreturn_t dmmat_cntr_handler (struct DMMAT_CNTR *cntr)
 
static irqreturn_t dmmat_irq_handler (int irq, void *dev_id)
 
static int dmd_mmat_add_irq_user (struct DMMAT *brd, int user_type)
 
static int dmd_mmat_remove_irq_user (struct DMMAT *brd, int user_type)
 
static void stopA2D_MM16AT (struct DMMAT_A2D *a2d)
 
static void stopA2D_MM32XAT (struct DMMAT_A2D *a2d)
 
static void stopA2D (struct DMMAT_A2D *a2d)
 General function to stop the A2D. More...
 
static int getA2DThreshold_MM16AT (struct DMMAT_A2D *a2d)
 
static int getA2DThreshold_MM32XAT (struct DMMAT_A2D *a2d)
 
static void startA2D_MM16AT (struct DMMAT_A2D *a2d)
 
static void startA2D_MM32XAT (struct DMMAT_A2D *a2d)
 
static int startA2D (struct DMMAT_A2D *a2d)
 
static int startAutoCal_MM32XAT (struct DMMAT_A2D *a2d)
 
static void stopCntr_MM16AT (struct DMMAT_CNTR *cntr)
 
static void stopCntr_MM32AT (struct DMMAT_CNTR *cntr)
 
static int stopCNTR (struct DMMAT_CNTR *cntr)
 General function to stop a counter. More...
 
static int startCntr_MM16AT (struct DMMAT_CNTR *cntr)
 
static int startCntr_MM32AT (struct DMMAT_CNTR *cntr)
 
static int startCNTR (struct DMMAT_CNTR *cntr, struct DMMAT_CNTR_Config *cfg)
 General function to start a counter. More...
 
static void do_filters (struct DMMAT_A2D *a2d, dsm_sample_time_t tt, const short *dp)
 Invoke filters. More...
 
static void dmmat_a2d_bottom_half (struct work_struct *work)
 Worker function that invokes filters on the data in a fifo sample. More...
 
static void dmmat_a2d_bottom_half_fast (struct work_struct *work)
 Worker function that invokes filters on the data in a fifo sample. More...
 
static void dmmat_a2d_waveform_bh (struct work_struct *work)
 Worker function for forming samples when operating in waveform mode. More...
 
static int setD2A_MM16AT (struct DMMAT_D2A *d2a, struct DMMAT_D2A_Outputs *outputs, int iout)
 
static int setD2A_MM32AT (struct DMMAT_D2A *d2a, struct DMMAT_D2A_Outputs *outputs, int iout)
 
static int setD2A_MM32DXAT (struct DMMAT_D2A *d2a, struct DMMAT_D2A_Outputs *outputs, int iout)
 
static int setD2A_mult (struct DMMAT_D2A *d2a, struct DMMAT_D2A_Outputs *outputs)
 
static void getD2A_mult (struct DMMAT_D2A *d2a, struct DMMAT_D2A_Outputs *outputs)
 
static void getD2A_conv (struct DMMAT_D2A *d2a, struct DMMAT_D2A_Conversion *conv)
 
static int addWaveform_MM16AT (struct DMMAT_D2A *d2a, struct D2A_Waveform *wave)
 
static int addWaveform_MM32XAT (struct DMMAT_D2A *d2a, struct D2A_Waveform *wave)
 
static int loadWaveforms_MM16AT (struct DMMAT_D2A *d2a)
 
static int loadWaveforms_MM32XAT (struct DMMAT_D2A *d2a)
 
static void stopWaveforms_MM16AT (struct DMMAT_D2A *d2a)
 
static void stopWaveforms_MM32XAT (struct DMMAT_D2A *d2a)
 
static void stopWaveforms (struct DMMAT_D2A *d2a)
 General function to stop the D2A waveform. More...
 
static void startWaveforms_MM16AT (struct DMMAT_D2A *d2a)
 
static void startWaveforms_MM32XAT (struct DMMAT_D2A *d2a)
 
static int startWaveforms (struct DMMAT_D2A *d2a)
 
static void startD2D_MM16AT (struct DMMAT_D2D *d2d)
 
static void startD2D_MM32XAT (struct DMMAT_D2D *d2d)
 
static int startD2D (struct DMMAT_D2D *d2d)
 
static void stopD2D_MM16AT (struct DMMAT_D2D *d2d)
 
static void stopD2D_MM32XAT (struct DMMAT_D2D *d2d)
 
static int stopD2D (struct DMMAT_D2D *d2d)
 
static int dmmat_open_a2d (struct inode *inode, struct file *filp)
 
static int dmmat_release_a2d (struct inode *inode, struct file *filp)
 
static unsigned int dmmat_poll_a2d (struct file *filp, poll_table *wait)
 
static ssize_t dmmat_read_a2d (struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 
static long dmmat_ioctl_a2d (struct file *filp, unsigned int cmd, unsigned long arg)
 
static int dmmat_open_cntr (struct inode *inode, struct file *filp)
 
static int dmmat_release_cntr (struct inode *inode, struct file *filp)
 
static ssize_t dmmat_read_cntr (struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 
static long dmmat_ioctl_cntr (struct file *filp, unsigned int cmd, unsigned long arg)
 
unsigned int dmmat_poll_cntr (struct file *filp, poll_table *wait)
 
static int dmmat_open_d2a (struct inode *inode, struct file *filp)
 
static int dmmat_release_d2a (struct inode *inode, struct file *filp)
 
static long dmmat_ioctl_d2a (struct file *filp, unsigned int cmd, unsigned long arg)
 
static int dmmat_open_d2d (struct inode *inode, struct file *filp)
 
static int dmmat_release_d2d (struct inode *inode, struct file *filp)
 
static unsigned int dmmat_poll_d2d (struct file *filp, poll_table *wait)
 
static ssize_t dmmat_read_d2d (struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 
static long dmmat_ioctl_d2d (struct file *filp, unsigned int cmd, unsigned long arg)
 
static int init_a2d (struct DMMAT *brd)
 
static void freeFilters (struct DMMAT_A2D *a2d)
 
static void cleanup_a2d (struct DMMAT *brd)
 
static void cntr_timer_fn (struct timer_list *tlist)
 Timer function which fetches the current counter value, makes a timetagged sample out of it, puts it in the circular buffer for the read method and wakens the read queue. More...
 
static int __init init_cntr (struct DMMAT *brd)
 
static void cleanup_cntr (struct DMMAT *brd)
 
static int checkD2A_MM32DXAT (struct DMMAT_D2A *d2a)
 
static int __init init_d2a (struct DMMAT *brd)
 
static void cleanup_d2a (struct DMMAT *brd)
 
static int __init init_d2d (struct DMMAT *brd)
 
static void cleanup_d2d (struct DMMAT *brd)
 
static void dmd_mmat_cleanup (void)
 
static int __init dmd_mmat_init (void)
 
 module_init (dmd_mmat_init)
 
 module_exit (dmd_mmat_cleanup)
 

Variables

static unsigned int ioports [MAX_DMMAT_BOARDS] = { 0x380, 0, 0, 0 }
 
static int numboards = 0
 
static int numActualBoards = 0
 
static int irqs [MAX_DMMAT_BOARDS] = { 12, 0, 0, 0 }
 
static int numirqs = 0
 
static int types [MAX_DMMAT_BOARDS] = { DMM32DXAT_BOARD, 0, 0, 0 }
 
static int numtypes = 0
 
static const char * BOARD_TYPE_STRS []
 
static int d2aconfig [MAX_DMMAT_BOARDS] = { DMMAT_D2A_UNI_5, 0, 0, 0 }
 
static int numd2aconfig = 0
 
static dev_t dmmat_device = MKDEV(0,0)
 
static struct class * dmmat_class
 
static struct DMMAT * board = 0
 
static struct workqueue_struct * work_queue = 0
 
static struct file_operations a2d_fops
 
static struct file_operations cntr_fops
 
static struct file_operations d2a_fops
 
static struct file_operations d2d_fops
 

Macro Definition Documentation

#define IRQF_SHARED   SA_SHIRQ

Referenced by dmd_mmat_add_irq_user().

#define REPO_REVISION   "unknown"

Referenced by dmd_mmat_init().

#define REPORT_UNDER_OVERFLOWS

Function Documentation

static int addA2DSampleConfig ( struct DMMAT_A2D *  a2d,
struct nidas_a2d_sample_config cfg 
)
static
static int addWaveform_MM16AT ( struct DMMAT_D2A *  d2a,
struct D2A_Waveform wave 
)
static

Referenced by init_d2a().

static int addWaveform_MM32XAT ( struct DMMAT_D2A *  d2a,
struct D2A_Waveform wave 
)
static
static int checkD2A_MM32DXAT ( struct DMMAT_D2A *  d2a)
static

Referenced by init_d2a().

static void cleanup_a2d ( struct DMMAT *  brd)
static
static void cleanup_cntr ( struct DMMAT *  brd)
static

References dmmat_class, and free_dsm_circ_buf().

Referenced by dmd_mmat_cleanup().

static void cleanup_d2a ( struct DMMAT *  brd)
static

References dmmat_class.

Referenced by dmd_mmat_cleanup().

static void cleanup_d2d ( struct DMMAT *  brd)
static

References dmmat_class.

Referenced by dmd_mmat_cleanup().

static void cntr_timer_fn ( struct timer_list *  tlist)
static

Timer function which fetches the current counter value, makes a timetagged sample out of it, puts it in the circular buffer for the read method and wakens the read queue.

This timer function is called at the rate requested by the user.

References readLatchedTimer().

Referenced by init_cntr().

static int configA2D ( struct DMMAT_A2D *  a2d,
struct nidas_a2d_config cfg 
)
static
static int div_10 ( unsigned int  x,
unsigned int  y,
int  prec,
int *  fp 
)
static

Referenced by setupClock12().

static int dmd_mmat_add_irq_user ( struct DMMAT *  brd,
int  user_type 
)
static

References DMM16AT_BOARD, dmmat_irq_handler(), IRQF_SHARED, and irqs.

Referenced by startA2D(), and startCNTR().

static void dmd_mmat_cleanup ( void  )
static
static int __init dmd_mmat_init ( void  )
static
static int dmd_mmat_remove_irq_user ( struct DMMAT *  brd,
int  user_type 
)
static

Referenced by startA2D(), stopA2D(), and stopCNTR().

static void dmmat_a2d_bottom_half ( struct work_struct *  work)
static

Worker function that invokes filters on the data in a fifo sample.

The contents of the fifo sample is not necessarily a multiple of the number of channels scanned.

References dsm_sample::data, do_filters(), getA2DDeviceName(), dsm_sample::length, screen_timetag(), dsm_sample::timetag, and TMSECS_PER_SEC.

Referenced by init_a2d().

static void dmmat_a2d_bottom_half_fast ( struct work_struct *  work)
static

Worker function that invokes filters on the data in a fifo sample.

The contents of the fifo sample must be a multiple of the number of channels scanned.

References dsm_sample::data, do_filters(), getA2DDeviceName(), dsm_sample::length, screen_timetag(), dsm_sample::timetag, and TMSECS_PER_SEC.

Referenced by init_a2d().

static irqreturn_t dmmat_a2d_handler ( struct DMMAT_A2D *  a2d)
static
static void dmmat_a2d_waveform_bh ( struct work_struct *  work)
static

Worker function for forming samples when operating in waveform mode.

References dsm_sample::data, getA2DDeviceName(), dsm_sample::length, and dsm_sample::timetag.

Referenced by init_a2d().

static irqreturn_t dmmat_cntr_handler ( struct DMMAT_CNTR *  cntr)
static

Referenced by dmmat_irq_handler().

static long dmmat_ioctl_a2d ( struct file *  filp,
unsigned int  cmd,
unsigned long  arg 
)
static
static long dmmat_ioctl_cntr ( struct file *  filp,
unsigned int  cmd,
unsigned long  arg 
)
static
static long dmmat_ioctl_d2a ( struct file *  filp,
unsigned int  cmd,
unsigned long  arg 
)
static
static long dmmat_ioctl_d2d ( struct file *  filp,
unsigned int  cmd,
unsigned long  arg 
)
static
static irqreturn_t dmmat_irq_handler ( int  irq,
void *  dev_id 
)
static
static int dmmat_open_a2d ( struct inode *  inode,
struct file *  filp 
)
static

References board, and numActualBoards.

static int dmmat_open_cntr ( struct inode *  inode,
struct file *  filp 
)
static

References board, and numActualBoards.

static int dmmat_open_d2a ( struct inode *  inode,
struct file *  filp 
)
static

References board, and numActualBoards.

static int dmmat_open_d2d ( struct inode *  inode,
struct file *  filp 
)
static

References board, and numActualBoards.

static unsigned int dmmat_poll_a2d ( struct file *  filp,
poll_table *  wait 
)
static
unsigned int dmmat_poll_cntr ( struct file *  filp,
poll_table *  wait 
)
static unsigned int dmmat_poll_d2d ( struct file *  filp,
poll_table *  wait 
)
static
static ssize_t dmmat_read_a2d ( struct file *  filp,
char __user *  buf,
size_t  count,
loff_t *  f_pos 
)
static

References nidas_circbuf_read().

static ssize_t dmmat_read_cntr ( struct file *  filp,
char __user *  buf,
size_t  count,
loff_t *  f_pos 
)
static

References nidas_circbuf_read().

static ssize_t dmmat_read_d2d ( struct file *  filp,
char __user *  buf,
size_t  count,
loff_t *  f_pos 
)
static

References nidas_circbuf_read().

static int dmmat_release_a2d ( struct inode *  inode,
struct file *  filp 
)
static

References board, numActualBoards, and stopA2D().

static int dmmat_release_cntr ( struct inode *  inode,
struct file *  filp 
)
static

References board, numActualBoards, and stopCNTR().

static int dmmat_release_d2a ( struct inode *  inode,
struct file *  filp 
)
static
static int dmmat_release_d2d ( struct inode *  inode,
struct file *  filp 
)
static

References board, numActualBoards, and stopD2D().

static void do_filters ( struct DMMAT_A2D *  a2d,
dsm_sample_time_t  tt,
const short *  dp 
)
static

Invoke filters.

References getA2DDeviceName(), and a2d_sample::id.

Referenced by dmmat_a2d_bottom_half(), and dmmat_a2d_bottom_half_fast().

static void freeA2DFilters ( struct DMMAT_A2D *  a2d)
static

Referenced by resetA2D_processing().

static void freeFilters ( struct DMMAT_A2D *  a2d)
static

Referenced by cleanup_a2d().

const char* getA2DDeviceName ( struct DMMAT_A2D *  a2d)
static int getA2DThreshold_MM16AT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static int getA2DThreshold_MM32XAT ( struct DMMAT_A2D *  a2d)
static

References DMM32AT_BOARD, getA2DDeviceName(), if(), and MSECS_PER_SEC.

Referenced by init_a2d().

static int getConvRateMM16AT ( struct DMMAT_A2D *  a2d,
unsigned char *  val 
)
static

Referenced by init_a2d().

static int getConvRateMM32XAT ( struct DMMAT_A2D *  a2d,
unsigned char *  val 
)
static

Referenced by init_a2d().

static void getD2A_conv ( struct DMMAT_D2A *  d2a,
struct DMMAT_D2A_Conversion conv 
)
static
static void getD2A_mult ( struct DMMAT_D2A *  d2a,
struct DMMAT_D2A_Outputs outputs 
)
static
static int getFifoLevelMM16AT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static int getFifoLevelMM32XAT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static int getGainSettingMM16AT ( struct DMMAT_A2D *  a2d,
int  gain,
int  bipolar,
unsigned char *  val 
)
static

References getA2DDeviceName().

Referenced by init_a2d().

static int getGainSettingMM32XAT ( struct DMMAT_A2D *  a2d,
int  gain,
int  bipolar,
unsigned char *  val 
)
static

References getA2DDeviceName().

Referenced by init_a2d().

static int getNumA2DChannelsMM16AT ( struct DMMAT_A2D *  a2d)
static

Determine number of available channels - depends on single-ended vs differential jumpering.

Referenced by init_a2d().

static int getNumA2DChannelsMM32XAT ( struct DMMAT_A2D *  a2d)
static

Determine number of available channels - depends on single-ended vs differential jumpering.

Referenced by init_a2d().

static int init_a2d ( struct DMMAT *  brd)
static
static int __init init_cntr ( struct DMMAT *  brd)
static
static int __init init_d2a ( struct DMMAT *  brd)
static
static int __init init_d2d ( struct DMMAT *  brd)
static
static int loadWaveforms_MM16AT ( struct DMMAT_D2A *  d2a)
static

Referenced by init_d2a().

static int loadWaveforms_MM32XAT ( struct DMMAT_D2A *  d2a)
static
MODULE_AUTHOR ( "Gordon Maclean <maclean@ucar.edu>"  )
MODULE_DESCRIPTION ( "Driver for Diamond DMM analog cards"  )
module_exit ( dmd_mmat_cleanup  )
module_init ( dmd_mmat_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param_array ( ioports  ,
int  ,
numboards  ,
 
)
module_param_array ( irqs  ,
int  ,
numirqs  ,
 
)
module_param_array ( types  ,
int  ,
numtypes  ,
 
)
module_param_array ( d2aconfig  ,
int  ,
numd2aconfig  ,
 
)
MODULE_VERSION ( REPO_REVISION  )
static unsigned int readLatchedTimer ( struct DMMAT *  brd,
int  clock 
)
static

Read counter value in a 82C54 clock.

Works on both MM16AT and MM32XAT, assuming both have set page bit(s) to 0: MM16AT: bit 6 in base+10 is the page bit MM32XAT: bits 0-2 in base+8 are page bits

Referenced by cntr_timer_fn().

static void releaseClock12 ( struct DMMAT *  brd)
static

Referenced by stopA2D(), and stopWaveforms().

static void resetA2D_processing ( struct DMMAT_A2D *  a2d)
static

Reset state of data processing.

References free_dsm_circ_buf(), freeA2DFilters(), MAX_DMMAT_A2D_CHANNELS, and work_queue.

Referenced by configA2D(), and stopA2D().

static void resetFifoMM16AT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static void resetFifoMM32XAT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static int selectA2DChannelsMM16AT ( struct DMMAT_A2D *  a2d)
static

returns: 0: ok, -EINVAL: channels out of range.

Referenced by init_a2d().

static int selectA2DChannelsMM32XAT ( struct DMMAT_A2D *  a2d)
static

returns: 0: ok, -EINVAL: channels out of range.

Referenced by init_a2d().

static int setClock1InputRate_MM16AT ( struct DMMAT *  brd,
int  rate 
)
static

Referenced by dmd_mmat_init().

static int setClock1InputRate_MM32AT ( struct DMMAT *  brd,
int  rate 
)
static

Referenced by dmd_mmat_init().

static int setD2A_MM16AT ( struct DMMAT_D2A *  d2a,
struct DMMAT_D2A_Outputs outputs,
int  iout 
)
static
static int setD2A_MM32AT ( struct DMMAT_D2A *  d2a,
struct DMMAT_D2A_Outputs outputs,
int  iout 
)
static
static int setD2A_MM32DXAT ( struct DMMAT_D2A *  d2a,
struct DMMAT_D2A_Outputs outputs,
int  iout 
)
static
static int setD2A_mult ( struct DMMAT_D2A *  d2a,
struct DMMAT_D2A_Outputs outputs 
)
static
static void setTimerClock ( struct DMMAT *  brd,
int  clock,
int  mode,
unsigned short  val 
)
static

Set counter value in a 82C54 clock.

Works on both MM16AT and MM32XAT, assuming both have set page bit(s) to 0: MM16AT: bit 6 in base+10 is the page bit MM32XAT: bits 0-2 in base+8 are page bits Does not hold a spin_lock.

Referenced by setupClock12(), startCntr_MM16AT(), and startCntr_MM32AT().

static int setupClock12 ( struct DMMAT *  brd,
int  inputRate,
int  outputRate 
)
static

References div_10(), and setTimerClock().

Referenced by startA2D(), and startWaveforms().

static int startA2D ( struct DMMAT_A2D *  a2d)
static
static void startA2D_MM16AT ( struct DMMAT_A2D *  a2d)
static
static void startA2D_MM32XAT ( struct DMMAT_A2D *  a2d)
static
static int startAutoCal_MM32XAT ( struct DMMAT_A2D *  a2d)
static

Referenced by dmmat_ioctl_a2d().

static int startCNTR ( struct DMMAT_CNTR *  cntr,
struct DMMAT_CNTR_Config cfg 
)
static

General function to start a counter.

Calls the board specific method.

References dmd_mmat_add_irq_user(), DMMAT_CNTR_Config::msecPeriod, MSECS_PER_SEC, and stopCNTR().

Referenced by dmmat_ioctl_cntr().

static int startCntr_MM16AT ( struct DMMAT_CNTR *  cntr)
static

References setTimerClock().

Referenced by init_cntr().

static int startCntr_MM32AT ( struct DMMAT_CNTR *  cntr)
static

References setTimerClock().

Referenced by init_cntr().

static int startD2D ( struct DMMAT_D2D *  d2d)
static
static void startD2D_MM16AT ( struct DMMAT_D2D *  d2d)
static

Referenced by init_d2d().

static void startD2D_MM32XAT ( struct DMMAT_D2D *  d2d)
static

Referenced by init_d2d().

static int startWaveforms ( struct DMMAT_D2A *  d2a)
static

References setupClock12().

Referenced by dmmat_ioctl_d2a(), and startD2D().

static void startWaveforms_MM16AT ( struct DMMAT_D2A *  d2a)
static

Referenced by init_d2a().

static void startWaveforms_MM32XAT ( struct DMMAT_D2A *  d2a)
static

Referenced by init_d2a().

static void stopA2D ( struct DMMAT_A2D *  a2d)
static

General function to stop the A2D.

Calls the board specific method. a2d->mutex should be locked, so that a2d->running reflects the current state of the A2D.

References dmd_mmat_remove_irq_user(), getA2DDeviceName(), releaseClock12(), and resetA2D_processing().

Referenced by dmmat_ioctl_a2d(), dmmat_release_a2d(), and stopD2D().

static void stopA2D_MM16AT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static void stopA2D_MM32XAT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static int stopCNTR ( struct DMMAT_CNTR *  cntr)
static

General function to stop a counter.

Calls the board specific method.

References dmd_mmat_remove_irq_user().

Referenced by dmmat_ioctl_cntr(), dmmat_release_cntr(), and startCNTR().

static void stopCntr_MM16AT ( struct DMMAT_CNTR *  cntr)
static

Referenced by init_cntr().

static void stopCntr_MM32AT ( struct DMMAT_CNTR *  cntr)
static

Referenced by init_cntr().

static int stopD2D ( struct DMMAT_D2D *  d2d)
static

References stopA2D(), and stopWaveforms().

Referenced by dmmat_ioctl_d2d(), and dmmat_release_d2d().

static void stopD2D_MM16AT ( struct DMMAT_D2D *  d2d)
static

Referenced by init_d2d().

static void stopD2D_MM32XAT ( struct DMMAT_D2D *  d2d)
static

Referenced by init_d2d().

static void stopWaveforms ( struct DMMAT_D2A *  d2a)
static

General function to stop the D2A waveform.

Calls the board specific method. d2da>waveform_mutex should be locked, so that d2a->waveform_running reflects the current state of the A2D.

References DMMAT_D2A_OUTPUTS_PER_BRD, and releaseClock12().

Referenced by dmmat_ioctl_d2a(), dmmat_release_d2a(), and stopD2D().

static void stopWaveforms_MM16AT ( struct DMMAT_D2A *  d2a)
static

Referenced by init_d2a().

static void stopWaveforms_MM32XAT ( struct DMMAT_D2A *  d2a)
static

Referenced by init_d2a().

static void waitForA2DSettleMM16AT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

static void waitForA2DSettleMM32XAT ( struct DMMAT_A2D *  a2d)
static

Referenced by init_a2d().

Variable Documentation

struct file_operations a2d_fops
static
Initial value:
= {
.owner = THIS_MODULE,
.read = dmmat_read_a2d,
.poll = dmmat_poll_a2d,
.open = dmmat_open_a2d,
.unlocked_ioctl = dmmat_ioctl_a2d,
.release = dmmat_release_a2d,
.llseek = no_llseek,
}
static int dmmat_release_a2d(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:2879
static ssize_t dmmat_read_a2d(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
Definition: dmd_mmat.c:2931
static long dmmat_ioctl_a2d(struct file *filp, unsigned int cmd, unsigned long arg)
Definition: dmd_mmat.c:2939
static int dmmat_open_a2d(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:2847
static unsigned int dmmat_poll_a2d(struct file *filp, poll_table *wait)
Definition: dmd_mmat.c:2917
struct DMMAT* board = 0
static
const char* BOARD_TYPE_STRS[]
static
Initial value:
= {
"DMM16AT", "DMM32AT", "DMM32XAT", "DMM32DXAT"}

Referenced by dmd_mmat_init().

struct file_operations cntr_fops
static
Initial value:
= {
.owner = THIS_MODULE,
.read = dmmat_read_cntr,
.poll = dmmat_poll_cntr,
.open = dmmat_open_cntr,
.unlocked_ioctl = dmmat_ioctl_cntr,
.release = dmmat_release_cntr,
.llseek = no_llseek,
}
static ssize_t dmmat_read_cntr(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
Definition: dmd_mmat.c:3159
unsigned int dmmat_poll_cntr(struct file *filp, poll_table *wait)
Definition: dmd_mmat.c:3245
static long dmmat_ioctl_cntr(struct file *filp, unsigned int cmd, unsigned long arg)
Definition: dmd_mmat.c:3168
static int dmmat_open_cntr(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:3100
static int dmmat_release_cntr(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:3131
struct file_operations d2a_fops
static
Initial value:
= {
.owner = THIS_MODULE,
.open = dmmat_open_d2a,
.unlocked_ioctl = dmmat_ioctl_d2a,
.release = dmmat_release_d2a,
.llseek = no_llseek,
}
static int dmmat_release_d2a(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:3294
static long dmmat_ioctl_d2a(struct file *filp, unsigned int cmd, unsigned long arg)
Definition: dmd_mmat.c:3325
static int dmmat_open_d2a(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:3266
int d2aconfig[MAX_DMMAT_BOARDS] = { DMMAT_D2A_UNI_5, 0, 0, 0 }
static

Referenced by init_d2a().

struct file_operations d2d_fops
static
Initial value:
= {
.owner = THIS_MODULE,
.read = dmmat_read_d2d,
.poll = dmmat_poll_d2d,
.open = dmmat_open_d2d,
.unlocked_ioctl = dmmat_ioctl_d2d,
.release = dmmat_release_d2d,
.llseek = no_llseek,
}
static long dmmat_ioctl_d2d(struct file *filp, unsigned int cmd, unsigned long arg)
Definition: dmd_mmat.c:3575
static unsigned int dmmat_poll_d2d(struct file *filp, poll_table *wait)
Definition: dmd_mmat.c:3548
static int dmmat_release_d2d(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:3511
static int dmmat_open_d2d(struct inode *inode, struct file *filp)
Definition: dmd_mmat.c:3473
static ssize_t dmmat_read_d2d(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
Definition: dmd_mmat.c:3565
struct class* dmmat_class
static
dev_t dmmat_device = MKDEV(0,0)
static
unsigned int ioports[MAX_DMMAT_BOARDS] = { 0x380, 0, 0, 0 }
static

Referenced by dmd_mmat_init().

int irqs[MAX_DMMAT_BOARDS] = { 12, 0, 0, 0 }
static
int numActualBoards = 0
static
int numboards = 0
static

Referenced by dmd_mmat_cleanup(), and dmd_mmat_init().

int numd2aconfig = 0
static
int numirqs = 0
static
int numtypes = 0
static
int types[MAX_DMMAT_BOARDS] = { DMM32DXAT_BOARD, 0, 0, 0 }
static

Referenced by dmd_mmat_init().

struct workqueue_struct* work_queue = 0
static