[PATCH 075/108] staging: comedi: addi_apci_3120: remove private data 'b_ExttrigEnable'

2014-11-04 Thread H Hartley Sweeten
This member of the private data is not really needed. The devpriv-ctrl value can be checked to determine if the external trigger is enabled. Remove the unnecessary member. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman

[PATCH 033/108] staging: comedi: addi_apci_3120: remove devpriv-mode '0xef' magic value

2014-11-04 Thread H Hartley Sweeten
This mask value is the same as APCI3120_DISABLE_TIMER_COUNTER. Use that instead and remove the magic value. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 035/108] staging: comedi: addi_apci_3120: remove APCI3120_DISABLE_WATCHDOG

2014-11-04 Thread H Hartley Sweeten
For aesthetics, remove this define and just use ~APCI3120_ENABLE_WATCHDOG. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 3 +-- 1

[PATCH 030/108] staging: comedi: addi_apci_3120: properly disable interrupts in apci3120_cancel()

2014-11-04 Thread H Hartley Sweeten
The APCI3120_DISABLE_ALL_INTERRUPT define is a mask value used to clear bits in devpriv-b_ModeSelectRegister to disable the interrupt sources. Writing this value directly sets unintended bits. Just set the devpriv-b_ModeSelectRegister to '0' and write that to the register. Signed-off-by: H

[PATCH 010/108] staging: comedi: addi_apci_3120: introduce apci3120_timer_set_mode()

2014-11-04 Thread H Hartley Sweeten
Introduce a helper function to set the operation mode of a timer. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 57 +++---

[PATCH 024/108] staging: comedi: addi_apci_3120: remove unnecessary reset of the scan sequence

2014-11-04 Thread H Hartley Sweeten
The scan sequence does not need to be reset when the driver is attached. Remove the code in apci3120_reset() that does this. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 025/108] staging: comedi: addi_apci_3120: tidy up scan chanlist programming

2014-11-04 Thread H Hartley Sweeten
Define the chanlist register and its bits and tidy up the programming of the scan chanlist. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 38

[PATCH 046/108] staging: comedi: addi_apci_3120: remove interrupt support from ai (*insn_read)

2014-11-04 Thread H Hartley Sweeten
(*insn_read) functions are supposed to do simple polled reads of a single channel. This driver tries to be tricky and allow enabling interrupts in the analog input (*insn_config) to allow the (*insn_read) to read samples with the end-of-conversion interrupt. The (*insn_config) doesn't follow the

[PATCH 071/108] staging: comedi: addi_apci_3120: set scan length/start after programming chanlist

2014-11-04 Thread H Hartley Sweeten
The APCI-3120 documentation says that the PR/PA bits should be set after the chanlist sequence is programmed. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 057/108] staging: comedi: addi_apci_3120: move apci3120_di_insn_bits() to driver source

2014-11-04 Thread H Hartley Sweeten
Move this function from the included hwdrv_apci31210.c source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 012/108] staging: comedi: addi_apci_3120: rename private data 'us_OutputRegister'

2014-11-04 Thread H Hartley Sweeten
Rename this CamelCase member of the private data and tidy up the mask/set of its bits. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 110

[PATCH 038/108] staging: comedi: addi_apci_3120: remove APCI3120_DISABLE_EOS_INT

2014-11-04 Thread H Hartley Sweeten
For aesthetics, remove this define and just use ~APCI3120_ENABLE_EOS_INT. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 7 +++ 1

[PATCH 043/108] staging: comedi: addi_apci_3120: rename APCI3120_WRITE_MODE_SELECT

2014-11-04 Thread H Hartley Sweeten
For aesthetics, rename this define used for the mode register offset. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 42

[PATCH 023/108] staging: comedi: addi_apci_3120: introduce apci3120_clr_timer2_interrupt()

2014-11-04 Thread H Hartley Sweeten
A dummy read of APCI3120_CTR0_REG clears the timer 2 interrupt. Introduce a helper function to clarify this. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 018/108] staging: comedi: addi_apci_3120: introduce apci3120_timer_enable()

2014-11-04 Thread H Hartley Sweeten
Introduce a helper function to enable/disable a timer. The disable of timers 0 and 1 in apci3120_interrupt() is probably not needed. For now use the helper function to make sure the devpriv-ctrl bits are cleared correctly to disable the timers. Signed-off-by: H Hartley Sweeten

