[PARPORT] AVLAB PCI parallel port card support (2.4.0), 11 cards

From: Gunther Mayer (Gunther.Mayer@t-online.de)
Date: Sun Dec 10 2000 - 18:21:55 EST

  • Next message: Dale Matthews: "[PARPORT] HP7200 with cdrdao"

    Dave Farrance wrote:
    >
    > On Wed, 29 Nov 2000 15:00:53 +0000, Tim Waugh wrote:
    >
    > >Okay. I've put a patch in my CVS tree that adds support for this card
    > >to 2.4.0test.
    >
    > Cheers! I must find some time during my Christmas vacation to learn
    > how to do a kernel compile.
    >
    > And as Gunther Mayer requested, I've obtained a pci interface spec
    > from Avlab on their i/o cards. I've put it here, for now:
    >
    > www.anvil.demon.co.uk/avlab-pci-spec.htm
    >

    Hi,
    this patch against 2.4.0t12p8 supports all 11 parallel port cards from given spec.

    Can people with AVLAB cards test please and report (positives and
    negatives). Is the correct mode shown for the cards too?

    Regards, Gunther

    -
    --- linux240t12p8-orig/drivers/parport/parport_pc.c Sun Sep 17 18:45:07 2000
    +++ linux/drivers/parport/parport_pc.c Sun Dec 10 23:58:41 2000
    @@ -2310,7 +2310,6 @@
            lava_parallel_dual_b,
            boca_ioppar,
            plx_9050,
    - afavlab_tk9902,
            timedia_4078a,
            timedia_4079h,
            timedia_4085h,
    @@ -2336,6 +2335,17 @@
            timedia_9018a,
            syba_2p_epp,
            syba_1p_ecp,
    + avlab_1s1p,
    + avlab_1s1p_650,
    + avlab_1s1p_850,
    + avlab_1p,
    + avlab_2p,
    + avlab_1s2p,
    + avlab_1s2p_650,
    + avlab_1s2p_850,
    + avlab_2s1p,
    + avlab_2s1p_650,
    + avlab_2s1p_850
     };
     
     
    @@ -2374,7 +2384,6 @@
            /* lava_parallel_dual_b */ { 1, { { 0, -1 }, } },
            /* boca_ioppar */ { 1, { { 0, -1 }, } },
            /* plx_9050 */ { 2, { { 4, -1 }, { 5, -1 }, } },
    - /* afavlab_tk9902 */ { 1, { { 0, 1 }, } },
            /* timedia_4078a */ { 1, { { 2, -1 }, } },
            /* timedia_4079h */ { 1, { { 2, 3 }, } },
            /* timedia_4085h */ { 2, { { 2, -1 }, { 4, -1 }, } },
    @@ -2402,6 +2411,17 @@
                                                a 1K io window */
            /* syba_2p_epp AP138B */ { 2, { { 0, 0x078 }, { 0, 0x178 }, } },
            /* syba_1p_ecp W83787 */ { 1, { { 0, 0x078 }, } },
    + /* avlab_1s1p */ { 1, { { 1, 2}, } },
    + /* avlab_1s1p_650 */ { 1, { { 1, 2}, } },
    + /* avlab_1s1p_850 */ { 1, { { 1, 2}, } },
    + /* avlab_1p */ { 1, { { 0, 1}, } },
    + /* avlab_2p */ { 2, { { 0, 1}, { 2, 3 },} },
    + /* avlab_1s2p */ { 2, { { 1, 2}, { 3, 4 },} },
    + /* avlab_1s2p_650 */ { 2, { { 1, 2}, { 3, 4 },} },
    + /* avlab_1s2p_850 */ { 2, { { 1, 2}, { 3, 4 },} },
    + /* avlab_2s1p */ { 1, { { 2, 3}, } },
    + /* avlab_2s1p_650 */ { 1, { { 2, 3}, } },
    + /* avlab_2s1p_850 */ { 1, { { 2, 3}, } },
     };
     
     static struct pci_device_id parport_pc_pci_tbl[] __devinitdata = {
    @@ -2457,8 +2477,6 @@
              PCI_ANY_ID, PCI_ANY_ID, 0, 0, boca_ioppar },
            { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
              PCI_SUBVENDOR_ID_EXSYS, PCI_SUBDEVICE_ID_EXSYS_4014, 0,0, plx_9050 },
    - { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_TK9902,
    - PCI_ANY_ID, PCI_ANY_ID, 0, 0, afavlab_tk9902 },
            /* PCI_VENDOR_ID_TIMEDIA/SUNIX has many differing cards ...*/
            { 0x1409, 0x7168, 0x1409, 0x4078, 0, 0, timedia_4078a },
            { 0x1409, 0x7168, 0x1409, 0x4079, 0, 0, timedia_4079h },
    @@ -2487,10 +2505,67 @@
              PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_2p_epp },
            { PCI_VENDOR_ID_SYBA, PCI_DEVICE_ID_SYBA_1P_ECP,
              PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_1p_ecp },
    + /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
    + { 0x14db, 0x2110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p},
    + { 0x14db, 0x2111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p_650},
    + { 0x14db, 0x2112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p_850},
    + { 0x14db, 0x2120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1p}, /* AFAVLAB_TK9902 */
    + { 0x14db, 0x2121, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_2p},
    + { 0x14db, 0x2140, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s2p},
    + { 0x14db, 0x2141, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s2p_650},
    + { 0x14db, 0x2142, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s2p_850},
    + { 0x14db, 0x2160, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_2s1p},
    + { 0x14db, 0x2161, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_2s1p_650},
    + { 0x14db, 0x2162, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_2s1p_850},
            { 0, } /* terminate list */
     };
     MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl);
     
    +/*
    + * Show Parallel Port Mode of AVLAB cards
    + */
    +void decode_avlab(struct pci_dev *dev, int n)
    +{ struct {
    + int devid;
    + int s; /*number of serial ports */
    + } avser[12] = {
    + { 0x2110, 1},
    + { 0x2111, 1},
    + { 0x2112, 1},
    + { 0x2120, 0},
    + { 0x2121, 0},
    + { 0x2140, 1},
    + { 0x2141, 1},
    + { 0x2142, 1},
    + { 0x2160, 2},
    + { 0x2161, 2},
    + { 0x2162, 2},
    + { 0 , 0 } };
    + char *modes[]={ "ECP/EPP(1.9)"
    + "ECP only",
    + "EPP only",
    + "BPP/SPP"};
    + int i,index;
    + u8 m0,m1;
    +
    + for(i=0; avser[i].devid; i++)
    + if( avser[i].devid == dev->device)
    + break;
    +
    + if(avser[i].devid == 0)
    + printk("parport_pc: AVLAB Card, cannot determine mode.\n");
    +
    + /* Read control registers */
    + pci_read_config_byte(dev, 0x6f + avser[i].s * 4 + n*8, &m0);
    + pci_read_config_byte(dev, 0x6f + avser[i].s * 4 + n*8 + 4, &m1);
    +
    + index = (m0 & 0x10) ? 1:0 + (m1 & 0x10) ? 2:0; /* Test Bit 4,add up */
    +
    + printk("parport_pc: AVLAB parallel port mode: %s\n",modes[index]);
    +}
    +
    +
    +
     static int __devinit parport_pc_pci_probe (struct pci_dev *dev,
                                               const struct pci_device_id *id)
     {
    @@ -2522,6 +2597,10 @@
                            "I/O at %#lx(%#lx)\n",
                            parport_pc_pci_tbl[i + last_sio].vendor,
                            parport_pc_pci_tbl[i + last_sio].device, io_lo, io_hi);
    +
    + if(dev->vendor == 0x14db) /* AVLAB */
    + decode_avlab(dev,n);
    +
                    if (parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE,
                                               PARPORT_DMA_NONE, dev))
                            count++;


    -- 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 : Sun Dec 10 2000 - 17:32:53 EST