aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/das800.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>
2016-06-17Staging: comedi: fix comment issue fixed for das800.cRavishankar Karkala Mallikarjunayya
This is a patch to the das800.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging:comedi:Use unsigned int instead of unsignedNikita Eshkeev
This patch fixed the checkpatch.pl warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Nikita Eshkeev <kastolom@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18staging: comedi: das800: rename 'thisboard' variablesH Hartley Sweeten
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi 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>
2015-06-18staging: comedi: das800: cleanup das800_probe()H Hartley Sweeten
Make this function return a pointer to the boardinfo instead of an index. Since it's not typical, add a comment to clarify why this legacy driver does a probe. For aesthetics, rename the local variable 'board' to 'index. Consolidate the dev_dbg() messages when a probed boardinfo is used and remove the extra dev_dbg() message when the boardinfo is not found. 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>
2015-04-03staging: comedi: das800: remove #include "comedi_fc.h"Ian Abbott
As preparation for removal of "comedi_fc.h", replace calls to the `cfc_check_trigger_...` functions from "comedi_fc.h" with the replacement `comedi_check_trigger_...` functions from "../comedidev.h" and remove the inclusion of "comedi_fc.h". 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-03-06staging: comedi: drivers/*.c: remove unnecessary blank linesH Hartley Sweeten
Blank lines are not needed before a close brace '}' or after an open brace '{'. Also remove any multiple blank lines. 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>
2015-03-01staging: comedi: das800: convert driver to use the comedi_8254 moduleH Hartley Sweeten
This driver uses an 8254 timer to generate the pacer clock used for analog input data acquisition. Convert it to use the comedi_8254 module to provide support for the 8254 timer. 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>
2015-01-25staging: comedi: drivers: remove inappropriate COMEDI_CB_EOA eventsH Hartley Sweeten
Hardware errors should be reported with the COMEDI_CB_ERROR event. This event will cause the async command to cancel. It's not necessary to also set the COMEDI_CB_EOA event. Remove these events. 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-11-05staging: comedi: das800: use comedi_async 'scans_done' to detect EOAH Hartley Sweeten
Remove the private data member 'count' and use the comedi_async 'scans_done' member to detect the end-of-acquisition. 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-11-03staging: comedi: drivers: digital output subdevices do not need SDF_READABLEH Hartley Sweeten
The SDF_READABLE flag is not necessary for digital output subdevices. For consistency, remove this flag from the comedi drivers that set 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-10-29staging: comedi: das800: use comedi_buf_write_samples()H Hartley Sweeten
Use comedi_buf_write_samples() instead of cfc_write_to_buffer() to add the single sample to the async buffer. The core will add the COMEDI_CB_BLOCK event when data is written to the async buffer. Remove the unnecessary event from the driver. 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-10-20staging: comedi: das800: use comedi_handle_events()H Hartley Sweeten
cfc_handle_events() is just a wrapper around comedi_handle_events(). 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-09-11staging: comedi: das800: replace comedi_board() callsIan Abbott
The `comedi_board(dev)` inline function calls just return `dev->board_ptr`. Expand the inline function calls. 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-07-21staging: comedi: drivers: remove unnecessary *_SIZE definesH Hartley Sweeten
Some of the legacy comedi drivers have a *_SIZE define that is only passed to comedi_request_region() to specify the size of the region. Some of the pnp drivers (pci, etc.) also have a *_SIZE define which is unused. For aesthetics, remove these defines. 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-28staging: comedi: das800: remove 'forever' from private dataH Hartley Sweeten
This member of the private data can be determined from the cmd->stop_src. Do that instead. 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-28staging: comedi: das800: add a local var for the comedi_cmd pointerH Hartley Sweeten
For aesthetics, use a local variable to access the comedi_cmd as a pointer in das800_ai_do_cmd() instead of getting to it from the comedi_async pointer. 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-28staging: comedi: das800: use comedi_fc helpers to validate timer argsH Hartley Sweeten
Use the comedi_fc helper cfc_check_trigger_arg_is() to validate the trigger arguments when the source is TRIG_TIMER. All the arguments are unsigned int, change the local variable to an unsigned int and rename it for aesthetic reasons. 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-03staging: comedi: das800: clarify 8254 timer programmingH Hartley Sweeten
Refactor the 8254 timer programming to use the i8254_set_mode() and i8254_write() helpers instead of i8254_load(). This allows us to use the I8254_MODE* defines to clarify the code. The das800_set_frequency() function will not fail. For aesthetics change the return to a void and remove the error handling. 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-03staging: comedi: remove duplicate pointer assignments in attach functionsChristian Engelmayer
Some board pointer are assigned twice via comedi_board() in the comedi low level driver attach functions. Remove the duplicate assignment from the variable definition where the pointer is not used anyway until assigned later in the function when dev->board_ptr, that comedi_board() relies on, is setup correctly. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-22staging: comedi: das800: factor out chanlist checking from (*do_cmdtest)H Hartley Sweeten
Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible with the hardware. For aesthetics, factor out the step 5 code for the analog input async command support. Tidy up the factored out code. To minimize the noise, change the dev_err() to dev_dbg(). 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-03-17staging: comedi: drivers should not clear the async->eventsH Hartley Sweeten
The comedi core resets the async->events in comedi_buf_reset() which is called when the subdevice is restored to an idle state and at the start of an async command. The async->events are also cleared after handling the events in comedi_event(). Drivers should not clear the events manually. 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-03-17staging: comedi: das800: use cfc_handle_events()H Hartley Sweeten
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Also, remove the clearing of the event, comedi_event() does that. In the Kconfig, COMEDI_DAS800 already selects COMEDI_FC. 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-02-14staging: comedi: das800: trigger sources are validated in (*do_cmdtest)H Hartley Sweeten
The trigger sources were already validataed in the (*do_cmdtest) before the (*do_cmd) is called. Refactor the code in das800_ai_do_cmd() to use if/else instead of the switch since the default cases can never be reached. 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>
2014-02-14staging: comedi: das800: use comedi_timeout()H Hartley Sweeten
Use comedi_timeout() to wait for the analog input end-of-conversion. 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-09-26staging: comedi: 8253.h: tidy up the i8253_cascade_ns_to_timer*() usersH Hartley Sweeten
Introduce a couple defines for the common 8254 oscillator base values used in the comedi drivers and remove the custom defines and open coded values. Change the i8253_cascade_ns_to_timer_2div() calls in the drivers to the more generic i8253_cascade_ns_to_timer(). They are identical due to the #define in the 8253.h header. Remove the extra mask by TRIG_ROUND_MASK of the 'round_mode' parameter to i8253_cascade_ns_to_timer(). That function already handles the mask. Tidy up all the calls to i8253_cascade_ns_to_timer(). 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-09-17staging: comedi: drivers: use comedi_dio_update_state() for simple casesH Hartley Sweeten
Use comedi_dio_update_state() to handle the boilerplate code to update the subdevice s->state for simple cases where the hardware is updated when any channel is modified. Also, fix a bug in the amplc_pc263 and amplc_pci263 drivers where the current state is not returned in data[1]. 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: drivers do not need <linux/ioport.h>H Hartley Sweeten
All the ioport resources are managed by the comedi core. None of the drivers depend on <linux/ioport.h>. Remove the includes. 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: 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-23staging: comedi: das800: cleanup the cio-das802/16 fifo commentsH Hartley Sweeten
Cleanup the comments about the cio-das802/16 specific register defines. This also removes a checkpatch.pl warning about > 80 char lines. 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-23staging: comedi: das800: rename CamelCase vars in das800_ai_do_cmd()H Hartley Sweeten
Rename the CamelCase variables in das800_ai_do_cmd(). For aesthetic reasons, initialize the variables when they are declared. 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-23staging: comedi: das800: tidy up the private dataH Hartley Sweeten
For aesthetic reasons, change the 'do_bits' type to unsigned int to match the subdevice s->state. and change the 'forever' flag to a bool. 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-23staging: comedi: das800: tidy up das800_interrupt()H Hartley Sweeten
Rename the CamelCase variable 'dataPoint'. Cleanup some of the comments and fix the > 80 char lines. Use the das800_ai_get_sample() helper to get the analog input data. Change the fifo flags into bools and make sure to check for the fifo overflow while reading the samples. This also fixes the overflow detection for 12-bit resolutions. In the current code the 'dataPoint' value has been shifted and masked. This could result in fifo_overflow being invalidly true. Remove the need for the 'thisboard' pointer by using the subdevice 'maxdata' to determine the sample size. The devpriv->forever flag is really a bool. Treat it as such. Remove the comedi_error() messages. The user will get the error condition back in the async event. The message is just added noise. 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-23staging: comedi: das800: tidy up das800_ai_insn_read()H Hartley Sweeten
Introduce a couple helper functions to read the 16-bit analog input sample and to wait for the analog conversion to complete. Tidy up the das800_ai_insn_read() function by using the new helpers. Also, remove the need for 'thisboard' in the function by checking the subdevice 'maxdata' variable to determine the analog input resolution. 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-23staging: comedi: das800: tidy up das800_di_insn_bits()H Hartley Sweeten
For digital input subdevices, the (*insn_bits) function simply needs to return the status of the input channels in data[1]. 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-23staging: comedi: das800: tidy up das800_do_insn_bits()H Hartley Sweeten
Use a couple local variables, mask and bits, to clarify this function. Its only necessary to update the outputs if the mask indicates that the bits are changing. Modify this function accordingly. Also, use the subdevice 'state' variable to hold the actual output channel state instead of needing to get it from the private data and shift 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-04-23staging: comedi: das800: remove extra divisor calculation callH Hartley Sweeten
The comedi core always calls the (*do_cmdtest) function before it calls the (*do_cmd) function. The divisors were already calculated in das800_ai_do_cmdtest(), it is not necessary to calculate them again in das800_ai_do_cmd(). 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-23staging: comedi: das800: rename {enable,disable}_das800H Hartley Sweeten
For aesthetic reasons, rename these functions to match the namespace of the rest of the driver. Also, remove the unnecessary comments. 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-23staging: comedi: das800: tidy up subdevice initH Hartley Sweeten
For aesthetic reasons, rename some of the subdevice functions to help with greps and add some whitespace to the subdevice init. 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-23staging: comedi: das800: allow attaching without interrupt supportH Hartley Sweeten
Interrupts are only requires for the analog input async command support. Allow the driver to attach to the board if the request_irq() fails. 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-23staging: comedi: das800: interrupts are required for async command supportH Hartley Sweeten
Interrupt support is optional with this driver. Only hook up the async command support for the analog input subdevice if the user requested an interrupt when attaching to the board. This also allows removing the extra test in das800_ai_do_cmd(). For aesthetic reasons, add some whitespace to the subdevice init. 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-23staging: comedi: das800: tidy up das800_ai_do_cmdtest()H Hartley Sweeten
For aesthetic reasons, move some of the local variables to the place they are actually used. Also, rename the CamelCase 'startChan' local variable. Remove the unnecessary '()' around the variables passed in the i8253_cascade_ns_to_timer_2div() call. Add a local variable, 'next', to hold the cmd->chanlist[i] value used in the loop that checks the channel/gain list. Replace the comedi_error() with dev_dbg() and shorten the messages 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>
2013-04-23staging: comedi: das800: remove 'volatile' on private data variablesH Hartley Sweeten
As indicated by checkpatch.pl, "WARNING: Use of volatile is usually wrong: ...". The variables in the private data that are marked volatile don't need to be. Remove the volatile. Also, cleanup the comments to avoid > 80 char lines. 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-23staging: comedi: das800: cleanup the boardinfoH Hartley Sweeten
For aesthetic reasons, name the enum used for the boardinfo indexes and change them to uppercase with the prefix BOARD_. Add some whitespace to the boardinfo declaration and use the enum values to clarify the table. Tidy up the das800_probe() function and only output a dev_dbg() message if a board model is actually probed. If the user provided the correct boardname when attaching to this driver the message is just added noise. For the 'default' case when checking the proded id, output the id_bits and return -EINVAL. It should not be assumed that unknown boards will work with this driver. 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-23staging: comedi: das800: cleanup range table declarationsH Hartley Sweeten
Use the BIP_RANGE and UNI_RANGE macros to define the range tables instead of the more generic RANGE macro. Tidy up the whitespace of the tables. 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-23staging: comedi: das800: introduce das800_ind_{write, read}()H Hartley Sweeten
The GAS800_GAIN register contains some bits that enable indirect writing to additional registers on the board through iobase + 2 and indirect reading of addition registers through iobase + 7. Introduce some helper functions to handle the indirect register write/read. 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-23staging: comedi: das800: remove forward declarationsH Hartley Sweeten
Move the das800_cancel() and das800_interrupt() functions to remove the need for the remaining forward declarations. 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>