~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/staging/comedi/drivers/gsc_hpdi.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
#include "plx9080.h"
54
54
#include "comedi_fc.h"
55
55
 
56
 
static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it);
57
 
static int hpdi_detach(struct comedi_device *dev);
58
56
static void abort_dma(struct comedi_device *dev, unsigned int channel);
59
57
static int hpdi_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
60
58
static int hpdi_cmd_test(struct comedi_device *dev, struct comedi_subdevice *s,
287
285
#endif
288
286
};
289
287
 
290
 
static DEFINE_PCI_DEVICE_TABLE(hpdi_pci_table) = {
291
 
        {
292
 
        PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9080, PCI_VENDOR_ID_PLX,
293
 
                    0x2400, 0, 0, 0}, {
294
 
        0}
295
 
};
296
 
 
297
 
MODULE_DEVICE_TABLE(pci, hpdi_pci_table);
298
 
 
299
288
static inline struct hpdi_board *board(const struct comedi_device *dev)
300
289
{
301
290
        return (struct hpdi_board *)dev->board_ptr;
338
327
        return dev->private;
339
328
}
340
329
 
341
 
static struct comedi_driver driver_hpdi = {
342
 
        .driver_name = "gsc_hpdi",
343
 
        .module = THIS_MODULE,
344
 
        .attach = hpdi_attach,
345
 
        .detach = hpdi_detach,
346
 
};
347
 
 
348
 
static int __devinit driver_hpdi_pci_probe(struct pci_dev *dev,
349
 
                                           const struct pci_device_id *ent)
350
 
{
351
 
        return comedi_pci_auto_config(dev, driver_hpdi.driver_name);
352
 
}
353
 
 
354
 
static void __devexit driver_hpdi_pci_remove(struct pci_dev *dev)
355
 
{
356
 
        comedi_pci_auto_unconfig(dev);
357
 
}
358
 
 
359
 
static struct pci_driver driver_hpdi_pci_driver = {
360
 
        .id_table = hpdi_pci_table,
361
 
        .probe = &driver_hpdi_pci_probe,
362
 
        .remove = __devexit_p(&driver_hpdi_pci_remove)
363
 
};
364
 
 
365
 
static int __init driver_hpdi_init_module(void)
366
 
{
367
 
        int retval;
368
 
 
369
 
        retval = comedi_driver_register(&driver_hpdi);
370
 
        if (retval < 0)
371
 
                return retval;
372
 
 
373
 
        driver_hpdi_pci_driver.name = (char *)driver_hpdi.driver_name;
374
 
        return pci_register_driver(&driver_hpdi_pci_driver);
375
 
}
376
 
 
377
 
static void __exit driver_hpdi_cleanup_module(void)
378
 
{
379
 
        pci_unregister_driver(&driver_hpdi_pci_driver);
380
 
        comedi_driver_unregister(&driver_hpdi);
381
 
}
382
 
 
383
 
module_init(driver_hpdi_init_module);
384
 
module_exit(driver_hpdi_cleanup_module);
385
 
 
386
330
static int dio_config_insn(struct comedi_device *dev,
387
331
                           struct comedi_subdevice *s, struct comedi_insn *insn,
388
332
                           unsigned int *data)
645
589
               "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
646
590
               pcidev->bus->number, PCI_SLOT(pcidev->devfn));
647
591
 
648
 
        if (comedi_pci_enable(pcidev, driver_hpdi.driver_name)) {
 
592
        if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
649
593
                printk(KERN_WARNING
650
594
                       " failed enable PCI device and request regions\n");
651
595
                return -EIO;
679
623
 
680
624
        /*  get irq */
681
625
        if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
682
 
                        driver_hpdi.driver_name, dev)) {
 
626
                        dev->driver->driver_name, dev)) {
683
627
                printk(KERN_WARNING
684
628
                       " unable to allocate irq %u\n", pcidev->irq);
685
629
                return -EINVAL;
720
664
        return init_hpdi(dev);
721
665
}
722
666
 
723
 
static int hpdi_detach(struct comedi_device *dev)
 
667
static void hpdi_detach(struct comedi_device *dev)
724
668
{
725
669
        unsigned int i;
726
670
 
727
 
        printk(KERN_WARNING "comedi%d: gsc_hpdi: remove\n", dev->minor);
728
 
 
729
671
        if (dev->irq)
730
672
                free_irq(dev->irq, dev);
731
673
        if ((priv(dev)) && (priv(dev)->hw_dev)) {
758
700
                        comedi_pci_disable(priv(dev)->hw_dev);
759
701
                pci_dev_put(priv(dev)->hw_dev);
760
702
        }
761
 
        return 0;
762
703
}
763
704
 
764
705
static int dio_config_block_size(struct comedi_device *dev, unsigned int *data)
1113
1054
        return 0;
1114
1055
}
1115
1056
 
 
1057
static struct comedi_driver gsc_hpdi_driver = {
 
1058
        .driver_name    = "gsc_hpdi",
 
1059
        .module         = THIS_MODULE,
 
1060
        .attach         = hpdi_attach,
 
1061
        .detach         = hpdi_detach,
 
1062
};
 
1063
 
 
1064
static int __devinit gsc_hpdi_pci_probe(struct pci_dev *dev,
 
1065
                                        const struct pci_device_id *ent)
 
1066
{
 
1067
        return comedi_pci_auto_config(dev, &gsc_hpdi_driver);
 
1068
}
 
1069
 
 
1070
static void __devexit gsc_hpdi_pci_remove(struct pci_dev *dev)
 
1071
{
 
1072
        comedi_pci_auto_unconfig(dev);
 
1073
}
 
1074
 
 
1075
static DEFINE_PCI_DEVICE_TABLE(gsc_hpdi_pci_table) = {
 
1076
        { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9080, PCI_VENDOR_ID_PLX,
 
1077
                    0x2400, 0, 0, 0},
 
1078
        { 0 }
 
1079
};
 
1080
MODULE_DEVICE_TABLE(pci, gsc_hpdi_pci_table);
 
1081
 
 
1082
static struct pci_driver gsc_hpdi_pci_driver = {
 
1083
        .name           = "gsc_hpdi",
 
1084
        .id_table       = gsc_hpdi_pci_table,
 
1085
        .probe          = gsc_hpdi_pci_probe,
 
1086
        .remove         = __devexit_p(gsc_hpdi_pci_remove)
 
1087
};
 
1088
module_comedi_pci_driver(gsc_hpdi_driver, gsc_hpdi_pci_driver);
 
1089
 
1116
1090
MODULE_AUTHOR("Comedi http://www.comedi.org");
1117
1091
MODULE_DESCRIPTION("Comedi low-level driver");
1118
1092
MODULE_LICENSE("GPL");