[PATCH 13/15] staging: comedi: addi_apci_1564: use addi_tcw.h defines for counters

2014-11-10 Thread H Hartley Sweeten
Use the generic TCW (timer/counter/watchdog) defines for the 32-bit counters. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 35 -- drivers/staging/comedi/drivers/addi_apci_1564.c| 35

[PATCH] staging: comedi: adl_pci9111: use comedi_async 'scans_done' to detect EOA

2014-11-10 Thread H Hartley Sweeten
sition. 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 Cc: Ian Abbott Cc: Greg

[PATCH 0/4] staging: comedi: adl_pci9118: tidy up AI acquisition

2014-11-10 Thread H Hartley Sweeten
Use the comedi_async 'scans_done' to detect the EOA and tidy up the DMA code a bit. H Hartley Sweeten (4): staging: comedi: adl_pci9118: use comedi_async 'scans_done' to detect EOA staging: comedi: adl_pci9118: absorb move_block_from_dma() staging: come

[PATCH 3/4] staging: comedi: adl_pci9118: use comedi_bytes_to_samples()

2014-11-10 Thread H Hartley Sweeten
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 Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adl_pci9118.c | 4 +--- 1 file

[PATCH 4/4] staging: comedi: adl_pci9118: switch DMA buffers after writing samples

2014-11-10 Thread H Hartley Sweeten
after writing the samples. The driver will detect the EOA event and not retart the DMA. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adl_pci9118.c | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff

[PATCH 2/4] staging: comedi: adl_pci9118: absorb move_block_from_dma()

2014-11-10 Thread H Hartley Sweeten
Absorb this simple helper function into interrupt_pci9118_ai_dma(). Remove the unnecessary local variables 'sampls' and 'm'. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adl_pci9118.c | 24 +++-

[PATCH 1/4] staging: comedi: adl_pci9118: use comedi_async 'scans_done' to detect EOA

2014-11-10 Thread H Hartley Sweeten
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-acquisit

[PATCH 08/30] staging: comedi: dmm32at: tidy up cmd->convert_{src, arg} validation

2014-11-11 Thread H Hartley Sweeten
This driver only supports a single convert_src, TRIG_TIMER. Tidy up the (*do_cmdtest) validation of the cmd->convert_{src,arg}. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 40 +++- 1 f

[PATCH 25/30] staging: comedi: dmm32at: rename DMM32AT_INTCLOCK

2014-11-11 Thread H Hartley Sweeten
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 Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 28

[PATCH 04/30] staging: comedi: dmm32at: tidy up dmm32at_ai_rinsn()

2014-11-11 Thread H Hartley Sweeten
nsn->n' to clarify the return value. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 33 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/drivers/staging/comedi/drivers/

[PATCH 05/30] staging: comedi: dmm32at: introduce dmm32at_reset()

2014-11-11 Thread H Hartley Sweeten
For aesthetics, factor the board reset and detection code out of the (*attach) function. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 64 ++-- 1 file changed, 36 insertions(+), 28 deletions

[PATCH 01/30] staging: comedi: dmm32at: make AI (*cancel) actually cancel async command

2014-11-11 Thread H Hartley Sweeten
terminated instantly. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers

[PATCH 20/30] staging: comedi: dmm32at: define the FIFO Depth register

2014-11-11 Thread H Hartley Sweeten
This driver currently does not use the FIFO. For completeness, define the offset to the FIFO Depth register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging

[PATCH 23/30] staging: comedi: dmm32at: rename DMM32AT_CNTRL

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the Miscellaneous Control register. Also, rename the defines for the bits of the register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 25 - 1 file

[PATCH 15/30] staging: comedi: dmm32at: rename DMM32AT_AUXDOUT

2014-11-11 Thread H Hartley Sweeten
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 Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers

[PATCH 11/30] staging: comedi: dmm32at: introduce dmm32at_ai_set_chanspec()

2014-11-11 Thread H Hartley Sweeten
est) validates the channel list in Step 5. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 53 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c

[PATCH 13/30] staging: comedi: dmm32at: rename DMM32AT_CONV

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the Start A/D Conversion register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 21/30] staging: comedi: dmm32at: rename DMM32AT_FIFOCNTRL

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the FIFO Control register. Also, rename the defines used for the bits of this register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 17 - 1 file changed, 8