[PATCH 054/108] staging: comedi: addi_apci_3120: define status register bits

2014-11-04 Thread H Hartley Sweeten
Define the bits in the status register and use them to clarify the code. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 58

[PATCH 056/108] staging: comedi: addi_apci_3120: move apci3120_do_insn_bits() to driver source

2014-11-04 Thread H Hartley Sweeten
Move this function from the included hwdrv_apci31210.c source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 050/108] staging: comedi: addi_apci_3120: absorb apci3120_interrupt_handle_eos()

2014-11-04 Thread H Hartley Sweeten
Absorb this simple function into apci3120_interrupt(). Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 28 +++--- 1 file

[PATCH 042/108] staging: comedi: addi_apci_3120: define the timer 2 clock select bits

2014-11-04 Thread H Hartley Sweeten
For aesthetics, redefine the bits in the mode register used to select the clock for timer 2. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 015/108] staging: comedi: addi_apci_3120: tidy up APCI3120_ENABLE_TIMER[012]

2014-11-04 Thread H Hartley Sweeten
For aesthetics, replace these defines with a macro that returns the correct bit needed to set the gate bit to enable a timer. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 011/108] staging: comedi: addi_apci_3120: move timer helpers to main driver source

2014-11-04 Thread H Hartley Sweeten
Move the timer read/write and set mode helpers from the included source file into the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 028/108] staging: comedi: addi_apci_3120: move ai range table to driver source

2014-11-04 Thread H Hartley Sweeten
Move the analog input comedi_lrange table from the included hwdrv_apci3120.c source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 041/108] staging: comedi: addi_apci_3120: define the timer 2 operation bits

2014-11-04 Thread H Hartley Sweeten
For aesthetics, redefine the bits in the mode register used to set the operation mode of timer 2. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c

[PATCH 001/108] staging: comedi: addi_apci_3120: introduce apci3120_ns_to_timer()

2014-11-04 Thread H Hartley Sweeten
The timer divisor calculations in this driver are over complicated. There are three timers on the board. They all use the same base clock with a fixed prescaler for each timer. The base clock used depends on the board version and type: APCI-3120 Rev A boards OSC = 14.29MHz base clock (~70ns)

[PATCH 069/108] staging: comedi: addi_apci_3120: tidy up timer 2 programming in apci3120_ai_cmd()

2014-11-04 Thread H Hartley Sweeten
Tidy up the programming of timer 2. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../staging/comedi/drivers/addi-data/hwdrv_apci3120.c| 16 +--- 1 file changed, 9

[PATCH 016/108] staging: comedi: addi_apci_3120: rename APCI3120_ENABLE_EXT_TRIGGER

2014-11-04 Thread H Hartley Sweeten
For aesthetics, rename this define. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 7 ++-

[PATCH 005/108] staging: comedi: addi_apci_3120: tidy up CTR0 register defines

2014-11-04 Thread H Hartley Sweeten
Define the CTR0 register in the main driver source file and remove all the old defines in hwrdv_apci3120.c. For aesthetics, save the raw digital output state (devpriv-do_bits) in the digital output (*insn_bits) function and use a macro to set them when reading/writing a timer. Use the CTR0

[PATCH 059/108] staging: comedi: addi_apci_3120: move apci3120_ai_insn_read() to driver source

2014-11-04 Thread H Hartley Sweeten
Move this function, and its helper function, from the included hwdrv_apci31210.c source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 051/108] staging: comedi: addi_apci_3120: remove private data 'ui_AiNbrofChannels'

2014-11-04 Thread H Hartley Sweeten
This member of the private data is always the cmd-chanlist_len. Use that instead and remove the member. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 058/108] staging: comedi: addi_apci_3120: move apci3120_ao_insn_write() to driver source

2014-11-04 Thread H Hartley Sweeten
Move this function, and its helper function, from the included hwdrv_apci31210.c source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 014/108] staging: comedi: addi_apci_3120: remove APCI3120_DISABLE_TIMER[012]

2014-11-04 Thread H Hartley Sweeten
For aesthetics, remove these defines and just use ~APCI3120_ENABLE_TIMER[012]. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 14

[PATCH 040/108] staging: comedi: addi_apci_3120: define the enable bits in the mode register

