Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324975
b: refs/heads/master
c: 83eef17
h: refs/heads/master
i:
  324973: a363d33
  324971: 0616504
  324967: 5a0bc6d
  324959: a9d0ad5
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 8, 2012
1 parent f9da0bd commit 677788a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 42 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: db9132e03054f1332952961ecc0db4fa955a46a5
refs/heads/master: 83eef17c7845d08eb40e5792ed40b387eb555bdd
51 changes: 10 additions & 41 deletions trunk/drivers/staging/comedi/drivers/me4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,69 +1510,38 @@ static int me4000_dio_insn_config(struct comedi_device *dev,
Counter section
===========================================================================*/

static int cnt_reset(struct comedi_device *dev, unsigned int channel)
{
struct me4000_info *info = dev->private;

i8254_load(info->timer_regbase, 0, channel, 0,
I8254_MODE0 | I8254_BINARY);

return 0;
}

static int cnt_config(struct comedi_device *dev, unsigned int channel,
unsigned int mode)
{
struct me4000_info *info = dev->private;

i8254_set_mode(info->timer_regbase, 0, channel,
(mode << 1) | I8254_BINARY);

return 0;
}

static int me4000_cnt_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
struct comedi_insn *insn,
unsigned int *data)
{

struct me4000_info *info = dev->private;
int err;

switch (data[0]) {
case GPCT_RESET:
if (insn->n != 1) {
printk(KERN_ERR
"comedi%d: me4000: me4000_cnt_insn_config(): "
"Invalid instruction length%d\n",
dev->minor, insn->n);
if (insn->n != 1)
return -EINVAL;
}

err = cnt_reset(dev, insn->chanspec);
err = i8254_load(info->timer_regbase, 0, insn->chanspec, 0,
I8254_MODE0 | I8254_BINARY);
if (err)
return err;
break;
case GPCT_SET_OPERATION:
if (insn->n != 2) {
printk(KERN_ERR
"comedi%d: me4000: me4000_cnt_insn_config(): "
"Invalid instruction length%d\n",
dev->minor, insn->n);
if (insn->n != 2)
return -EINVAL;
}

err = cnt_config(dev, insn->chanspec, data[1]);
err = i8254_set_mode(info->timer_regbase, 0, insn->chanspec,
(data[1] << 1) | I8254_BINARY);
if (err)
return err;
break;
default:
printk(KERN_ERR
"comedi%d: me4000: me4000_cnt_insn_config(): "
"Invalid instruction\n", dev->minor);
return -EINVAL;
}

return 2;
return insn->n;
}

static int me4000_cnt_insn_read(struct comedi_device *dev,
Expand Down

0 comments on commit 677788a

Please sign in to comment.