[PATCH 00/30] staging: comedi: dmm32at: cleanup driver

2014-11-11 Thread H Hartley Sweeten
Here's the big cleanup series for the dmm32at comedi driver. H Hartley Sweeten (30): staging: comedi: dmm32at: make AI (*cancel) actually cancel async command staging: comedi: dmm32at: use comedi_async 'scans_done' to detect EOA staging: comedi: dmm32at: introduce dmm3

[PATCH 22/30] staging: comedi: dmm32at: rename DMM32AT_FIFOSTAT

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the FIFO Status register. Define the bits of the register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions

[PATCH 19/30] staging: comedi: dmm32at: rename DMM32AT_DACMSB_CHAN

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used to set the DACH[10] bits in the DAC MSB register to select the D/A channel. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 06/30] staging: comedi: dmm32at: tidy up subdevice initialization

2014-11-11 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice initialization. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 58 +++- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a

[PATCH 02/30] staging: comedi: dmm32at: use comedi_async 'scans_done' to detect EOA

2014-11-11 Thread H Hartley Sweeten
Remove the private data member 'ai_scans_left' and use the comedi_async 'scans_done' to detect the end-of-acquisition. This also removes the artifical max limit on the cmd->stop_arg. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers

[PATCH 14/30] staging: comedi: dmm32at: rename DMM32AT_AI[LM]SB

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename these defines used for the A/D LSB/MSB registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 28/30] staging: comedi: dmm32at: rename DMM32AT_AIRBACK

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the Analog I/O Readback register. Define the bits of the register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 15 ++- 1 file changed, 10 insertions(+), 5

[PATCH 18/30] staging: comedi: dmm32at: rename DMM32AT_DACSTAT

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the Status / Auxillary Digital Inputs register. Document the bits in the register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 15 +-- 1 file changed, 9 insertions

[PATCH 10/30] staging: comedi: dmm32at: remove unused members of the private data

2014-11-11 Thread H Hartley Sweeten
The 'data' and 'ai_inuse' members in the private data are not used in the driver. Remove them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dr

[PATCH 16/30] staging: comedi: dmm32at: rename DMM32AT_AI{LOW,HIGH}

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename these defines used for the A/D Low/High Channel registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH 24/30] staging: comedi: dmm32at: rename DMM32AT_AISTAT

2014-11-11 Thread H Hartley Sweeten
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 Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 23 +++ 1 file changed, 15 insertions(+), 8

[PATCH 29/30] staging: comedi: dmm32at: tidy up multi-line comments

2014-11-11 Thread H Hartley Sweeten
Reformat the multi-line comments for follow the CodingStyle. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 65 +--- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/drivers

[PATCH 17/30] staging: comedi: dmm32at: rename DMM32AT_DAC[LM]SB

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename these defines used for the D/A LSB/MSB registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 03/30] staging: comedi: dmm32at: introduce dmm32_ai_get_sample()

2014-11-11 Thread H Hartley Sweeten
rrupt handler for the async command. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 40 +--- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at

[PATCH 09/30] staging: comedi: dmm32at: remove dmm32at_ns_to_timer()

2014-11-11 Thread H Hartley Sweeten
This function is not necessary. It simply returns the 'ns' value that was passed to it. Remove it as well as the unnecessary Step 4 check of the cmd->convert_arg. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/d

[PATCH 26/30] staging: comedi: dmm32at: rename DMM32AT_CNTRDIO

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the Counter and Digital I/O Configuration register. Define the bits of the register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 17 ++--- 1 file changed, 10

[PATCH 12/30] staging: comedi: dmm32at: use 8255 module for Digital I/O subdevice

2014-11-11 Thread H Hartley Sweeten
8255 module to support this subdevice. This also removes the need for the private data in this driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/Kconfig | 1 + drivers/staging/comedi/drivers/dmm32at.c | 123

[PATCH 30/30] staging: comedi: dmm32at: update the MODULE_DESCRIPTION

2014-11-11 Thread H Hartley Sweeten
Change the MODULE_DESCRIPTION to something more useful than the generic "Comedi low-level driver". Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 07/30] staging: comedi: dmm32at: tidy up cmd->scan_begin_{src, arg} validation

