summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/amplc_dio200.c
AgeCommit message (Collapse)Author
2017-11-28staging: comedi: drivers: Remove redundant license textGreg Kroah-Hartman
Now that the SPDX tag is in all comedi files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: comedi: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/comedi files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: comedi: amplc_dio200.c: reformat copyright commentIan Abbott
Reformat the copyright comment at the top of the file to use the preferred block comment style. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: comedi: amplc_dio200: remove dio200_common_detach()H Hartley Sweeten
This exported function just does a free_irq() to release the interrupt handler for the legacy and PCI dio200 drivers. The legacy driver also calls comedi_legacy_detach() which would also do the free_irq(). For that driver the just use comedi_legacy_detach() directly for the (*detach). For the PCI driver, add the free_irq() to the private (*datach) function. Remove the, then unused, dio200_common_detach() function. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: comedi: amplc_dio200.h: remove struct dio200_layout definitionH Hartley Sweeten
This struct is used to provide part of the boardinfo data. Using the extra indirection does not provide any additional clarity to the driver. Absorb the members from dio200_layout into dio200_board and remove the extra 'layout' indirection. For aesthetics, rename all the local variables used for the boardinfo pointer to 'board'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: comedi: amplc_dio200: tidy up comedi_driver declarationH Hartley Sweeten
For aesthetics, add some whitespace to the declaration. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: comedi: amplc_dio200: remove unnecessary local variableH Hartley Sweeten
The local variable 'irq' is not necessary in dio200_attach(). Just pass the it->options[1] value directly. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: comedi: amplc_dio200: remove 'mainsize' from ISA boardinfoH Hartley Sweeten
All the ISA DIO200 boards have an i/o region size of 0x20 (DIO200_IO_SIZE). Remove the boardinfo and open code the size in the comedi_request_region() call. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: comedi: amplc_dio200: remove 'bustype' from boardinfoH Hartley Sweeten
This member of the boardinfo is not used by the driver. Remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: comedi: amplc_dio200: remove private dataH Hartley Sweeten
The private data in this driver only has one member, 'intr_sd', which is the index to the interrupt subdevice. This member is initialized during the attach of the driver when the sd_intr subdevice is detected in the boadinfo 'layout'. The member is then used in the interrupt handler to get the pointer to the subdevice. This member is not necessary. The comedi_device 'read_subdev' is also initialized during the attach. This can be used in the interrupt handler to get the subdevice pointer. Refactor the code to not require the private data and remove the struct and its allocations. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-30staging: comedi: amplc_dio200: use the comedi_device 'mmio' memberH Hartley Sweeten
The amplc_dio200_common module currently uses a union in the private data to determine if the hardware uses port or memory mapped I/O. Use the new 'mmio' member in the comedi_device for the ioremap'ed base address and remove all the union code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: don't rely on comedidev.h to include headersH Hartley Sweeten
comedidev.h is the main kernel header for comedi. Every comedi driver includes this header which then includes a number of <linux/*> headers. All the drivers need <linux/module.h> and some of them need <linux/delay.h>. The rest are not needed by any of the drivers. Remove all the includes in comedidev.h except for <linux/dma-mapping.h>, which is needed to pick up the enum dma_data_direction for the comedi_subdevice definition, and "comedi.h", which is the uapi header for comedi. Add <linux/module.h> to all the comedi drivers and <linux/delay.h> to the couple that need it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: use comedi_alloc_devpriv()H Hartley Sweeten
Use the helper function to allocate memory and set the comedi_device private data pointer. This removes the dependency on slab.h from most of the drivers so remove the global #include in comedidev.h and the local #include in some of the drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13staging: comedi: remove FSF address from boilerplate textH Hartley Sweeten
Addresses change... Remove the paragraph with the FSF address from all the comedi source files. Also, remove the paragraph about the finding the complete GPL in the COPYING file since it's unnecessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-19staging: comedi: amplc_dio200: use comedi_legacy_detach()H Hartley Sweeten
The I/O region used by this driver is always requested using comedi_request_region(). The devpriv->io union is only used by the common code shared by the legacy and PCI drivers. Use the new comedi_legacy_detach() helper in the (*detach) to release the I/O region requested by this driver. That function will handle the proper sanity checking before releasing the resource. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-11staging: comedi: ampcl_dio200: use comedi_request_region()H Hartley Sweeten
Use comedi_request_region() to request the I/O region used by this driver. Remove the noise when the board is first attached as well as the error message when the request_region() fails, comedi_request_reqion() will output the error message if necessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-11staging: comedi: amplc_dio200: cleanup dev->board_name usageH Hartley Sweeten
This legacy driver does no additional probing so the dev->board_name will already be properly initialized by the comedi core before calling the (*attach) function. Remove the unnecessary initialization of dev->board_name. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: split into ISA, PCI and commonIan Abbott
Split the "amplc_dio200" comedi driver module into separate driver modules for ISA and PCI boards with a common module for the shared code. Keep the old name "amplc_dio200" for the ISA board driver as the module may be modprobed with this name by a script. (If the script uses insmod it will need modifying to load the "amplc_dio200_common" module first.) Use the module name "amplc_dio200_pci" for the PCI board driver. On most systems this will be auto-loaded. Use the module name "amplc_dio200_common" for the module containing the shared code. This is normally loaded as a dependency of the other two modules. "amplc_dio200_common" exports the following functions: * `amplc_dio200_common_attach()`: this is basically the old `dio200_common_attach()` from the combined driver module. It is called from the driver-specific attach or auto-attach routines. * `amplc_dio200_common_detach()`: this is most of the old `dio200_detach()`. It is called from the driver-specific detach routine. * `amplc_dio200_set_enhance()`: this is a new function called during initialization of PCIe cards to enable "enhanced" mode. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: refactor dio200_handle_read_intr()Ian Abbott
Refactor `dio200_handle_read_intr()` to fix checkpatch warning about too many leading tabs. Factor out the part that puts the scan data into the asynchronous command data buffer and checks for end of acquisition into new function `dio200_read_scan_intr()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: don't check bus-type in dio200_common_attach()Ian Abbott
The "amplc_dio200" driver is going to be split into separate drivers for ISA and PCI cards with a common module containing most of the code. We don't want the common module code to depend on whether ISA boards, PCI boards, or both are supported. Currently, `dio200_common_attach()` and `dio200_detach()` optimize out the code to support a timer subdevice when built to support ISA boards only. Remove the `if (DO_PCI)` tests which optimize out that code. Unfortunately, this will expand the module's code size for an ISA-only driver a bit. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: remove dio200_report_attach()Ian Abbott
`dio200_report_attach()` is called from `dio200_common_attach()` to report the successful attachment of a supported board. It includes various information about the board. Replace the function with a simple acknowledgement that the attachment completed successfully. The `dio200_attach()` and `dio200_auto_attach()` functions also output an message during the attachment. Include extra information in those messages to compensate for the removal of the information output by `dio200_report_attach()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: remove DIO200_DRIVER_NAMEIan Abbott
Remove the `DIO200_DRIVER_NAME` macro which expands to the driver name "amplc_dio200". Use the board name from our `struct dio200_board` when requesting resources. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: set board_name before common attachIan Abbott
`dio200_common_attach()` is called from `dio200_attach()` for ISA boards and from `dio200_auto_attach()` for PCI boards. `dio200_auto_attach()` assigns `dev->board_name` (where `dev` is the `struct comedi_device *` under consideration) before calling `dio200_common_attach()`. Do the same in `dio200_attach()` so it can be used there before the call to `dio200_common_attach()`. This makes the assignment in `dio200_common_attach()` unnessary, so remove the assignment from there. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: dio200_common_attach() return 0Ian Abbott
Change the successful return value of `dio200_common_attach()` from 1 to 0. This is propagated as the return value from the driver's "attach" (`dio200_attach()`) or "auto_attach" (`dio200_auto_attach()`) handler. Any non-negative value will do, but 0 is more conventional than 1. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: shrink struct dio200_subdev_intrIan Abbott
Shave a few bytes off the size of `struct dio200_subdev_intr` by rearranging members and changing two of them to bit-fields. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: embed board layout in board structureIan Abbott
The amplc_dio200 driver supports both ISA and PCI boards, some of which are quite similar. The driver takes advantage of this by defining a "board layout" structure `struct dio200_layout` along with an array of this structure `dio200_layouts[]` and an enumerated type for the indices into this array `enum dio200_layout_idx`. The main board information structure `struct dio200_board` contains a `layout` member holding an enumerated index into the array of layouts and the enumerated layout values are used to designate the indices in the initializer of `dio200_layouts[]`. We would like to split the ISA and PCI support into separate driver modules and having the shared layouts makes this slightly awkward as the enumerated values are condionally present depending on whether the driver is configured to support ISA, PCI, or both. Embed the `struct dio200_layout` into the main board information structure `struct dio200_board` to make things simpler, discarding `dio200_layouts[]` and the `enum dio200_layout_idx` in the process. Only two of the layouts were used by more than one board anyway (each of which was used by one ISA and one PCI board). While we're at it, change the `has_int_sce`, `has_clk_gat_sce` and `has_enhancements` members of `struct dio200_layout` to `bool:1` bit-fields to save a few bytes. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: Simplify PCI board look-upIan Abbott
Set the `driver_data` member of each element (apart from the sentinel) of our PCI device table `dio200_pci_table[]` to the index of the corresponding element of our private PCI board details `dio200_pci_boards[]`. This index appears in the context parameter of our auto_attach routine `dio200_auto_attach()`. In this function, nename the parameter to `context_model` and use it to set `dev->board_ptr` to point to an element of `dio200_pci_boards[] directly by index instead of calling `dio200_find_pci_board()` to search for the element whose `devid` member matches the PCI device ID. Remove `dio200_find_pci_board()` and the `devid` member of `struct dio200_board`. Also remove the `model` member of `struct dio200_board` and the `enum dio200_model` type as we can do without them. The only function that uses the `model` member is `dio200_auto_attach()`, so use the `context_model` parameter instead. Define the enumerated value for each PCI board in new type `enum dio200_pci_model` which replaces `enum dio200_model` minus the enumerated values for the ISA boards (so the numeric values for the PCI boards have changed). Use these enumerated values to designate the initializer for each element of `dio200_pci_boards[]`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: don't check bus type in attachIan Abbott
Since the legacy attach routine `dio200_attach()` is only called for board names matching an entry in our array of ISA boards `dio200_isa_boards[]`, and it is reasonable to expect all elements of `dio200_isa_boards[]` to have their `bustype` member initialized correctly to `isa_bustype`, don't bother checking the bus type in `dio200_attach()`. Add `if (!DO_ISA) return -EINVAL` to optimize out the remainder of the function if `CONFIG_COMEDI_AMPLC_DIO200_ISA` is not defined. Similarly, don't bother checking the bus type in `dio200_find_pci_board()` as it is reasonable to expect all elements of `dio200_pci_boards[]` to have their `bustype` member initialized correctly to `pci_bustype`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: comedi: amplc_dio200: split dio200_boards[] into ISA & PCIIan Abbott
Split `dio200_boards[]` into `dio200_isa_boards[]` for ISA cards and `dio200_pci_boards[]` for PCI cards. Only initialize the board-name look-up members of `struct comedi_driver amplc_dio200_driver` if the ISA part of the driver is enabled in the kernel config (`CONFIG_COMEDI_AMPLC_DIO200_ISA`) using the array of ISA boards (`dio200_isa_boards[]`). The driver doesn't allow manual configuration of PCI devices, so there is no point having the comedi core match the names of the PCI boards before it calls our driver's legacy attach routine (`dio200_attach()`). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14staging: comedi_pci: pass comedi_device to comedi_pci_enable()H Hartley Sweeten
Make comedi_pci_enable() use the same parameter type as comedi_pci_disable(). This also allows comedi_pci_enable to automatically determine the resource name passed to pci_request_regions(). Make sure the errno value returned is passed on instead of assuming an errno. Also, remove any kernel noise that is generated when the call fails. The National Instruments drivers that use the mite module currently enable the PCI device in the mite module. For those drivers move the call to comedi_pci_enable into the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14staging: comedi_pci: make comedi_pci_disable() safe to callH Hartley Sweeten
Currently all the comedi PCI drivers need to do some checking in their (*detach) before calling comedi_pci_disable() in order to make sure the PCI device has actually be enabled. Change the parameter passed to comedi_pci_disable() from a struct pci_dev pointer to a comedi_device pointer and have comedi_pci_disable() handle all the checking. For most comedi PCI drivers this also allows removing the local variable holding the pointer to the pci_dev. For some of the drivers comedi_pci_disable can now be used directly as the (*detach) function. The National Instruments drivers that use the mite module currently enable/disable the PCI device in the mite module. For those drivers move the call to comedi_pci_disable into the driver and make sure dev->iobase is set to a non-zero value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: comedi: comedi_pci: change the comedi_pci_auto_config() 'context'H Hartley Sweeten
The comedi_pci_auto_config() function is used to allow the PCI driver (*probe) function to automatically call the comedi driver (*auto_attach). This allows the comedi driver to be part of the PnP process when the PCI device is detected. Currently the comedi_pci_auto_config() always passes a 'context' of '0' to comedi_auto_config(). This makes the 'context' a bit useless. Modify comedi_pci_auto_config() to allow the comedi pci drivers to pass a 'context' from the PCI driver. Make all the comedi pci drivers pass the pci_device_id 'driver_data' as the 'context'. Since none of the comedi pci drivers currently set the 'driver_data' the 'context' will still be '0'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-11staging: Remove unnecessary OOM messagesJoe Perches
alloc failures already get standardized OOM messages and a dump_stack. For the affected mallocs around these OOM messages: Converted kzallocs with multiplies to kcalloc. Converted kmallocs with multiplies to kmalloc_array. Converted a kmalloc/strlen/strncpy to kstrdup. Moved a spin_lock below a removed OOM message and removed a now unnecessary spin_unlock. Neatened alignment and whitespace. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-31staging: comedi: conditionally build in PCI driver supportH Hartley Sweeten
Separate the comedi_pci_* functions out of drivers.c into a new source file, comedi_pci.c. This allows conditionally building support for comedi PCI drivers into the comedi core. Fix the Kconfig and Makefile appropriately. Group all the comedi_pci_* prototypes and related defines into one place in comedidev.h. Protect these prototypes with an #ifdef and provide some dummy functions so that the mixed ISA/PCI comedi drivers will still build correctly. Remove the #include <linux/pci.h> from comedidev.h and drivers.c. This include is only needed by the comedi PCI driver support code and the PCI drivers. The include should occur in those files. Also, remove the #include <linux/pci.h> from a couple non-PCI drivers since it's not needed. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.removePeter Huewe
(Almost) all comedi pci drivers have some wrapper for their pci_driver.remove function which simply calls comedi_pci_auto_unconfig which has the same function prototype as the wrapper. -> we can remove these wrappers and call comedi_pci_auto_unconfig directly. This removes a lot some boilerplate code and saves some bytes. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18Staging: Comedi: amplc_dio200: Fixed bracing issueJake Champlin
Fixed coding style error Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: comedi: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: comedi: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: comedi: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14staging: comedi: amplc_dio200: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of dio200_subdev_intr_cmdtest(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30staging: comedi/drivers: use auto_attach instead of attach_pciIan Abbott
Change comedi drivers for PCI boards to use the new `auto_attach()` method instead of the `attach_pci()` method. I plan to remove the `attach_pci()` and `attach_usb()` methods from `struct comedi_driver` once nothing is using them. Tag the functions with `__devinit` where they are not already so tagged, as they are only called during PCI probe. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: comedidev.h: add PCI_VENDOR_ID_AMPLICONH Hartley Sweeten
Add a define for the Amplicon Liveline Limited PCI vendor id. Remove the duplicates in the drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: support multiple read/write of counterIan Abbott
Change the `insn_read` and `insn_write` handlers of the '8254' counter subdevices to support reading and writing multiple data values. (Writing multiple values isn't very useful, but if that's what the user wants....) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: implement timer subdeviceIan Abbott
Implement the timer subdevice for the new PCIe boards. The subdevice was previously marked as unused, but was reserved for this purpose. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: add 32-bit register access functionsIan Abbott
These are currently unused but will be used to support extra features of the PCIe boards. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: allow extra clock and gate sourcesIan Abbott
One of the enhancements of the new PCIe boards is the addition of extra clock and gate sources. Allow clock and gate sources up to 31 for these boards (compared to 7 for the old boards) although most of those are reserved for future use. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: enable enhanced features of PCIe boardsIan Abbott
The new PCIe boards PCIe215, PCIe236 and PCIe296 have some enhanced features (over the older boards), although none of these features are supported by this driver yet. Enable the enhanced features in hardware and use `dio200_layouts[]` to indicate which boards support the enhanced features. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: allow generation of PCIe interruptsIan Abbott
The new PCIe boards PCIe215, PCIe236 and PCIe296 need a special register setting to allow generation of interrupts on the PCIe bus. Add `dio200_pcie_board_setup()` to do this and call it from `dio200_attach_pci()` for those boards. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: support PCIe215, PCIe236 and PCIe296Ian Abbott
Add preliminary support for the above PCIe boards. The interrupt subdevice is not working yet as the boards need some additional initialization to enable interrupts. Reserve an unused subdevice that will eventually become a timer subdevice. Some unused subdevices have been added between the used subdevices on the PCIe215 and PCIe236. This is so the subdevice numbers will match a pattern-matching feature to be added at a later date, where the pattern-match specifications for a subdevice include pattern-match results from other subdevices, specified by index. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging: comedi: amplc_dio200: add register shift to board infoIan Abbott
Add `mainshift` member to `struct dio200_board` to hold the amount of left-shift required for main register offsets. This is 0 for all the boards currently supported so it doesn't need initializing explicitly in any current element of `dio200_boards[]`. It will be non-zero for some new boards to be supported by this driver. Modify the register access functions `dio200_read8()` and `dio200_write8()` to take the shift into account. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>