Configuration Options:
none
*/
-#include <linux/comedidev.h>
+#include "../comedidev.h"
#include <linux/pci.h>
#include "mf624.h"
+typedef unsigned int lsampl_t;
#define EXTDEBUG
#define MF624_EXIT_FAILURE -1
*/
/* Analog functions operation to be attached */
-/*static int mf624_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
+static int mf624_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, lsampl_t *data);
static int mf624_ai_cfg(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, lsampl_t *data);
struct comedi_insn *insn, lsampl_t *data);
static int mf624_ao_cfg(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, lsampl_t *data);
-*/
+
/* Digital functions operation to be attached */
-/*static int mf624_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
+static int mf624_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, lsampl_t *data);
static int mf624_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, lsampl_t *data);
-*/
+
/*static irqreturn_t mf624_interrupt(int irq, void *d, struct pt_regs *regs);*/
*/
static int mf624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
- comedi_subdevice *s;
+ struct comedi_subdevice *s;
struct pci_dev* pcidev;
unsigned int index, channel, status;
- int regA, regB;
-
- rt_printk("comedi%d: mf624: driver: Bourgeot - Poulain 2006-2007\n", dev->minor);
- rt_printk("This is an experimental version, you can report \
+ printk("comedi%d: mf624: driver: Bourgeot - Poulain 2006-2007\n", dev->minor);
+ printk("This is an experimental version, you can report \
some remarks or problems to fpoulain@gmail.com\n");
}
}
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: No supported Humusoft card \
+ printk("comedi%d: mf624: No supported Humusoft card \
found on requested position\n", dev->minor);
#endif
comedi_error(dev, "No supported Humusoft card found on requested position\n");
return -EIO;
found:
- rt_printk("comedi%d: mf624: Found %s on bus %i, slot %i\n", dev->minor,
+ printk("comedi%d: mf624: Found %s on bus %i, slot %i\n", dev->minor,
mf624_boards[index].name, pcidev->bus->number, PCI_SLOT(pcidev->devfn));
/* Enable PCI device and reserve I/O ports. */
if(pci_enable_device(pcidev)) {
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: Failed to enable PCI device\n", dev->minor);
+ printk("comedi%d: mf624: Failed to enable PCI device\n", dev->minor);
#endif
comedi_error(dev, "Failed to enable PCI device\n");
return -EIO;
}
if(pci_request_regions(pcidev, "mf624")) {
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: I/O port conflict\n", dev->minor);
+ printk("comedi%d: mf624: I/O port conflict\n", dev->minor);
#endif
comedi_error(dev, "I/O port conflict\n");
return -EIO;
devpriv->IO_BADR2 = pci_ioremap_bar(devpriv->pci_dev, 4);
#ifdef EXTDEBUG
- rt_printk ("comedi%d: mf624: PCI Resource 0 addr %lx \n", dev->minor, devpriv->BADR0);
- rt_printk ("comedi%d: mf624: PCI Resource 1 addr %lx \n", dev->minor, devpriv->BADR1);
- rt_printk ("comedi%d: mf624: PCI Resource 2 addr %lx \n", dev->minor, devpriv->BADR2);
+ printk ("comedi%d: mf624: PCI Resource 0 addr %lx \n", dev->minor, devpriv->BADR0);
+ printk ("comedi%d: mf624: PCI Resource 1 addr %lx \n", dev->minor, devpriv->BADR1);
+ printk ("comedi%d: mf624: PCI Resource 2 addr %lx \n", dev->minor, devpriv->BADR2);
- rt_printk ("comedi%d: mf624: IO_BADR0 addr %p \n", dev->minor, devpriv->IO_BADR0);
- rt_printk ("comedi%d: mf624: IO_BADR1(2) addr %p \n", dev->minor, devpriv->IO_BADR1);
- rt_printk ("comedi%d: mf624: IO_BADR2(4) addr %p \n", dev->minor, devpriv->IO_BADR2);
+ printk ("comedi%d: mf624: IO_BADR0 addr %p \n", dev->minor, devpriv->IO_BADR0);
+ printk ("comedi%d: mf624: IO_BADR1(2) addr %p \n", dev->minor, devpriv->IO_BADR1);
+ printk ("comedi%d: mf624: IO_BADR2(4) addr %p \n", dev->minor, devpriv->IO_BADR2);
#endif
dev->board_name = thisboard->name;
s->insn_bits = mf624_do_insn_bits;
- rt_printk("comedi%d: mf624: Driver attached\n", dev->minor);
+ printk("comedi%d: mf624: Driver attached\n", dev->minor);
/* Enable DAC */
status = ioread32(devpriv->IO_BADR0 + MF624_GPIOC) | MF624_GPIOC_DACEN;
devpriv->ao_readback[channel] = 0x2000;
}
- //rt_printk("comedi%d: mf624: Board initialized\n", dev->minor);
+ //printk("comedi%d: mf624: Board initialized\n", dev->minor);
return 1;
}
*/
static int mf624_detach(struct comedi_device *dev)
{
- //rt_printk("comedi%d: mf624: remove\n", dev->minor);
-
- if(dev->irq) {
- comedi_free_irq(dev->irq, dev);
- }
+ //printk("comedi%d: mf624: remove\n", dev->minor);
if(devpriv && devpriv->pci_dev)
{
{
pci_release_regions(devpriv->pci_dev);
pci_disable_device(devpriv->pci_dev);
- //rt_printk("comedi%d: mf624: remove2\n", dev->minor);
+ //printk("comedi%d: mf624: remove2\n", dev->minor);
}
pci_dev_put(devpriv->pci_dev);
- //rt_printk("comedi%d: mf624: remove3\n", dev->minor);
+ //printk("comedi%d: mf624: remove3\n", dev->minor);
}
return 0;
unsigned int chan = CR_CHAN(insn->chanspec);
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: mf624_ai_rinsn called \n", dev->minor);
+ printk("comedi%d: mf624: mf624_ai_rinsn called \n", dev->minor);
#endif
/* write channel to multiplexer */
}
}
if(i == TIMEOUT) {
- rt_printk("comedi%d: mf624: _ai_rinsn: conversion timeout !\n", dev->minor);
+ printk("comedi%d: mf624: _ai_rinsn: conversion timeout !\n", dev->minor);
comedi_error(dev, "Conversion timeout !\n");
return -ETIMEDOUT;
}
struct comedi_insn *insn, lsampl_t *data)
{
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: _insn_ai_cfg called\n", dev->minor);
+ printk("comedi%d: mf624: _insn_ai_cfg called\n", dev->minor);
#endif
return insn->n;
}
unsigned int i, status;
unsigned int chan = CR_CHAN(insn->chanspec);
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: _ao_winsn called\n", dev->minor);
+ printk("comedi%d: mf624: _ao_winsn called\n", dev->minor);
#endif
status = ioread32(devpriv->IO_BADR0 + MF624_GPIOC) | MF624_GPIOC_DACEN;
iowrite32(status, devpriv->IO_BADR0 + MF624_GPIOC);
iowrite16(data[i], devpriv->IO_BADR1 + MF624_DA0 + 2*chan);
devpriv->ao_readback[chan] = data[i];
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: _ao_winsn: wrote at address \
+ printk("comedi%d: mf624: _ao_winsn: wrote at address \
%i data %i ", dev->minor, MF624_DA0 + 2*chan , data[i] );
#endif
}
struct comedi_insn *insn, lsampl_t *data)
{
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: _ao_cfg called\n, dev->minor");
+ printk("comedi%d: mf624: _ao_cfg called\n", dev->minor);
#endif
return insn->n;
}
struct comedi_insn *insn, lsampl_t *data)
{
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: _do_insn_bits called \
+ printk("comedi%d: mf624: _do_insn_bits called \
with data: %d %d\n", dev->minor, data[0], data[1]);
#endif
if(insn->n != 2) {
s->state &= ~data[0];
s->state |= data[0] & data[1];
#ifdef EXTDEBUG
- rt_printk ("comedi%d: mf624: _do_insn_bits: out: %d \
+ printk ("comedi%d: mf624: _do_insn_bits: out: %d \
on %lx\n", dev->minor, s->state, devpriv->IO_BADR1 + MF624_DOUT );
#endif
iowrite16(s->state, devpriv->IO_BADR1 + MF624_DOUT);
struct comedi_insn *insn, lsampl_t *data)
{
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: _di_insn_bits called with \
+ printk("comedi%d: mf624: _di_insn_bits called with \
data: %d %d\n", dev->minor, data[0], data[1]);
#endif
if(insn->n != 2) {
data[1] = ioread16(devpriv->IO_BADR1 + MF624_DIN);
#ifdef EXTDEBUG
- rt_printk("comedi%d: mf624: _di_insn_bits read \
+ printk("comedi%d: mf624: _di_insn_bits read \
data: %d\n", dev->minor, data[1]);
#endif
return 2;
* the board, and also about the kernel module that contains
* the device code.
*/
-static comedi_driver driver_mf624 = {
+static struct comedi_driver driver_mf624 = {
driver_name: "mf624",
module: THIS_MODULE,
attach: mf624_attach,