2014-11-11 Thread H Hartley Sweeten
This driver only supports a single scan_begin_src, TRIG_TIMER. Tidy up the (*do_cmdtest) validation of the cmd->scan_begin_{src,arg}. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 36

[PATCH 27/30] staging: comedi: dmm32at: rename DMM32AT_AICONF

2014-11-11 Thread H Hartley Sweeten
For aesthetics, rename this define used for the Analog Configuration register. Define the bits of the register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 19 +++ 1 file changed, 11 insertions(+), 8

[PATCH 0/4] staging: comedi: das6402: add basic AI async command support

2014-11-12 Thread H Hartley Sweeten
This driver was _really_ broken and had to be rewritten. During that rewrite the async command support was stubbed in but not completed. This series adds support for basic AI async commands. H Hartley Sweeten (4): staging: comedi: das6402: add basic (*do_cmdtest) for AI async commands

[PATCH 3/4] staging: comedi: das6402: read analog input samples in interrupt handler

2014-11-12 Thread H Hartley Sweeten
Currently the interrupt handler just clears the interrupt. Add the code necessary to read the analog input samples when running an async command. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 42

[PATCH 1/4] staging: comedi: das6402: add basic (*do_cmdtest) for AI async commands

2014-11-12 Thread H Hartley Sweeten
Currently the async command support in this driver consists of just the stubbed in functions. Flesh out the (*do_cmdtest) function for basic support of timed analog input acquisitions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers

[PATCH 4/4] staging: comedi: das6402: add (*do_cmd) for AI async commands

2014-11-12 Thread H Hartley Sweeten
Flesh out the (*do_cmd) function to support timed analog input acquisitions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH 2/4] staging: comedi: das6402: introduce das6402_ai_set_mode()

2014-11-12 Thread H Hartley Sweeten
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 Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 31

[PATCH v2 1/4] staging: comedi: das6402: add basic (*do_cmdtest) for AI async commands

2014-11-13 Thread H Hartley Sweeten
Currently the async command support in this driver consists of just the stubbed in functions. Flesh out the (*do_cmdtest) function for basic support of timed analog input acquisitions. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi

[PATCH v2 2/4] staging: comedi: das6402: introduce das6402_ai_set_mode()

2014-11-13 Thread H Hartley Sweeten
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 Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 31

[PATCH v2 4/4] staging: comedi: das6402: add (*do_cmd) for AI async commands

2014-11-13 Thread H Hartley Sweeten
Flesh out the (*do_cmd) function to support timed analog input acquisitions. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a

[PATCH v2 0/4] staging: comedi: das6402: add basic AI async command support

2014-11-13 Thread H Hartley Sweeten
This series adds support for basic AI async commands. v2: fix a debug message in PATCH 1/4 pointed out by Ian Abbott. H Hartley Sweeten (4): staging: comedi: das6402: add basic (*do_cmdtest) for AI async commands staging: comedi: das6402: introduce das6402_ai_set_mode() staging: comedi

[PATCH v2 3/4] staging: comedi: das6402: read analog input samples in interrupt handler

2014-11-13 Thread H Hartley Sweeten
Currently the interrupt handler just clears the interrupt. Add the code necessary to read the analog input samples when running an async command. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 42

[PATCH 05/19] staging: comedi: cb_pcidas64: fix ad8402_write_insn()

2014-11-20 Thread H Hartley Sweeten
like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcidas64.c | 31 1 file changed, 18 insertions(+),

[PATCH 11/19] staging: comedi: cb_pcidas: tidy up dac08_write_insn()

2014-11-20 Thread H Hartley Sweeten
For consistency with the other calib subdevices, refactor this (*insn_write) function so that it only writes the final data value to the hardware., For aesthetics, rename the function so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah

[PATCH 00/19] staging: comedi: more comedi_subdevice 'readback' cleanup

2014-11-20 Thread H Hartley Sweeten
27; memory. A couple of the comedi drivers still use a private (*insn_read), move the hook up after the allocation and add a comment for them. Convert some more comedi drivers to use the comedi_subdevice 'readback'. Tidy up/fix the (*insn_write) functions for the ones that don'

[PATCH 06/19] staging: comedi: cb_pcidas: remove unnecessary check in caldac_8800_write()

