Update broken web addresses in the kernel.
[deliverable/linux.git] / drivers / staging / comedi / drivers / ni_labpc.c
index 4966c8e496d53bb9773590bb7e1ca72a42673846..1411dd8f4e7c21581f53ee91f9a2f0d8188c1000 100644 (file)
@@ -37,7 +37,7 @@ boards has not
 yet been added to the driver, mainly due to the fact that
 I don't know the device id numbers.  If you have one
 of these boards,
-please file a bug report at https://bugs.comedi.org/
+please file a bug report at http://comedi.org/ 
 so I can get the necessary information from you.
 
 The 1200 series boards have onboard calibration dacs for correcting
@@ -1098,7 +1098,10 @@ static int labpc_ai_cmdtest(struct comedi_device *dev,
                        err++;
                }
                break;
-               /*  TRIG_EXT doesn't care since it doesn't trigger off a numbered channel */
+               /*
+                * TRIG_EXT doesn't care since it doesn't
+                * trigger off a numbered channel
+                */
        default:
                break;
        }
@@ -1156,25 +1159,35 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
        /*  setup hardware conversion counter */
        if (cmd->stop_src == TRIG_EXT) {
-               /*  load counter a1 with count of 3 (pc+ manual says this is minimum allowed) using mode 0 */
+               /*
+                * load counter a1 with count of 3
+                * (pc+ manual says this is minimum allowed) using mode 0
+                */
                ret = labpc_counter_load(dev, dev->iobase + COUNTER_A_BASE_REG,
                                         1, 3, 0);
                if (ret < 0) {
                        comedi_error(dev, "error loading counter a1");
                        return -1;
                }
-       } else                  /*  otherwise, just put a1 in mode 0 with no count to set its output low */
+       } else                  /*
+                                * otherwise, just put a1 in mode 0
+                                * with no count to set its output low
+                                */
                devpriv->write_byte(INIT_A1_BITS,
                                    dev->iobase + COUNTER_A_CONTROL_REG);
 
        /*  figure out what method we will use to transfer data */
        if (devpriv->dma_chan &&        /*  need a dma channel allocated */
-           /*  dma unsafe at RT priority, and too much setup time for TRIG_WAKE_EOS for */
+               /*
+                * dma unsafe at RT priority,
+                * and too much setup time for TRIG_WAKE_EOS for
+                */
            (cmd->flags & (TRIG_WAKE_EOS | TRIG_RT)) == 0 &&
            /*  only available on the isa boards */
            thisboard->bustype == isa_bustype) {
                xfer = isa_dma_transfer;
-       } else if (thisboard->register_layout == labpc_1200_layout &&   /*  pc-plus has no fifo-half full interrupt */
+               /* pc-plus has no fifo-half full interrupt */
+       } else if (thisboard->register_layout == labpc_1200_layout &&
                   /*  wake-end-of-scan should interrupt on fifo not empty */
                   (cmd->flags & TRIG_WAKE_EOS) == 0 &&
                   /*  make sure we are taking more than just a few points */
@@ -1621,7 +1634,10 @@ static int labpc_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
                devpriv->command4_bits |= ADC_DIFF_BIT;
        devpriv->write_byte(devpriv->command4_bits, dev->iobase + COMMAND4_REG);
 
-       /* initialize pacer counter output to make sure it doesn't cause any problems */
+       /*
+        * initialize pacer counter output to make sure it doesn't
+        * cause any problems
+        */
        devpriv->write_byte(INIT_A0_BITS, dev->iobase + COUNTER_A_CONTROL_REG);
 
        labpc_clear_adc_fifo(dev);
@@ -1846,7 +1862,10 @@ static void labpc_adc_timing(struct comedi_device *dev, struct comedi_cmd *cmd)
                unsigned int scan_period;
 
                scan_period = labpc_ai_scan_period(cmd);
-               /* calculate cascaded counter values that give desired scan timing */
+               /*
+                * calculate cascaded counter values
+                * that give desired scan timing
+                */
                i8253_cascade_ns_to_timer_2div(LABPC_TIMER_BASE,
                                               &(devpriv->divisor_b1),
                                               &(devpriv->divisor_b0),
@@ -1857,7 +1876,10 @@ static void labpc_adc_timing(struct comedi_device *dev, struct comedi_cmd *cmd)
                unsigned int convert_period;
 
                convert_period = labpc_ai_convert_period(cmd);
-               /* calculate cascaded counter values that give desired conversion timing */
+               /*
+                * calculate cascaded counter values
+                * that give desired conversion timing
+                */
                i8253_cascade_ns_to_timer_2div(LABPC_TIMER_BASE,
                                               &(devpriv->divisor_a0),
                                               &(devpriv->divisor_b0),
@@ -2078,9 +2100,56 @@ static void write_caldac(struct comedi_device *dev, unsigned int channel,
 }
 
 #ifdef CONFIG_COMEDI_PCI
-COMEDI_PCI_INITCLEANUP(driver_labpc, labpc_pci_table);
+static int __devinit driver_labpc_pci_probe(struct pci_dev *dev,
+                                           const struct pci_device_id *ent)
+{
+       return comedi_pci_auto_config(dev, driver_labpc.driver_name);
+}
+
+static void __devexit driver_labpc_pci_remove(struct pci_dev *dev)
+{
+       comedi_pci_auto_unconfig(dev);
+}
+
+static struct pci_driver driver_labpc_pci_driver = {
+       .id_table = labpc_pci_table,
+       .probe = &driver_labpc_pci_probe,
+       .remove = __devexit_p(&driver_labpc_pci_remove)
+};
+
+static int __init driver_labpc_init_module(void)
+{
+       int retval;
+
+       retval = comedi_driver_register(&driver_labpc);
+       if (retval < 0)
+               return retval;
+
+       driver_labpc_pci_driver.name = (char *)driver_labpc.driver_name;
+       return pci_register_driver(&driver_labpc_pci_driver);
+}
+
+static void __exit driver_labpc_cleanup_module(void)
+{
+       pci_unregister_driver(&driver_labpc_pci_driver);
+       comedi_driver_unregister(&driver_labpc);
+}
+
+module_init(driver_labpc_init_module);
+module_exit(driver_labpc_cleanup_module);
 #else
-COMEDI_INITCLEANUP(driver_labpc);
+static int __init driver_labpc_init_module(void)
+{
+       return comedi_driver_register(&driver_labpc);
+}
+
+static void __exit driver_labpc_cleanup_module(void)
+{
+       comedi_driver_unregister(&driver_labpc);
+}
+
+module_init(driver_labpc_init_module);
+module_exit(driver_labpc_cleanup_module);
 #endif
 
 EXPORT_SYMBOL_GPL(labpc_common_attach);
This page took 0.030686 seconds and 5 git commands to generate.