The analog output, offset calib, and gain calib subdevices all use similar
(*insn_write) functions. The onyl difference is the 'mode' that is passed
to the set_dac() helper.
Introduce a new (*insn_write) function that can be used by all the subdevices.
Use the s->private member to pass the 'mode' needed by set_dac(). Remove the
subdevice specific (*insn_write) functions.
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: adv_pci1724: use subdevice readback for 'gain_value'
Use the comedi_subdevice 'readback' member and the core provided (*insn_read)
to handle the readback of the write-only gain calib subdevice. Remove the
then unused 'gain_value' member from the private data.
The private data is now unnecessary. Remove it and the allocation.
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: adv_pci1724: use subdevice readback for 'offset_value'
Use the comedi_subdevice 'readback' member and the core provided (*insn_read)
to handle the readback of the write-only offset calib subdevice. Remove the
then unused 'offset_value' member from the private data.
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: adv_pci1724: use subdevice readback for 'ao_value'
Use the comedi_subdevice 'readback' member and the core provided (*insn_read)
to handle the readback of the write-only analog output subdevice. Remove the
then unused 'ao_value' member from the private data.
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>
Introduce a helper function to set the analog input acquisition mode.
This will be needed when the (*do_cmd) function is completed to support
async commands.
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>
Some comedi drivers allow the `scan_end_arg` value of an asynchronous
command to be a multiple (> 1) of the `chanlist_len` although most
require them to be the same value.
`comedi_bytes_per_scan()` is incorrectly using `chanlist_len` as the
length of the scan. Change it to use `scan_end_arg`.
`comedi_nsamples_left()` is incorrectly using `cur_chan` as the current
sample position in the scan (it is actually the current position in the
channel list). Change it to use the actual sample position in the scan.
(Unfortunately we only have the current scan position in bytes currently,
so convert that to a sample position.)
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>
For aesthetics, rename this define used for the Interrupt and A/D Clock Control
and Status register. Also, rename the defines for the bits of 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 this define used for the A/D Status register. Also,
rename the defines for the bits of the register.
The probe code in dmm32at_reset() checks this register to make sure the
S/D1 and S/D0 bits are set. This check actually verifies that the board is
configured (with jumpers on the board) with all the Analog Input channels
operating in single-ended mode. Add a comment about this.
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 this define used for the Auxillary Digital Output
register. This register is currently not used in the driver. Document the
bits of the register for completeness.
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: dmm32at: use 8255 module for Digital I/O subdevice
The Dimond-MM-32-AT board uses an internal 82C55-type digital I/O circuit to
provide the 24 digital I/O lines. The only quirk is the need to set the page
selection bits in the control register to select page 1 addresses.
Instead of duplicating the 8255 code, provide an (*io) callback and use the
8255 module to support this subdevice.
This also removes the need for the private data in 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>
Introduce a helper function to set the analog input channel scan and range
control registers. Use the new helper in the analog input (*insn_read) and
(*do_cmd) functions.
The extra sanity checks in the (*do_cmd) are not necessary. The cmd->chanlist
will always be valid and the (*do_cmdtest) validates the channel list in
Step 5.
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>
Introduce a helper function to read the two's complement analog input
sample from the hardware and munge it to the offset binary (unsigned)
format that comedi expects. Use the comedi_offset_munge() helper to
munge the data.
Use the new helper in the analog input (*insn_read) and in the interrupt
handler for the async command.
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: dmm32at: make AI (*cancel) actually cancel async command
Currently the AI (*cancel) changes a private data member to cause the
interrupt handler to cancel the async command after the next interrupt.
Move the code that disables the interrupt and terminates the acquisition
from the interrunt handler into dmm32at_ai_cancel() so that the async
command is terminated instantly.
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: adl_pci9111: use comedi_async 'scans_done' to detect EOA
The comedi core now counts the number of samples added to the async buffer and
detects the end-of-scan and increments the comedi_async 'scans_done' counter.
Remove the private data member 'stop_counter' and use the 'scans_done' member
to detect the end-of-acquisition.
This fixes a possible interger overflow when calculating the value of the
'stop_counter' and removes the need to accumulate the 'total' number of
samples added to the async buffer in pci9111_handle_fifo_half_full().
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: adl_pci9118: use comedi_bytes_to_samples()
Remove the assumption of the sample size by using the comedi_bytes_to_samples()
helper function to convert the number of bytes to the number of samples.
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: adl_pci9118: use comedi_async 'scans_done' to detect EOA
The comedi core now counts the number of samples added to the async buffer and
detects the end-of-scan and increments the comedi_async 'scans_done' counter.
Remove the private data member 'ai_act_scan' and use the '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>
staging: comedi: addi_tcw.h: provide generic defines for the ADDI-DATA TCW
The TCW (timer/counter/watchdog) devices in the various ADDI-DATA drivers
use a common register map definition. Provide a common generic define for
these registers so they don't have to be replicated in each 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: addi_apci_1564: fix timer iobase for all PLD revisions
The APCI-1564 has different I/O mapping depending on if the PLD revision
is Rev 1.0 or Rev 2.x.
Add a member, 'timer', to the private data for the base address of the
12-bit timer. Fix the register defines so they will work for all PLD
revisions and initialize the devpriv->timer appropriately.
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: addi_apci_1564: fix dev->iobase for all PLD revisions
The APCI-1564 has different I/O mapping depending on if the PLD revision is
Rev 1.0 or Rev 2.x.
Fix the main register defines so they will work for all PLD revisions and
initialie the dev->iobase appropriately. Move the register defines to the
main driver source file.
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: addi_apci_1564: detect PLD revision for I/O mapping
The APCI-1564 has different I/O mapping depending on if the PLD revision is
Rev 1.0 or Rev 2.x. The revision can be determined by reading the EEPROM
register at offset 0x00 of PCI BAR 0 and checking the value of bits 7 to 4.
Add this check to apci1564_auto_attach(). Currently this driver is coded
to work with the Rev 2.x I/O mapping. For now, fail the attach if a Rev 1.0
PLD is detected. Document the I/O mapping for both revisions.
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: addi_apci_1564: store PCI BAR 1 base address in private data
According to ADDI-DATA, only the PLD Revision 2.x versions of the APCI-1564
have the 3 counters. The base address for these counters is found in PCI BAR 1.
For aesthetics, save this base address in the private data. The dev->iobase
can then be used for the main registers of the board.
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: addi_apci_1564: use correct I/O base for APCI1564_DI_INT_STATUS_REG
The APCI1564_DI_INT_STATUS_REG is located in the PCI BAR 0 I/O space. That
base address is stored in devpriv->amcc_iobase. Use that to correctly read
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>
staging: comedi: addi_apci_1564: board does not use an AMCC PCI controller
According to ADDI-DATA, the APCI-1564 board has a FPGA with a PCI core, it
does not use an AMCC PCI controller chip.
Remove the amcc_s5933.h include as well as the read of the AMCC_OP_REG_INTCSR
register. That offset would actually read APCI1564_WDOG_STATUS_REG register
in the FPGA which has nothing to do with the interrupt status.
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>
A rather obvious typo in one of the identifier has been found. This patch
fixes the typo and ensures any lines changed do not exceed 80 characters
as indicated by scripts/checkpatch.pl
Signed-off-by: Krzysztof Konopko <kris@konagma.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rtw_led.* files include Free Software Foundation's mailing address in
the sample GPL notice. This is not desired and picked when running
scripts/checkpatch.pl.
Signed-off-by: Krzysztof Konopko <kris@konagma.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Markus Elfring [Mon, 24 Nov 2014 21:58:48 +0000 (22:58 +0100)]
staging: olpc_dcon: Deletion of a check before backlight_device_unregister()
The backlight_device_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Fri, 7 Nov 2014 20:44:58 +0000 (22:44 +0200)]
staging: octeon-ethernet: drop multiple NAPI instances
Octeon Ethernet driver is currently trying to wake up multiple
CPU cores for parallel NAPI processing when needed, to cope
with the fact that all network interfaces are handled through
the same receive queue processed by a single core/interrupt
(see http://marc.info/?l=linux-kernel&m=137209784914565&w=2).
This partially overlaps with generic RPS functionality.
Commit a6a39a7fcff5 ("staging: octeon-ethernet: disable load balance
for receiving packet when CONFIG_RPS is enabled") already disabled this
when RPS is enabled. Let's delete this code altogether as it has issues
like packet reordering and potential problems with CPU offlining/onlining.
Tested on EdgeRouter Lite.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Acked-By: David Daney <david.daney@cavium.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>