2014-11-04 Thread H Hartley Sweeten
For aesthetics, redefine the bits in the mode register that enable interrupts and scanning. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 38

[PATCH 061/108] staging: comedi: addi_apci_3120: move apci3120_set_chanlist() to driver source

2014-11-04 Thread H Hartley Sweeten
Move this function from the included hwdrv_apci31210.c source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c

[PATCH 020/108] staging: comedi: addi_apci_3120: rename APCI3120_WR_ADDRESS

2014-11-04 Thread H Hartley Sweeten
For aesthetics, rename this define. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 11 +--

[PATCH 048/108] staging: comedi: addi_apci_3120: remove private data 'ui_AiReadData'

2014-11-04 Thread H Hartley Sweeten
This member of the private data was used to return analog input samples that were acquired for the (*insn_read) using interrupts. The interrupt support code for the (*insn_read) has been removed. Remove this unused member from the private data. Signed-off-by: H Hartley Sweeten

[PATCH 080/108] staging: comedi: addi_apci_3120: move APCI3120_FIFO_ADVANCE_ON_BYTE_2

2014-11-04 Thread H Hartley Sweeten
Move this define to the main driver source and convert it to a bit-shift. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 6 --

[PATCH 053/108] staging: comedi: addi_apci_3120: rename APCI3120_RD_STATUS

2014-11-04 Thread H Hartley Sweeten
For aesthetics, rename this define used for the status register offset. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 17

[PATCH 003/108] staging: comedi: addi_apci_3120: introduce apci3120_timer_write()

2014-11-04 Thread H Hartley Sweeten
Introduce a helper function to select a timer and write a value to it. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 138

[PATCH 044/108] staging: comedi: addi_apci_3120: remove scanning from ai (*insn_read)

2014-11-04 Thread H Hartley Sweeten
(*insn_read) functions are supposed to do simple polled reads of a single channel. This driver tries to be tricky and allow passing a chanlist in the analog input (*insn_config) to allow the (*insn_read) to do chanlist scanning with or without interrupts. The (*insn_config) doesn't follow the

[PATCH 070/108] staging: comedi: addi_apci_3120: reset fifo after programming chanlist

2014-11-04 Thread H Hartley Sweeten
The APCI-3120 documentation says that the FIFO should be reset after the chanlist sequence is programmed. Reset the FIFO after programming the chanlist and remove the extra FIFO resets in the driver. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk

[PATCH 060/108] staging: comedi: addi_apci_3120: remove check in apci3120_setup_chan_list()

2014-11-04 Thread H Hartley Sweeten
The n_chan check is not needed. This value will always be = 1. Remove the unnecessary check. For aesthetics, rename the function and change it's return type to void. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman

[PATCH 055/108] staging: comedi: addi_apci_3120: remove private data 'ai_running'

2014-11-04 Thread H Hartley Sweeten
This member of the private data was used to determine if the interrupt routine was handling data for the (*insn_read) or an async command. Now that the (*insn_read) does not use interrupts this member is not needed. Remove the member and refactor the code. Signed-off-by: H Hartley Sweeten

[PATCH 077/108] staging: comedi: addi_apci_3120: introduce apci3120_addon_write()

2014-11-04 Thread H Hartley Sweeten
Introduce a helper function to handle the common code that writes a 32-bit value to the 16-bit add-on register. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 031/108] staging: comedi: addi_apci_3120: rename private data 'b_ModeSelectRegister'

2014-11-04 Thread H Hartley Sweeten
Rename this CamelCase member of the private data and tidy up the mask/set of its bits. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 198

[PATCH 022/108] staging: comedi: addi_apci_3120: move apci3120_exttrig_enable() to driver source

2014-11-04 Thread H Hartley Sweeten
Move this helper function from the included source file into the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c

[PATCH 026/108] staging: comedi: addi_apci_3120: remove 'check' param from apci3120_setup_chan_list()

2014-11-04 Thread H Hartley Sweeten
This parameter is always passed as '0'. Remove it and refactor the code. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 23

[PATCH 006/108] staging: comedi: addi_apci_3120: fix counter and external interrupt disable

