Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325123
b: refs/heads/master
c: 2f002cc
h: refs/heads/master
i:
  325121: b57c70c
  325119: 4aef51d
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 11, 2012
1 parent 4a2295b commit 9af43aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 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: b5d8d11931f3b772487381e7ca89dfd6e5b4f0fd
refs/heads/master: 2f002cc9b8c5e59d3e67a184d7b1520fed9e3094
19 changes: 7 additions & 12 deletions trunk/drivers/staging/comedi/drivers/adl_pci9111.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,10 +966,11 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int resolution =
((struct pci9111_board *)dev->board_ptr)->ai_resolution;

int timeout, i;
unsigned int maxdata = s->maxdata;
unsigned int invert = (maxdata + 1) >> 1;
unsigned int shift = (maxdata == 0xffff) ? 0 : 4;
int timeout;
int i;

pci9111_ai_channel_set(CR_CHAN((&insn->chanspec)[0]));

Expand All @@ -995,14 +996,8 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,

conversion_done:

if (resolution == PCI9111_HR_AI_RESOLUTION)
data[i] = (inw(dev->iobase + PCI9111_AI_FIFO_REG)
& PCI9111_HR_AI_RESOLUTION_MASK)
^ PCI9111_HR_AI_RESOLUTION_2_CMP_BIT;
else
data[i] = ((inw(dev->iobase + PCI9111_AI_FIFO_REG) >> 4)
& PCI9111_AI_RESOLUTION_MASK)
^ PCI9111_AI_RESOLUTION_2_CMP_BIT;
data[i] = inw(dev->iobase + PCI9111_AI_FIFO_REG);
data[i] = ((data[i] >> shift) & maxdata) ^ invert;
}

return i;
Expand Down

0 comments on commit 9af43aa

Please sign in to comment.