summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-11-15staging: comedi: define operations for INSN_CONFIG_DIGITAL_TRIGIan Abbott
The 'addi_apci_1032' driver recently started supporting the `INSN_CONFIG_DIGITAL_TRIG` configuration instruction, but as no other drivers were using it before, there was no existing practice of how the instruction should look. Define the format to be something a bit more configurable. In particular, a subdevice might have more than one trigger requiring an ID and/or `COMEDI_EV_...` flags to disambiguate them, a trigger might have more than 32 inputs, and a trigger might need several `INSN_CONFIG_DIGITAL_TRIG` configuration instructions to configure completely (if there are more than 32 inputs or if it uses a combination of edge-triggered and level-triggered inputs). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15staging: comedi: check data length for INSN_CONFIG_DIGITAL_TRIGIan Abbott
The newly defined format for the `INSN_CONFIG_DIGITAL_TRIG` configuration instruction expects 6 data values. Check the length in `check_insn_config_length()` before calling the comedi subdevice's `insn_config` handler. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15staging: comedi: addi_apci_1032: conform to new INSN_CONFIG_DIGITAL_TRIGIan Abbott
Conform to the new definition of the `INSN_CONFIG_DIGITAL_TRIG` configuration instruction. Return an error if the 'trigger number' in `data[1]` is non-zero or if the configuration operation in `data[2]` is not supported. Deal with the 'left-shift' amount in `data[3]`. The trigger's input channels can only be configured as a set of rising and falling edges ('OR' mode) or as a set of high and low levels ('AND' mode). Preserve the old input channels to the right of the 'left-shift' value except when switching modes. (The 'left-shift' support is a bit of an overkill for this driver since the trigger only has 16 input channels.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15staging: comedi: ni_mio_common: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of ni_{ai,ao,cdio}_cmdtest(). Note that all the command triggers in ni_cdio_cmdtest are single source so the extra tests are not required. 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-11-15staging: comedi: usbduxsigma: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of usbdux_{ai,ao}_cmdtest(). Also, remove some debug noise. 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-11-15staging: comedi: usbduxfast: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of usbduxfast_ai_cmdtest(). Also, remove some debug noise. 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-11-15staging: comedi: usbdux: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of usbdux_{ai,ao}_cmdtest(). Also, remove some dev_dbg() noise. 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-11-15staging: comedi: skel: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of skel_ai_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-11-15staging: comedi: s626: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of s626_ai_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-11-15staging: comedi: rtd520: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of rtd_ai_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-11-15staging: comedi: quatech_daqp_cs: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of daqp_ai_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-11-15staging: comedi: pcl818: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of ai_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-11-15staging: comedi: pcl816: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pcl816_ai_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-11-15staging: comedi: pcl812: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pcl812_ai_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-11-15staging: comedi: pcl711: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pcl711_ai_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-11-15staging: comedi: ni_tiocmd: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of ni_tio_cmdtest(). Note that cmd->stop_src only has one trigger source so the extra test is not required. 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-11-15staging: comedi: ni_pcidio: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of ni_pcidio_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-11-15staging: comedi: ni_labpc: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of labpc_ai_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-11-15staging: comedi: ni_atmio16d: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of atmio16d_ai_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-11-15staging: comedi: ni_at_a2150: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of a2150_ai_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-11-15staging: comedi: gsc_hpdi: cleanup step 3 of me4000_ai_do_cmd_test()H Hartley Sweeten
Remove the dev_err() noise and convert the error handling to the normal form (err |= -EINVAL) used in the do_cmdtest functions. 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-11-15staging: comedi: gsc_hpdi: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of di_cmd_test(). 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-11-15staging: comedi: dt3000: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of dt3k_ai_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-11-15staging: comedi: dt282x: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of dt282x_{ai,ao}_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-11-15staging: comedi: dt2814: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of dt2814_ai_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-11-15staging: comedi: dmm32at: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of dmm32at_ai_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-11-15staging: comedi: das1800: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of das1800_ai_do_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-11-15staging: comedi: das16m1: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of das16m1_cmd_test(). 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-11-15staging: comedi: das16: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of das16_cmd_test(). 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-11-15staging: comedi: cb_pcidas: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of cb_pcidas_{ai,ao}_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-11-15staging: comedi: cb_das16_cs: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of das16cs_ai_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-11-15staging: comedi: amplc_pci230: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pci230_{ao,ai}_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-11-15staging: comedi: amplc_pci224: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pci224_ao_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-11-15staging: comedi: adv_pci1710: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pci171x_ai_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-11-15staging: comedi: adl_pci9118: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pci9118_ai_do_cmd_test(). 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-11-15staging: comedi: adl_pci9111: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pci9111_ai_do_cmd_test(). 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-11-15staging: comedi: hwdrv_apci3120: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of i_APCI3120_CommandTestAnalogInput(). 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-11-15staging: comedi: comedi_test: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of waveform_ai_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-11-15staging: comedi: das800: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of das800_ai_do_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-11-15staging: comedi: pcm_common: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of comedi_pcm_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-11-15staging: comedi: ni_65xx: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of ni_65xx_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-11-15staging: comedi: ni_6527: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of ni6527_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-11-15staging: comedi: amplc_pc236: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of pc236_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-11-15staging: 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-11-15staging: comedi: addi_apci_1032: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of apci1032_cos_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-11-15staging: comedi: comedi_parport: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of parport_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-11-15staging: comedi: 8255: use cfc_check_trigger_arg_*() helpersH Hartley Sweeten
Use the new helpers in the step 3 tests of subdev_8255_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-11-15staging: comedi: comedi_fc.h: introduce new helpers for do_cmdtest step 3H Hartley Sweeten
Step 3 of the do_cmdtest functions validates the arguments for the command to be executed. Most of these are simple tests to see if the argument "is" a value, a "min" value, or a "max" value. Each of these tests then clamps the argument to the value if it fails the test. Introduce three new helper functions in comedi_fc.h to handle these tests and remove the boilerplate code from the drivers. The new helper functions are: cfc_check_trigger_arg_is() - argument must be == the value cfc_check_trigger_arg_min() - argument must be >= the value cfc_check_trigger_arg_max() - argument must be <= the value All of these helpers set the argument to the value and return -EINVAL if the validation fails. 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-11-13staging: comedi: Kconfig: remove VIRT_TO_BUS depends onH Hartley Sweeten
The only addi-data driver that uses virt_to_bus is addi_apci_3120. Remove the depends on for the other addi-data 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-11-13staging: drm/omap: Fix usage of IS_ERR_OR_NULL and PTR_ERRAndy Gross
Return PTR_ERR(-ENOMEM) if dmm_txn_init cannot allocate a refill engine. Signed-off-by: Andy Gross <andy.gross@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>