2014-11-04 Thread H Hartley Sweeten
The APCI3120_DISABLE_ALL_TIMER define define is not needed, and it's used incorrectly in apci3120_cancel(). The define is a mask of the bits needed to disable the counters. Writing the value directly sets unintended bits. Prior to writing the value, the 'devpriv-us_OutputRegister' is set to 0 and

[PATCH 068/108] staging: comedi: addi_apci_3120: tidy up timer programming in apci3120_ai_cmd()

2014-11-04 Thread H Hartley Sweeten
Tidy up the programming of timers 0 and 1 so that only one local variable is required. Also, remove the unnecessary clear of devpriv-timer_mode. This value will get set correctly by each apci3120_timer_set_mode() call. It's not necessary to clear it first. Signed-off-by: H Hartley Sweeten

[PATCH 065/108] staging: comedi: addi_apci_3120: move timer 2 enable in apci3120_cyclic_ai()

2014-11-04 Thread H Hartley Sweeten
Move the enable of timer 2 to avoid needing the extra if() check. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 5 ++--- 1 file

[PATCH 062/108] staging: comedi: addi_apci_3120: factor DMA setup out of apci3120_cyclic_ai()

2014-11-04 Thread H Hartley Sweeten
For aesthetics, factor the DMA setup code out of apci3120_cyclic_ai(). Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 295

[PATCH 013/108] staging: comedi: addi_apci_3120: tidy up devpriv-ctrl use

2014-11-04 Thread H Hartley Sweeten
The apci3120_setup_chan_list() function sets devpriv-ctrl to the scan length (PR) and scan start (PA) values and writes the value to the register. There is no need to mask the value first. The apci3120_ai_insn_read() function calles apci3120_setup_chan_list(). There is no need to clear

[PATCH 073/108] staging: comedi: addi_apci_3120: tidy up devpriv-mode in apci3120_ai_cmd()

2014-11-04 Thread H Hartley Sweeten
There is no reason for the separate updates of the mode register in this function. Refactor the code so that the mode register is only updated at the end of the function after all the necessary bits have been set. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott

[PATCH 072/108] staging: comedi: addi_apci_3120: enable chanlist scanning if needed

2014-11-04 Thread H Hartley Sweeten
The 'SCAN_ENA' bit in the mode register needs to be set if the chanlist has more than 1 channel. Set the bit in apci3120_set_chanlist() if needed. The callers write the mode register after setting any additional bits, Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott

[PATCH 029/108] staging: comedi: addi_apci_3120: remove APCI3120_DISABLE_ALL_INTERRUPT_WITHOUT_TIMER

2014-11-04 Thread H Hartley Sweeten
At the start of apci3120_ai_insn_read() the devpriv-b_ModeSelectRegister is set to '0'. Remove the unnecessary masking to clear the interrupt enable bits. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman

[PATCH 074/108] staging: comedi: addi_apci_3120: remove private data 'b_InterruptMode'

2014-11-04 Thread H Hartley Sweeten
This member of the private data is not really needed. The interrupt mode can be determined by checking the devpriv-mode value to see if the interrupt is enabled. Remove the unnecessary member. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg

[PATCH 067/108] staging: comedi: addi_apci_3120: absorb apci3120_cyclic_ai()

2014-11-04 Thread H Hartley Sweeten
This functon is called by apci3120_ai_cmd() with one additional parameter, 'mode', The 'mode' is based on the cmd-scan_begin_src. For aesthetics, absorb the function into apci3120_ai_cmd() and use the cmd-scan_begin_src directly to determine the 'mode'. Signed-off-by: H Hartley Sweeten

[PATCH 049/108] staging: comedi: addi_apci_3120: fix apci3120_ai_insn_read()

2014-11-04 Thread H Hartley Sweeten
Now that the scanning and interrupt support have been removed from this function it can be refactored to work correctly. The comedi core expects (*insn_read) functions to read insn-n values from the hardware and return the number of samples read. This function currently just reads one sample but

[PATCH 045/108] staging: comedi: addi_apci_3120: remove private data 'ui_EocEosConversionTime'

2014-11-04 Thread H Hartley Sweeten
This driver tries to be tricky and allow passing an analog input conversion time for the (*insn_read) in the (*insn_config). The (*insn_config) doesn't follow the comedi API and this programmable conversion time is not part of the API for (*insn_read) operations. Remove the member from the

