[PARPORT] lp/parport_pc fix for ECP or ECP+EPP mode (ECR init)


Andrea Arcangeli (arcangeli@mbox.queen.it)
Thu, 28 May 1998 00:36:27 +0200 (CEST)


Seems that the printing problems of Andreas Muck was caused by the ECP (or
ECP+EPP) settings of the parallel port (since I suggested him to use SPP
mode in the BIOS and then lp started to work fine for him too).

I taken a look at ECP specs and seems that parport_pc was initializing the
ECR control register to use the parallel port in SPP mode _but_ it _left_
active the ECP _enable_ bit and ECP _service_ bit in the ECR control
register.

I suppose that the parport_pc policy is to _initialize_ all detected ECP
parallel port in plain SPP mode with more backwards compatibility with SPP
mode as possible, then if a pardevice will need a special handshaking mode
will (implement removing FIXME ;-) and then) use parport_change_mode() in
its init stage.

This patch seems to fix the lp problem initializing the ECR register (_if_
_detected_ and this is a bugfix) at 0x0 and not at 0xc. Muck said me that
fix things for him. I' d like if everybody is having troubles with lp in
2.1.104 (or with < 2.1.104 in polling mode) could try this not very tested
;-) patch and feedback.

Andrea[s] Arcangeli

--- linux/drivers/misc/parport_pc.c 1998/04/25 10:38:34 1.1
+++ linux/drivers/misc/parport_pc.c 1998/05/27 14:44:03
@@ -708,7 +708,8 @@
         p->flags |= PARPORT_FLAG_COMA;
 
         /* Done probing. Now put the port into a sensible start-up state. */
- parport_pc_write_econtrol(p, 0xc);
+ if (p->modes & PARPORT_MODE_PCECR)
+ parport_pc_write_econtrol(p, 0x0);
         parport_pc_write_control(p, 0xc);
         parport_pc_write_data(p, 0);
 

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:47 EST