Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325141
b: refs/heads/master
c: 20614d9
h: refs/heads/master
i:
  325139: 10123c2
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 11, 2012
1 parent dbcc5d1 commit b385803
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 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: 2959bc21ba38e9b711cd5ebf581272d3d7455444
refs/heads/master: 20614d96f0b2e0d3acd07212afdf82919ae88a94
29 changes: 16 additions & 13 deletions trunk/drivers/staging/comedi/drivers/adl_pci9111.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ a multiple of chanlist_len*convert_arg.
#define PCI9111_REGISTER_AD_CHANNEL_READBACK 0x06
#define PCI9111_AI_RANGE_REG 0x08
#define PCI9111_RANGE_STATUS_REG 0x08
#define PCI9111_REGISTER_TRIGGER_MODE_CONTROL 0x0A
#define PCI9111_AI_MODE_CTRL_REG 0x0A
#define PCI9111_AI_MODE_INT_RB_REG 0x0A
#define PCI9111_SOFTWARE_TRIGGER_REG 0x0E
#define PCI9111_INT_CTRL_REG 0x0C
Expand Down Expand Up @@ -133,12 +133,6 @@ a multiple of chanlist_len*convert_arg.
* Define inlined function
*/

#define pci9111_trigger_and_autoscan_get() \
(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_fifo_reset() do { \
outb(PCI9111_FFEN_SET_FIFO_ENABLE, \
dev->iobase + PCI9111_INT_CTRL_REG); \
Expand Down Expand Up @@ -256,7 +250,10 @@ static void pci9111_trigger_source_set(struct comedi_device *dev,
{
int flags;

flags = pci9111_trigger_and_autoscan_get() & 0x09;
/* Read the current trigger mode control bits */
flags = inb(dev->iobase + PCI9111_AI_MODE_INT_RB_REG);
/* Mask off the EITS and TPST bits */
flags &= 0x9;

switch (source) {
case software:
Expand All @@ -272,31 +269,37 @@ static void pci9111_trigger_source_set(struct comedi_device *dev,
break;
}

pci9111_trigger_and_autoscan_set(flags);
outb(flags, dev->iobase + PCI9111_AI_MODE_CTRL_REG);
}

static void pci9111_pretrigger_set(struct comedi_device *dev, bool pretrigger)
{
int flags;

flags = pci9111_trigger_and_autoscan_get() & 0x07;
/* Read the current trigger mode control bits */
flags = inb(dev->iobase + PCI9111_AI_MODE_INT_RB_REG);
/* Mask off the PTRG bit */
flags &= 0x7;

if (pretrigger)
flags |= PCI9111_PTRG_ON;

pci9111_trigger_and_autoscan_set(flags);
outb(flags, dev->iobase + PCI9111_AI_MODE_CTRL_REG);
}

static void pci9111_autoscan_set(struct comedi_device *dev, bool autoscan)
{
int flags;

flags = pci9111_trigger_and_autoscan_get() & 0x0e;
/* Read the current trigger mode control bits */
flags = inb(dev->iobase + PCI9111_AI_MODE_INT_RB_REG);
/* Mask off the ASCAN bit */
flags &= 0xe;

if (autoscan)
flags |= PCI9111_ASCAN_ON;

pci9111_trigger_and_autoscan_set(flags);
outb(flags, dev->iobase + PCI9111_AI_MODE_CTRL_REG);
}

enum pci9111_ISC0_sources {
Expand Down

0 comments on commit b385803

Please sign in to comment.