staging: comedi: new adl_pci7x3x driver
PATCH v2 1/2 staging: comedi: new adl_pci7x3x driver
Currently the ADLink PCI-7230 and PCI-7432 Isolated Digital I/O Boards are supported using two drivers (adl_pci7230 and adl_pci7432). These drivers are very similar and only differ in the total number of di/do channels provided.
This driver combines the support for both boards into one common driver. In addition, it adds PCI PnP support for the other boards in the ADLink PCI-723x and PCI-743x series.
This driver only supports the comedi PCI auto config attach mechanism. The legacy attach using the comedi_config utility is not supported or required by this driver.
--- drivers/staging/comedi/Kconfig | 11 + drivers/staging/comedi/drivers/Makefile | 1 + drivers/staging/comedi/drivers/adl_pci7x3x.c | 342 +++++++++++++++++++++++++++ 3 files changed, 354 insertions(+) create mode 100644 drivers/staging/comedi/drivers/adl_pci7x3x.c
drivers/staging/comedi/Kconfig +11 -0
@@ -676,6 +676,17 @@ config COMEDI_ADL_PCI6208 To compile this driver as a module, choose M here: the module will be called adl_pci6208. +config COMEDI_ADL_PCI7X3X + tristate "ADLink PCI-723X/743X isolated digital i/o board support" + ---help--- + Enable support for ADlink PCI-723X/743X isolated digital i/o boards. + Supported boards include the 32-channel PCI-7230 (16 in/16 out), + PCI-7233 (32 in), and PCI-7234 (32 out) as well as the 64-channel + PCI-7432 (32 in/32 out), PCI-7433 (64 in), and PCI-7434 (64 out). + + To compile this driver as a module, choose M here: the module will be + called adl_pci7x3x. + config COMEDI_ADL_PCI7230 tristate "ADLink PCI-7230 digital io board support" ---help---
drivers/staging/comedi/drivers/Makefile +1 -0
@@ -69,6 +69,7 @@ obj-$(CONFIG_COMEDI_ADDI_APCI_3120) += addi_apci_3120.o obj-$(CONFIG_COMEDI_ADDI_APCI_3501) += addi_apci_3501.o obj-$(CONFIG_COMEDI_ADDI_APCI_3XXX) += addi_apci_3xxx.o obj-$(CONFIG_COMEDI_ADL_PCI6208) += adl_pci6208.o +obj-$(CONFIG_COMEDI_ADL_PCI7X3X) += adl_pci7x3x.o obj-$(CONFIG_COMEDI_ADL_PCI7230) += adl_pci7230.o obj-$(CONFIG_COMEDI_ADL_PCI7296) += adl_pci7296.o obj-$(CONFIG_COMEDI_ADL_PCI7432) += adl_pci7432.o
drivers/staging/comedi/drivers/adl_pci7x3x.c new file +342 -0
342 lines not on this page · raw message
Signature · 1 line
1.7.11
Greg KH
maintainerQuoted 5 lines · H Hartley Sweeten
Currently the ADLink PCI-7230 and PCI-7432 Isolated Digital I/O Boards are supported using two drivers (
adl_pci7230andadl_pci7432). These drivers are very similar and only differ in the total number of di/do channels provided.
Quoted 7 lines
This driver combines the support for both boards into one common driver. In addition, it adds PCI PnP support for the other boards in the ADLink PCI-723x and PCI-743x series.
This driver only supports the comedi PCI auto config attach mechanism. The legacy attach using the
comedi_configutility is not supported or required by this driver.
I now get the following build warnings on my box with this patch applied:
drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_do_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:124:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_di_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:150:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Care to send a follow-on patch to fix this up?
thanks,
greg k-h
Quoted 14 lines · Greg KH
Quoted 5 lines · H Hartley Sweeten
Currently the ADLink PCI-7230 and PCI-7432 Isolated Digital I/O Boards are supported using two drivers (
adl_pci7230andadl_pci7432). These drivers are very similar and only differ in the total number of di/do channels provided.Quoted 7 lines
This driver combines the support for both boards into one common driver. In addition, it adds PCI PnP support for the other boards in the ADLink PCI-723x and PCI-743x series.
This driver only supports the comedi PCI auto config attach mechanism. The legacy attach using the
comedi_configutility is not supported or required by this driver.
Quoted 7 lines
I now get the following build warnings on my box with this patch applied:
drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_do_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:124:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_di_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:150:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Hmm.. My build does not have the [-Wpointer-to-int-cast] for some reason so I didn't see this. I was trying to save having to allocate any private data but I guess it's cleaner if I do. BTW, there is another comedi driver that does this but I can't recall which one of the top of my head...
Quoted 1 line
Care to send a follow-on patch to fix this up?
Not a problem.
Thanks,
Hartley ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Quoted 23 lines · H Hartley Sweeten
Quoted 14 lines · Greg KH
Quoted 5 lines · H Hartley Sweeten
Currently the ADLink PCI-7230 and PCI-7432 Isolated Digital I/O Boards are supported using two drivers (
adl_pci7230andadl_pci7432). These drivers are very similar and only differ in the total number of di/do channels provided.Quoted 7 lines
This driver combines the support for both boards into one common driver. In addition, it adds PCI PnP support for the other boards in the ADLink PCI-723x and PCI-743x series.
This driver only supports the comedi PCI auto config attach mechanism. The legacy attach using the
comedi_configutility is not supported or required by this driver.Quoted 7 lines
I now get the following build warnings on my box with this patch applied:
drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_do_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:124:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_di_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:150:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Quoted 4 lines
Hmm.. My build does not have the [-Wpointer-to-int-cast] for some reason so I didn't see this. I was trying to save having to allocate any private data but I guess it's cleaner if I do. BTW, there is another comedi driver that does this but I can't recall which one of the top of my head...
You could always cast to unsigned long as that is the same size as a pointer, at least in the Linux kernel.
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
Quoted 24 lines · Ian Abbott
Quoted 23 lines · H Hartley Sweeten
Quoted 21 lines · Greg KH
Quoted 5 lines · H Hartley Sweeten
Currently the ADLink PCI-7230 and PCI-7432 Isolated Digital I/O Boards are supported using two drivers (
adl_pci7230andadl_pci7432). These drivers are very similar and only differ in the total number of di/do channels provided.Quoted 7 lines
This driver combines the support for both boards into one common driver. In addition, it adds PCI PnP support for the other boards in the ADLink PCI-723x and PCI-743x series.
This driver only supports the comedi PCI auto config attach mechanism. The legacy attach using the
comedi_configutility is not supported or required by this driver.I now get the following build warnings on my box with this patch applied:
drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_do_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:124:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]drivers/staging/comedi/drivers/adl_pci7x3x.c: In function ‘adl_pci7x3x_di_insn_bits’:drivers/staging/comedi/drivers/adl_pci7x3x.c:150:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Quoted 7 lines
Quoted 4 lines
Hmm.. My build does not have the [-Wpointer-to-int-cast] for some reason so I didn't see this. I was trying to save having to allocate any private data but I guess it's cleaner if I do. BTW, there is another comedi driver that does this but I can't recall which one of the top of my head...
You could always cast to unsigned long as that is the same size as a pointer, at least in the Linux kernel.
Ah, so it's a 32/64-bit issue... My build setup is only 32-bit that's why I didn't see it.
The acl7225b driver is the other one that passes the register offset in the s->private pointer. That one does cast the pointer to an unsigned long.
I assume this will fix the warning in the adl_pci7x3x driver. Patch coming shortly.
Regards,
Hartley
���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