2014-11-20 Thread H Hartley Sweeten
The 'address' passed to this function is actually the comedi channel. This value will always be less than the subdevice n_chan (which is 8). Remove the unnecessary sanity check in caldac_8800_write(). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drive

[PATCH 15/19] staging: comedi: ni_labpc_common: use subdevice readback for 'caldac'

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only caldac subdevice. Remove the then unused 'caldac' member from the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman

[PATCH 02/19] staging: comedi: cb_pcidas64: use subdevice readback for 'caldac_state'

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only calibration subdevice. Remove the then unused 'caldac_state' member from the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-H

[PATCH 12/19] staging: comedi: cb_pcidas: use subdevice readback for 'dac08_value'

2014-11-20 Thread H Hartley Sweeten
n the driver, modify the subdevice init so that a loop is used to initialize the channels and readback values. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcidas.c | 32 -- 1 file changed, 13 inserti

[PATCH 08/19] staging: comedi: cb_pcidas: use subdevice readback for 'caldac_value'

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only caldac subdevice. Remove the then unused 'caldac_value' member from the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-H

[PATCH 16/19] staging: comedi: ni_labpc_common: introduce labpc_ao_write()

2014-11-20 Thread H Hartley Sweeten
Introduce a helper function to write a value to a given DAC channel. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_labpc_common.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a

[PATCH 04/19] staging: comedi: cb_pcidas64: use subdevice readback for 'ad8402_state'

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only calibration subdevice. Remove the then unused 'ad8402_state' member from the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-H

[PATCH 13/19] staging: comedi: ni_at_ao: use subdevice readback for 'caldac'

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only caldac subdevice. Remove the then unused 'caldac' member from the private data. Tidy up atao_calib_insn_write(). Signed-off-by: H Hartley Sweeten Cc:

[PATCH 14/19] staging: comedi: ni_labpc_common: move calib readback value check/save to (*insn_write)

2014-11-20 Thread H Hartley Sweeten
Move the check/save of the calib subdevice value to the (*insn_write) function. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_labpc_common.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a

[PATCH 07/19] staging: comedi: cb_pcidas: fix caldac_write_insn()

2014-11-20 Thread H Hartley Sweeten
like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcidas.c | 40 +- 1 file changed, 23 insertions(+),

[PATCH 17/19] staging: comedi: ni_labpc_common: use subdevice readback for analog outputs

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the analog output subdevice. Remove the then unused 'ao_value' member from the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman

[PATCH 03/19] staging: comedi: cb_pcidas64: fix calib_write_insn()

2014-11-20 Thread H Hartley Sweeten
like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcidas64.c | 30 +--- 1 file changed, 18 insertions(+),

[PATCH 09/19] staging: comedi: cb_pcidas: fix trimpot_write_insn()

2014-11-20 Thread H Hartley Sweeten
like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcidas.c | 44 +- 1 file changed, 25 insertions(+),

[PATCH 18/19] staging: comedi: ni_labpc_common: use subdevice readback for eeprom

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the eeprom subdevice. Remove the then unused 'eeprom_data' member from the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- dr

[PATCH 10/19] staging: comedi: cb_pcidas: use subdevice readback for 'trimpot_value'

2014-11-20 Thread H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only trimpot calib subdevice. Remove the then unused 'trimpot_value' member from the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc

[PATCH 19/19] staging: comedi: ni_labpc_common: use comedi_timeout() when writing to eeprom

2014-11-20 Thread H Hartley Sweeten
Use the comedi_timeout() helper to wait for the eeprom to be ready to accept writes and remove the timeout loop in labpc_eeprom_write(). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_labpc_common.c | 37 1

[PATCH 01/19] staging: comedi: drivers: have core hook up default (*insn_read) for readback

2014-11-20 Thread H Hartley Sweeten
he default. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers.c | 3 +++ drivers/staging/comedi/drivers/addi_apci_3120.c | 1 - drivers/staging/comedi/drivers/addi_apci_3501.c | 1 - drivers/staging/comedi/drivers/addi_apci_3

[PATCH 06/19] staging: comedi: adv_pci1724: use comedi_timeout() to wait for DAC idle state

