[PARPORT] patch epat.c 1.01 to 1.02 (initial)

From: jjore@imation.com
Date: Thu May 25 2000 - 15:34:26 EDT

  • Next message: Curt R Johansson: "[PARPORT] Looking for a driver to SyQuest SQ3270 parallell port drive"

    This is a work-in-progress patch. This should fix epat.c so that it talks
    correctly with c8/7 epat chips. It hasn't been tested with c2-c6 chips and
    today anyway, that wasn't a goal. If you've got a device that uses a newer
    epat chip that isn't currently working go ahead and try this. Once I've
    been able to get the c8/7 support where I want it I'll go back and try to
    make sure that it still works for c2-c6.

    Currently, this doesn't get the 2x ppd SuperDisk running. It looks like
    I've got all of the epat initialization done and now have to look at what's
    being sent to the atapi drive by the published binary driver as opposed to
    what pf.o is sending. If you're a whiz with ATA please try this and let me
    know if you have any insight into why the drive is turning over but isn't
    accessible.

    I'd very curious to know what happens for other devices besides the ATAPI
    SuperDisk.

    Josh Jore
    (Not speaking for my employer)

    --- epat.c.101 Tue May 23 10:27:47 2000
    +++ epat.c.102 Thu May 25 14:13:20 2000
    @@ -12,10 +12,10 @@
     /* Changes:

             1.01 GRG 1998.05.06 init_proto, release_proto
    -
    + 1.02 JbJ 2000.05.25 CPP, epat_connect, epat_log_adapter
    + This rev is still being poked at.
    */

    -#define EPAT_VERSION "1.01"
    +#define EPAT_VERSION "1.01a"

     #include <linux/module.h>
     #include <linux/delay.h>
    @@ -196,27 +196,51 @@
     #define WRi(r,v) epat_write_regr(pi,0,r,v)
     #define RRi(r) (epat_read_regr(pi,0,r))

    -/* FIXME: the CCP stuff should be fixed to handle multiple EPATs on a
    chain */
    +/* FIXME: the CPP stuff should be fixed to handle multiple EPATs on a
    chain */
    +/* Also change CPP into a function to support the status readbacks */

    -#define CCP(x) w2(4);w0(0x22);w0(0xaa);w0(0x55);w0(0);w0(0xff);\
    - w0(0x87);w0(0x78);w0(x);w2(4);w2(5);w2(4);w0(0xff);
    +#define CPP(x) w2(4);\
    + w0(0xaa);w0(0xaa);w0(0x55);w0(0x55);\
    + w0(0);w0(0);w0(0xff);w0(0xff);\
    + w0(0x87);w0(0x87);\
    + w0(0x78);w0(0x78);\
    + w0(x);w2(4);w2(5);w2(4);\
    + w0(0xff);

     static void epat_connect ( PIA *pi )

     { pi->saved_r0 = r0();
             pi->saved_r2 = r2();
    - CCP(0); CCP(0xe0);
    - w0(0); w2(1); w2(4);
    + CPP(0x8);
    + CPP(0);
    +/* CPP(0x80); */
    + CPP(0x40);
    + CPP(0xe0);
    + w0(0); w2(1); w2(4);
    + WR(0x8,0);
    + w0(3); w2(1); w2(4);
    + w0(0); w2(1); w2(4);
    +
         if (pi->mode >= 3) {
              w0(0); w2(1); w2(4); w2(0xc);
              w0(0x40); w2(6); w2(7); w2(4); w2(0xc); w2(4);
         }
    - WR(8,0x10); WR(0xc,0x14); WR(0xa,0x38); WR(0x12,0x10);
    +
    + WR(0x8,0x2);
    + WR(0xe,0xf);WR(0xf,4);
    + WR(0xc,0x1c);
    + WR(0xd,0x1b);
    + WR(0x12,0);
    + WR(0xe,0xa);WR(0xf,4);
    + WR(0xe,0xd);WR(0xf,0);
    + WR(0xc,0x1c);
    + WR(0xa,0x38);
    + WR(0x8,2);
     }

     static void epat_disconnect ( PIA *pi )

    -{ CCP(0x30);
    +{ CPP(0x30);
             w0(pi->saved_r0);
             w2(pi->saved_r2);
     }
    @@ -267,8 +291,9 @@
                 {"4-bit","5/3","8-bit","EPP-8","EPP-16","EPP-32"};

         epat_connect(pi);
    - WR(0xa,0x38); /* read the version code */
    - ver = RR(0xb);
    + WR(0xa,0x38);
    +/* WR(0x0a,0x00); */
    + ver = RR(0xb); /* read the version code */
             epat_disconnect(pi);

         printk("%s: epat %s, Shuttle EPAT chip %x at 0x%x, ",

    -- 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 2b29 : Thu May 25 2000 - 15:37:56 EDT