diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-13 17:37:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-13 17:37:33 -0700 |
commit | b79013b2449c23f1f505bdf39c5a6c330338b244 (patch) | |
tree | 67908ffb1705a595cda8de7224d121fa40b8f36d /drivers/staging/comedi/drivers/adl_pci6208.c | |
parent | c4be50eee2bd4d50e0f0ca58776f685c08de69c3 (diff) | |
parent | c610f7f772aa06ae2bd8e5ace87cde4d90f70198 (diff) |
Merge tag 'staging-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here's the big staging driver patchset for 4.1-rc1.
There's a lot of patches here, the Outreachy application period
happened during this development cycle, so that means that there was a
lot of cleanup patches accepted. Other than the normal coding style
and sparse fixes here, there are some driver updates and work toward
making some of the drivers into "mergable" shape (like the Unisys
drivers.)
All of these have been in linux-next for a while"
* tag 'staging-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1214 commits)
staging: lustre: orthography & coding style
staging: lustre: lnet: lnet: fix error return code
staging: lustre: fix sparse warning
Revert "Staging: sm750fb: Fix C99 Comments"
Staging: rtl8192u: use correct array for debug output
staging: rtl8192e: Remove dead code
staging: rtl8192e: Comment cleanup (style/format)
staging: rtl8192e: Fix indentation in rtllib_rx_auth_resp()
staging: rtl8192e: Decrease nesting of rtllib_rx_auth_resp()
staging: rtl8192e: Divide rtllib_rx_auth()
staging: rtl8192e: Fix PRINTK_WITHOUT_KERN_LEVEL warnings
staging: rtl8192e: Fix DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON warning
staging: rtl8192e: Fix BRACES warning
staging: rtl8192e: Fix LINE_CONTINUATIONS warning
staging: rtl8192e: Fix UNNECESSARY_PARENTHESES warnings
staging: rtl8192e: remove unused EXPORT_SYMBOL_RSL macro
staging: rtl8192e: Fix RETURN_VOID warnings
staging: rtl8192e: Fix UNNECESSARY_ELSE warning
staging: rtl8723au: Remove unneeded comments
staging: rtl8723au: Use __func__ in trace logs
...
Diffstat (limited to 'drivers/staging/comedi/drivers/adl_pci6208.c')
-rw-r--r-- | drivers/staging/comedi/drivers/adl_pci6208.c | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci6208.c b/drivers/staging/comedi/drivers/adl_pci6208.c index a3ea4b7c18dd..7ed3fd6fbd3e 100644 --- a/drivers/staging/comedi/drivers/adl_pci6208.c +++ b/drivers/staging/comedi/drivers/adl_pci6208.c @@ -19,19 +19,22 @@ /* * Driver: adl_pci6208 * Description: ADLink PCI-6208/6216 Series Multi-channel Analog Output Cards - * Devices: [ADLink] PCI-6208 (adl_pci6208), PCI-6216 (adl_pci6216) + * Devices: [ADLink] PCI-6208 (adl_pci6208), PCI-6216 * Author: nsyeow <nsyeow@pd.jaring.my> - * Updated: Fri, 30 Jan 2004 14:44:27 +0800 + * Updated: Wed, 11 Feb 2015 11:37:18 +0000 * Status: untested * * Configuration Options: not applicable, uses PCI auto config + * + * All supported devices share the same PCI device ID and are treated as a + * PCI-6216 with 16 analog output channels. On a PCI-6208, the upper 8 + * channels exist in registers, but don't go to DAC chips. */ #include <linux/module.h> #include <linux/delay.h> -#include <linux/pci.h> -#include "../comedidev.h" +#include "../comedi_pci.h" /* * PCI-6208/6216-GL register map @@ -45,27 +48,6 @@ #define PCI6208_DIO_DI_MASK (0xf0) #define PCI6208_DIO_DI_SHIFT (4) -enum pci6208_boardid { - BOARD_PCI6208, - BOARD_PCI6216, -}; - -struct pci6208_board { - const char *name; - int ao_chans; -}; - -static const struct pci6208_board pci6208_boards[] = { - [BOARD_PCI6208] = { - .name = "adl_pci6208", - .ao_chans = 8, - }, - [BOARD_PCI6216] = { - .name = "adl_pci6216", - .ao_chans = 16, - }, -}; - static int pci6208_ao_eoc(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, @@ -136,21 +118,13 @@ static int pci6208_do_insn_bits(struct comedi_device *dev, } static int pci6208_auto_attach(struct comedi_device *dev, - unsigned long context) + unsigned long context_unused) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct pci6208_board *boardinfo = NULL; struct comedi_subdevice *s; unsigned int val; int ret; - if (context < ARRAY_SIZE(pci6208_boards)) - boardinfo = &pci6208_boards[context]; - if (!boardinfo) - return -ENODEV; - dev->board_ptr = boardinfo; - dev->board_name = boardinfo->name; - ret = comedi_pci_enable(dev); if (ret) return ret; @@ -164,7 +138,7 @@ static int pci6208_auto_attach(struct comedi_device *dev, /* analog output subdevice */ s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE; - s->n_chan = boardinfo->ao_chans; + s->n_chan = 16; /* Only 8 usable on PCI-6208 */ s->maxdata = 0xffff; s->range_table = &range_bipolar10; s->insn_write = pci6208_ao_insn_write; @@ -217,8 +191,9 @@ static int adl_pci6208_pci_probe(struct pci_dev *dev, } static const struct pci_device_id adl_pci6208_pci_table[] = { - { PCI_VDEVICE(ADLINK, 0x6208), BOARD_PCI6208 }, - { PCI_VDEVICE(ADLINK, 0x6216), BOARD_PCI6216 }, + { PCI_DEVICE(PCI_VENDOR_ID_ADLINK, 0x6208) }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, + 0x9999, 0x6208) }, { 0 } }; MODULE_DEVICE_TABLE(pci, adl_pci6208_pci_table); |