Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337206
b: refs/heads/master
c: 82327aa
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Oct 24, 2012
1 parent 8214d22 commit cccd461
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 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: 32bd027dd700744b29b89c38353b5597e70ce802
refs/heads/master: 82327aaf2e9fada01c972b296cbfc46a2ca9d85c
16 changes: 5 additions & 11 deletions trunk/drivers/staging/comedi/drivers/ni_660x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,22 +1114,13 @@ static int ni_660x_set_pfi_routing(struct comedi_device *dev, unsigned chan,
return 0;
}

static void ni660x_config_filter(struct comedi_device *dev,
unsigned pfi_channel,
enum ni_gpct_filter_select filter)
{
unsigned bits = ni_660x_read_register(dev, 0, IOConfigReg(pfi_channel));
bits &= ~pfi_input_select_mask(pfi_channel);
bits |= pfi_input_select_bits(pfi_channel, filter);
ni_660x_write_register(dev, 0, bits, IOConfigReg(pfi_channel));
}

static int ni_660x_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct ni_660x_private *devpriv = dev->private;
int chan = CR_CHAN(insn->chanspec);
unsigned int val;

/* The input or output configuration of each digital line is
* configured by a special insn_config instruction. chanspec
Expand Down Expand Up @@ -1158,7 +1149,10 @@ static int ni_660x_dio_insn_config(struct comedi_device *dev,
data[1] = devpriv->pfi_output_selects[chan];
break;
case INSN_CONFIG_FILTER:
ni660x_config_filter(dev, chan, data[1]);
val = ni_660x_read_register(dev, 0, IOConfigReg(chan));
val &= ~pfi_input_select_mask(chan);
val |= pfi_input_select_bits(chan, data[1]);
ni_660x_write_register(dev, 0, val, IOConfigReg(chan));
break;
default:
return -EINVAL;
Expand Down

0 comments on commit cccd461

Please sign in to comment.