Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354154
b: refs/heads/master
c: 953a36c
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 25, 2013
1 parent ef99ba5 commit 5610fa2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 48 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: 3d596e50ffbb183df6fb132a9a795a5ff8d7842c
refs/heads/master: 953a36c45aa4ba23be687451df6311ad33d89538
22 changes: 0 additions & 22 deletions trunk/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,6 @@ static int apci3501_di_insn_bits(struct comedi_device *dev,
return insn->n;
}

static int apci3501_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
struct addi_private *devpriv = dev->private;
unsigned int mask = data[0];
unsigned int bits = data[1];

s->state = inl(devpriv->iobase + APCI3501_DIGITAL_OP);
if (mask) {
s->state &= ~mask;
s->state |= (bits & mask);

outl(s->state, devpriv->iobase + APCI3501_DIGITAL_OP);
}

data[1] = s->state;

return insn->n;
}

/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ConfigAnalogOutput |
Expand Down
55 changes: 30 additions & 25 deletions trunk/drivers/staging/comedi/drivers/addi_apci_3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,36 @@ static const struct addi_board apci3501_boardtypes[] = {
.i_AoMaxdata = 16383,
.pr_AoRangelist = &range_apci3501_ao,
.i_NbrDiChannel = 2,
.i_NbrDoChannel = 2,
.i_DoMaxdata = 0x3,
.interrupt = v_APCI3501_Interrupt,
.reset = i_APCI3501_Reset,
.ao_config = i_APCI3501_ConfigAnalogOutput,
.ao_write = i_APCI3501_WriteAnalogOutput,
.di_bits = apci3501_di_insn_bits,
.do_bits = apci3501_do_insn_bits,
},
};

static int apci3501_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
struct addi_private *devpriv = dev->private;
unsigned int mask = data[0];
unsigned int bits = data[1];

s->state = inl(devpriv->iobase + APCI3501_DIGITAL_OP);
if (mask) {
s->state &= ~mask;
s->state |= (bits & mask);

outl(s->state, devpriv->iobase + APCI3501_DIGITAL_OP);
}

data[1] = s->state;

return insn->n;
}

static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
Expand Down Expand Up @@ -132,8 +151,6 @@ static int apci3501_auto_attach(struct comedi_device *dev,
devpriv->s_EeParameters.i_AiMaxdata = this_board->i_AiMaxdata;
devpriv->s_EeParameters.i_AoMaxdata = this_board->i_AoMaxdata;
devpriv->s_EeParameters.i_NbrDiChannel = this_board->i_NbrDiChannel;
devpriv->s_EeParameters.i_NbrDoChannel = this_board->i_NbrDoChannel;
devpriv->s_EeParameters.i_DoMaxdata = this_board->i_DoMaxdata;
devpriv->s_EeParameters.i_Dma = this_board->i_Dma;
devpriv->s_EeParameters.ui_MinAcquisitiontimeNs =
this_board->ui_MinAcquisitiontimeNs;
Expand Down Expand Up @@ -240,27 +257,15 @@ static int apci3501_auto_attach(struct comedi_device *dev,
} else {
s->type = COMEDI_SUBD_UNUSED;
}
/* Allocate and Initialise DO Subdevice Structures */
s = &dev->subdevices[3];
if (devpriv->s_EeParameters.i_NbrDoChannel) {
s->type = COMEDI_SUBD_DO;
s->subdev_flags =
SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = devpriv->s_EeParameters.i_NbrDoChannel;
s->maxdata = devpriv->s_EeParameters.i_DoMaxdata;
s->len_chanlist =
devpriv->s_EeParameters.i_NbrDoChannel;
s->range_table = &range_digital;
s->io_bits = 0xf; /* all bits output */

/* insn_config - for digital output memory */
s->insn_config = this_board->do_config;
s->insn_write = this_board->do_write;
s->insn_bits = this_board->do_bits;
s->insn_read = this_board->do_read;
} else {
s->type = COMEDI_SUBD_UNUSED;
}
/* Initialize the digital output subdevice */
s = &dev->subdevices[3];
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITEABLE;
s->n_chan = 2;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = apci3501_do_insn_bits;

/* Allocate and Initialise Timer Subdevice Structures */
s = &dev->subdevices[4];
Expand Down

0 comments on commit 5610fa2

Please sign in to comment.