Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354158
b: refs/heads/master
c: b2b8218
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 25, 2013
1 parent c213504 commit 5401158
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 63 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: 678a4d3ab159b776a7cb9c8ca9fdaf5498f3423a
refs/heads/master: b2b82184c9c9a82553bfd49e7940ebc67fe655a8
56 changes: 0 additions & 56 deletions trunk/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,59 +467,3 @@ static int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device *dev,
}
return insn->n;
}

/*
+----------------------------------------------------------------------------+
| Function Name : static void v_APCI3501_Interrupt |
| (int irq , void *d) |
+----------------------------------------------------------------------------+
| Task : Interrupt processing Routine |
+----------------------------------------------------------------------------+
| Input Parameters : int irq : irq number |
| void *d : void pointer |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
| Return Value : TRUE : No error occur |
| : FALSE : Error occur. Return the error |
| |
+----------------------------------------------------------------------------+
*/
static void v_APCI3501_Interrupt(int irq, void *d)
{
int i_temp;
struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private;
unsigned int ui_Timer_AOWatchdog;
unsigned long ul_Command1;

/* Disable Interrupt */
ul_Command1 =
inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);

ul_Command1 = (ul_Command1 & 0xFFFFF9FDul);
outl(ul_Command1,
devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);

ui_Timer_AOWatchdog =
inl(devpriv->iobase + APCI3501_WATCHDOG +
APCI3501_TCW_IRQ) & 0x1;

if ((!ui_Timer_AOWatchdog)) {
comedi_error(dev, "IRQ from unknown source");
return;
}

/*
* Enable Interrupt Send a signal to from kernel to user space
*/
send_sig(SIGIO, devpriv->tsk_Current, 0);
ul_Command1 =
inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
ul_Command1 = ((ul_Command1 & 0xFFFFF9FDul) | 1 << 1);
outl(ul_Command1,
devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
i_temp = inl(devpriv->iobase + APCI3501_WATCHDOG +
APCI3501_TCW_TRIG_STATUS) & 0x1;
return;
}
40 changes: 34 additions & 6 deletions trunk/drivers/staging/comedi/drivers/addi_apci_3501.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ static const struct addi_board apci3501_boardtypes[] = {
.pc_EepromChip = ADDIDATA_S5933,
.i_AoMaxdata = 16383,
.pr_AoRangelist = &range_apci3501_ao,
.interrupt = v_APCI3501_Interrupt,
.ao_config = i_APCI3501_ConfigAnalogOutput,
.ao_write = i_APCI3501_WriteAnalogOutput,
},
Expand Down Expand Up @@ -75,13 +74,42 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev,
return insn->n;
}

static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
static irqreturn_t apci3501_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
const struct addi_board *this_board = comedi_board(dev);
struct addi_private *devpriv = dev->private;
unsigned int ui_Timer_AOWatchdog;
unsigned long ul_Command1;
int i_temp;

/* Disable Interrupt */
ul_Command1 =
inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);

ul_Command1 = (ul_Command1 & 0xFFFFF9FDul);
outl(ul_Command1,
devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);

ui_Timer_AOWatchdog =
inl(devpriv->iobase + APCI3501_WATCHDOG +
APCI3501_TCW_IRQ) & 0x1;

if ((!ui_Timer_AOWatchdog)) {
comedi_error(dev, "IRQ from unknown source");
return IRQ_NONE;
}

this_board->interrupt(irq, d);
return IRQ_RETVAL(1);
/* Enable Interrupt Send a signal to from kernel to user space */
send_sig(SIGIO, devpriv->tsk_Current, 0);
ul_Command1 =
inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
ul_Command1 = ((ul_Command1 & 0xFFFFF9FDul) | 1 << 1);
outl(ul_Command1,
devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
i_temp = inl(devpriv->iobase + APCI3501_WATCHDOG +
APCI3501_TCW_TRIG_STATUS) & 0x1;

return IRQ_HANDLED;
}

static int apci3501_reset(struct comedi_device *dev)
Expand Down Expand Up @@ -190,7 +218,7 @@ static int apci3501_auto_attach(struct comedi_device *dev,
/* ## */

if (pcidev->irq > 0) {
ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
ret = request_irq(pcidev->irq, apci3501_interrupt, IRQF_SHARED,
dev->board_name, dev);
if (ret == 0)
dev->irq = pcidev->irq;
Expand Down

0 comments on commit 5401158

Please sign in to comment.