]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
parport: parport_serial: Add support for Sunix Multi I/O boards
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Tue, 13 Aug 2019 11:55:00 +0000 (13:55 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 17 Sep 2019 16:02:18 +0000 (18:02 +0200)
BugLink: https://bugs.launchpad.net/bugs/1826716
Sunix Multi I/O boards are different to Timedia's.

This patch adds proper support for Sunix MIO boards with 1 parallel and
up to 4 serial ports.

Cc: Morris Ku <morris_ku@sunix.com>
Cc: Debbie Liu <debbie_liu@sunix.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20190809190130.30773-2-kai.heng.feng@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(backported from commit 605b5b4c90ecc31c5fea234f882bf4248dae4fc8 linux-next)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Anthony Wong <anthony.wong@canonical.com>
Acked-by: AceLan Kao <acelan.kao@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/parport/parport_serial.c

index e15b4845f7c6302816f5622fe225761227e770f0..7c7856c4381a2c6358608ff3d4e73244bc990e2e 100644 (file)
@@ -65,7 +65,10 @@ enum parport_pc_pci_cards {
        wch_ch353_1s1p,
        wch_ch353_2s1p,
        wch_ch382_2s1p,
-       sunix_2s1p,
+       sunix_4008a,
+       sunix_5069a,
+       sunix_5079a,
+       sunix_5099a,
 };
 
 /* each element directly indexed from enum list, above */
@@ -153,7 +156,10 @@ static struct parport_pc_pci cards[] = {
        /* wch_ch353_1s1p*/             { 1, { { 1, -1}, } },
        /* wch_ch353_2s1p*/             { 1, { { 2, -1}, } },
        /* wch_ch382_2s1p*/             { 1, { { 2, -1}, } },
-       /* sunix_2s1p */                { 1, { { 3, -1 }, } },
+       /* sunix_4008a */               { 1, { { 1, 2 }, } },
+       /* sunix_5069a */               { 1, { { 1, 2 }, } },
+       /* sunix_5079a */               { 1, { { 1, 2 }, } },
+       /* sunix_5099a */               { 1, { { 1, 2 }, } },
 };
 
 #define PCI_VENDOR_ID_SUNIX            0x1fd4
@@ -261,13 +267,15 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
        { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
        { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
 
-       /*
-        * More SUNIX variations. At least one of these has part number
-        * '5079A but subdevice 0x102. That board reports 0x0708 as
-        * its PCI Class.
-        */
+       /* Sunix boards */
+       { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999, PCI_VENDOR_ID_SUNIX,
+         0x0100, 0, 0, sunix_4008a },
+       { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999, PCI_VENDOR_ID_SUNIX,
+         0x0101, 0, 0, sunix_5069a },
        { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999, PCI_VENDOR_ID_SUNIX,
-         0x0102, 0, 0, sunix_2s1p },
+         0x0102, 0, 0, sunix_5079a },
+       { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999, PCI_VENDOR_ID_SUNIX,
+         0x0104, 0, 0, sunix_5099a },
 
        { 0, } /* terminate list */
 };
@@ -504,11 +512,23 @@ static struct pciserial_board pci_parport_serial_boards[] = {
                .uart_offset    = 8,
                .first_offset   = 0xC0,
        },
-       [sunix_2s1p] = {
-               .flags          = FL_BASE0|FL_BASE_BARS,
+       [sunix_4008a] = {
+               .num_ports      = 0,
+       },
+       [sunix_5069a] = {
+               .num_ports      = 1,
+               .base_baud      = 921600,
+               .uart_offset    = 0x8,
+       },
+       [sunix_5079a] = {
                .num_ports      = 2,
-               .base_baud      = 921600,
-               .uart_offset    = 8,
+               .base_baud      = 921600,
+               .uart_offset    = 0x8,
+       },
+       [sunix_5099a] = {
+               .num_ports      = 4,
+               .base_baud      = 921600,
+               .uart_offset    = 0x8,
        },
 };