summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/das08.h
AgeCommit message (Collapse)Author
2018-12-05staging: comedi: drivers: Cleanup malformed licence identifierStephen Davies
This patch fixes multiple occurences of the checkpatch.pl warning: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 NB. This is an additional patch and does not overlap the patch sent yesterday for 8255.h. Should have sent them all together. Newb mistake. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Stephen Davies <davo2002@tpg.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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-06-12staging: comedi: das08.h: make self-reliantIan Abbott
The Comedi "das08.h" header file is included by drivers for the ComputerBoards/MeasurementComputing and Keithley Metrabyte boards in the DAS08 series. It does not compile cleanly when it is the first header included by the ".c" file. It uses `struct comedi_device *` in the parameter list of a function prototype, so just declare `struct comedi_device` as an incomplete type. It also uses `bool`, so include <linux/types.h> to declare it. 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>
2015-06-12staging: comedi: das08: use indexed initializer for AI range table typesIan Abbott
The "das08" common module for DAS08 ISA, PCI, and PCMCIA drivers includes a predefined set of AI range tables. The static board data (of type `struct das08_board_struct`) for a particular board contains an index in its `ai_pg` member (of type `enum das08_lrange`) indicating which of the predefined AI range tables to use. The "das08" common module looks up this index in `das08_ai_lranges[]` to get a pointer to the predefined range table for the board. The same index is also looked up in `das08_gainlists[]` to get a corresponding pointer to a list of hardware gain values for each range supported by the board (NULL for boards without programmable gain). To make this clearer, used indexed initializers for `das08_ai_lranges[]` and `das08_gainlists[]`, using the enumerated constants from `enum das08_lrange` as the indices. Also add a short comment to the definition of `enum das08_lrange`. 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>
2015-06-12staging: comedi: das08.h: reformat remaining commentsIan Abbott
Reformat remaining comments to use the preferred style for single-line and block comments. 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>
2015-06-12staging: comedi: das08.h: change description in copyright header commentIan Abbott
The copyright header comment includes a single-line description saying it is for "das08.c" and "das08_cs.c". However, it is also used by "das08_isa.c" and "das08_pci.c". Update the description to say it is for common DAS08 support, similar to description in "das08.c" (the common module for the DAS08 ISA/PCI/PCMCIA drivers). 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>
2015-06-12staging: comedi: das08.h: 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-30staging: comedi: das08: use comedi_subdevice 'readback'H Hartley Sweeten
Use the new comedi_subdevice 'readback' member and the core provided (*insn_read) for the readback of the analog output subdevice channels. The das08_ao_initialize() function is only called when the subdevice is first setup during the attach. It is used to initialize the channels to a known state. Absorb that function to simplify the code a bit. 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-05-23staging: comedi: Fixes Coding Style Warning in file das08.hSheetal Tigadoli
The Patch fixes following Warnings, found using checkpatch.pl, in file das08.h ./scripts/checkpatch.pl --file --terse drivers/staging/comedi/drivers/das08.h drivers/staging/comedi/drivers/das08.h:43: WARNING: line over 80 characters total: 0 errors, 1 warnings, 50 lines checked Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17staging: comedi: das08: remove do_bits from private dataH Hartley Sweeten
Use the subdevice 'state' variable instead of carrying the state of the output channels in the private data. Use comedi_dio_update_state() to handle the boilerplate code to update the subdevice s->state. 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-06-17staging: comedi: drivers: let core handle freeing s->privateH Hartley Sweeten
Introduce a new subdevice runflags, SRF_FREE_SPRIV, and a new helper function, comedi_set_spriv(), that the drivers can use to set the comedi_subdevice private data pointer. The helper function will also set SRF_FREE_SPRIV to allow the comedi core to automatically free the subdevice private data during the cleanup_device() stage of the detach. Currently s->private is only allocated by the 8255, addi_watchdog, amplc_dio200_common, and ni_65xx drivers. All users of those drivers can then have the comedi_spriv_free() calls removed and in many cases the (*detach) can then simply be the appropriate comedi core provided function. The ni_65xx driver uses a helper function, ni_65xx_alloc_subdevice_private(), to allocate the private data. Refactor the function to return an errno or call comedi_set_spriv() instead of returning a pointer to the private data and requiring the caller to handle 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>
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-03-11staging: comedi: das08: remove 'id' from boardinfoH Hartley Sweeten
With the bus specific code split out, the device id in the boardinfo is no longer needed. Remove 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-02-03staging: comedi: das08: split out bus specific codeH Hartley Sweeten
Split the bus specific ISA/PC-104 and PCI code out of this driver and create two new drivers, das08_isa and das08_pci. This allows removing all the #ifdef'ery in the das08 driver that handled if the CONFIG_COMEDI_DAS08_{ISA,PCI} options were enabled. It also makes the PCI driver cleanly Plug-and-Play since the comedi driver only has an auto_attach callback. Previously it also had an attach callback in order to handle the ISA cards. Since the PCMCIA support was already split out, we can also remove the now unused enum das08_bustype and it's use in the boardinfo. The bus specific code deals with the bustype automatically before it calls the common attach function in das08. 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-09-05staging: comedi: das08: Use struct comedi_device hw_dev for PCIIan Abbott
Remove the pointer to the PCI device from the private data `struct das08_private_struct`. Use `comedi_set_hw_dev()` to save a pointer to the PCI device (actually, its embedded `struct device`) and `comedi_to_pci_dev()` to retrieve it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08: Support read-back of AO subdeviceIan Abbott
Stash the last value written to each AO channel in private data and support the INSN_READ instruction to read it back. Don't bother setting the SDF_READABLE subdevice flag though as the hardware isn't really readable - we're just faking it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08: Remove i8254_iobase from private dataIan Abbott
The I/O port base address for the counter subdevice doesn't need to be stored in the private data. It can be calculated on the fly using the offset in the static board data. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08: Remove pci_iobase from private dataIan Abbott
The `pci_iobase` I/O port registers from PCI BAR 1 are never accessed, so don't bother storing this base address in `struct das08_private_struct`. The `pci_iobase` member was checked for non-zero in `das08_detach()` but we can check `dev->iobase` is non-zero instead. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08,das08_cs: Move das08_cs_boards[]Ian Abbott
Move `das08_cs_boards[]` from "das08.c" to "das08_cs.c" and make it static const. It no longer refers to anything in "das08.c" and no longer needs to be exported. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08: Remove function pointers from board structureIan Abbott
Remove the `ai`, `ao`, `di` and `do` pointers from `struct das08_board_struct`. These were initialized in `das08_boards[]` and `das08_cs_boards[]` to point to comedi instruction handler functions for the subdevice, but there are only two sets of functions depending on whether the `is_jr` member is true or false, and some of the functions will be NULL if the corresponding `ai_nbits`, `ao_nbits`, `di_nchan` and `do_nchan` members are zero. Determine which handler functions to use in das08_common_attach(). One element of `das08_boards[]` had `ao` set to NULL and `ao_nbits` set to 12. Set `ao_nbits` to 0 in this case to let das08_common_attach() know this board has no AO subdevice. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08: Mark 'JR' boards in board dataIan Abbott
Add a bool member `is_jr` to `struct das08_board_struct` and initialize it to `true` in those elements of `das08_boards[]` corresponding to the 'JR' board models. This will be used by a following patch that removes the `ai`, `ao`, `di` and `do` members from `struct das08_board_struct`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08: Add number of DI channels in board structureIan Abbott
Add member `di_nchan` to `struct das08_board_struct` to set the number of digital input channels explicitly. Currently, the code determines the number of channels to 3 or 8 depending on what function the `di` member points to, which is not very elegant. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: das08: Remove pc104 bustype valueIan Abbott
Remove the `pc104` value from `enum das08_bustype` and replace occurrences of it in the code and data with the `isa` value. The code treats them as equivalent anyway with expressions like `(thisboard->bustype == isa || thisboard->bustype == pc104)`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: das_08: absorb i8254_struct into the private dataH Hartley Sweeten
The i8254_struct now only contains the iobase address used to read/write the 8254 timer device. Move that variable into the das08 private data struct and remove the i8254_struct. 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-07-06staging: comedi: das_08: remove the unneeded 8254 variables and definesH Hartley Sweeten
Now that the driver is using the 8253 helper functions, remove the unused variables in the i8254_struct as well as the unused defines for the 8254 register offsets. 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-05-18staging: comedi: cleanup all the comedi_driver 'detach' functionsH Hartley Sweeten
1. Change the return type from int to void All the detach functions, except for the comedi usb drivers, simply return success (0). Plus, the return code is never checked in the comedi core. The comedi usb drivers do return error codes but the conditions can never happen. The first check is: if (!dev) return -EFAULT; This checks that the passed comedi_device pointer is valid. The detach function itself is called using this pointer so it MUST always be valid or there is a bug in the core: if (dev->driver) dev->driver->detach(dev); And the second check: usb = dev->private; if (!usb) return -EFAULT; The dev->private pointer is setup in the attach function to point to the probed usb device. This value could be NULL if the attach fails. But, since the comedi core is going to unload the driver anyway and does not check for errors there is no gain by returning one. After removing these checks from the comedi usb drivers the detach functions required a bit of cleanup. 2. Remove all the printk noise in the detach functions All of the printk output is really just noise. The user did a rmmod to unload the driver, we really don't need to tell them about it. Also, some of the messages are output using: dev_dbg(dev->hw_dev, ... or dev_info(dev->hw_dev, ... Unfortunately the hw_dev value is only used by drivers that are doing DMA. For most drivers this variable is going to be NULL so the output is not going to work as expected. 3. Refactor a couple static 'free_resource' functions into the detach functions. The 'free_resource' function is only being called by the detach and it makes more sense to just absorb the code. 4. Remove a couple unnecessary braces for single statements. 5. Remove unnecessary comments. Most of the comedi drivers appear to be based on the comedi skel driver and have the comments from that driver included. These comments make sense in the skel driver for reference but they don't need to be in any of the actual drivers. 6. Remove all the extra whitespace. It's not needed to make the functions any more readable. 7. Remove the now unused 'attached_successfully' variable in the cb_pcimdda driver. This variable was only used to conditionally output some driver noise during the detach. Since all the printk's have been removed this variable is no longer necessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2010-05-14staging: trivial: fix typo "seperate"Anand Gadiyar
s/seperate/separate Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: Jiri Kosina <trivial@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: Comedi: Lindent changes to comdi driver in staging treeMithlesh Thukral
Lindent changes to comdi driver in staging tree. This patch is followed by the checkpatch.pl error fixes. Did not make them part of this patch as the patch size is already huge. Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19Staging: comedi: fix "foo * bar" should be "foo *bar"Bill Pemberton
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19Staging: comedi: Remove C99 commentsBill Pemberton
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03Staging: comedi: Remove das08_board typedefBill Pemberton
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03Staging: comedi: Remove comedi_device typedefBill Pemberton
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03Staging: comedi: add das08 driversDavid Schleef
Supports [Keithley Metrabyte] DAS08 (isa-das08), [ComputerBoards] DAS08 (isa-das08), DAS08-PGM (das08-pgm), DAS08-PGH (das08-pgh), DAS08-PGL (das08-pgl), DAS08-AOH (das08-aoh), DAS08-AOL (das08-aol), DAS08-AOM (das08-aom), DAS08/JR-AO (das08/jr-ao), DAS08/JR-16-AO (das08jr-16-ao), PCI-DAS08 (das08), PC104-DAS08 (pc104-das08), DAS08/JR/16 (das08jr/16) [ComputerBoards] PCM-DAS08 (pcm-das08) From: David Schleef <ds@schleef.org> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>