[PATCH 064/108] staging: comedi: addi_apci_3120: flip 'us_UseDma' test in apci3120_cyclic_ai()

2014-11-04 Thread H Hartley Sweeten
For aesthetics, flip this test and do the DMA setup first. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 9 - 1 file changed,

[PATCH 036/108] staging: comedi: addi_apci_3120: remove APCI3120_DISABLE_TIMER_INT

2014-11-04 Thread H Hartley Sweeten
For aesthetics, remove this define and just use ~APCI3120_ENABLE_TIMER_INT. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 9 -

[PATCH 076/108] staging: comedi: addi_apci_3120: introduce apci3120_init_dma()

2014-11-04 Thread H Hartley Sweeten
Introduce a helper function to handle the common code that writes the DMA start address and number of acquisitions to the AMCC Add-on registers. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 032/108] staging: comedi: addi_apci_3120: remove unnecessary devpriv-mode masking

2014-11-04 Thread H Hartley Sweeten
The devpriv-mode is set to '0' at the start of apci3120_ai_insn_read() and apci3120_cyclic_ai(). There is no need to clear any of the bits or do any of the additional writes of those cleared bits. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc:

[PATCH 066/108] staging: comedi: addi_apci_3120: move start_src check into apci3120_cyclic_ai()

2014-11-04 Thread H Hartley Sweeten
For aesthetics, move the check of the cmd-start_src. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 12 +--- 1 file changed, 5

[PATCH 088/108] staging: comedi: addi_apci_3120: define the AI FIFO register

2014-11-04 Thread H Hartley Sweeten
Define the offset for the analog input FIFO register. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 4 +---

Re: [PATCH 05/10] added media specific (MS) TCP drivers

2014-11-04 Thread Greg KH
On Tue, Nov 04, 2014 at 09:48:33AM +0100, Tobias Klauser wrote: On 2014-11-03 at 21:42:52 +0100, Stephanie Wallick stephanie.s.wall...@intel.com wrote: This is where we handle media specific packets and transport. The MS driver interfaces with a media agnostic (MA) driver via a series of

Re: [PATCH 10/10] added kernel build, configuration, and TODO files

2014-11-04 Thread sostalle
On Mon, Nov 03, 2014 at 01:24:04PM -0800, Greg KH wrote: On Mon, Nov 03, 2014 at 12:42:57PM -0800, Stephanie Wallick wrote: --- /dev/null +++ b/drivers/staging/mausb/TODO @@ -0,0 +1,14 @@ +TODO: +- checkpatch.pl cleanups Is this still true? checkpatch.pl reports: total: 7 errors, 208

Re: [PATCH 10/10] added kernel build, configuration, and TODO files

2014-11-04 Thread Greg KH
On Tue, Nov 04, 2014 at 09:55:19AM -0800, sostalle wrote: On Mon, Nov 03, 2014 at 01:24:04PM -0800, Greg KH wrote: On Mon, Nov 03, 2014 at 12:42:57PM -0800, Stephanie Wallick wrote: --- /dev/null +++ b/drivers/staging/mausb/TODO @@ -0,0 +1,14 @@ +TODO: + - checkpatch.pl cleanups Is

[PATCH 2/2] staging: comedi: add ioctls to set per-file read and write subdevice

2014-11-04 Thread Ian Abbott
Now that Comedi has the structures in place to support setting the current read and/or write subdevice on a per-file object basis, add new ioctls to set them. The newly chosen read (write) subdevice needs to support read (write) commands, and the file cannot be busy handling a read (write)

[PATCH 0/2] staging: comedi: per-file read/write subdevice choice

2014-11-04 Thread Ian Abbott
This series of patches adds a couple of ioctl codes to the Comedi core to allow the current read and write subdevice to be changed after opening the comedi device. The current read and write subdevice information is stored in file private data allocated for the lifetime of the file object, so the

[PATCH 1/2] staging: comedi: prepare support for per-file read and write subdevices

2014-11-04 Thread Ian Abbott
Comedi devices may have several subdevices that support read and/or write asynchronous commands that use the read or write file operations for data transfer. The low-level Comedi drivers may nominate a default read subdevice and/or a default write subdevice, but it may have other subdevices that

[PATCH 079/108] staging: comedi: addi_apci_3120: define the Add-On registers

