// bit in hexadecimal representation of range index that indicates unipolar input range
#define IS_UNIPOLAR 0x4
// analog input ranges for most boards
-comedi_lrange cb_pcidas_ranges =
+static comedi_lrange cb_pcidas_ranges =
{
8,
{
};
// pci-das1001 input ranges
-comedi_lrange cb_pcidas_alt_ranges =
+static comedi_lrange cb_pcidas_alt_ranges =
{
8,
{
};
// analog output ranges
-comedi_lrange cb_pcidas_ao_ranges =
+static comedi_lrange cb_pcidas_ao_ranges =
{
4,
{
return 0;
}
-void cb_pcidas_load_counters(comedi_device *dev, unsigned int *ns, int rounding_flags)
+static void cb_pcidas_load_counters(comedi_device *dev, unsigned int *ns, int rounding_flags)
{
i8253_cascade_ns_to_timer_2div(TIMER_BASE, &(devpriv->divisor1),
&(devpriv->divisor2), ns, rounding_flags & TRIG_ROUND_MASK);
static unsigned int das16_set_pacer(comedi_device *dev, unsigned int ns, int flags);
static int das1600_mode_detect(comedi_device *dev);
-unsigned int das16_suggest_transfer_size(comedi_cmd cmd);
+static unsigned int das16_suggest_transfer_size(comedi_cmd cmd);
#ifdef DEBUG
static void reg_dump(comedi_device *dev);
COMEDI_INITCLEANUP(driver_das16);
// utility function that suggests a dma transfer size in bytes
-unsigned int das16_suggest_transfer_size(comedi_cmd cmd)
+static unsigned int das16_suggest_transfer_size(comedi_cmd cmd)
{
unsigned int size;
unsigned int freq;
static int das1800_di_rbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int das1800_do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
-int das1800_set_frequency(comedi_device *dev);
-unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode);
-unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns);
+static int das1800_set_frequency(comedi_device *dev);
+static unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode);
+static unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns);
// analog input ranges
static comedi_lrange range_ai_das1801 = {
* not always achievable depending on board setup (see
* user manual.)
*/
-das1800_board das1800_boards[] =
+static das1800_board das1800_boards[] =
{
{
name: "das-1701st",
break;
}
-//dma stuff
+ //dma stuff
// need an irq to do dma
if(irq)
{
/* probes and checks das-1800 series board type
*/
-int das1800_probe(comedi_device *dev)
+static int das1800_probe(comedi_device *dev)
{
int id;
int board;
// first, some utility functions used in the main ai_do_cmd()
// returns appropriate bits for control register a, depending on command
-int control_a_bits(comedi_cmd cmd)
+static int control_a_bits(comedi_cmd cmd)
{
int control_a;
}
// returns appropriate bits for control register c, depending on command
-int control_c_bits(comedi_cmd cmd)
+static int control_c_bits(comedi_cmd cmd)
{
int control_c;
int aref;
}
// sets up counters
-int setup_counters(comedi_device *dev, comedi_cmd cmd)
+static int setup_counters(comedi_device *dev, comedi_cmd cmd)
{
// setup cascaded counters for conversion/scan frequency
switch(cmd.scan_begin_src)
}
// sets up dma
-void setup_dma(comedi_device *dev, comedi_cmd cmd)
+static void setup_dma(comedi_device *dev, comedi_cmd cmd)
{
unsigned long lock_flags;
const int dual_dma = devpriv->irq_dma_bits & DMA_DUAL;
}
// programs channel/gain list into card
-void program_chanlist(comedi_device *dev, comedi_cmd cmd)
+static void program_chanlist(comedi_device *dev, comedi_cmd cmd)
{
int i, n, chan_range;
unsigned long irq_flags;
}
/* loads counters with divisor1, divisor2 from private structure */
-int das1800_set_frequency(comedi_device *dev)
+static int das1800_set_frequency(comedi_device *dev)
{
int err = 0;
/* converts requested conversion timing to timing compatible with
* hardware, used only when card is in 'burst mode'
*/
-unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode)
+static unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode)
{
unsigned int micro_sec;
}
// utility function that suggests a dma transfer size based on the conversion period 'ns'
-unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns)
+static unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns)
{
unsigned int size;
unsigned int freq = 1000000000 / ns;
enum{das800, ciodas800, das801, ciodas801, das802, ciodas802, ciodas80216};
-das800_board das800_boards[] =
+static das800_board das800_boards[] =
{
{
name: "das-800",
};
static void das800_interrupt(int irq, void *d, struct pt_regs *regs);
-void enable_das800(comedi_device *dev);
-void disable_das800(comedi_device *dev);
+static void enable_das800(comedi_device *dev);
+static void disable_das800(comedi_device *dev);
static int das800_ai_do_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd);
static int das800_ai_do_cmd(comedi_device *dev, comedi_subdevice *s);
static int das800_ai_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int das800_di_rbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int das800_do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
-int das800_probe(comedi_device *dev);
-int das800_set_frequency(comedi_device *dev);
+static int das800_probe(comedi_device *dev);
+static int das800_set_frequency(comedi_device *dev);
/* checks and probes das-800 series board type */
-int das800_probe(comedi_device *dev)
+static int das800_probe(comedi_device *dev)
{
int id_bits;
unsigned long irq_flags;
}
/* enable_das800 makes the card start taking hardware triggered conversions */
-void enable_das800(comedi_device *dev)
+static void enable_das800(comedi_device *dev)
{
unsigned long irq_flags;
comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
}
/* disable_das800 stops hardware triggered conversions */
-void disable_das800(comedi_device *dev)
+static void disable_das800(comedi_device *dev)
{
unsigned long irq_flags;
comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
}
/* loads counters with divisor1, divisor2 from private structure */
-int das800_set_frequency(comedi_device *dev)
+static int das800_set_frequency(comedi_device *dev)
{
int err = 0;
#define A2150_SIZE 28
#define A2150_DMA_BUFFER_SIZE 0xff00 // size in bytes of dma buffer
-#define A2150_DEBUG // enable debugging code
+//#define A2150_DEBUG // enable debugging code
+#undef A2150_DEBUG // disable debugging code
/* Registers and bits */
#define CONFIG_REG 0x0
// enum must match board indices
enum{a2150_c, a2150_s};
-a2150_board a2150_boards[] =
+static a2150_board a2150_boards[] =
{
{
name: "at-a2150c",
#ifdef A2150_DEBUG
-void ni_dump_regs(comedi_device *dev)
+static void ni_dump_regs(comedi_device *dev)
{
rt_printk("config bits 0x%x\n", devpriv->config_bits);
rt_printk("irq dma bits 0x%x\n", devpriv->irq_dma_bits);
enable_dma(devpriv->dma);
release_dma_lock(lock_flags);
+ /* clear dma interrupt before enabling it, to try and get rid of that
+ * one spurious interrupt that has been happening */
+ outw(0x00, dev->iobase + DMA_TC_CLEAR_REG);
+
// enable dma on card
devpriv->irq_dma_bits |= DMA_INTR_EN_BIT | DMA_EN_BIT;
outw(devpriv->irq_dma_bits, dev->iobase + IRQ_DMA_CNTRL_REG);
return 0;
}
+// XXX doesn't seem to work
static int a2150_ai_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
unsigned int i, n;