Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353922
b: refs/heads/master
c: f95d45d
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 5b87ba6 commit 0805637
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 86 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 215caceb3dac9eb7d431c9da21394c6ccb778b15
refs/heads/master: f95d45d114e1fd024bdee67beb80fce9b9c96126
1 change: 0 additions & 1 deletion trunk/drivers/staging/comedi/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#

# Comedi "helper" modules
obj-$(CONFIG_COMEDI) += pcm_common.o

# Comedi misc drivers
obj-$(CONFIG_COMEDI_BOND) += comedi_bond.o
Expand Down
63 changes: 0 additions & 63 deletions trunk/drivers/staging/comedi/drivers/pcm_common.c

This file was deleted.

8 changes: 0 additions & 8 deletions trunk/drivers/staging/comedi/drivers/pcm_common.h

This file was deleted.

61 changes: 55 additions & 6 deletions trunk/drivers/staging/comedi/drivers/pcmmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ Configuration Options:

#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/pci.h>

#include "../comedidev.h"
#include "pcm_common.h"
#include <linux/pci.h> /* for PCI devices */
#include "comedi_fc.h"

/* This stuff is all from pcmuio.c -- it refers to the DIO subdevices only */
#define CHANS_PER_PORT 8
Expand Down Expand Up @@ -802,11 +803,59 @@ static int pcmmio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
return 0;
}

static int
pcmmio_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_cmd *cmd)
static int pcmmio_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
return comedi_pcm_cmdtest(dev, s, cmd);
int err = 0;

/* Step 1 : check if triggers are trivially valid */

err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW | TRIG_INT);
err |= cfc_check_trigger_src(&cmd->scan_begin_src, TRIG_EXT);
err |= cfc_check_trigger_src(&cmd->convert_src, TRIG_NOW);
err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT | TRIG_NONE);

if (err)
return 1;

/* Step 2a : make sure trigger sources are unique */

err |= cfc_check_trigger_is_unique(cmd->start_src);
err |= cfc_check_trigger_is_unique(cmd->stop_src);

/* Step 2b : and mutually compatible */

if (err)
return 2;

/* Step 3: check if arguments are trivially valid */

err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
err |= cfc_check_trigger_arg_is(&cmd->convert_arg, 0);
err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len);

switch (cmd->stop_src) {
case TRIG_COUNT:
/* any count allowed */
break;
case TRIG_NONE:
err |= cfc_check_trigger_arg_is(&cmd->stop_arg, 0);
break;
default:
break;
}

if (err)
return 3;

/* step 4: fix up any arguments */

/* if (err) return 4; */

return 0;
}

static int adc_wait_ready(unsigned long iobase)
Expand Down
62 changes: 55 additions & 7 deletions trunk/drivers/staging/comedi/drivers/pcmuio.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ Configuration Options:

#include <linux/interrupt.h>
#include <linux/slab.h>
#include "../comedidev.h"
#include "pcm_common.h"
#include <linux/pci.h>

#include <linux/pci.h> /* for PCI devices */
#include "../comedidev.h"
#include "comedi_fc.h"

#define CHANS_PER_PORT 8
#define PORTS_PER_ASIC 6
Expand Down Expand Up @@ -740,11 +740,59 @@ static int pcmuio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
return 0;
}

static int
pcmuio_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_cmd *cmd)
static int pcmuio_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
return comedi_pcm_cmdtest(dev, s, cmd);
int err = 0;

/* Step 1 : check if triggers are trivially valid */

err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW | TRIG_INT);
err |= cfc_check_trigger_src(&cmd->scan_begin_src, TRIG_EXT);
err |= cfc_check_trigger_src(&cmd->convert_src, TRIG_NOW);
err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT | TRIG_NONE);

if (err)
return 1;

/* Step 2a : make sure trigger sources are unique */

err |= cfc_check_trigger_is_unique(cmd->start_src);
err |= cfc_check_trigger_is_unique(cmd->stop_src);

/* Step 2b : and mutually compatible */

if (err)
return 2;

/* Step 3: check if arguments are trivially valid */

err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
err |= cfc_check_trigger_arg_is(&cmd->convert_arg, 0);
err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len);

switch (cmd->stop_src) {
case TRIG_COUNT:
/* any count allowed */
break;
case TRIG_NONE:
err |= cfc_check_trigger_arg_is(&cmd->stop_arg, 0);
break;
default:
break;
}

if (err)
return 3;

/* step 4: fix up any arguments */

/* if (err) return 4; */

return 0;
}

static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
Expand Down

0 comments on commit 0805637

Please sign in to comment.