Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354175
b: refs/heads/master
c: 2627369
h: refs/heads/master
i:
  354173: bd50427
  354171: a2976cd
  354167: 5cf4db9
  354159: be7a599
  354143: 2e5b46f
  354111: 6ebbaea
  354047: da6a08e
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 25, 2013
1 parent a830792 commit 939cfc5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 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: 5458f3e7b5a8707a49948857d69b2eb2fa5931ac
refs/heads/master: 262736988d445cb1613aa936bfe343261627f899
27 changes: 15 additions & 12 deletions trunk/drivers/staging/comedi/drivers/addi_apci_3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#define APCI3501_AO_CTRL_BIPOLAR (1 << 0)
#define APCI3501_AO_STATUS_READY (1 << 8)
#define APCI3501_AO_DATA_REG 0x04
#define APCI3501_AO_DATA_CHAN(x) ((x) << 0)
#define APCI3501_AO_DATA_VAL(x) ((x) << 8)
#define APCI3501_AO_DATA_BIPOLAR (1 << 31)
#define APCI3501_AO_TRIG_SCS_REG 0x08
#define APCI3501_DO_REG 0x40
#define APCI3501_DI_REG 0x50
Expand Down Expand Up @@ -219,28 +222,28 @@ static irqreturn_t apci3501_interrupt(int irq, void *d)

static int apci3501_reset(struct comedi_device *dev)
{
int i_Count = 0, i_temp = 0;
unsigned int ul_Command1 = 0, ul_Polarity;
unsigned int val;
int chan;
int ret;

/* Reset all digital outputs to "0" */
outl(0x0, dev->iobase + APCI3501_DO_REG);
outl(1, dev->iobase + APCI3501_AO_CTRL_STATUS_REG);

ul_Polarity = 0x80000000;
/* Default all analog outputs to 0V (bipolar) */
outl(APCI3501_AO_CTRL_BIPOLAR,
dev->iobase + APCI3501_AO_CTRL_STATUS_REG);
val = APCI3501_AO_DATA_BIPOLAR | APCI3501_AO_DATA_VAL(0);

for (i_Count = 0; i_Count <= 7; i_Count++) {
/* Set all analog output channels */
for (chan = 0; chan < 8; chan++) {
ret = apci3501_wait_for_dac(dev);
if (ret) {
dev_warn(dev->class_dev,
"%s: DAC not-ready for channel %i\n",
__func__, i_Count);
__func__, chan);
} else {
/* Output the Value on the output channels. */
ul_Command1 =
(unsigned int) ((unsigned int) (i_Count & 0xFF) |
(unsigned int) ((i_temp << 0x8) & 0x7FFFFF00L) |
(unsigned int) (ul_Polarity));
outl(ul_Command1, dev->iobase + APCI3501_AO_DATA_REG);
outl(val | APCI3501_AO_DATA_CHAN(chan),
dev->iobase + APCI3501_AO_DATA_REG);
}
}

Expand Down

0 comments on commit 939cfc5

Please sign in to comment.