Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325121
b: refs/heads/master
c: af031ed
h: refs/heads/master
i:
  325119: 4aef51d
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 11, 2012
1 parent fab27c7 commit b57c70c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 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: 2873ea8154b220c11f5e17222a3879925d7db506
refs/heads/master: af031edf3f377b946c1d2b0d163fcf32b1041434
22 changes: 8 additions & 14 deletions trunk/drivers/staging/comedi/drivers/adl_pci9111.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,21 +809,15 @@ static void pci9111_ai_munge(struct comedi_device *dev,
unsigned int num_bytes,
unsigned int start_chan_index)
{
unsigned int i, num_samples = num_bytes / sizeof(short);
short *array = data;
int resolution =
((struct pci9111_board *)dev->board_ptr)->ai_resolution;

for (i = 0; i < num_samples; i++) {
if (resolution == PCI9111_HR_AI_RESOLUTION)
array[i] =
(array[i] & PCI9111_HR_AI_RESOLUTION_MASK) ^
PCI9111_HR_AI_RESOLUTION_2_CMP_BIT;
else
array[i] =
((array[i] >> 4) & PCI9111_AI_RESOLUTION_MASK) ^
PCI9111_AI_RESOLUTION_2_CMP_BIT;
}
unsigned int maxdata = s->maxdata;
unsigned int invert = (maxdata + 1) >> 1;
unsigned int shift = (maxdata == 0xffff) ? 0 : 4;
unsigned int num_samples = num_bytes / sizeof(short);
unsigned int i;

for (i = 0; i < num_samples; i++)
array[i] = ((array[i] >> shift) & maxdata) ^ invert;
}

/* ------------------------------------------------------------------ */
Expand Down

0 comments on commit b57c70c

Please sign in to comment.