[Linux-parport] initialising the port with ppdev

Paul Millar paul at astro.gla.ac.uk
Thu May 26 09:57:49 EDT 2005


I've been converting some code that previously using raw outb() so it using 
the kernel and ppdev instead.

One thing I've noticed is that when one claims the device (via PPCLAIM), the 
control lines are set to some arbitrary, fixed value.  For the application 
I'm working on (eeprom burner), this value happens to be most unfortunate as 
it switches on the VPP (programing) voltage.

There seems no way of telling the driver not to use this default value: the 
best I seem to be able to do is quickly PPFCONTROL the relevant lines to a 
safe value.  Unfortunately (I guess due to the switch to kernel-land), 
there's often context switches happening between the two ioctls, resulting in 
VPP being on for a noticeable time.

So, unless I've missed something, there's a bug here.  Two possible solutions:
  1.  fix the parport API (e.g. parport_pc_init_state() ), allowing the 
desired initial state to be passed.

  2.  fix ppdev so it will accept PPWCONTROL ioctls before a PPCLAIM and 
remember the state.  On claiming the device, ppdev could then immediately set 
the control lines to the cached values (from the PPWCONTROL).

(or perhaps some combination of these two...)

Does this make sense?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-parport/attachments/20050526/ef47f70f/attachment.bin

More information about the Linux-parport mailing list