2014-11-04 Thread H Hartley Sweeten
Define the add-On registers and bits and remove the magic numbers in the driver. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 40

[PATCH 087/108] staging: comedi: addi_apci_3120: don't use timer 2 to count scans

2014-11-04 Thread H Hartley Sweeten
Timer 2 can be used to count the number of scans when the cmd-stop_src is TRIG_COUNT. Unfortunately that timer can also be used by userspace and this breaks the async command. Timer 2 also only works for counting the number of scans when DMA is not used. The number of scans is counted by the core

[PATCH 090/108] staging: comedi: addi_apci_3120: fix timer (*insn_read)

2014-11-04 Thread H Hartley Sweeten
The timer subdevice in this driver does not follow the comedi API. Fix the (*insn_read) to work correctly. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 084/108] staging: comedi: addi_apci_3120: rename private data 'us_UseDma'

2014-11-04 Thread H Hartley Sweeten
Rename this CamelCase member of the private data and convert it to a bit-field. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 2 +-

[PATCH 091/108] staging: comedi: addi_apci_3120: fix timer (*insn_config)

2014-11-04 Thread H Hartley Sweeten
The timer subdevice in this driver does not follow the comedi API. Fix the (*insn_config) to correctly arm, disarm, set the mode, and get the status of the timer. Remove the unnecessary, and broken, (*insn_write). The new (*insn_config) does not enable the interrupt for timer 2. Remove the

[PATCH 095/108] staging: comedi: addi_apci_3120: remove unnecessary include

2014-11-04 Thread H Hartley Sweeten
The linux/sched.h header is not needed by this driver. Remove the include. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi_apci_3120.c | 1 - 1 file changed, 1

[PATCH 092/108] staging: comedi: addi_apci_3120: fix cmd-convert_arg vaildation

2014-11-04 Thread H Hartley Sweeten
Regardless of the cmd-scan_begin_src, the minimum cmd-convert_arg value is 1 (10us). Fix the validation in apci3120_ai_cmdtest(). Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 093/108] staging: comedi: addi_apci_3120: move AI (*do_cmdtest) to main driver

2014-11-04 Thread H Hartley Sweeten
Move apci3120_ai_cmdtest() from the included source file to the main driver source file. Tidy up Step 4 a bit during the move. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 096/108] staging: comedi: addi_apci_3120: move apci3120_addon_write() to driver

2014-11-04 Thread H Hartley Sweeten
Move this function from the included source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 14

[PATCH 100/108] staging: comedi: addi_apci_3120: use async-events to report hardware error

2014-11-04 Thread H Hartley Sweeten
In apci3120_interrupt_dma(), use the async-events to report the hardware error and allow the core to (*cancel) the command instead of calling the (*cancel) function directly. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman

[PATCH 094/108] staging: comedi: addi_apci_3120: add copyright information

2014-11-04 Thread H Hartley Sweeten
Remove the copyright info from the included source file and add it to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c

[PATCH 103/108] staging: comedi: addi_apci_3120: use comedi_bytes_to_samples()

2014-11-04 Thread H Hartley Sweeten
Use the helper function to calculate the number of samples in the DMA buffer. For aesthetics, tidy up the local variables. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 104/108] staging: comedi: addi_apci_3120: move apci3120_interrupt_dma() to driver

2014-11-04 Thread H Hartley Sweeten
Move this function from the included source file to the main driver source file. Remove the now empty included source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 107/108] staging: comedi: addi_apci_3120: enable AI async commands

2014-11-04 Thread H Hartley Sweeten
The async command support should now work. Enable the hook up of the command support functions in apci3120_auto_attach(). Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 099/108] staging: comedi: addi_apci_3120: move apci3120_ai_cmd() to driver

2014-11-04 Thread H Hartley Sweeten
Move this function from the included source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 56

[PATCH 102/108] staging: comedi: addi_apci_3120: move apci3120_interrupt() to driver

2014-11-04 Thread H Hartley Sweeten
Move this function from the included source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 72

[PATCH 083/108] staging: comedi: addi_apci_3120: move apci3120_reset() to driver source

2014-11-04 Thread H Hartley Sweeten
Move this function from the included hwdrv_apci31210.c source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 108/108] staging: comedi: addi_apci_3120: absorb apci3120_ai_reset_fifo()

