Current implementation assumes HZ = 1000 for calculating
all internal timer intervals, which creates problem on
platforms where HZ != 1000.
As well we need resolution of less than 10 mSec for heartbeat
calculation, this creates problem on some platforms where HZ is
configured as HZ = 100, or around, which restricts us to timer interval
of 10 mSec. This is particularly found on embedded devices.
This patch moves on to use high resolution timers to calculate
all timer intervals as it allows us to have very small resolution
of timer interval, removing dependency on HZ.
staging: comedi: allow ISA and PC/104 drivers on non-ISA systems
Embedded systems with a PC/104 bus might have a configuration that
does not have ISA enabled. This creates a problem in Comedi where
the PC/104 drivers cannot be enabled.
Remove the 'depends on ISA' for the "Comedi ISA and PC/104 drivers"
menu to allow the user to select these drivers on non-ISA systems.
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>
staging: comedi: usbduxsigma: init 'pwm_buf_sz' in usbduxsigma_auto_attach()
Initialize this variable with then_ai_urbs and n_ao_urbs in the
attach. Then usbduxsigma_alloc_usb_buffers() can just check the
variable to determine if the urb needs to be allocated.
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>
staging: comedi: usbduxsigma: 'dac_commands' does not need to be kzalloc()'d
The 'dac_commands' buffer is used to pass the ao channel list from
usbduxsigma_ao_cmd() to the urb callback, usbduxsigma_ao_urb_complete().
This buffer does not need to be allocated.
Change it into a simple array of the correct size. Rename the variable
to 'ao_chanlist' to clarify what it actually is.
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>
staging: comedi: usbduxsigma: return void from usbduxsigma_pwm_pattern()
This function never fails and currently returns '1' so that the
usbduxsigma_pwm_write() function returns to proper value (insn->n).
It's also called by usbduxsigma_pwm_config() which also returns the
'1' value. The proper return code for this function should be '0' to
indicate success.
Change the return type of the function to void and just have the
callers return the proper values.
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>
Eli Billauer [Wed, 31 Jul 2013 08:22:43 +0000 (11:22 +0300)]
staging: xillybus: Fixed sparse errors
Changes:
* xillybus.h: __iomem added to struct xilly_endpoint -> registers to suppress
"different address spaces" errors.
* xillybus_core.c: __user added as required for the same reason.
* The two member names of struct xilly_endpoint_hardware of the form
sync_single_for_{cpu,device} were changed to something that won't look
like the well-known functions.
* All *.c files: Variables and functions made static as required.
staging: comedi: das16: remove an unnecessary check in the attach
If the user does not specify the analog output range the private data
'user_ao_range_table' will not be allocated. The comedi core will detect
the NULL s->range_table and automatically set it to &range_unknown.
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>
The function das16_reset() needs a valid dev->iobase. Since the iobase
is requested after the devpriv has been allocated in the attach, move
the das16_reset() call into the if (devpriv) and add a if (dev->iobase).
Also, move the release of the extra iobase into the if (devpriv) to
prevent an invalid memory access.
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>
staging: comedi: das16: fail attach if board id is incorrect
This driver probes the board id during the attach to ensure that the
user is attempting to attach to the correct board type. Currently an
error message is output if the ids are not consistent but the attach
continues anyway.
Make the attach fail if the id bits do not match. Also, cleanup the
printk messages and use a dev_err() only if the probe 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>
staging: comedi: das16: tidy up 8255 digital i/o subdevice
The 8255 digital i/o subdevice is only available on some of the boards
supported by this driver. Currently the 'i8255_offset' member of the
boardinfo is used to indicate that it is available.
To clarify this support, add a 'has_8255' bit-field flag to the boardinfo.
We can then use this flag to conditionally allocate the space for the
subdevice only when it is needed.
Also, make sure to check that subdev_8255_init() is successful and propagate
any errors.
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>
staging: comedi: das16: remove 'volatile' on private data variables
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.
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>
staging: comedi: das16: cleanup analog output subdevice
All the boards supported by this driver that have analog outputs use
the same function to handle the (*insn_write) for the subdevice. They
all also have 12-bit resolution (maxdata = 0x0fff).
Remove the 'ao' and 'ao_nbits' members from the boardinfo and replace
them with a simple bit-field flag 'has_ao'.
Tidy up the subdevice init a bit as well as the (*insn_write) 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>
staging: comedi: das16: all supported board have digital outputs
All the boards supported by this driver have digital outputs and all
of then use the same function to handle the (*insn_bits) for the
subdevice.
Remove the 'do_' member from the boardinfo and always initialize the
digital output subdevice during the board attach.
Tidy up the subdevice init a bit as well as the (*insn_bits) function.
Remove SDF_READABLE from the subdev_flags. This is a pure digital output
subdevice and the outputs are not readable.
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>
staging: comedi: das16: fix DMA init during board attach
DMA support is optional in this driver. To enable it, the user
passes the desired DMA channel during the board attach. A timer
is then used by the driver to periodically get the analog input
data from the DMA.
Since the DMA support is optional, modify the init code so that
it only fails if the DMA channel is unavailable or the DMA buffers
can not be allocated. Don't fail just because the user passed an
invalid DMA channel (only DMA channels 1 and 3 are valid).
Remove the printk() noise about the DMA. Change the printk() when
the request_dma() fails into a dev_err().
Move the timer initialization so it's only setup if DMA is available.
It's not needed otherwise. Also, only hook up the subdevice command
support functions if DMA is available. This allows removing a couple
sanity checks in the command support.
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>
As noted in the driver, a timer is always used by this driver to handle
the DMA because samples could be dropped while waiting for the DMA done
interrupt.
Remove the irq setup code as well as the interrupt handler.
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>
staging: comedi: das16: "timer_mode" is always used for DMA
As noted in the driver, a timer is always used by this driver to handle the
DMA due to buggy DMA controllers and the lack of a hardware fifo in some of
the supported boards.
Remove all the non-timer mode specific 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>
staging: olpc_dcon: provide detailed FB_OLPC_DCON help section
The FB_OLPC_DCON help section is to short according to checkpatch.pl.
We want more information about the controller type, its task, its video
pipeline position and so on.
There are no style issues, remove checkpatch.pl TODO entry.
Aaro Koskinen [Mon, 29 Jul 2013 17:07:56 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete duplicated documentation from .h file
Delete duplicated function call documentation from the .h file. These
functions are just internal anyway, and the .h file will be completely
removed in the future when the driver will be made a single self-contained
.c file.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix most of the whitespace issues reported by checkpatch:
- use tabs for indentation
- brace placement vs. newlines
- (foo_t*) -> (foo_t *)
- i=0 -> i = 0
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Mon, 29 Jul 2013 17:07:47 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: utilize Linux error codes
Use generic Linux error codes to replace cvmx_usb_status_t.
The conversion table:
Before After
cvmx_usb_status_t int
CVMX_USB_SUCCESS 0
CVMX_USB_INVALID_PARAM -EINVAL
CVMX_USB_NO_MEMORY -ENOMEM
CVMX_USB_BUSY -EBUSY
CVMX_USB_TIMEOUT -ETIMEDOUT
CVMX_USB_INCORRECT_MODE Deleted (was never used)
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>