firefly-linux-kernel-4.4.55.git
10 years agostaging: comedi: pcl818: convert private data flags to bit-fields
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:50 +0000 (14:27 -0700)]
staging: comedi: pcl818: convert private data flags to bit-fields

Convert the flags in the private data to bit-fields to save a bit of
space.

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>
10 years agostaging: comedi: pcl812: convert private data flags to bit-fields
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:48 +0000 (14:27 -0700)]
staging: comedi: pcl812: convert private data flags to bit-fields

Convert the flags in the private data to bit-fields to save a bit of
space.

Rename the CamelCase 'use_MPC' member.

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>
10 years agostaging: comedi: pcl818: remove 'ai_chanlist' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:46 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'ai_chanlist' from private data

This member of the private data is just a pointer to the cmd->chanlist.
Use that instead.

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>
10 years agostaging: comedi: pcl812: remove 'ai_chanlist' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:45 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove 'ai_chanlist' from private data

This member of the private data is just a copy of the cmd->chanlist. Use
that instead.

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>
10 years agostaging: comedi: pcl818: remove 'ai_timer[12]' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:44 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'ai_timer[12]' from private data

These members of the private data are set but never used. Remove them.

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>
10 years agostaging: comedi: pcl818: remove analog output interrupt code
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:43 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove analog output interrupt code

The hardware does not have any analog output interrupt support. Remove the
stubbed in code.

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>
10 years agostaging: comedi: pcl818: use subdevice (*cancel)
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:42 +0000 (14:27 -0700)]
staging: comedi: pcl818: use subdevice (*cancel)

Use the subdevice (*cancel) operation to remove the need for a forward
declaration.

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>
10 years agostaging: comedi: pcl812: use subdevice (*cancel)
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:40 +0000 (14:27 -0700)]
staging: comedi: pcl812: use subdevice (*cancel)

Use the subdevice (*cancel) operation to remove the need for a forward
declaration.

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>
10 years agostaging: comedi: pcl818: don't calc the timer divisors twice
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:39 +0000 (14:27 -0700)]
staging: comedi: pcl818: don't calc the timer divisors twice

The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd)
is called by the comedi core. The extra sanity checks in the (*do_cmd) are
not necessary, the values returned from i8253_cascade_ns_to_timer() will be
greater than 1. Save the values in the private data so they don't need to be
recalced.

Refactor pcl818_start_pacer() to use the values from the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl812: don't calc the timer divisors twice
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:37 +0000 (14:27 -0700)]
staging: comedi: pcl812: don't calc the timer divisors twice

The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd)
is called by the comedi core. Save the values in the private data so they
don't need to be recalced.

Refactor pcl812_start_pacer() to use the values from the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl816: remove unneeded forward declarations
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:36 +0000 (14:27 -0700)]
staging: comedi: pcl816: remove unneeded forward declarations

These forward declarations are not needed.

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>
10 years agostaging: comedi: pcl818: use 8253.h helpers
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:35 +0000 (14:27 -0700)]
staging: comedi: pcl818: use 8253.h helpers

Use the helper functions in 8253.h to clarify the timer programming.

Move start_pacer() to remove the need for the forward declarations.
Rename the function so it has namespace associated with the driver.

Change the 'mode' parameter. This parameter is really a flag to the
function indicating if the divisors should be loaded into the timers.

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>
10 years agostaging: comedi: pcl816: use 8253.h helpers
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:34 +0000 (14:27 -0700)]
staging: comedi: pcl816: use 8253.h helpers

Use the helper functions in 8253.h to clarify the timer programming.

Move start_pacer() to remove the need for the forward declarations.
Rename the function so it has namespace associated with the driver.

Change the 'mode' parameter. This parameter is really a flag to the
function indicating if the divisors should be loaded into the timers.

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>
10 years agostaging: comedi: pcl812: use 8253.h helpers
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:33 +0000 (14:27 -0700)]
staging: comedi: pcl812: use 8253.h helpers

Use the helper functions in 8253.h to clarify the timer programming.

Move start_pacer() to remove the need for the forward declarations.
Rename the function so it has namespace associated with the driver.

Change the 'mode' parameter. This parameter is really a flag to the
function indicating if the divisors should be loaded into the timers.

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>
10 years agostaging: comedi: pcl818: remove 'last_int_sub' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:32 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'last_int_sub' from private data

