Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337717
b: refs/heads/master
c: 272b6b0
h: refs/heads/master
i:
  337715: 6618f39
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Nov 13, 2012
1 parent fdb7c56 commit 173e0f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 42 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: 3b8e2de347e5d52cc005c5becc2a13c38115c8ad
refs/heads/master: 272b6b04e7fcc3b045050ffc595a4655425b0c24
45 changes: 5 additions & 40 deletions trunk/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,50 +84,15 @@ static struct comedi_lrange range_apci3501_ao = {
}
};

/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ReadDigitalInput |
| (struct comedi_device *dev,struct comedi_subdevice *s, |
| struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
| Input Parameters : struct comedi_device *dev : Driver handle |
| unsigned int ui_NoOfChannels : No Of Channels To read |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
| Return Value : TRUE : No error occur |
| : FALSE : Error occur. Return the error |
| |
+----------------------------------------------------------------------------+
*/

static int i_APCI3501_ReadDigitalInput(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
static int apci3501_di_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 ui_Temp;
unsigned int ui_NoOfChannel;

ui_NoOfChannel = CR_CHAN(insn->chanspec);
ui_Temp = data[0];
*data = inl(devpriv->iobase + APCI3501_DIGITAL_IP);
if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1;
} /* if (ui_Temp==0) */
else {
if (ui_Temp == 1) {
data[1] = inl(devpriv->iobase + APCI3501_DIGITAL_IP) & 0x3;

*data = *data & 0x3;
} /* if (ui_Temp==1) */
else {
printk("\nSpecified channel not supported \n");
} /* elseif (ui_Temp==1) */
} /* elseif (ui_Temp==0) */
return insn->n;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/comedi/drivers/addi_apci_3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const struct addi_board apci3501_boardtypes[] = {
.reset = i_APCI3501_Reset,
.ao_config = i_APCI3501_ConfigAnalogOutput,
.ao_write = i_APCI3501_WriteAnalogOutput,
.di_bits = i_APCI3501_ReadDigitalInput,
.di_bits = apci3501_di_insn_bits,
.do_write = i_APCI3501_WriteDigitalOutput,
.do_bits = i_APCI3501_ReadDigitalOutput,
.timer_config = i_APCI3501_ConfigTimerCounterWatchdog,
Expand Down

0 comments on commit 173e0f0

Please sign in to comment.