Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: comedi: adv_pci_dio: update for PCI-1761

Advantech PCI-1761 device support to the driver adv_pci_dio has been
added. Patch has been successfully tested on a real card (8 digital
outs, 8 digital inputs).

Signed-off-by: Anton Dozenko <anton.dozenko@gmail.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Anton Dozenko and committed by
Greg Kroah-Hartman
682455be 52673926

+26 -4
+2 -2
drivers/staging/comedi/Kconfig
··· 785 785 ---help--- 786 786 Enable support for Advantech PCI DIO cards 787 787 PCI-1730, PCI-1733, PCI-1734, PCI-1735U, PCI-1736UP, PCI-1739U, 788 - PCI-1750, PCI-1751, PCI-1752, PCI-1753/E, PCI-1754, PCI-1756 and 789 - PCI-1762 788 + PCI-1750, PCI-1751, PCI-1752, PCI-1753/E, PCI-1754, PCI-1756, 789 + PCI-1761 and PCI-1762 790 790 791 791 To compile this driver as a module, choose M here: the module will be 792 792 called adv_pci_dio.
+24 -2
drivers/staging/comedi/drivers/adv_pci_dio.c
··· 12 12 * Devices: [Advantech] PCI-1730 (adv_pci_dio), PCI-1733, 13 13 * PCI-1734, PCI-1735U, PCI-1736UP, PCI-1739U, PCI-1750, 14 14 * PCI-1751, PCI-1752, PCI-1753, PCI-1753+PCI-1753E, 15 - * PCI-1754, PCI-1756, PCI-1762 15 + * PCI-1754, PCI-1756, PCI-1761, PCI-1762 16 16 * Author: Michal Dobes <dobes@tesnet.cz> 17 - * Updated: Mon, 09 Jan 2012 12:40:46 +0000 17 + * Updated: Fri, 25 Aug 2017 07:23:06 +0300 18 18 * Status: untested 19 19 * 20 20 * Configuration Options: not applicable, uses PCI auto config ··· 50 50 /* PCI-1752, PCI-1756 special registers */ 51 51 #define PCI1752_CFC_REG 0x12 /* R/W: channel freeze function */ 52 52 53 + /* PCI-1761 interrupt control registers */ 54 + #define PCI1761_INT_EN_REG 0x03 /* R/W: enable/disable interrupts */ 55 + #define PCI1761_INT_RF_REG 0x04 /* R/W: falling/rising edge */ 56 + #define PCI1761_INT_CLR_REG 0x05 /* R/W: clear interrupts */ 57 + 53 58 /* PCI-1762 interrupt control registers */ 54 59 #define PCI1762_INT_REG 0x06 /* R/W: status/control */ 55 60 ··· 77 72 TYPE_PCI1753E, 78 73 TYPE_PCI1754, 79 74 TYPE_PCI1756, 75 + TYPE_PCI1761, 80 76 TYPE_PCI1762 81 77 }; 82 78 ··· 186 180 .sdo[1] = { 32, 0x04, }, /* DO 0-31 */ 187 181 .id_reg = 0x10, 188 182 .is_16bit = 1, 183 + }, 184 + [TYPE_PCI1761] = { 185 + .name = "pci1761", 186 + .nsubdevs = 3, 187 + .sdi[1] = { 8, 0x01 }, /* ISO DI 0-7 */ 188 + .sdo[1] = { 8, 0x00 }, /* RELAY DO 0-7 */ 189 + .id_reg = 0x02, 189 190 }, 190 191 [TYPE_PCI1762] = { 191 192 .name = "pci1762", ··· 321 308 outw(0x08, dev->iobase + PCI1754_INT_REG(2)); 322 309 outw(0x08, dev->iobase + PCI1754_INT_REG(3)); 323 310 } 311 + break; 312 + case TYPE_PCI1761: 313 + /* disable interrupts */ 314 + outb(0, dev->iobase + PCI1761_INT_EN_REG); 315 + /* clear interrupts */ 316 + outb(0xff, dev->iobase + PCI1761_INT_CLR_REG); 317 + /* set rising edge trigger */ 318 + outb(0, dev->iobase + PCI1761_INT_RF_REG); 324 319 break; 325 320 case TYPE_PCI1762: 326 321 outw(0x0101, dev->iobase + PCI1762_INT_REG); ··· 517 496 { PCI_VDEVICE(ADVANTECH, 0x1753), TYPE_PCI1753 }, 518 497 { PCI_VDEVICE(ADVANTECH, 0x1754), TYPE_PCI1754 }, 519 498 { PCI_VDEVICE(ADVANTECH, 0x1756), TYPE_PCI1756 }, 499 + { PCI_VDEVICE(ADVANTECH, 0x1761), TYPE_PCI1761 }, 520 500 { PCI_VDEVICE(ADVANTECH, 0x1762), TYPE_PCI1762 }, 521 501 { 0 } 522 502 };