THis member of the private data is set but never used. 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>
10 years agostaging: comedi: pcl816: remove 'last_int_sub' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:31 +0000 (14:27 -0700)]
staging: comedi: pcl816: remove 'last_int_sub' from private data

THis member of the private data is set but never used. 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>
10 years agostaging: comedi: pcl818: tidy up dma buffer allocation
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:30 +0000 (14:27 -0700)]
staging: comedi: pcl818: tidy up dma buffer allocation

This driver uses 2 buffers for DMA. Refactor the buffer allocation to
use a for loop to remove code duplication. Remove the dev_err() messages
when __get_dma_pages() fails and change the errno returned from -EBUSY
to -ENOMEM.

Both buffers are the same size so replace the 'dmapages' and 'hwdmasize'
arrays in the private data with variables to save a bit of space.

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>
10 years agostaging: comedi: pcl816: tidy up dma buffer allocation
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:29 +0000 (14:27 -0700)]
staging: comedi: pcl816: tidy up dma buffer allocation

This driver uses 2 buffers for DMA. Refactor the buffer allocation to
use a for loop to remove code duplication. Remove the dev_err() messages
when __get_dma_pages() fails and change the errno returned from -EBUSY
to -ENOMEM.

Both buffers are the same size so replace the 'dmapages' and 'hwdmasize'
arrays in the private data with variables to save a bit of space.

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>
10 years agostaging: comedi: pcl812: tidy up dma buffer allocation
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:28 +0000 (14:27 -0700)]
staging: comedi: pcl812: tidy up dma buffer allocation

This driver uses 2 buffers for DMA. Refactor the buffer allocation to
use a for loop to remove code duplication. Remove the dev_err() messages
when __get_dma_pages() fails and change the errno returned from -EBUSY
to -ENOMEM.

Both buffers are the same size so replace the 'dmapages' and 'hwdmasize'
arrays in the private data with variables to save a bit of space.

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>
10 years agostaging: comedi: pcl818: remove 'ai_flags' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:27 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'ai_flags' from private data

This member of the private data is not used. 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>
10 years agostaging: comedi: pcl812: remove 'ai_flags' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:26 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove 'ai_flags' from private data

This member of the private data is just a copy of the cmd->flags.

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>
10 years agostaging: comedi: pcl818: remove 'ai_n_chan' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:25 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'ai_n_chan' from private data

This member of the private data is just a copy of the cmd->chanlist_len.

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>
10 years agostaging: comedi: pcl816: remove 'ai_n_chan' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:24 +0000 (14:27 -0700)]
staging: comedi: pcl816: remove 'ai_n_chan' from private data

This member of the private data is just a copy of the cmd->chanlist_len.

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>
10 years agostaging: comedi: pcl812: remove 'ai_n_chan' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:23 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove 'ai_n_chan' from private data

This member of the private data is just a copy of the cmd->chanlist_len.

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>
10 years agostaging: comedi: pcl818: remove 'ai_scans' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:22 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'ai_scans' from private data

This member of the private data is just a copy of the cmd->stop_arg.

Refactor the code to follow the style of pcl812 and pcl816 drivers.

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>
10 years agostaging: comedi: pcl816: remove 'ai_scans' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:21 +0000 (14:27 -0700)]
staging: comedi: pcl816: remove 'ai_scans' from private data

This member of the private data is just a copy of the cmd->stop_arg.

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>
10 years agostaging: comedi: pcl812: remove 'ai_scans' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:20 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove 'ai_scans' from private data

This member of the private data is just a copy of the cmd->stop_arg.

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>
10 years agostaging: comedi: pcl812: remove 'valid' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:19 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove 'valid' from private data

This member of the private data is set but never used. 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>
10 years agostaging: comedi: pcl812: remove acl8216_ai_insn_read()
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:18 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove acl8216_ai_insn_read()

This (*insn_read) function was used to read 16-bit analog input data
from the boardACL8216 boardtypes. The 12/16-bit differences are now
handled by the pcl812_ai_eoc() and pcl812_ai_get_sample() helpers.

Remove this function and use pcl812_ai_insn_read() for all boardtypes.

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>
10 years agostaging: comedi: pcl812: remove 'ai_is16b' from private data
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:17 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove 'ai_is16b' from private data

We can check the subdevice 'maxdata' to determine if the analog input
data is 12 or 16-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>
10 years agostaging: comedi: pcl818: introduce pcl818_ai_get_sample()
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:16 +0000 (14:27 -0700)]
staging: comedi: pcl818: introduce pcl818_ai_get_sample()

