Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Make this work on fast platforms by making sure s...



details:   https://anonhg.NetBSD.org/src/rev/7a055868013d
branches:  trunk
changeset: 540335:7a055868013d
user:      rafal <rafal%NetBSD.org@localhost>
date:      Tue Dec 10 07:19:25 2002 +0000

description:
Make this work on fast platforms by making sure signals are held for at
least 1us.  Documentation I've found for the simple (SPP) parallel port
mode says that data should be stable 500ns before STROBE, STROBE should
be pulsed for no less than 500ns, and that data should be stable another
500ns after STROBE has been de-asserted.

Makes lpt@ebus on my Sun Ultra5 work with my HP DeskJet 712C, at least in
polled mode.  Thanks to Martin for astutely noting it was probably a bug
with STROBE being pulsed too quickly.

diffstat:

 sys/dev/ic/lpt.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r fc57b60d0897 -r 7a055868013d sys/dev/ic/lpt.c
--- a/sys/dev/ic/lpt.c  Tue Dec 10 06:18:07 2002 +0000
+++ b/sys/dev/ic/lpt.c  Tue Dec 10 07:19:25 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lpt.c,v 1.60 2002/10/23 09:13:17 jdolecek Exp $        */
+/*     $NetBSD: lpt.c,v 1.61 2002/12/10 07:19:25 rafal Exp $   */
 
 /*
  * Copyright (c) 1993, 1994 Charles M. Hannum.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.60 2002/10/23 09:13:17 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.61 2002/12/10 07:19:25 rafal Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -311,10 +311,13 @@
                        }
 
                        bus_space_write_1(iot, ioh, lpt_data, *sc->sc_cp++);
+                       DELAY(1);
                        bus_space_write_1(iot, ioh, lpt_control,
                            control | LPC_STROBE);
+                       DELAY(1);
                        sc->sc_count--;
                        bus_space_write_1(iot, ioh, lpt_control, control);
+                       DELAY(1);
 
                        /* adapt busy-wait algorithm */
                        if (spin*2 + 16 < sc->sc_spinmax)
@@ -402,6 +405,7 @@
                DELAY(1);
                sc->sc_count--;
                bus_space_write_1(iot, ioh, lpt_control, control);
+               DELAY(1);
                sc->sc_state |= LPT_OBUSY;
        } else
                sc->sc_state &= ~LPT_OBUSY;



Home | Main Index | Thread Index | Old Index