Hi folks,
parport_pc must never be loaded (and rmmod-ed) if comedi_parport shall use the port!
After 2 weeks of searching I found out, why comedi_parport always returns
0x00FF on subdev 0 and 0x001F on subdev 1 when read (using "monitor").
After
rmmod ppdev parport_pc
, which I had to do to allow
comedi_config -v /dev/comedi2 comedi_parport 0x0278,5
without conflict, there is no sw-visible parallel port hardware! :-O
The parallel port is on a Supermicro X7DAL mainboard and setup to use address 0x0278 anf IRQ 5.
If ACPI is enabled (in BIOS), parport_pc will automatically claim the parport hardware and
comedi_config -v /dev/comedi2 comedi_parport 0x0278,5 will cause
Sep 29 10:18:42 Node-06 kernel: comedi comedi2: comedi_parport: I/O port conflict (0x278,3)
rmmod ppdev parport_pc will produce
Sep 29 10:19:20 Node-06 kernel: parport_pc 00:06: disabled
After that the "comedi_config" call seems to succeed without error but the driver behaves as if any empty fantasy address is given. :-(
On the other hand
modprobe parport_pc (without comedy_parport attached) produces
Sep 29 10:29:57 Node-06 kernel: parport_pc 00:06: activated
Sep 29 10:29:57 Node-06 kernel: parport_pc 00:06: reported by Plug and Play ACPI
Sep 29 10:29:57 Node-06 kernel: parport0: PC-style at 0x278 (0x678), irq 5, dma 3 [PCSPP,TRISTATE,COMPAT,EPP,ECP,DMA]
Sep 29 10:29:57 Node-06 kernel: ppdev: user-space parallel port driver
The line "kernel: parport_pc 00:06: activated" made me wonder...
It seems like the parport hardware is really no longer visible after parport_pc is unloaded!
This does not apply a WCH38xx parport card in a PCIe slot which we prchased to test comedi_parport. But that one uses IRQ 16 which comedi_config seems to be unable to handle. :-(
After my
suspicion that parport_pc leaves an unuseable parport I first deactivated ACPI in the BIOS and indeed parport_pc was not loaded anymore, but also the serial ports were invisible.
But comedy_parport finally began to work! :-)
The data port reads 0x0000 and the 5-bit input subdevice 1 only reads 0x000F without external connections. My test plug which grounds 2 pins ( /ACK and PE ) now finally changes the value to 0x0003. :-)
I decided to turn on ACPI again and blacklist parport_pc and ppdev in
/etc/modprobe.d/99-comedi.conf
So that file now looks like:
blacklist ppdev
blacklist parport_pc
options comedi comedi_num_legacy_minors=4
Maybe we should add a comment with a hint in the source file of comedi_parport.c and in the comedi documemtation. I searched for "parport" in comedilib.pdf and found nothing helpful.
The next thing I found out is that my
printk ("parport_interrupt() nsd=%d ", dev->n_subdevices);
is never called so far even if I force falling and rising edges on the /ACK pin.
In "monitor" I see the bits toggle as I switch the signal level but the ISR is not called so far. That is probably caused by the semantics of the driver, which only enables the interrupt in
parport_intr_cmd() and disables it again in parport_intr_cancel().
Seems like I first have to find an adequate demo program in ./comedilib-0.12.0/demo/ or learn to write one to test the interrupt functionality of the comedi_parport and then also adl_pci7x3c and adv_pci_dio...
Greetings,
Bernd Harries