Introduce a helper function to read the 12-bit analog input data
sample and optionally return the channel that the sample was for.
The channel is only used in the interrupt routine to check for
dropped samples.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl816: introduce pcl816_ai_get_sample()
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:15 +0000 (14:27 -0700)]
staging: comedi: pcl816: introduce pcl816_ai_get_sample()

Introduce a helper function to read the 14/16-bit analog input data
sample.

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>
10 years agostaging: comedi: pcl812: introduce pcl812_ai_get_sample()
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:14 +0000 (14:27 -0700)]
staging: comedi: pcl812: introduce pcl812_ai_get_sample()

Introduce a helper function to read the 12/16-bit analog input data
sample.

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>
10 years agostaging: comedi: pcl812: remove 'ai_maxdata' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:13 +0000 (14:27 -0700)]
staging: comedi: pcl812: remove 'ai_maxdata' from boardinfo

Most of the board types supported by this driver have 12-bit analog
inputs. Two of them, the acl8216 and a826pg, have 16-bit analog inputs.

Remove the 'ai_maxdata' member from the boardinfo and replace it with
a bit-field flag 'has_16bit_ai'. Refactor pcl812_attach() to use this
new boardinfo.

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>
10 years agostaging: comedi: pcl818: remove 'ao_maxdata' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:12 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'ao_maxdata' from boardinfo

All the board types have 12-bit analog outputs. Remove this data from
the boardinfo.

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>
10 years agostaging: comedi: pcl818: remove 'ai_maxdata' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:11 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'ai_maxdata' from boardinfo

All the board types have 12-bit analog inputs. Remove this data from
the boardinfo.

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>
10 years agostaging: comedi: pcl818: clarify irq request in pcl818_attach()
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:10 +0000 (14:27 -0700)]
staging: comedi: pcl818: clarify irq request in pcl818_attach()

All the board types can use IRQ 2-7 for async command support. Remove
the 'IRQbits', which is a mask of the valid IRQs, from the boardinfo
and refactor pcl818_attach().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl816: remove 'ai_range_type' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:06 +0000 (14:27 -0700)]
staging: comedi: pcl816: remove 'ai_range_type' from boardinfo

All the board types use the same analog input range_table. Remove this
data from the boardinfo.

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>
10 years agostaging: comedi: pcl816: remove 'ao_chanlist' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:04 +0000 (14:27 -0700)]
staging: comedi: pcl816: remove 'ao_chanlist' from boardinfo

This member in the boardinfo is the same for all board types. Remove
it.

The comedi core will initalize the subdevice len_chanlist to 1 if it
is not set by the driver so remove the unnecessary initialization.

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>
10 years agostaging: comedi: pcl818: remove 'n_ranges' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:03 +0000 (14:27 -0700)]
staging: comedi: pcl818: remove 'n_ranges' from boardinfo

This member in the boardinfo is not used. 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>
10 years agostaging: comedi: pcl816: remove 'n_ranges' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:02 +0000 (14:27 -0700)]
staging: comedi: pcl816: remove 'n_ranges' from boardinfo

This member in the boardinfo is not used. 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>
10 years agostaging: comedi: pcl812: tidy up differential ai user option
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:01 +0000 (14:27 -0700)]
staging: comedi: pcl812: tidy up differential ai user option

Some of the boards supported by this driver can do differential analog
input when configureg with jumpers on the board. When diff. ai is used
the number of input channels is half the single-ended number of channels.
The user specifies the analog input mode for these boards when attaching
to the driver by using a configuration option.

Remove the unnecessary 'n_aichan_diff' member from the boardinfo. Add a
comment for the boards that can do differential ai.

Refactor pcl812_attach() to parse the user option before setting up the
subdevices. We can then use the 'use_diff' flag to determine if the ai
is single-ended or differential and set the subdev_flags and n_chan.

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>
10 years agostaging: comedi: pcl818: all board types have analog inputs
H Hartley Sweeten [Mon, 17 Feb 2014 21:27:00 +0000 (14:27 -0700)]
staging: comedi: pcl818: all board types have analog inputs

All the boards supported by this driver have 16 single-ended analog input
channels. The boards can also be configued to give 8 differential inputs.

Remove the 'n_aichan_se' and 'n_aichan_diff' members from the boardinfo and
refactor pcl818_attach().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl816: all board types have 16 analog inputs
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:59 +0000 (14:26 -0700)]
staging: comedi: pcl816: all board types have 16 analog inputs

