firefly-linux-kernel-4.4.55.git
9 years agostaging: comedi: ni_stc.h: tidy up AI_Trigger_Select_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:19 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AI_Trigger_Select_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

Tidy up ni_ai_cmd() by using a local var to set the common bits and
programming the register in the common code path.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AI_START_STOP_Select_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:18 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AI_START_STOP_Select_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up Analog_Trigger_Etc_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:17 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up Analog_Trigger_Etc_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AI_Output_Control_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:16 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AI_Output_Control_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

Tidy up the programming of this register un ni_ai_reset() by using a
local variable to set the common bits then writing the register in the
common code path.

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>
9 years agostaging: comedi: ni_stc.h: tidy up Interrupt_Control_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:15 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up Interrupt_Control_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up RTSI_Trig_Direction_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:14 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up RTSI_Trig_Direction_Register and bits

Rename the CamelCase and convert the enum and inline function into defines.
Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: remove unreachable code in RTSI_Output_Bit()
H Hartley Sweeten [Fri, 1 May 2015 21:59:13 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: remove unreachable code in RTSI_Output_Bit()

All the callers of this function check the 'channel' number with
num_configurable_rtsi_channels(). This check can never occure.
Remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_stc.h: tidy up IO_Bidirection_Pin_Register
H Hartley Sweeten [Fri, 1 May 2015 21:59:12 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up IO_Bidirection_Pin_Register

Rename the CamelCase.

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>
9 years agostaging: comedi: ni_mio_common: use 'reg' in ni_set_bitfield()
H Hartley Sweeten [Fri, 1 May 2015 21:59:11 +0000 (14:59 -0700)]
staging: comedi: ni_mio_common: use 'reg' in ni_set_bitfield()

Use the passed 'reg' parameter to write to the STC registers instead
of duplicating the case symbol.

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>
9 years agostaging: comedi: ni_stc.h: tidy up Clock_and_FOUT_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:10 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up Clock_and_FOUT_Register and bits

Rename the CamelCase and convert the enum and inline function into defines.
Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AO_*_Load_[AB]_Register
H Hartley Sweeten [Fri, 1 May 2015 21:59:09 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AO_*_Load_[AB]_Register

Rename the CamelCase.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AO_Mode_2_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:08 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AO_Mode_2_Register and bits

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AO_Mode_1_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:07 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AO_Mode_1_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up G_{Mode,Load,Input}*_Register
H Hartley Sweeten [Fri, 1 May 2015 21:59:06 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up G_{Mode,Load,Input}*_Register

Rename the CamelCase and define he G0 and G1 registers to add clarity
to the mio_regmap tables.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AI_*_Load_[AB]_Registers
H Hartley Sweeten [Fri, 1 May 2015 21:59:05 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AI_*_Load_[AB]_Registers

Rename the CamelCase.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AI_Mode_2_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:04 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AI_Mode_2_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AI_Mode_1_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:03 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AI_Mode_1_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up DIO_Control_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:02 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up DIO_Control_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up DIO_Output_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:01 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up DIO_Output_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AO_Command_1_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:59:00 +0000 (14:59 -0700)]
staging: comedi: ni_stc.h: tidy up AO_Command_1_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AI_Command_1_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:59 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up AI_Command_1_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up G_Command_Register
H Hartley Sweeten [Fri, 1 May 2015 21:58:58 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up G_Command_Register

Rename the CamelCase and define the G0 and G1 registers to add clarity
to the mio_regmap tables.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AO_Command_2_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:57 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up AO_Command_2_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up AI_Command_2_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:56 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up AI_Command_2_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up Interrupt_B_Ack_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:55 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up Interrupt_B_Ack_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up Interrupt_A_Ack_Register and bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:54 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up Interrupt_A_Ack_Register and bits

Rename the CamelCase. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_mio_common: remove disabled GPCT functions
H Hartley Sweeten [Fri, 1 May 2015 21:58:53 +0000 (14:58 -0700)]
staging: comedi: ni_mio_common: remove disabled GPCT functions

The GPCT (general purpose counter timer) is handled by the ni_tio and
ni_tiocmd modules. Remove the old disabled code in this 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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_INTC_STATUS_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:52 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_INTC_STATUS_REG bits

Rename the CamelCase and convert enums into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_INTC_ENA_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:51 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_INTC_ENA_REG bits

Rename the CamelCase and convert enums into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_CDO_MODE_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:50 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_CDO_MODE_REG bits

Rename the CamelCase and convert enums into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_mio_common: remove BUG() check in ni_cdio_cmd()
H Hartley Sweeten [Fri, 1 May 2015 21:58:49 +0000 (14:58 -0700)]
staging: comedi: ni_mio_common: remove BUG() check in ni_cdio_cmd()

The cmd->scan_begin_src was validated in ni_cdio_cmdtest() and can only
be TRIG_EXT. Remove the switch statement and unnecessary BUG() check.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_CDI_MODE_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:48 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_CDI_MODE_REG bits

Rename the CamelCase and convert enums into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_CDIO_CMD_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:47 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_CDIO_CMD_REG bits

Rename the CamelCase and convert enums into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_CDIO_STATUS_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:46 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_CDIO_STATUS_REG bits

Rename the CamelCase and convert enums into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_CDIO_DMA_SEL_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:45 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_CDIO_DMA_SEL_REG bits

Rename the CamelCase and convert enums into macros to set the
bits in this 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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_PFI_FILTER_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:44 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_PFI_FILTER_REG bits

Rename the CamelCase and convert the inline helper functions
that set the bits in this register to macros.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_PFI_OUT_SEL_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:43 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_PFI_OUT_SEL_REG bits

Rename the CamelCase and convert the inline helper functions
that set/get the bits in this register to macros.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_CAL_PWM_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:42 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_CAL_PWM_REG bits

Rename the CamelCase and convert the inline helper functions
that set the bits in this register to macros.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_AO_REF_ATTENUATION_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:41 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_AO_REF_ATTENUATION_REG bits

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_AO_CFG_BANK_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:40 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_AO_CFG_BANK_REG bits

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_AI_CFG_BYPASS_FIFO_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:39 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_AI_CFG_BYPASS_FIFO_REG bits

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits. Convert the inline helper functions into
macros.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_PLL_STATUS_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:38 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_PLL_STATUS_REG bits

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_PLL_CTRL_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:37 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_PLL_CTRL_REG bits

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits.

Convert the inline functions MSeries_PLL_Divisor_Bits() and
MSeries_PLL_Multiplier_Bits() to macros. The helper function
ni_mseries_get_pll_parameters() always returns valid values for the
'divisor' and 'multiplier' so the sanity checking can safely be
removed.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_CLK_FOUT2_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:36 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_CLK_FOUT2_REG bits

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits.

Convert the inline function MSeries_PLL_In_Source_Select_RTSI_Bits()
to a macro. The caller always passes valid values for 'RTIS_channel'
so the sanity checking can safely be removed.

Tidy up ni_mseries_set_pll_master_clock() to remove the unnecessary
extra indent level for the code that sets a RTSI channel for the
PLL source.

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>
9 years agostaging: comedi: ni_stc.h: tidy up NI_M_AI_CFG_FIFO_DATA_REG bits
H Hartley Sweeten [Fri, 1 May 2015 21:58:35 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up NI_M_AI_CFG_FIFO_DATA_REG bits

Rename all the CamelCase and convert the enum and helper functions
into defines. Use the BIT() macro to define the bits.

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>
9 years agostaging: comedi: ni_stc.h: rename M_Offset_* symbols
H Hartley Sweeten [Fri, 1 May 2015 21:58:34 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: rename M_Offset_* symbols

Renamme these CamelCase symbols.

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>
9 years agostaging: comedi: ni_stc.h: simplify MSeries_AI_Config_Bank_Bits()
H Hartley Sweeten [Fri, 1 May 2015 21:58:33 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: simplify MSeries_AI_Config_Bank_Bits()

Simplify this helper function by using a bit-shift to set the high
banks select bit.

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>
9 years agostaging: comedi: ni_stc.h: reg_type is not needed by MSeries_AI_Config_Bank_Bits()
H Hartley Sweeten [Fri, 1 May 2015 21:58:32 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: reg_type is not needed by MSeries_AI_Config_Bank_Bits()

This helper function sets the bits in the M_Offset_AI_Config_FIFO_Data register
to select the correct bank to configure a given analog output channel. The NI
M Series boards are defined by the boardinfo to have 16, 32, or 80 channels.
Only 2 of the M Series boards have 80 channels, those boards happen to have a
reg_type of ni_reg_622x.

The bank for the 16 and 32 channel boards is selected by the 'channel & 0x30'
calculation (comedi channels 0 to 15 or 31). This also selects the bank for the
first 64 channels of the 80 channel boards. The additional '|= 0x400' sets the
bank to access the extra channels (comedi channels >= 63).

Since all the non ni_reg_622x boards have at most 32 channels, the extra check
of the 'reg_type' is not required in this function. Remove it as well as the
parameter.

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>
9 years agostaging: comedi: ni_stc.h: tidy up M_Offset_* values
H Hartley Sweeten [Fri, 1 May 2015 21:58:31 +0000 (14:58 -0700)]
staging: comedi: ni_stc.h: tidy up M_Offset_* values

For aesthetics, define the M_Offset_* values instead of using an enum.

Convert the inline helpers used to get some of the M-Series register
offsets into macros.

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>
9 years agostaging: comedi: ni_mio_common: simplify ni_m_series_set_pfi_routing()
H Hartley Sweeten [Fri, 1 May 2015 21:58:30 +0000 (14:58 -0700)]
staging: comedi: ni_mio_common: simplify ni_m_series_set_pfi_routing()

This function is overly complex due to the M_Offset_PFI_Output_Select()
helper using a 1 based index for the registers and the private data using
a 0 based index for the cached values.

Modify the M_Offset_PFI_Output_Select() helper to use a 0 based index and
remove the sanity check which can never happen. The 'n' value passed is
calculated from the subdevice channel which will always be in range.

Tidy up the function by using a local variable to mask/set the pfi output
select bits.

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>
9 years agostaging: comedi: ni_mio_common: open code the M-Series GPCT register offsets
H Hartley Sweeten [Fri, 1 May 2015 21:58:29 +0000 (14:58 -0700)]
staging: comedi: ni_mio_common: open code the M-Series GPCT register offsets

Remove the enum m_series_register_offsets values that are only used in
the lookup tables for the GPCT to STC register mapping and just open
code the values. Having the extra level of indirection does not add any
additional clarity and it gets rid of some of the CamelCase symbols.

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>
9 years agostaging: comedi: ni_mio_common: refactor gpct to stc register handling
H Hartley Sweeten [Fri, 1 May 2015 21:58:28 +0000 (14:58 -0700)]
staging: comedi: ni_mio_common: refactor gpct to stc register handling

The NI General Purpose Counter Timer (gpct) registers are mapped to the
STC registers with a big switch statement. Create a lookup table to handle
the mapping ot the registers. This is easier to maintain.

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>
9 years agostaging: comedi: ni_mio_common: open code the M-Series regmap offsets
H Hartley Sweeten [Fri, 1 May 2015 21:58:27 +0000 (14:58 -0700)]
staging: comedi: ni_mio_common: open code the M-Series regmap offsets

Remove the enum m_series_register_offsets values that are only used in
the lookup tables for the STC to M-Series register mapping and just open
code the values. Having the extra level of indirection does not add any
additional clarity and it gets rid of some of the CamelCase symbols.

Some of the registers are not currently used by the driver so the mappings
were not present in the original switch code. Add the missing register
mappings to the lookup tables.

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>
9 years agostaging: comedi: ni_mio_common: refactor m-series stc register handling
H Hartley Sweeten [Fri, 1 May 2015 21:58:26 +0000 (14:58 -0700)]
staging: comedi: ni_mio_common: refactor m-series stc register handling

For M-Series boards (devpriv->is_m_series), the STC registers need to be
remapped. This is currently handled with some big switch statements to
convert the STC register offset to the M-Series offset. Some of the
registers also need special handling due to differences in the register
size on the M-Series boards.

Create some lookup tables to handle the remapping of the read and write
registers. These are easier to maintain and can contain the register size
so that a common function can be used instead of the separate helpers.

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>
9 years agoMerge tag 'iio-for-v4.2a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Sat, 9 May 2015 16:15:50 +0000 (18:15 +0200)]
Merge tag 'iio-for-v4.2a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First round of new drivers, functionality and cleanups for the 4.2 cycle

New drivers / device support
* st sensors driver, lsm303dlh magnetometer support.
* ltr501 - support ltr301 and ltr559 chips.

New functionality
* IIO_CHAN_INFO_CALIBEMISSIVITY for thermopile sensors.
* kxcjk1013 - make driver operational with external trigger.
* Add iio targets to the tools Makefile.

Cleanups
* st sensors - more helpful error message if device id wrong or irq request
  fails, explicitly make the Block Data Update optional rather
  than relying on writes to address 0 not doing anything, make interrupt
  support optional (Not always wired, and not all devices actually have
  an interrupt line.)
* kxcjk-1013 white space additions for readability, add the KXCJ9000 ACPI
  id as seen in the wild.
* sx9500 - GPIO reset support, refactor the GPIO interrupt code, add power
  management, optimize power usage by powering down when possible, rename
  the gpio interrupt pin to be more useful, trivial return path simplification,
  trivial formatting fixes.
* isl29018 -  move towards ABI compliance with a view to moving this driver
  out of staging, add some brackets to ensure code works as expected.  Note
  there is no actual bug as the condition being tested is always true
  (with current devices).
* ltr501 - add regmap support to get caching etc for later patches,
  fix a parameter sanity check that always fails (bug introduced
  earlier in this series), ACPI enumeration support,
  interrupt rate control support, interrupt support in general and
  integration time control support, code alignment cleanups.
* mma9553 - a number of little cleanups following a review from Hartmut
  after I'd already applied the original driver patch.
* tmp006 - prefix some defines with TMP006 for consistency.
* tsl4531 - cleanup some wrong prefixes, presumably from copy and paste.
* mlx90614 - check for errors in read values, add power management,
  add emissivity setting, add device tree binding documentation,
  fix a duplicate const warning.
* ti_am335x_adc - refactor the DT parsing into a separate function.

9 years agostaging: unisys: uislib.h: Remove unused cache allocation prototypes
Jes Sorensen [Tue, 5 May 2015 22:37:16 +0000 (18:37 -0400)]
staging: unisys: uislib.h: Remove unused cache allocation prototypes

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchipset: Remove unused cache allocator
Jes Sorensen [Tue, 5 May 2015 22:37:15 +0000 (18:37 -0400)]
staging: unisys: visorchipset: Remove unused cache allocator

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Remove wrapper around parser_init_guts()
Jes Sorensen [Tue, 5 May 2015 22:37:14 +0000 (18:37 -0400)]
staging: unisys: Remove wrapper around parser_init_guts()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: parser_init_guts(): standard_payload_header is always false
Jes Sorensen [Tue, 5 May 2015 22:37:13 +0000 (18:37 -0400)]
staging: unisys: parser_init_guts(): standard_payload_header is always false

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: parser: Remove unused functions and mark others static
Jes Sorensen [Tue, 5 May 2015 22:37:12 +0000 (18:37 -0400)]
staging: unisys: parser: Remove unused functions and mark others static

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchipset: Declare parser_init_byte_stream() static
Jes Sorensen [Tue, 5 May 2015 22:37:11 +0000 (18:37 -0400)]
staging: unisys: visorchipset: Declare parser_init_byte_stream() static

In addition remove unused parser_init()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchannel: Make visorchannel_create take a gfp_t
Jes Sorensen [Tue, 5 May 2015 22:37:10 +0000 (18:37 -0400)]
staging: unisys: visorchannel: Make visorchannel_create take a gfp_t

This allows the caller to specify an appropriate GFP flag instead of
hardcoding the lowest common denominator.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove visorutil from top level Makefile
Benjamin Romer [Tue, 5 May 2015 22:37:09 +0000 (18:37 -0400)]
staging: unisys: remove visorutil from top level Makefile

The visorutil directory is still mentioned in the top level makefile for
the Unisys drivers, so remove it.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: fix visorbus Kconfig
Benjamin Romer [Tue, 5 May 2015 22:37:08 +0000 (18:37 -0400)]
staging: unisys: fix visorbus Kconfig

Removing visorutil made it impossible to build visorbus. Remove the config
setting from the Kconfig so the module can be enabled in the build.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: move periodic_work.c into the visorbus directory
Erik Arfvidson [Tue, 5 May 2015 22:37:07 +0000 (18:37 -0400)]
staging: unisys: move periodic_work.c into the visorbus directory

This patch removes visorutil directory, move periodic_work.c into
the visorbus directory.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove timskmod.h and procobjecttree.h
Erik Arfvidson [Tue, 5 May 2015 22:37:06 +0000 (18:37 -0400)]
staging: unisys: remove timskmod.h and procobjecttree.h

This patch move the needed linux include files from timskmod.h
to the files that calls those include. Also procobjecttree.h is
removed since it is dead code.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove charqueue.c
Erik Arfvidson [Tue, 5 May 2015 22:37:05 +0000 (18:37 -0400)]
staging: unisys: remove charqueue.c

This patch removes charqueue.[ch] since it no longer called

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: move timskmod.h functionality
Erik Arfvidson [Tue, 5 May 2015 22:37:04 +0000 (18:37 -0400)]
staging: unisys: move timskmod.h functionality

This patch removes all timksmod.h pound defines. It also removes
visorkmodutils.c since it no longer has any use by itself. Since
visorkmodutils.c is no longer needed the module_init for
visorchipset.c is modified to call visorutil_spar_detect directly
instead of the extern variable in timksmod.h.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: add ACPI and PCI requirement to Kconfig
Benjamin Romer [Tue, 5 May 2015 22:37:03 +0000 (18:37 -0400)]
staging: unisys: add ACPI and PCI requirement to Kconfig

Later patches will require PCI and ACPI support in the kernel, so add these
features to the Kconfig.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: add acpi pnp driver
Prarit Bhargava [Tue, 5 May 2015 22:37:02 +0000 (18:37 -0400)]
staging: unisys: add acpi pnp driver

According to Unisys, another OS detects the PNP0A07 as the auto load
device.  We can also do this in the linux kernel by simply converting the
driver over to the ACPI driver model.

Notes: This changes the usage of __init and it had to be removed from some
functions to avoid a !__init function calling an __init function.
Additionally I also cleaned up the headers in visorchipset.c since I was
adding a header file.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove BOOL,TRUE,FALSE definitions
Prarit Bhargava [Tue, 5 May 2015 22:37:01 +0000 (18:37 -0400)]
staging: unisys: remove BOOL,TRUE,FALSE definitions

These shouldn't be defined in the code and can be replaced with the
standard bool, true, and false usage that the kernel uses.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Finally remove the last remnants of memregion
Jes Sorensen [Tue, 5 May 2015 22:37:00 +0000 (18:37 -0400)]
staging: unisys: Finally remove the last remnants of memregion

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Eliminate visor_memregion_write()
Jes Sorensen [Tue, 5 May 2015 22:36:59 +0000 (18:36 -0400)]
staging: unisys: Eliminate visor_memregion_write()

visorchannel's signal code should call visorchannel_write() directly.
This is more consistent and cleaner, and allows us to remove the last
memregion call.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Eliminate visor_memregion_read()
Jes Sorensen [Tue, 5 May 2015 22:36:58 +0000 (18:36 -0400)]
staging: unisys: Eliminate visor_memregion_read()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchannel_create_guts(): Use visorchannel_read()
Jes Sorensen [Tue, 5 May 2015 22:36:57 +0000 (18:36 -0400)]
staging: unisys: visorchannel_create_guts(): Use visorchannel_read()

There is no benefit to calling visor_memregion_read() at this point.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchannel_write(): Handle partial channel_header writes
Jes Sorensen [Tue, 5 May 2015 22:36:56 +0000 (18:36 -0400)]
staging: unisys: visorchannel_write(): Handle partial channel_header writes

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchannel_read(): Use memcpy_fromio() directly
Jes Sorensen [Tue, 5 May 2015 22:36:55 +0000 (18:36 -0400)]
staging: unisys: visorchannel_read(): Use memcpy_fromio() directly

Note, this changes the behavior of visorchannel_read(). The old code
would return the channel header, if the offset argument was 0, and the
caller tried to read beyond the size of the visorchannel. Note this
only worked for offset == 0, but not for
(offset > 0) && (offset < header_size), which was inconsistent.

The new implementation returns an error if someone tries to read
beyond the visorchannel size.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchannel_write(): Use memcpy_toio() directly
Jes Sorensen [Tue, 5 May 2015 22:36:54 +0000 (18:36 -0400)]
staging: unisys: visorchannel_write(): Use memcpy_toio() directly

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: memregion: {un, }mapit() are no longer used
Jes Sorensen [Tue, 5 May 2015 22:36:53 +0000 (18:36 -0400)]
staging: unisys: memregion: {un, }mapit() are no longer used

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: memregion: Eliminate visor_memregion_get_*() functions
Jes Sorensen [Tue, 5 May 2015 22:36:52 +0000 (18:36 -0400)]
staging: unisys: memregion: Eliminate visor_memregion_get_*() functions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: memregion: Eliminate visor_memregion_resize()
Jes Sorensen [Tue, 5 May 2015 22:36:51 +0000 (18:36 -0400)]
staging: unisys: memregion: Eliminate visor_memregion_resize()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: memregion: Eliminate visor_memregion_destroy()
Jes Sorensen [Tue, 5 May 2015 22:36:50 +0000 (18:36 -0400)]
staging: unisys: memregion: Eliminate visor_memregion_destroy()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Eliminate visor_memregion_create()
Jes Sorensen [Tue, 5 May 2015 22:36:49 +0000 (18:36 -0400)]
staging: unisys: Eliminate visor_memregion_create()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: get rid of serialloopbacktest
David Kershner [Tue, 5 May 2015 22:36:48 +0000 (18:36 -0400)]
staging: unisys: get rid of serialloopbacktest

serialloopbacktest is no longer supported. Get rid of it.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: cleanup and align iochannel.h comments
Erik Arfvidson [Tue, 5 May 2015 22:36:47 +0000 (18:36 -0400)]
staging: unisys: cleanup and align iochannel.h comments

This patch reorganizes, aligns, and corrects grammar mistakes on
comments.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused #define in iochannel.h
Erik Arfvidson [Tue, 5 May 2015 22:36:46 +0000 (18:36 -0400)]
staging: unisys: remove unused #define in iochannel.h

This patch simply remove all unused #define's in iochannel.h

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused chipset feature PCIVBUS
Erik Arfvidson [Tue, 5 May 2015 22:36:45 +0000 (18:36 -0400)]
staging: unisys: remove unused chipset feature PCIVBUS

This patch removes unused chipset feature
ULTRA_CHIPSET_FEATURE_PCIVBUS

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused CONTROLVM_CHIPSET_SHUTDOWN
Erik Arfvidson [Tue, 5 May 2015 22:36:44 +0000 (18:36 -0400)]
staging: unisys: remove unused CONTROLVM_CHIPSET_SHUTDOWN

this patch removes unused chipset command on the guest
CONTROLVM_CHIPSET_SHUTDOWN

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused device_map and guest_devices struct
Erik Arfvidson [Tue, 5 May 2015 22:36:43 +0000 (18:36 -0400)]
staging: unisys: remove unused device_map and guest_devices struct

This patch removes unused struct in the controlvm_channel message
and replaces it with a char reserved inorder to mantain same
message size.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: controlvmchannel.h comment aligment and cleanup
Erik Arfvidson [Tue, 5 May 2015 22:36:42 +0000 (18:36 -0400)]
staging: unisys: controlvmchannel.h comment aligment and cleanup

This patch is a comment aligment and cleanup for
controlvmchannel.h.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: rename variable to reserverd since it is unused
Erik Arfvidson [Tue, 5 May 2015 22:36:41 +0000 (18:36 -0400)]
staging: unisys: rename variable to reserverd since it is unused

This patch renames send_irq_handle to reserved1 since this variable
is unused in the guest side.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused CONTROL_VM messages from enum
Erik Arfvidson [Tue, 5 May 2015 22:36:40 +0000 (18:36 -0400)]
staging: unisys: remove unused CONTROL_VM messages from enum

This patch removes CONTROL_VM  disk messages from enum since they
are completely unused.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove server crust from visorchipset.
David Kershner [Tue, 5 May 2015 22:36:39 +0000 (18:36 -0400)]
staging: unisys: remove server crust from visorchipset.

The visorchipset driver originally serviced both servers and
clients. This implementation is client only so remove some
more server side implementation.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused #define MAX_SERIAL_NUM
Erik Arfvidson [Tue, 5 May 2015 22:36:38 +0000 (18:36 -0400)]
staging: unisys: remove unused #define MAX_SERIAL_NUM

This patch simply removes #define MAX_SERIAL_NUM from iochannel.h

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused #define in controlvmchannel
Erik Arfvidson [Tue, 5 May 2015 22:36:37 +0000 (18:36 -0400)]
staging: unisys: remove unused #define in controlvmchannel

This patch remove unused controlvmchannel.h #defines

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove unused enum from controlvmchannel.h
Erik Arfvidson [Tue, 5 May 2015 22:36:36 +0000 (18:36 -0400)]
staging: unisys: remove unused enum from controlvmchannel.h

This patch removes this enum since it is unused

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove typedef GUEST_PHYSICAL_ADDRESS to u64
Erik Arfvidson [Tue, 5 May 2015 22:36:35 +0000 (18:36 -0400)]
staging: unisys: remove typedef GUEST_PHYSICAL_ADDRESS to u64

This patch removes typedef GUEST_PHYSICAL_ADDRESS to u64

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Eliminate unused visorchannel_dump_section()
Jes Sorensen [Tue, 5 May 2015 22:36:34 +0000 (18:36 -0400)]
staging: unisys: Eliminate unused visorchannel_dump_section()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchannel_get_memregion() isn't used
Jes Sorensen [Tue, 5 May 2015 22:36:33 +0000 (18:36 -0400)]
staging: unisys: visorchannel_get_memregion() isn't used

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: memregion: Embed memregion in struct channel
Jes Sorensen [Tue, 5 May 2015 22:36:32 +0000 (18:36 -0400)]
staging: unisys: memregion: Embed memregion in struct channel

This changes the API for visor_memregion_create() to require a
pre-allocated struct memregion. Embedding this in struct channel
avoids a layer of additional kmalloc()'s and error checks.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>