Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364201
b: refs/heads/master
c: d24160f
h: refs/heads/master
i:
  364199: 1b2b42d
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 23, 2013
1 parent 4d8f06f commit f8b89b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 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: ad5774fcd2cd40dd8a0f3d9db9b0a3538d47e610
refs/heads/master: d24160f83d5fd7d4ef383085cae90aa27ce63ed6
15 changes: 6 additions & 9 deletions trunk/drivers/staging/comedi/drivers/das800.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,25 +407,22 @@ static int das800_ai_do_cmd(struct comedi_device *dev,
{
const struct das800_board *thisboard = comedi_board(dev);
struct das800_private *devpriv = dev->private;
int startChan, endChan, scan, gain;
struct comedi_async *async = s->async;
unsigned int gain = CR_RANGE(async->cmd.chanlist[0]);
unsigned int start_chan = CR_CHAN(async->cmd.chanlist[0]);
unsigned int end_chan = (start_chan + async->cmd.chanlist_len - 1) % 8;
unsigned int scan_chans = (end_chan << 3) | start_chan;
int conv_bits;
unsigned long irq_flags;
struct comedi_async *async = s->async;

das800_disable(dev);

/* set channel scan limits */
startChan = CR_CHAN(async->cmd.chanlist[0]);
endChan = (startChan + async->cmd.chanlist_len - 1) % 8;
scan = (endChan << 3) | startChan;

spin_lock_irqsave(&dev->spinlock, irq_flags);
/* set scan limits */
das800_ind_write(dev, scan, SCAN_LIMITS);
das800_ind_write(dev, scan_chans, SCAN_LIMITS);
spin_unlock_irqrestore(&dev->spinlock, irq_flags);

/* set gain */
gain = CR_RANGE(async->cmd.chanlist[0]);
if (thisboard->resolution == 12 && gain > 0)
gain += 0x7;
gain &= 0xf;
Expand Down

0 comments on commit f8b89b5

Please sign in to comment.