All the boards supported by this driver have 16 analog input channels.

Remove the 'n_aichan' member from the boardinfo and refactor pcl816_attach().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl812: all board types have analog inputs
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:58 +0000 (14:26 -0700)]
staging: comedi: pcl812: all board types have analog inputs

All the boards supported by this driver have 16 or 32 analog input
channels.

Remove the unnecessary check in pcl812_attach() to reduce the indent
level of the code.

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>
10 years agostaging: comedi: pcl818: factor analog input range selection out of (*attach)
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:57 +0000 (14:26 -0700)]
staging: comedi: pcl818: factor analog input range selection out of (*attach)

The analog input subdevice range is setup in this driver based on a config
option passed by the user. Factor the code that sets the range_table out
of pcl818_attach() to clarify the (*attach).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl812: factor analog input range selection out of (*attach)
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:56 +0000 (14:26 -0700)]
staging: comedi: pcl812: factor analog input range selection out of (*attach)

The analog input subdevice range is setup in this driver based on a config
option passed by the user. Factor the code that sets the range_table out
of pcl812_attach() to clarify the (*attach).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl816: all board types have digital inputs and outputs
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:55 +0000 (14:26 -0700)]
staging: comedi: pcl816: all board types have digital inputs and outputs

All the board types have 16 digital inputs and 16 digital outputs.

Remove the 'n_dichan' and 'n_dochan' members in the boardinfo.

The subdevice support code is currently incomplete in this driver. For
now just tidy up the incomplete subdevice code in pcl816_attach().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcl818: all board types have digital inputs and outputs
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:54 +0000 (14:26 -0700)]
staging: comedi: pcl818: all board types have digital inputs and outputs

All the board types have 16 digital inputs and 16 digital outputs.

Remove the 'n_dichan' and 'n_dochan' members in the boardinfo. Refactor
pcl818_attach() to always setup these subdevices.

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>
10 years agostaging: comedi: pcl812: tidy up digital subdevice boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:53 +0000 (14:26 -0700)]
staging: comedi: pcl812: tidy up digital subdevice boardinfo

For the board types that have digital inputs and outputs there are always
16 input channels and 16 output channels.

Remove the 'n_dichan' and 'n_dochan' members in the boardinfo and replace
them with a bit-field flag 'has_dio'. Refactor pcl812_attach() to use the
new boardinfo.

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>
10 years agostaging: comedi: pcl818: change 'is_818' in boardinfo to a bit-field
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:52 +0000 (14:26 -0700)]
staging: comedi: pcl818: change 'is_818' in boardinfo to a bit-field

Change this flag in the boardinfo into a bit-field.

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>
10 years agostaging: comedi: pcl812: rename 'haveMPC508' in boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:51 +0000 (14:26 -0700)]
staging: comedi: pcl812: rename 'haveMPC508' in boardinfo

Rename this CamelCase member in the boardinfo and change it to a bit-
field flag.

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>
10 years agostaging: comedi: pcl818: clarify dma channel request in pcl818_attach()
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:50 +0000 (14:26 -0700)]
staging: comedi: pcl818: clarify dma channel request in pcl818_attach()

All the board types that can do DMA can use DMA channels 3 or 1. Remove
the 'DMAbits', which is a mask of the valid channels, from the boardinfo
and replace it with a bit-field flag 'has_dma'.

Refactor pcl818_attach() to use the new flag and remove the need for the
goto.

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>
10 years agostaging: comedi: pcl816: clarify dma channel request in pcl816_attach()
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:49 +0000 (14:26 -0700)]
staging: comedi: pcl816: clarify dma channel request in pcl816_attach()

All the board types can do DMA using DMA channels 3 or 1. Remove the 'DMAbits',
which is a mask of the valid channels, from the boardinfo.

Refactor pcl816_attach() to remove the need for the goto.

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>
10 years agostaging: comedi: pcl812: clarify dma channel request in pcl812_attach()
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:48 +0000 (14:26 -0700)]
staging: comedi: pcl812: clarify dma channel request in pcl812_attach()

All the board types that can do DMA can use DMA channels 3 or 1. Remove
the 'DMAbits', which is a mask of the valid channels, from the boardinfo
and replace it with a bit-field flag 'has_dma'.