2014-11-04 Thread H Hartley Sweeten
This function is only called by apci3120_set_chanlist(). Absorb it. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi_apci_3120.c | 9 ++--- 1 file changed,

[PATCH 082/108] staging: comedi: addi_apci_3120: tidy up apci3120_reset()

2014-11-04 Thread H Hartley Sweeten
This function is only called during the attach of the driver and it's called after the private data has been kzalloc'd. There is no reason to clear any of the private data members. Simplify the function by just writing '0' to the necessary registers to disable all the interrupt sources and stop

[PATCH 106/108] staging: comedi: addi_apci_3120: switch DMA buffers after writing samples

2014-11-04 Thread H Hartley Sweeten
Currently the DMA buffers are switched before writing the current samples to the async buffer. This works but when the EOA event happens we end up with an outstanding DMA operation in progress that gets terminated by the (*cancel). Avoid the outstanding DMA operation by switching the DMA buffers

[PATCH 078/108] staging: comedi: addi_apci_3120: use amcc_s5933.h defines

2014-11-04 Thread H Hartley Sweeten
Use the defines for the AMCC 5933 PCI controller registers and bits instead of creating private defines in this driver. Move the generic AGCSTS_TC_ENABLE define from this driver to the header. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg

[PATCH 086/108] staging: comedi: addi_apci_3120: rename private data 'ui_DmaActualBuffer'

2014-11-04 Thread H Hartley Sweeten
Rename this CamelCase member of the private data and convert it to a bit-field. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 10

[PATCH 027/108] staging: comedi: addi_apci_3120: introduce apci3120_ai_reset_fifo()

2014-11-04 Thread H Hartley Sweeten
A dummy read of APCI3120_TIMER_MODE_REG resets the analog input FIFO. Introduce a helper function to clarify this. It's not necessary to do a dummy read of the FIFO (base + 0) before reseting it. Remove the unnecessary dummy reads. The APCI3120_TIMER_MODE_REG is a 16-bit register. This fixes a

[PATCH 105/108] staging: comedi: addi_apci_3120: change params to apci3120_interrupt_dma()

2014-11-04 Thread H Hartley Sweeten
Pass the comedi_device and comedi_subdevice pointers to this function instead of the irq number and void pointer. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org ---

[PATCH 101/108] staging: comedi: addi_apci_3120: move apci3120_cancel() to driver

2014-11-04 Thread H Hartley Sweeten
Move this function from the included source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 28

[PATCH 097/108] staging: comedi: addi_apci_3120: move apci3120_init_dma() to driver

2014-11-04 Thread H Hartley Sweeten
Move this function from the included source file to the main driver source file. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- .../comedi/drivers/addi-data/hwdrv_apci3120.c | 32

RE: [PATCH 0/2] staging: comedi: per-file read/write subdevice choice

2014-11-04 Thread Hartley Sweeten
On Tuesday, November 04, 2014 11:09 AM, Ian Abbott wrote: This series of patches adds a couple of ioctl codes to the Comedi core to allow the current read and write subdevice to be changed after opening the comedi device. The current read and write subdevice information is stored in file

Re: [PATCH 00/10] MA USB drivers cover letter

2014-11-04 Thread sostalle
On Tue, Nov 04, 2014 at 10:00:32AM +0100, Bjørn Mork wrote: [added linux-...@vger.kernel.org Cc] Nice. But don't you think this deserves the attention of the linux-usb mailing list? Yes, Greg's attention is of course good to have too :-) But I believe this is of interest to more people,

Re: [PATCH 00/10] MA USB drivers cover letter

2014-11-04 Thread sostalle
On Tue, Nov 04, 2014 at 10:00:32AM +0100, Bjørn Mork wrote: [added linux-...@vger.kernel.org Cc] Nice. But don't you think this deserves the attention of the linux-usb mailing list? Yes, Greg's attention is of course good to have too :-) But I believe this is of interest to more people,

[PATCH] staging: unisys: virtpci: Remove GET_BUS_DEV macro

2014-11-04 Thread Bryan Thompson
The GET_BUS_DEV macro contained flow control statements that are undesirable. This patch removes the macro and places the code in each function. Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com --- drivers/staging/unisys/virtpci/virtpci.c | 48 -- 1 file

<    1   2   3   >