Merge the remaining code from hwdrv_apci1032.c into the driver and delete the now unused file. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- .../comedi/drivers/addi-data/hwdrv_apci1032.c | 137 --------------------- drivers/staging/comedi/drivers/addi_apci_1032.c | 101 ++++++++++++++- 2 files changed, 100 insertions(+), 138 deletions(-) delete mode 100644 drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c deleted file mode 100644 index 6ee5d5d..0000000 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c +++ /dev/null @@ -1,137 +0,0 @@ -/** -@verbatim - -Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module. - - ADDI-DATA GmbH - Dieselstrasse 3 - D-77833 Ottersweier - Tel: +19(0)7223/9493-0 - Fax: +49(0)7223/9493-92 - http://www.addi-data.com - info@xxxxxxxxxxxxx - -This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -You should also find the complete GPL in the COPYING file accompanying this source code. - -@endverbatim -*/ -/* - - +-----------------------------------------------------------------------+ - | (C) ADDI-DATA GmbH Dieselstraße 3 D-77833 Ottersweier | - +-----------------------------------------------------------------------+ - | Tel : +49 (0) 7223/9493-0 | email : info@xxxxxxxxxxxxx | - | Fax : +49 (0) 7223/9493-92 | Internet : http://www.addi-data.com | - +-------------------------------+---------------------------------------+ - | Project : APCI-1032 | Compiler : GCC | - | Module name : hwdrv_apci1032.c| Version : 2.96 | - +-------------------------------+---------------------------------------+ - | Project manager: Eric Stolz | Date : 02/12/2002 | - +-------------------------------+---------------------------------------+ - | Description : Hardware Layer Access For APCI-1032 | - +-----------------------------------------------------------------------+ - | UPDATES | - +----------+-----------+------------------------------------------------+ - | Date | Author | Description of updates | - +----------+-----------+------------------------------------------------+ - | | | | - | | | | - | | | | - +----------+-----------+------------------------------------------------+ -*/ - -/* - * I/O Register Map - */ -#define APCI1032_DI_REG 0x00 -#define APCI1032_MODE1_REG 0x04 -#define APCI1032_MODE2_REG 0x08 -#define APCI1032_STATUS_REG 0x0c -#define APCI1032_CTRL_REG 0x10 -#define APCI1032_CTRL_INT_OR (0 << 1) -#define APCI1032_CTRL_INT_AND (1 << 1) -#define APCI1032_CTRL_INT_ENA (1 << 2) - -/* Digital Input IRQ Function Selection */ -#define ADDIDATA_OR 0 -#define ADDIDATA_AND 1 - -static unsigned int ui_InterruptStatus; - -/* -+----------------------------------------------------------------------------+ -| Function Name : int i_APCI1032_ConfigDigitalInput | -| (struct comedi_device *dev,struct comedi_subdevice *s, | -| struct comedi_insn *insn,unsigned int *data) | -+----------------------------------------------------------------------------+ -| Task : Configures the digital input Subdevice | -+----------------------------------------------------------------------------+ -| Input Parameters : struct comedi_device *dev : Driver handle | -| unsigned int *data : Data Pointer contains | -| configuration parameters as below | -| | -| data[0] : 1 Enable Digital Input Interrupt | -| 0 Disable Digital Input Interrupt | -| data[1] : 0 ADDIDATA Interrupt OR LOGIC | -| : 1 ADDIDATA Interrupt AND LOGIC | -| data[2] : Interrupt mask for the mode 1 | -| data[3] : Interrupt mask for the mode 2 | -| | -+----------------------------------------------------------------------------+ -| Output Parameters : -- | -+----------------------------------------------------------------------------+ -| Return Value : TRUE : No error occur | -| : FALSE : Error occur. Return the error | -| | -+----------------------------------------------------------------------------+ -*/ - -static int i_APCI1032_ConfigDigitalInput(struct comedi_device *dev, - struct comedi_subdevice *s, - struct comedi_insn *insn, - unsigned int *data) -{ - struct addi_private *devpriv = dev->private; - unsigned int ui_TmpValue; - unsigned int ul_Command1 = 0; - unsigned int ul_Command2 = 0; - - devpriv->tsk_Current = current; - - /*******************************/ - /* Set the digital input logic */ - /*******************************/ - if (data[0] == ADDIDATA_ENABLE) { - ul_Command1 = ul_Command1 | data[2]; - ul_Command2 = ul_Command2 | data[3]; - outl(ul_Command1, dev->iobase + APCI1032_MODE1_REG); - outl(ul_Command2, dev->iobase + APCI1032_MODE2_REG); - if (data[1] == ADDIDATA_OR) { - outl(APCI1032_CTRL_INT_ENA | - APCI1032_CTRL_INT_OR, - dev->iobase + APCI1032_CTRL_REG); - ui_TmpValue = - inl(dev->iobase + APCI1032_CTRL_REG); - } /* if (data[1] == ADDIDATA_OR) */ - else - outl(APCI1032_CTRL_INT_ENA | - APCI1032_CTRL_INT_AND, - dev->iobase + APCI1032_CTRL_REG); - /* else if(data[1] == ADDIDATA_OR) */ - } /* if( data[0] == ADDIDATA_ENABLE) */ - else { - ul_Command1 = ul_Command1 & 0xFFFF0000; - ul_Command2 = ul_Command2 & 0xFFFF0000; - outl(ul_Command1, dev->iobase + APCI1032_MODE1_REG); - outl(ul_Command2, dev->iobase + APCI1032_MODE2_REG); - outl(0x0, dev->iobase + APCI1032_CTRL_REG); - } /* else if ( data[0] == ADDIDATA_ENABLE) */ - - return insn->n; -} diff --git a/drivers/staging/comedi/drivers/addi_apci_1032.c b/drivers/staging/comedi/drivers/addi_apci_1032.c index ab34671..3d5cbbf 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1032.c +++ b/drivers/staging/comedi/drivers/addi_apci_1032.c @@ -1,10 +1,109 @@ +/* + * addi_apci_1032.c + * Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module. + * Project manager: Eric Stolz + * + * ADDI-DATA GmbH + * Dieselstrasse 3 + * D-77833 Ottersweier + * Tel: +19(0)7223/9493-0 + * Fax: +49(0)7223/9493-92 + * http://www.addi-data.com + * info@xxxxxxxxxxxxx + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + * + * You should also find the complete GPL in the COPYING file accompanying this + * source code. + */ + #include "../comedidev.h" #include "comedi_fc.h" #include "amcc_s5933.h" #include "addi-data/addi_common.h" -#include "addi-data/hwdrv_apci1032.c" +/* + * I/O Register Map + */ +#define APCI1032_DI_REG 0x00 +#define APCI1032_MODE1_REG 0x04 +#define APCI1032_MODE2_REG 0x08 +#define APCI1032_STATUS_REG 0x0c +#define APCI1032_CTRL_REG 0x10 +#define APCI1032_CTRL_INT_OR (0 << 1) +#define APCI1032_CTRL_INT_AND (1 << 1) +#define APCI1032_CTRL_INT_ENA (1 << 2) + +/* Digital Input IRQ Function Selection */ +#define ADDIDATA_OR 0 +#define ADDIDATA_AND 1 + +static unsigned int ui_InterruptStatus; + +/* + * data[0] : 1 Enable Digital Input Interrupt + * 0 Disable Digital Input Interrupt + * data[1] : 0 ADDIDATA Interrupt OR LOGIC + * : 1 ADDIDATA Interrupt AND LOGIC + * data[2] : Interrupt mask for the mode 1 + * data[3] : Interrupt mask for the mode 2 + */ +static int i_APCI1032_ConfigDigitalInput(struct comedi_device *dev, + struct comedi_subdevice *s, + struct comedi_insn *insn, + unsigned int *data) +{ + struct addi_private *devpriv = dev->private; + unsigned int ui_TmpValue; + unsigned int ul_Command1 = 0; + unsigned int ul_Command2 = 0; + + devpriv->tsk_Current = current; + + /*******************************/ + /* Set the digital input logic */ + /*******************************/ + if (data[0] == ADDIDATA_ENABLE) { + ul_Command1 = ul_Command1 | data[2]; + ul_Command2 = ul_Command2 | data[3]; + outl(ul_Command1, dev->iobase + APCI1032_MODE1_REG); + outl(ul_Command2, dev->iobase + APCI1032_MODE2_REG); + if (data[1] == ADDIDATA_OR) { + outl(APCI1032_CTRL_INT_ENA | + APCI1032_CTRL_INT_OR, + dev->iobase + APCI1032_CTRL_REG); + ui_TmpValue = + inl(dev->iobase + APCI1032_CTRL_REG); + } /* if (data[1] == ADDIDATA_OR) */ + else + outl(APCI1032_CTRL_INT_ENA | + APCI1032_CTRL_INT_AND, + dev->iobase + APCI1032_CTRL_REG); + /* else if(data[1] == ADDIDATA_OR) */ + } /* if( data[0] == ADDIDATA_ENABLE) */ + else { + ul_Command1 = ul_Command1 & 0xFFFF0000; + ul_Command2 = ul_Command2 & 0xFFFF0000; + outl(ul_Command1, dev->iobase + APCI1032_MODE1_REG); + outl(ul_Command2, dev->iobase + APCI1032_MODE2_REG); + outl(0x0, dev->iobase + APCI1032_CTRL_REG); + } /* else if ( data[0] == ADDIDATA_ENABLE) */ + + return insn->n; +} static irqreturn_t apci1032_interrupt(int irq, void *d) { -- 1.7.11 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel