]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/staging/comedi/drivers/comedi_test.c
Staging: comedi: Remove comedi_async typedef
[linux-2.6-omap-h63xx.git] / drivers / staging / comedi / drivers / comedi_test.c
index 4b4c37d0748246824e722b80f98fb2cb06da95e6..f8baf83c588c5f2182ecb18abd647fd5723d8ac4 100644 (file)
@@ -89,12 +89,12 @@ struct waveform_private {
        unsigned int scan_period;       /* scan period in usec */
        unsigned int convert_period;    /* conversion period in usec */
        unsigned timer_running:1;
-       lsampl_t ao_loopbacks[N_CHANS];
+       unsigned int ao_loopbacks[N_CHANS];
 };
 #define devpriv ((struct waveform_private *)dev->private)
 
-static int waveform_attach(comedi_device *dev, comedi_devconfig *it);
-static int waveform_detach(comedi_device *dev);
+static int waveform_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int waveform_detach(struct comedi_device *dev);
 static comedi_driver driver_waveform = {
       .driver_name =   "comedi_test",
       .module =                THIS_MODULE,
@@ -107,21 +107,21 @@ static comedi_driver driver_waveform = {
 
 COMEDI_INITCLEANUP(driver_waveform);
 
-static int waveform_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
                               comedi_cmd *cmd);
-static int waveform_ai_cmd(comedi_device *dev, comedi_subdevice *s);
-static int waveform_ai_cancel(comedi_device *dev, comedi_subdevice *s);
-static int waveform_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
-                                comedi_insn *insn, lsampl_t *data);
-static int waveform_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
-                                 comedi_insn *insn, lsampl_t *data);
-static sampl_t fake_sawtooth(comedi_device *dev, unsigned int range,
+static int waveform_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
+static int waveform_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
+static int waveform_ai_insn_read(struct comedi_device *dev, struct comedi_subdevice *s,
+                                comedi_insn *insn, unsigned int *data);
+static int waveform_ao_insn_write(struct comedi_device *dev, struct comedi_subdevice *s,
+                                 comedi_insn *insn, unsigned int *data);
+static short fake_sawtooth(struct comedi_device *dev, unsigned int range,
                             unsigned long current_time);
-static sampl_t fake_squarewave(comedi_device *dev, unsigned int range,
+static short fake_squarewave(struct comedi_device *dev, unsigned int range,
                               unsigned long current_time);
-static sampl_t fake_flatline(comedi_device *dev, unsigned int range,
+static short fake_flatline(struct comedi_device *dev, unsigned int range,
                             unsigned long current_time);
-static sampl_t fake_waveform(comedi_device *dev, unsigned int channel,
+static short fake_waveform(struct comedi_device *dev, unsigned int channel,
                             unsigned int range, unsigned long current_time);
 
 /* 1000 nanosec in a microsec */
@@ -143,8 +143,8 @@ static const comedi_lrange waveform_ai_ranges = {
 */
 static void waveform_ai_interrupt(unsigned long arg)
 {
-       comedi_device *dev = (comedi_device *) arg;
-       comedi_async *async = dev->read_subdev->async;
+       struct comedi_device *dev = (struct comedi_device *) arg;
+       struct comedi_async *async = dev->read_subdev->async;
        comedi_cmd *cmd = &async->cmd;
        unsigned int i, j;
        /* all times in microsec */
@@ -192,9 +192,9 @@ static void waveform_ai_interrupt(unsigned long arg)
        comedi_event(dev, dev->read_subdev);
 }
 
-static int waveform_attach(comedi_device *dev, comedi_devconfig *it)
+static int waveform_attach(struct comedi_device *dev, comedi_devconfig *it)
 {
-       comedi_subdevice *s;
+       struct comedi_subdevice *s;
        int amplitude = it->options[0];
        int period = it->options[1];
        int i;
@@ -259,7 +259,7 @@ static int waveform_attach(comedi_device *dev, comedi_devconfig *it)
        return 1;
 }
 
-static int waveform_detach(comedi_device *dev)
+static int waveform_detach(struct comedi_device *dev)
 {
        printk("comedi%d: comedi_test: remove\n", dev->minor);
 
@@ -269,7 +269,7 @@ static int waveform_detach(comedi_device *dev)
        return 0;
 }
 
-static int waveform_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
                               comedi_cmd *cmd)
 {
        int err = 0;
@@ -397,7 +397,7 @@ static int waveform_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
        return 0;
 }
 
-static int waveform_ai_cmd(comedi_device *dev, comedi_subdevice *s)
+static int waveform_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 {
        comedi_cmd *cmd = &s->async->cmd;
 
@@ -429,17 +429,17 @@ static int waveform_ai_cmd(comedi_device *dev, comedi_subdevice *s)
        return 0;
 }
 
-static int waveform_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int waveform_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
 {
        devpriv->timer_running = 0;
        del_timer(&devpriv->timer);
        return 0;
 }
 
-static sampl_t fake_sawtooth(comedi_device *dev, unsigned int range_index,
+static short fake_sawtooth(struct comedi_device *dev, unsigned int range_index,
                             unsigned long current_time)
 {
-       comedi_subdevice *s = dev->read_subdev;
+       struct comedi_subdevice *s = dev->read_subdev;
        unsigned int offset = s->maxdata / 2;
        u64 value;
        const comedi_krange *krange = &s->range_table->range[range_index];
@@ -457,10 +457,10 @@ static sampl_t fake_sawtooth(comedi_device *dev, unsigned int range_index,
 
        return offset + value;
 }
-static sampl_t fake_squarewave(comedi_device *dev, unsigned int range_index,
+static short fake_squarewave(struct comedi_device *dev, unsigned int range_index,
                               unsigned long current_time)
 {
-       comedi_subdevice *s = dev->read_subdev;
+       struct comedi_subdevice *s = dev->read_subdev;
        unsigned int offset = s->maxdata / 2;
        u64 value;
        const comedi_krange *krange = &s->range_table->range[range_index];
@@ -476,14 +476,14 @@ static sampl_t fake_squarewave(comedi_device *dev, unsigned int range_index,
        return offset + value;
 }
 
-static sampl_t fake_flatline(comedi_device *dev, unsigned int range_index,
+static short fake_flatline(struct comedi_device *dev, unsigned int range_index,
                             unsigned long current_time)
 {
        return dev->read_subdev->maxdata / 2;
 }
 
 /* generates a different waveform depending on what channel is read */
-static sampl_t fake_waveform(comedi_device *dev, unsigned int channel,
+static short fake_waveform(struct comedi_device *dev, unsigned int channel,
                             unsigned int range, unsigned long current_time)
 {
        enum {
@@ -504,8 +504,8 @@ static sampl_t fake_waveform(comedi_device *dev, unsigned int channel,
        return fake_flatline(dev, range, current_time);
 }
 
-static int waveform_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
-                                comedi_insn *insn, lsampl_t *data)
+static int waveform_ai_insn_read(struct comedi_device *dev, struct comedi_subdevice *s,
+                                comedi_insn *insn, unsigned int *data)
 {
        int i, chan = CR_CHAN(insn->chanspec);
 
@@ -515,8 +515,8 @@ static int waveform_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
        return insn->n;
 }
 
-static int waveform_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
-                                 comedi_insn *insn, lsampl_t *data)
+static int waveform_ao_insn_write(struct comedi_device *dev, struct comedi_subdevice *s,
+                                 comedi_insn *insn, unsigned int *data)
 {
        int i, chan = CR_CHAN(insn->chanspec);