Refactor pcl812_attach() to use the new flag and remove the need for the
goto.

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>
10 years agostaging: comedi: pcl818: remove 'rangelist_ao' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:47 +0000 (14:26 -0700)]
staging: comedi: pcl818: remove 'rangelist_ao' from boardinfo

The 'rangelist_ao' is the same for all board types. Remove this data
from the boardinfo.

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>
10 years agostaging: comedi: pcl816: remove 'rangelist_ao' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:46 +0000 (14:26 -0700)]
staging: comedi: pcl816: remove 'rangelist_ao' from boardinfo

The 'rangelist_ao' is the same for all board types. Remove this data
from the boardinfo.

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>
10 years agostaging: comedi: pcl812: remove 'rangelist_ao' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:45 +0000 (14:26 -0700)]
staging: comedi: pcl812: remove 'rangelist_ao' from boardinfo

The 'rangelist_ao' is the same for all board types. Remove this data
from the boardinfo.

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>
10 years agostaging: comedi: pcl816: remove 'i8254_osc_base' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:44 +0000 (14:26 -0700)]
staging: comedi: pcl816: remove 'i8254_osc_base' from boardinfo

The 'i8254_osc_base' is the same for all board types. Remove this data
from the boardinfo.

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>
10 years agostaging: comedi: pcl812: remove 'i8254_osc_base' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:43 +0000 (14:26 -0700)]
staging: comedi: pcl812: remove 'i8254_osc_base' from boardinfo

The 'i8254_osc_base' is the same for all board types. Remove this data
from the boardinfo.

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>
10 years agostaging: comedi: pcl818: remove 'io_range' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:42 +0000 (14:26 -0700)]
staging: comedi: pcl818: remove 'io_range' from boardinfo

The 'io_range' is the same for all board types. Remove this data from
the boardinfo.

The i/o resource size is larger for board types that have a FIFO but this
larger region is only requested if the user wants to use the fifo.

Modify the pcl818_attach() to remove the need for the 'io_range' in the
private data.

For aesthetics, rename the 'fifo' member in the boardinfo to 'has_fifo'
and change it to a bit-field.

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>
10 years agostaging: comedi: pcl816: remove 'io_range' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:41 +0000 (14:26 -0700)]
staging: comedi: pcl816: remove 'io_range' from boardinfo

The 'io_range' is the same for all board types. Remove this data from
the boardinfo.

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>
10 years agostaging: comedi: pcl812: remove 'io_range' from boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:40 +0000 (14:26 -0700)]
staging: comedi: pcl812: remove 'io_range' from boardinfo

The 'io_range' is the same for all board types. Remove this data from
the boardinfo.

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>
10 years agostaging: comedi: pcl818: remove 0/NULL initialzation in boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:39 +0000 (14:26 -0700)]
staging: comedi: pcl818: remove 0/NULL initialzation in boardinfo

The unlisted members in the boardinfo declaration will default to 0/NULL.

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>
10 years agostaging: comedi: pcl812: remove 0/NULL initialzation in boardinfo
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:38 +0000 (14:26 -0700)]
staging: comedi: pcl812: remove 0/NULL initialzation in boardinfo

The unlisted members in the boardinfo declaration will default to 0/NULL.

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>
10 years agostaging: comedi: pcl818: convert boardinfo declaration to C99 format
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:37 +0000 (14:26 -0700)]
staging: comedi: pcl818: convert boardinfo declaration to C99 format

To reduce editing errors and make the data more maintainable, convert
the boardinfo declaration to C99 format.

For aesthetics, move the declaration closer to the definition and remove
the unnecessary comments in the definition.

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>
10 years agostaging: comedi: pcl816: convert boardinfo declaration to C99 format
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:36 +0000 (14:26 -0700)]
staging: comedi: pcl816: convert boardinfo declaration to C99 format

To reduce editing errors and make the data more maintainable, convert
the boardinfo declaration to C99 format.

For aesthetics, move the declaration closer to the definition and remove
the unnecessary comments in the definition.

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>
10 years agostaging: comedi: pcl812: convert boardinfo declaration to C99 format
H Hartley Sweeten [Mon, 17 Feb 2014 21:26:35 +0000 (14:26 -0700)]
staging: comedi: pcl812: convert boardinfo declaration to C99 format

To reduce editing errors and make the data more maintainable, convert
the boardinfo declaration to C99 format.

For aesthetics, move the declaration closer to the definition and remove
the unnecessary comments in the definition.

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>
10 years agostaging/bcm: integer underflow leads to Oom
Dan Carpenter [Mon, 17 Feb 2014 19:57:31 +0000 (22:57 +0300)]
staging/bcm: integer underflow leads to Oom

