Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325137
b: refs/heads/master
c: 9676437
h: refs/heads/master
i:
  325135: 7564c49
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 11, 2012
1 parent 4948d04 commit b0b60cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 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: 0f0bde920c3ba7333800b874260a917cc408832d
refs/heads/master: 967643734582396275efd6183c2b95786993231c
30 changes: 13 additions & 17 deletions trunk/drivers/staging/comedi/drivers/adl_pci9111.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,6 @@ a multiple of chanlist_len*convert_arg.
dev->iobase + PCI9111_REGISTER_INTERRUPT_CONTROL); \
} while (0)

#define pci9111_is_fifo_full() \
((inb(dev->iobase + PCI9111_RANGE_STATUS_REG)& \
PCI9111_FIFO_FULL_MASK) == 0)

#define pci9111_is_fifo_half_full() \
((inb(dev->iobase + PCI9111_RANGE_STATUS_REG)& \
PCI9111_FIFO_HALF_FULL_MASK) == 0)

#define pci9111_is_fifo_empty() \
((inb(dev->iobase + PCI9111_RANGE_STATUS_REG)& \
PCI9111_FIFO_EMPTY_MASK) == 0)

static const struct comedi_lrange pci9111_hr_ai_range = {
5,
Expand Down Expand Up @@ -698,6 +687,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
struct pci9111_private_data *dev_private = dev->private;
struct comedi_subdevice *s = dev->read_subdev;
struct comedi_async *async;
unsigned int status;
unsigned long irq_flags;
unsigned char intcsr;

Expand Down Expand Up @@ -729,7 +719,10 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
(PLX9050_LINTI1_ENABLE | PLX9050_LINTI1_STATUS)) {
/* Interrupt comes from fifo_half-full signal */

if (pci9111_is_fifo_full()) {
status = inb(dev->iobase + PCI9111_RANGE_STATUS_REG);

/* '0' means FIFO is full, data may have been lost */
if (!(status & PCI9111_FIFO_FULL_MASK)) {
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
comedi_error(dev, PCI9111_DRIVER_NAME " fifo overflow");
pci9111_interrupt_clear();
Expand All @@ -740,7 +733,8 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
return IRQ_HANDLED;
}

if (pci9111_is_fifo_half_full()) {
/* '0' means FIFO is half-full */
if (!(status & PCI9111_FIFO_HALF_FULL_MASK)) {
unsigned int num_samples;
unsigned int bytes_written = 0;

Expand Down Expand Up @@ -844,14 +838,14 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
unsigned int maxdata = s->maxdata;
unsigned int invert = (maxdata + 1) >> 1;
unsigned int shift = (maxdata == 0xffff) ? 0 : 4;
unsigned int current_range;
unsigned int status;
int timeout;
int i;

outb(chan, dev->iobase + PCI9111_AI_CHANNEL_REG);

current_range = inb(dev->iobase + PCI9111_RANGE_STATUS_REG);
if ((current_range & PCI9111_RANGE_MASK) != range) {
status = inb(dev->iobase + PCI9111_RANGE_STATUS_REG);
if ((status & PCI9111_RANGE_MASK) != range) {
outb(range & PCI9111_RANGE_MASK,
dev->iobase + PCI9111_AI_RANGE_REG);
}
Expand All @@ -864,7 +858,9 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
timeout = PCI9111_AI_INSTANT_READ_TIMEOUT;

while (timeout--) {
if (!pci9111_is_fifo_empty())
status = inb(dev->iobase + PCI9111_RANGE_STATUS_REG);
/* '1' means FIFO is not empty */
if (status & PCI9111_FIFO_EMPTY_MASK)
goto conversion_done;
}

Expand Down

0 comments on commit b0b60cb

Please sign in to comment.