Merge branch 'master' into for_paulus
[powerpc.git] / drivers / serial / 8250_pci.c
index cd1979d..a2dac37 100644 (file)
@@ -458,11 +458,11 @@ static int pci_siig_setup(struct serial_private *priv,
  * growing *huge*, we use this function to collapse some 70 entries
  * in the PCI table into one, for sanity's and compactness's sake.
  */
-static unsigned short timedia_single_port[] = {
+static const unsigned short timedia_single_port[] = {
        0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
 };
 
-static unsigned short timedia_dual_port[] = {
+static const unsigned short timedia_dual_port[] = {
        0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
        0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, 
        0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, 
@@ -470,35 +470,34 @@ static unsigned short timedia_dual_port[] = {
        0xD079, 0
 };
 
-static unsigned short timedia_quad_port[] = {
+static const unsigned short timedia_quad_port[] = {
        0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, 
        0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, 
        0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
        0xB157, 0
 };
 
-static unsigned short timedia_eight_port[] = {
+static const unsigned short timedia_eight_port[] = {
        0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166, 
        0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
 };
 
 static const struct timedia_struct {
        int num;
-       unsigned short *ids;
+       const unsigned short *ids;
 } timedia_data[] = {
        { 1, timedia_single_port },
        { 2, timedia_dual_port },
        { 4, timedia_quad_port },
-       { 8, timedia_eight_port },
-       { 0, NULL }
+       { 8, timedia_eight_port }
 };
 
 static int pci_timedia_init(struct pci_dev *dev)
 {
-       unsigned short *ids;
+       const unsigned short *ids;
        int i, j;
 
-       for (i = 0; timedia_data[i].num; i++) {
+       for (i = 0; i < ARRAY_SIZE(timedia_data); i++) {
                ids = timedia_data[i].ids;
                for (j = 0; ids[j]; j++)
                        if (dev->subsystem_device == ids[j])
@@ -678,6 +677,13 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
        /*
         * PLX
         */
+       {
+               .vendor         = PCI_VENDOR_ID_PLX,
+               .device         = PCI_DEVICE_ID_PLX_9030,
+               .subvendor      = PCI_SUBVENDOR_ID_PERLE,
+               .subdevice      = PCI_ANY_ID,
+               .setup          = pci_default_setup,
+       },
        {
                .vendor         = PCI_VENDOR_ID_PLX,
                .device         = PCI_DEVICE_ID_PLX_9050,
@@ -937,6 +943,7 @@ enum pci_board_num_t {
 
        pbn_b2_1_115200,
        pbn_b2_2_115200,
+       pbn_b2_4_115200,
        pbn_b2_8_115200,
 
        pbn_b2_1_460800,
@@ -1250,6 +1257,12 @@ static struct pciserial_board pci_boards[] __devinitdata = {
                .base_baud      = 115200,
                .uart_offset    = 8,
        },
+       [pbn_b2_4_115200] = {
+               .flags          = FL_BASE2,
+               .num_ports      = 4,
+               .base_baud      = 115200,
+               .uart_offset    = 8,
+       },
        [pbn_b2_8_115200] = {
                .flags          = FL_BASE2,
                .num_ports      = 8,
@@ -1790,6 +1803,7 @@ static void __devexit pciserial_remove_one(struct pci_dev *dev)
        pci_disable_device(dev);
 }
 
+#ifdef CONFIG_PM
 static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
 {
        struct serial_private *priv = pci_get_drvdata(dev);
@@ -1819,6 +1833,7 @@ static int pciserial_resume_one(struct pci_dev *dev)
        }
        return 0;
 }
+#endif
 
 static struct pci_device_id serial_pci_tbl[] = {
        {       PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
@@ -1989,6 +2004,10 @@ static struct pci_device_id serial_pci_tbl[] = {
        {       PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
                PCI_ANY_ID, PCI_ANY_ID, 0, 0,
                pbn_panacom2 },
+       {       PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
+               PCI_VENDOR_ID_ESDGMBH,
+               PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
+               pbn_b2_4_115200 },
        {       PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
                PCI_SUBVENDOR_ID_CHASE_PCIFAST,
                PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0, 
@@ -2237,6 +2256,30 @@ static struct pci_device_id serial_pci_tbl[] = {
                PCI_ANY_ID, PCI_ANY_ID, 0, 0,
                pbn_b0_bt_1_460800 },
 
+       /*
+        * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
+        * Cards are identified by their subsystem vendor IDs, which
+        * (in hex) match the model number.
+        *
+        * Note that JC140x are RS422/485 cards which require ox950
+        * ACR = 0x10, and as such are not currently fully supported.
+        */
+       {       PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+               0x1204, 0x0004, 0, 0,
+               pbn_b0_4_921600 },
+       {       PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+               0x1208, 0x0004, 0, 0,
+               pbn_b0_4_921600 },
+/*     {       PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+               0x1402, 0x0002, 0, 0,
+               pbn_b0_2_921600 }, */
+/*     {       PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+               0x1404, 0x0004, 0, 0,
+               pbn_b0_4_921600 }, */
+       {       PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
+               0x1208, 0x0004, 0, 0,
+               pbn_b0_4_921600 },
+
        /*
         * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
         */
@@ -2353,6 +2396,15 @@ static struct pci_device_id serial_pci_tbl[] = {
                PCI_ANY_ID, PCI_ANY_ID, 0, 0,   /* 135a.0811 */
                pbn_b2_2_115200 },
 
+       /*
+        * Perle PCI-RAS cards
+        */
+       {       PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
+               PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
+               0, 0, pbn_b2_4_921600 },
+       {       PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
+               PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
+               0, 0, pbn_b2_8_921600 },
        /*
         * These entries match devices with class COMMUNICATION_SERIAL,
         * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
@@ -2376,8 +2428,10 @@ static struct pci_driver serial_pci_driver = {
        .name           = "serial",
        .probe          = pciserial_init_one,
        .remove         = __devexit_p(pciserial_remove_one),
+#ifdef CONFIG_PM
        .suspend        = pciserial_suspend_one,
        .resume         = pciserial_resume_one,
+#endif
        .id_table       = serial_pci_tbl,
 };