2014-11-20 Thread H Hartley Sweeten
Use the comedi_timeout() helper to wait for the DAC to be idle before writing to it. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 33 +++- 1 file changed, 13 insertions(+), 20 deletions

[PATCH 01/19] staging: comedi: adv_pci1724: use subdevice readback for 'ao_value'

2014-11-20 Thread H Hartley Sweeten
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 Cc: Ian Abbott Cc: Greg Kroah-H

[PATCH 08/19] staging: comedi: adv_pci1724: remove PCI_VENDOR_ID_ADVANTECH define

2014-11-20 Thread H Hartley Sweeten
This define is already in pci_ids.h. Remove the duplicate in this driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c

[PATCH 02/19] staging: comedi: adv_pci1724: use subdevice readback for 'offset_value'

2014-11-20 Thread H Hartley Sweeten
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 Cc: Ian Abbott Cc: Greg Kroah-H

[PATCH 09/19] staging: comedi: adv_pci1724: tidy up the register I/O map

2014-11-20 Thread H Hartley Sweeten
For aesthetics, convert the enum board_registers into defines and rename them so they have namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 24 1 file

[PATCH 13/19] staging: comedi: adv_pci1724: define the board id register bits

2014-11-20 Thread H Hartley Sweeten
For aesthetics, remove the enum and define the bits for this register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 12/19] staging: comedi: adv_pci1724: remove enum sync_output_trigger_contents

2014-11-20 Thread H Hartley Sweeten
This enum is not used in the driver. Remove it. For aesthetics, rename the register define and move the comment that any value will trigger the sync output. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 6 +- 1

[PATCH 03/19] staging: comedi: adv_pci1724: use subdevice readback for 'gain_value'

2014-11-20 Thread H Hartley Sweeten
n. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 46 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers

[PATCH 05/19] staging: comedi: adv_pci1724: introduce adv_pci1724_insn_write()

2014-11-20 Thread H Hartley Sweeten
ass the 'mode' needed by set_dac(). Remove the subdevice specific (*insn_write) functions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 68 1 file changed, 18 insertions(+), 50 del

[PATCH 15/19] staging: comedi: adv_pci1724: remove unnecessary dev_info()

2014-11-20 Thread H Hartley Sweeten
Remove the unnecessary noise at the end of the (*auto_attach). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers

[PATCH 16/19] staging: comedi: adv_pci1724: tidy up the pci_driver declaration

2014-11-20 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the pci_driver declaration. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 17/19] staging: comedi: adv_pci1724: tidy up the comedi_driver declaration

2014-11-20 Thread H Hartley Sweeten
For aesthetics, add some whitespace to the comedi_driver declaration. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 18/19] staging: comedi: adv_pci1724: tidy up multi-line comments

2014-11-20 Thread H Hartley Sweeten
Tidy up the multi-line comments to follow the CodingStyle. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 94 +--- 1 file changed, 44 insertions(+), 50 deletions(-) diff --git a/drivers/staging

[PATCH 10/19] staging: comedi: adv_pci1724: define the dac control register bits

2014-11-20 Thread H Hartley Sweeten
Define the bits for the DAC control register and remove the enum along with the helper functions. Simplify adv_pci1724_insn_write() a bit. The 'ctrl' bits are based on the 'chan' and 'mode' and do not need to be recalculated for each 'val'. Signed-off-b

[PATCH 07/19] staging: comedi: adv_pci1724: absorb set_dac()

2014-11-20 Thread H Hartley Sweeten
Absorb this simple function into adv_pci1724_insn_write(). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 19/19] staging: comedi: adv_pci1724: rename ao_ranges_1724

2014-11-20 Thread H Hartley Sweeten
For aesthetics, rename the analog output comedi_lrange table so it has namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 14/19] staging: comedi: adv_pci1724: absorb setup_subdevices()

2014-11-20 Thread H Hartley Sweeten
For aesthetics, absorb this function into the (*auto_attach). Add some whitespace to the subdevice init. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 83 1 file changed, 35 insertions

[PATCH 11/19] staging: comedi: adv_pci1724: define the sync output control/status reg

2014-11-20 Thread H Hartley Sweeten
Define the bits for the synchronous output control/status register and remove the enum. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a

[PATCH 04/19] staging: comedi: adv_pci1724: remove NUM_AO_CHANNELS define