We do:

        if (NOB > DEFAULT_BUFF_SIZE)
                BuffSize = DEFAULT_BUFF_SIZE;
        else
                BuffSize = NOB;

Since NOB can be negative it results in a larger than intended BuffSize
and makes kzalloc() fail.

The code is still a bit crap because it lets the users read as much as
they want from nvram, but I don't know what a sensible upper limit
should be.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/bcm: two information leaks in ioctl
Dan Carpenter [Mon, 17 Feb 2014 19:56:06 +0000 (22:56 +0300)]
staging/bcm: two information leaks in ioctl

There are a couple paths where we don't check how much data we copy back
to the user.

Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: wlan-ng: replace function ieee80211_dsss_chan_to_freq()
Zhao, Gang [Tue, 18 Feb 2014 15:03:27 +0000 (23:03 +0800)]
staging: wlan-ng: replace function ieee80211_dsss_chan_to_freq()

Replace ieee80211_dsss_chan_to_freq() with more generic
ieee80211_channel_to_frequency(), and add a variable to deal with 80
characters problem.

File cfg80211.c is included by p80211netdev.c, p80211netdev.c includes
<net/cfg80211.h>, both ieee80211_channel_to_frequency() and
IEEE80211_BAND_2GHZ is defined / declared in <net/cfg80211.h>. So this
change is safe.

This change is a preparation for the removal of function
ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: gdm724x: cleanup alloc_tx_sdu_struct()
Dan Carpenter [Tue, 18 Feb 2014 12:18:10 +0000 (15:18 +0300)]
staging: gdm724x: cleanup alloc_tx_sdu_struct()

The kfree(t_sdu->buf) sets off a private static checker warning because
"t_sdu->buf" is always NULL.

This function just allocates two pointers so we can re-write it to be
simpler.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: bcm: DDRInit: fix up indentation issues.
Gary Rookard [Sun, 16 Feb 2014 16:16:41 +0000 (11:16 -0500)]
Staging: bcm: DDRInit: fix up indentation issues.

fixed up a couple of indentation issues.

Signed-off-by: Gary Alan Rookard <garyrookard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: comedi: addi-data: do not initialize statics to 0 in hwdrv_apci035.c
Chase Southwood [Sun, 16 Feb 2014 08:41:32 +0000 (02:41 -0600)]
Staging: comedi: addi-data: do not initialize statics to 0 in hwdrv_apci035.c

This patch for hwdrv_apci035.c removes a zero initialization from two
static variables.  Static variables are initialized to zero by default,
so doing so explicitly is not necessary.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: comedi: addi-data: convert printk() to dev_err()
Chase Southwood [Tue, 18 Feb 2014 06:34:39 +0000 (00:34 -0600)]
Staging: comedi: addi-data: convert printk() to dev_err()

This patch for hwdrv_apci035.c changes a printk() call to a dev_err() call
since this is generally preferred.  It also removes a newline from the start
of the error message.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: comedi: addi-data: cleanup comments in hwdrv_apci035.c
Chase Southwood [Sun, 16 Feb 2014 08:41:09 +0000 (02:41 -0600)]
Staging: comedi: addi-data: cleanup comments in hwdrv_apci035.c

This patch for hwdrv_apci035.c aligns comment blocks and makes indentation
of comments consistent.  Removed all "spaces before tabs" in comment
indentation as well.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: comedi: addi-data: fix brace-related coding style issues in hwdrv_apci035.c
Chase Southwood [Sun, 16 Feb 2014 08:40:06 +0000 (02:40 -0600)]
Staging: comedi: addi-data: fix brace-related coding style issues in hwdrv_apci035.c

This patch for hwdrv_apci035 removes some unneeded braces, and moves some
improperly placed braces to the correct position, as found by checkpatch.
It also removes a commented out if-statement that I found whilst cleaning
braces that is identical to another un-commented if-statement directly
above it, so it is just added clutter and so we can delete it to clean up
further.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: ion_cma_heap: Remove '0x' when using %pa format
Fabio Estevam [Tue, 18 Feb 2014 12:46:33 +0000 (09:46 -0300)]
staging: ion: ion_cma_heap: Remove '0x' when using %pa format

