According to the user's manual, the A/D converter uses 2's complement
coding. Use the comedi_offset_munge() helper to convert the data to
the offset binary format used by comedi.
staging: comedi: mpc624: tidy up the ai conversion speed code
Rename the CamelCase private data 'ulConvertionRate' and MPC624_SPEED_*
defines.
Create a macro to set the OSR bits that set the ai conversion speed and
use it for the various MPC624_SPEED_* defines. Remove the unnecessary
comment describing the speeds, this information is alread in the comedi
driver comment block.
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>
Remove the #if 0'ed out code that would initialize an analog output
subdevice.
The hardware does not normally support an analog output subdevice.
Analog outputs are only supported with additional "piggyback" modules.
Support for these modules is not included in 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>
staging: comedi: multiq3: tidy up multiq3_encoder_insn_read()
Encoders are not a "normal" subdevice in comedi. For aesthetics, tidy
up this function and add a couple comments to clarify the function and
explain the strange munging of the data.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: multiq3: allow user to reset encoder channels
Currently this driver resets all the encoder channels when the driver
is first attached. Add a (*insn_config) to the subdevice to allow the
use to reset the channels manually.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: multiq3: tidy up control register bit defines
For aesthetics, move these defines closer to the register define and
use the BIT macro to define the bits.
Add macros to set the bits needed to select the channel for the analog
output, analog input, and encoder (counter) subdevices as well as the
realtime clock registers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
According to the programming manual. the 'SH' and 'CLK' bits in the
control register need to be kept high at all times. Clarify this by
introducing a helper function to set the control register.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: quatech_daqp_cs: avoid calculating pacer divisor multiple times
The pacer will either be used to trigger each conversion or to start each
scan. Modify the (*do_cmdtest) so that one one divisor calculation is needed.
Save the divisor value in the private data so that the (*do_cmd) does not
have to do the calculation again.
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: quatech_daqp_cs: ai async command requires a pacer
The ai (*do_cmd) assumes that either the convert_src is TRIG_TIMER or
the scan_begin_src is TRIG_TIMER and always programs the pacer clock
with the appropriate trigger argument.
Add a Step 2b check to the (*do_cmdtest) to ensure that at least one
of the triggers is TRIG_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>
staging: comedi: quatech_daqp_cs: cleanup Step 3 of ai (*do_cmdtest)
Step 3 of the (*do_cmdtest) trivially validates the async command arguments.
The validations also modify the arguments if they are invalid so that the
user gets valid values if the test fails.
Reorder the checks so that if any of the checks fail proper values are
used for subsequent checks.
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>
Make sure interrupts are disabled and the event flags are cleared when
an analog input async command is canceled.
Remove the unnecessary calls to stop any running conversions in the
(*insn_read) and (*do_cmd) functions. The comedi core will only call
these functions if the subdevice is not busy (it has already been
canceled).
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>
This is a PCMCIA driver and interrupts are always shared. Detect if
the hardware did not produce the interrupt and return IRQ_NONE so
that other drivers might 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>
The interrupt handler is now only used for the ai async command.
Remove the unnecessary 'interrupt_mode' from the private data and
tidy up 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: quatech_daqp_cs: only hook up cmd support if we have an IRQ
Interrupts are only needed by this driver to support the analog input async
commands. Don't hook up the command support if pcmcia_request_irq() fails
instead of completely failing the (*auto_attach).
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: quatech_daqp_cs: don't use interrupts for ai (*insn_read)
The comedi (*insn_read) functions are supposed to do simple one-shot
reading of an analog input channel. Currently this driver enables
interrupts and uses wait_for_completion_interruptible() to allow the
interrupt routine to let the analog input (*insn_read) know that
the end-of-conversion has occured.
Simplify the function by using the comedi_timeout() helper to check
the aux status register to see when the conversion is finished.
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: quatech_daqp_cs: tidy up command register bits
For aesthetics, move the bit defines for this register and use the
BIT macro to define the bits. Define a macro for the scanrate bits
and use it to remove the CamelCase. Rename the defines to match the
register.
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>
For aesthetics, rename the register map defines and convert the
values to hex. Also, move the private data definition and
DAQP_FIFO_SIZE define after the register definitions.
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: quatech_daqp_cs: use comedi_timeout() in ao (*insn_write)
The data link between the D/A data port and the D/A converter is a serial
link. The serial link requires about 8ms to complete a transfer. Use the
comedi_timeout() helper to ensure that there is not a previous transfer
still happening before trying to write new data to the channel.
For aesthetics, save the readback value after updating the hardware.
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>
Paul Gortmaker [Sun, 11 Oct 2015 19:47:34 +0000 (15:47 -0400)]
drivers/staging: make emxx_udc.c explicitly non-modular
The Kconfig currently controlling compilation of this code is:
drivers/staging/emxx_udc/Kconfig:config USB_EMXX
drivers/staging/emxx_udc/Kconfig: bool "EMXX USB Function Device Controller"
...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.
Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.
The .remove function was declared __exit, so it wouldn't have been
available for a sysfs bind/unbind anyway, so lets be explicit here and
use ".suppress_bind_attrs = true" to prevent root from doing something
silly.
We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.
Cc: Vincenzo Scotti <vinc94@gmail.com> Cc: Haneen Mohammed <hamohammed.sa@gmail.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Roberta Dobrescu <roberta.dobrescu@gmail.com> Cc: Tapasweni Pathak <tapaswenipathak@gmail.com> Cc: Peter Chen <peter.chen@freescale.com> Cc: Robert Baldyga <r.baldyga@samsung.com> Cc: Chris Rorvick <chris@rorvick.com> Cc: "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Gortmaker [Sun, 11 Oct 2015 19:47:30 +0000 (15:47 -0400)]
drivers/staging: make android tegra_ion.c properly tristate
The Kconfig currently controlling compilation of this code is:
drivers/staging/android/ion/Kconfig:config ION_TEGRA
drivers/staging/android/ion/Kconfig: tristate "Ion for Tegra"
...which led me to incorrectly conclude this file was built modular
earlier. However the above CONFIG is just used to enter the dir and
once we do enter that dir, we see the build is unconditional:
...meaning that it currently is not being built as a module by anyone.
However, given that the Kconfig did explicitly choose tristate, and that
the dummy ion driver is (functionally) tristate, I chose to make the
Makefile do the right thing for it to build as a module.
After this change, on an ARM allmodconfig, we see:
CC [M] drivers/staging/android/ion/tegra/tegra_ion.o
so it does build OK as a module. I can't vouch for the modular
functionality however, so consider this compile tested only.
Sudip Mukherjee [Sun, 4 Oct 2015 15:49:20 +0000 (21:19 +0530)]
staging: dgap: remove unused configuration
The IO configuration was not used to configure the board. It was only
read from the configuration file. Stop reading it and also remove the
other related variables defined for it.
A check using 'sparse' shows warnings in linux_wlan_spi.c:
drivers/staging/wilc1000/linux_wlan_spi.c:43:19: warning: symbol 'wilc_spi_dev' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:71:19: warning: symbol 'wilc_bus' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:95:5: warning: symbol 'linux_spi_init' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:195:5: warning: symbol 'linux_spi_write' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:320:5: warning: symbol 'linux_spi_read' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:365:5: warning: symbol 'linux_spi_write_read' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:402:5: warning: symbol 'linux_spi_set_max_speed' was not declared. Should it be static?
Let's avoid it by including "linux_wlan_spi.h" header.
Signed-off-by: Stanislav Kholmanskikh <kholmanskikh.s.s@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>