2014-11-20 Thread H Hartley Sweeten
This define is now only used to set each of the subdevice 'n_chan'. For clarity, remove the define and open code the values. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1724.c | 8 +++- 1 file changed, 3 insert

[PATCH 00/19] staging: comedi: adv_pci1724: cleanup driver

2014-11-20 Thread H Hartley Sweeten
Following is the big cleanup for the adv_pci1724 driver. H Hartley Sweeten (19): staging: comedi: adv_pci1724: use subdevice readback for 'ao_value' staging: comedi: adv_pci1724: use subdevice readback for 'offset_value' staging: comedi: adv_pci1724: use subdevice read

[PATCH v2 01/19] staging: comedi: drivers: have core hook up default (*insn_read) for readback

2014-11-21 Thread H Hartley Sweeten
ack to the comedi_readback_insn_read() helper to provide the readback. Have the core automatically hook up the (*insn_read) callback after allocating the memory if the driver has not already hooked it up to a private function. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartm

[PATCH 05/11] staging: comedi: adv_pci1723: use comedi_subdevice readback for 'ao_data'

2014-11-21 Thread H Hartley Sweeten
r aesthetics, rename the (*insn_write) function and tidy it up a bit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 57 +--- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/dr

[PATCH 01/11] staging: comedi: adv_pci1723: tidy up register map

2014-11-21 Thread H Hartley Sweeten
For aesthetics, rename the defines used for the register map offsets and remove the unnecessary comments. Add the bit defines for the registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 117

[PATCH 02/11] staging: comedi: adv_pci1723: remove private data 'da_range'

2014-11-21 Thread H Hartley Sweeten
This member of the private data is initialized to 0 by pci1723_reset() and is not used any where else in the driver. Remove it. Use the register map defines to set the range for each output channel. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging

[PATCH 07/11] staging: comedi: adv_pci1723: tidy up DIO io_bits initialization

2014-11-21 Thread H Hartley Sweeten
Tidy up the code that determines the initial io_bits (direction) of the digital I/O subdevice and remove the magic numbers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 23 +++ 1 file changed, 7

[PATCH 11/11] staging: comedi: adv_pci1723: remove comedi_device 'write_subdev' init

2014-11-21 Thread H Hartley Sweeten
The comedi_device 'write_subdev' should only be initialized if the subdevice supports async commands. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drive

[PATCH 04/11] staging: comedi: adv_pci1723: absorb pci1723_reset()

2014-11-21 Thread H Hartley Sweeten
ntrol" register in order to load the range setting. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 45 ++-- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/drivers/st

[PATCH 03/11] staging: comedi: adv_pci1723: remove board reset during (*detach)

2014-11-21 Thread H Hartley Sweeten
The pci1723_reset() function simply resets all the analog output channels to 0V and a +/-10V range. This really isn't necessary when detaching the driver. Remove the board reset and just use comedi_pci_detach() directly for the (*detach). Signed-off-by: H Hartley Sweeten Cc: Ian Abbot

[PATCH 09/11] staging: comedi: adv_pci1723: update the MODULE_DESCRIPTION

2014-11-21 Thread H Hartley Sweeten
Update the MODULE_DESCRIPTION to something more useful than the generic "Comedi low-level driver". Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH 00/11] staging: comedi: adv_pci1723: cleanup driver

2014-11-21 Thread H Hartley Sweeten
Following is the big cleanup for the adv_pci1723 driver. H Hartley Sweeten (11): staging: comedi: adv_pci1723: tidy up register map staging: comedi: adv_pci1723: remove private data 'da_range' staging: comedi: adv_pci1723: remove board reset during (*detach) staging: comedi: a

[PATCH 08/11] staging: comedi: adv_pci1723: remove subdevice 'len_chanlist' initialization

2014-11-21 Thread H Hartley Sweeten
The subdevice 'len_chanlist' is only used by subdevices that support async commands. Remove the unnecessary initializations in this driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 4 +--- 1 file

[PATCH 10/11] staging: comedi: adv_pci1723: tidy up multi-line comments

2014-11-21 Thread H Hartley Sweeten
Tidy up the multi-line comments to follow the CodingStyle. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci1723.c | 79 +--- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/drivers/staging

<    1   2   3   4   5   6   7   8   9   10   >