Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325140
b: refs/heads/master
c: 2959bc2
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 11, 2012
1 parent 10123c2 commit dbcc5d1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 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: f123f287e03ed19a2eb6a4fd6a15908f76c9f086
refs/heads/master: 2959bc21ba38e9b711cd5ebf581272d3d7455444
29 changes: 14 additions & 15 deletions trunk/drivers/staging/comedi/drivers/adl_pci9111.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ a multiple of chanlist_len*convert_arg.
#define PCI9111_AI_RANGE_REG 0x08
#define PCI9111_RANGE_STATUS_REG 0x08
#define PCI9111_REGISTER_TRIGGER_MODE_CONTROL 0x0A
#define PCI9111_REGISTER_AD_MODE_INTERRUPT_READBACK 0x0A
#define PCI9111_AI_MODE_INT_RB_REG 0x0A
#define PCI9111_SOFTWARE_TRIGGER_REG 0x0E
#define PCI9111_REGISTER_INTERRUPT_CONTROL 0x0C
#define PCI9111_INT_CTRL_REG 0x0C
#define PCI9111_8254_BASE_REG 0x40
#define PCI9111_INT_CLR_REG 0x48

Expand Down Expand Up @@ -134,25 +134,18 @@ a multiple of chanlist_len*convert_arg.
*/

#define pci9111_trigger_and_autoscan_get() \
(inb(dev->iobase + PCI9111_REGISTER_AD_MODE_INTERRUPT_READBACK)&0x0F)
(inb(dev->iobase + PCI9111_AI_MODE_INT_RB_REG)&0x0F)

#define pci9111_trigger_and_autoscan_set(flags) \
outb(flags, dev->iobase + PCI9111_REGISTER_TRIGGER_MODE_CONTROL)

#define pci9111_interrupt_and_fifo_get() \
((inb(dev->iobase + PCI9111_REGISTER_AD_MODE_INTERRUPT_READBACK) \
>> 4) & 0x03)

#define pci9111_interrupt_and_fifo_set(flags) \
outb(flags, dev->iobase + PCI9111_REGISTER_INTERRUPT_CONTROL)

#define pci9111_fifo_reset() do { \
outb(PCI9111_FFEN_SET_FIFO_ENABLE, \
dev->iobase + PCI9111_REGISTER_INTERRUPT_CONTROL); \
dev->iobase + PCI9111_INT_CTRL_REG); \
outb(PCI9111_FFEN_SET_FIFO_DISABLE, \
dev->iobase + PCI9111_REGISTER_INTERRUPT_CONTROL); \
dev->iobase + PCI9111_INT_CTRL_REG); \
outb(PCI9111_FFEN_SET_FIFO_ENABLE, \
dev->iobase + PCI9111_REGISTER_INTERRUPT_CONTROL); \
dev->iobase + PCI9111_INT_CTRL_REG); \
} while (0)


Expand Down Expand Up @@ -322,15 +315,21 @@ static void pci9111_interrupt_source_set(struct comedi_device *dev,
{
int flags;

flags = pci9111_interrupt_and_fifo_get() & 0x04;
/* Read the current interrupt control bits */
flags = inb(dev->iobase + PCI9111_AI_MODE_INT_RB_REG);
/* Shift the bits so they are compatible with the write register */
flags >>= 4;
/* Mask off the ISCx bits */
flags &= 0xc0;

/* Now set the new ISCx bits */
if (irq_0_source == irq_on_fifo_half_full)
flags |= PCI9111_ISC0_SET_IRQ_ON_FIFO_HALF_FULL;

if (irq_1_source == irq_on_external_trigger)
flags |= PCI9111_ISC1_SET_IRQ_ON_EXT_TRG;

pci9111_interrupt_and_fifo_set(flags);
outb(flags, dev->iobase + PCI9111_INT_CTRL_REG);
}

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

0 comments on commit dbcc5d1

Please sign in to comment.