%pa format already prints in hexadecimal format, so remove the '0x' annotation
to avoid a double '0x0x' pattern.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Add private buffer flag to skip page pooling on free
Mitchel Humpherys [Mon, 17 Feb 2014 21:58:39 +0000 (13:58 -0800)]
staging: ion: Add private buffer flag to skip page pooling on free

Currently, when we free a buffer it might actually just go back into a
heap-specific page pool rather than going back to the system. This poses
a problem because sometimes (like when we're running a shrinker in low
memory conditions) we need to force the memory associated with the
buffer to truly be relinquished to the system rather than just going
back into a page pool.

There isn't a use case for this flag by Ion clients, so make it a
private flag. The main use case right now is to provide a mechanism for
the deferred free code to force stale buffers to bypass page pooling.

Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
[jstultz: Minor commit subject tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Move shrinker out of heaps
Colin Cross [Mon, 17 Feb 2014 21:58:38 +0000 (13:58 -0800)]
staging: ion: Move shrinker out of heaps

Every heap that uses deferred frees is going to need a shrinker
to shrink the freelist under memory pressure.  Rather than
requiring each heap to implement a shrinker, automatically
register a shrinker if the deferred free flag is set.
The system heap also needs to shrink its page pools, so add
a shrink function to the heap ops that will be called after
shrinking the freelists.

Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
[jstultz: Resolved big conflicts with the shrinker api change.
Also minor commit subject tweak.]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Make sure all clients are exposed in debugfs
Mitchel Humpherys [Mon, 17 Feb 2014 21:58:37 +0000 (13:58 -0800)]
staging: ion: Make sure all clients are exposed in debugfs

Currently, if multiple Ion clients are created with the same name, only
the first one shows up in debugfs. Rectify this by adding a
monotonically-increasing serial number to the debug names of Ion
clients.

Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
[jstultz: Minor commit subject tweaks]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Store a copy of the client name on client creation
Mitchel Humpherys [Mon, 17 Feb 2014 21:58:36 +0000 (13:58 -0800)]
staging: ion: Store a copy of the client name on client creation

Currently, we copy the pointer passed in to ion_client_create without
making a copy of the string itself. This approach is problematic since
it relies on the client keeping the name string in working order.

Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
[jstultz: Minor commit subject tweaks]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Fix debugfs handling of multiple kernel clients
Laura Abbott [Mon, 17 Feb 2014 21:58:35 +0000 (13:58 -0800)]
staging: ion: Fix debugfs handling of multiple kernel clients

Currently, Ion registers all debugfs entries for clients
via pid. If there are multiple kernel clients, this means
the debugfs entry only gets created for the first one. Fix
this by creating debugfs entries by name always. When
creating user clients, specify the name via the pid.

Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
[jstultz: Minor commit subject tweaks]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Create separate heap and client debugfs directories
Mitchel Humpherys [Mon, 17 Feb 2014 21:58:34 +0000 (13:58 -0800)]
staging: ion: Create separate heap and client debugfs directories

It can be slightly annoying to figure out which files under the ion
debugfs directory are heap debug files and which ones are client debug
files. Create separate subdirectories under ion to hold the different
types of debug files.

Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
[jstultz: Minor commit subject tweaks]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: Split uapi out of binder.h
Colin Cross [Mon, 17 Feb 2014 21:58:33 +0000 (13:58 -0800)]
staging: android: Split uapi out of binder.h

Move the userspace interface of binder.h to
drivers/staging/android/uapi/binder.h.

Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
[jstultz: Worked out the collisions from some of the type changes
made upstream. Also minor commit subject tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: split uapi out of sync.h and sw_sync.h
Colin Cross [Mon, 17 Feb 2014 21:58:32 +0000 (13:58 -0800)]
staging: android: split uapi out of sync.h and sw_sync.h

Move the userspace interfaces of sync.h and sw_sync.h to
drivers/staging/android/uapi/

Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
[jstultz: Fixed up some conflicts from upstream spelling fixes]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: Split uapi out of ashmem.h
Colin Cross [Mon, 17 Feb 2014 21:58:31 +0000 (13:58 -0800)]
staging: android: Split uapi out of ashmem.h

Move the userspace interface of ashmem.h to
drivers/staging/android/uapi/ashmem.h

Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
[jstultz: Minor commit message tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: Split uapi out of android_alarm.h
Colin Cross [Mon, 17 Feb 2014 21:58:30 +0000 (13:58 -0800)]
staging: android: Split uapi out of android_alarm.h

Move the userspace interface of android_alarm.h to
drivers/staging/android/uapi/android_alarm.h

Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
[jstultz: minor commit msg tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: clean up s_nsInterruptUsbIoCompleteRead
Malcolm Priestley [Mon, 17 Feb 2014 21:27:30 +0000 (21:27 +0000)]
staging: vt6656: clean up s_nsInterruptUsbIoCompleteRead

Remove comments, white space and camel case

Camel Case changes
pDevice -> priv
ntStatus -> status

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: Remove variable fKillEventPollingThread
Malcolm Priestley [Mon, 17 Feb 2014 21:24:33 +0000 (21:24 +0000)]
staging: vt6656: Remove variable fKillEventPollingThread

We already kill the urb and since patch
s_nsInterruptUsbIoCompleteRead add urb status returns.
have error handling

There is no need for this variable.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: s_nsInterruptUsbIoCompleteRead remove usb_fill_bulk_urb
Malcolm Priestley [Mon, 17 Feb 2014 21:18:40 +0000 (21:18 +0000)]
staging: vt6656: s_nsInterruptUsbIoCompleteRead remove usb_fill_bulk_urb

No need to fill urb in again, just resubmit it.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: s_nsInterruptUsbIoCompleteRead add urb status returns
Malcolm Priestley [Mon, 17 Feb 2014 21:16:20 +0000 (21:16 +0000)]
staging: vt6656: s_nsInterruptUsbIoCompleteRead add urb status returns

Drop out of urb return on usb errors and set intBuf.bInUse to false.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: s_nsInterruptUsbIoCompleteRead set intBuf.bInUse to true
Malcolm Priestley [Mon, 17 Feb 2014 21:12:51 +0000 (21:12 +0000)]
staging: vt6656: s_nsInterruptUsbIoCompleteRead set intBuf.bInUse to true

intBuf.bInUse is set to false set back to true on successful usb_submit_urb

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: Clean up and remove camel case INTnsProcessData.
Malcolm Priestley [Sun, 16 Feb 2014 19:10:18 +0000 (19:10 +0000)]
staging: vt6656: Clean up and remove camel case INTnsProcessData.

Camel Case changes
pDevice -> priv
pINTData -> int_data
pStats -> stats

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: int : Replace typedef struct tagSINTData.
Malcolm Priestley [Sun, 16 Feb 2014 19:09:20 +0000 (19:09 +0000)]
staging: vt6656: int : Replace typedef struct tagSINTData.

New struct vnt_interrupt_data removing the camel case from members.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: int.h correct endian type
Malcolm Priestley [Sun, 16 Feb 2014 19:08:21 +0000 (19:08 +0000)]
staging: vt6656: int.h correct endian type

Endian type u64 qwTSF Change to new base type __le64 tsf

In INTnsProcessData use le64_to_cpu for qwCurrTSF.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: Remove typedef _VIA_BB_TYPE
Malcolm Priestley [Sat, 15 Feb 2014 22:00:41 +0000 (22:00 +0000)]
staging: vt6656: Remove typedef _VIA_BB_TYPE

BB_TYPE_11* are already defined in baseband.h as macros.

assign variable as u8 type.

iwctl.c needs the baseband.h header for the macros.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: remove typedef VIA_PKT_TYPE.
Malcolm Priestley [Sat, 15 Feb 2014 21:58:55 +0000 (21:58 +0000)]
staging: vt6656: remove typedef VIA_PKT_TYPE.

The packet types PK_TYPE_11* are already defined in baseband.h as macros

assign variable as u8 type.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: vt6656: Replace typedef enum _CARD_OP_MODE
Malcolm Priestley [Sat, 15 Feb 2014 21:56:20 +0000 (21:56 +0000)]
staging: vt6656: Replace typedef enum _CARD_OP_MODE

Replace typedef enum _CARD_OP_MODE eOPMode with op_mode enum nl80211_iftype

enum changes
OP_MODE_INFRASTRUCTURE -> NL80211_IFTYPE_STATION
OP_MODE_AP -> NL80211_IFTYPE_AP
OP_MODE_DEF -> NL80211_IFTYPE_UNSPECIFIED
OP_MODE_ADHOC -> NL80211_IFTYPE_ADHOC

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge 3.14-rc3 into staging-next
Greg Kroah-Hartman [Mon, 17 Feb 2014 22:45:02 +0000 (14:45 -0800)]
Merge 3.14-rc3 into staging-next

We want the fixes in this branch to make testing and future work easier.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>