YAMANE Toshiaki [Wed, 14 Nov 2012 10:28:54 +0000 (19:28 +0900)]
staging/omapdrm: Fix spacing coding style in omap_connector.c
The following warnings fixed.
- WARNING: braces {} are not necessary for any arm of this statement
- WARNING: braces {} are not necessary for single statement blocks
Stefan Hajnoczi [Wed, 14 Nov 2012 07:50:44 +0000 (08:50 +0100)]
staging: line6: drop MIDI dumping code
ALSA amidi(1) and aseqdump(1) can be used to dump MIDI instead of
manually dumping MIDI messages in the driver. The advantage of using
these existing tools is that can be used at run-time rather than
compile-time.
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Hajnoczi [Wed, 14 Nov 2012 07:50:41 +0000 (08:50 +0100)]
staging: line6: drop control URB dumping code
The usbmon feature should be used instead of manually dumping control
URBs. There are a few advantages to using usbmon:
* Can be turned on/off at runtime
* Provides full USB-level traffic
* tcpdump and wireshark support for powerful analysis
* No driver-specific code is required
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 13:10:40 +0000 (13:10 +0000)]
staging: comedi: use inlines for PCI/USB auto config
Apart from the somewhat unnecessary `BUG_ON()` calls,
`comedi_pci_auto_config()` and `comedi_usb_auto_config()` are just
one-line wrappers around `comedi_auto_config()`, and
`comedi_pci_auto_unconfig()` and `comedi_usb_auto_unconfig()` are just
one-line wrappers around `comedi_auto_unconfig()`. Convert them to
inline functions and remove the `BUG_ON()` calls.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 13:10:39 +0000 (13:10 +0000)]
staging: comedi: remove attach_pci and attach_usb handlers
No comedi drivers set the `attach_pci()` or `attach_usb()` handlers in
their `struct comedi_driver` any longer as they have all been replaced
with an `auto_attach()` handler. Also, no code calls the `attach_pci()`
or `attach_usb()` handlers any longer. Remove them from `struct
comedi_driver`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 13:10:38 +0000 (13:10 +0000)]
staging: comedi: simplify comedi_auto_attach()
`comedi_auto_config()` just calls internal function
`comedi_auto_config_helper()`, passing it a wrapper function
`comedi_auto_config_wrapper()` to handle the specifics of checking and
calling the low-level comedi driver's `auto_attach()` handler.
Since there are no other callers of `comedi_auto_config_helper()` or
`comedi_auto_config_wrapper()`, combine everything into the single
exported function `comedi_auto_config()`.
Change the ordering of the check for existence of the low-level comedi
driver's `auto_attach()` handler and the allocation of the comedi minor
device number. This means the log message warning of the absence of the
handler now has to be refer to the hardware device instead of the
not-yet-allocated comedi device.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 13:10:37 +0000 (13:10 +0000)]
staging: comedi: don't check driver->auto_attach
There is no need for `comedi_pci_auto_config()` and
`comedi_usb_auto_config()` to check that `driver->auto_attach` is
non-null before calling `comedi_auto_attach()` as this check is done by
`comedi_auto_config()` itself (actually by
`comedi_auto_config_wrapper()`). Remove the unnecessary checks.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 13:10:36 +0000 (13:10 +0000)]
staging: comedi: don't call attach_usb handler
All the Comedi drivers that call `comedi_usb_auto_config()` have
replaced the `attach_usb()` handler in their `struct comedi_driver` with
a `auto_attach()` handler, so there is no need to check for the
existence of the `attach_usb()` handler any more. Remove this check and
the code that calls it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 13:10:35 +0000 (13:10 +0000)]
staging: comedi: don't call attach_pci handler
All the Comedi drivers that call `comedi_pci_auto_config()` have
replaced the `attach_pci()` handler in their `struct comedi_driver` with
a `auto_attach()` handler, so there is no need to check for the
existence of the `attach_pci()` handler any more. Remove this check and
the code that calls it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 13:10:34 +0000 (13:10 +0000)]
staging: comedi: remove old auto-config
All the Comedi drivers that call `comedi_pci_auto_config()` or
`comedi_usb_auto_config()` define a `auto_attach()` handler in their
`struct comedi_driver`. There is no need to fall back to abusing the
`attach()` handler any more, so remove the code that supports that.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 14 Nov 2012 11:22:55 +0000 (11:22 +0000)]
staging: comedi: define operations for INSN_CONFIG_DIGITAL_TRIG
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>
Ian Abbott [Wed, 14 Nov 2012 11:22:57 +0000 (11:22 +0000)]
staging: comedi: check data length for INSN_CONFIG_DIGITAL_TRIG
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>
Ian Abbott [Wed, 14 Nov 2012 11:22:56 +0000 (11:22 +0000)]
staging: comedi: addi_apci_1032: conform to new INSN_CONFIG_DIGITAL_TRIG
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>
staging: comedi: comedi_fc.h: introduce new helpers for do_cmdtest step 3
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>
This function is used by the watchdog subdevice to "ping" the watchdog.
Rename the CamelCase function to apci1516_wdog_insn_write.
Currently this function does not follow the comed API. INSN_WRITE functions
are supposed to write insn->n values. Also, starting and stopping the
watchdog is handled by the INSN_CONFIG function.
Fix this function so it works like the comedi core expects. Also, since
the watchdog needs to be enabled in order to "ping" it, make sure it is
enabled before writing to 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>
This function is used by the watchdog subdevice to enable/disable and
set the timeout for the watchdog. Rename the CamelCase function to
apci1516_wdog_insn_config.
Currently this function does not follow the comed API. Recode it so
it works like the core expects. data[0] is the configuration id code
(INSN_CONFIG_*) for the configuration instruction. Two instructions
are supported:
INSN_CONFIG_ARM: enables the watchdog and sets the timeout value
INSN_CONFIG_DISARM: disables the watchdog
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>
This function is used by the watchdog subdevice to read the status of
the watchdog. Rename the CamelCase function to apci1516_wdog_insn_read
and fix the function to return the status value insn->n times like
the comedi core expects.
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>