2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 14:14:01 +08:00
Commit Graph

495821 Commits

Author SHA1 Message Date
Heba Aamer
75b4d52bae staging: vt6655: fix space prohibited before that ','
This patch fixes the following checkpatch.pl error:
fix space prohibited before that ','

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Reviewed-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Dan Carpenter
074e6fd133 staging: fbtft: fix allyesconfig build
There are two functions call reset() so the allyesconfig breaks.  Let's
make this one static.

Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Jon Bernard
b3c986d3c1 staging: lustre: ptlrpc: fix lproc_ptlrpc static declarations
This patch fixes the following sparse warnings:

drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:51:3⚠️
 symbol 'll_rpc_opcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:142:3: warning:
 symbol 'll_eopcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:178:12: warning:
 symbol 'll_eopcode2str' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:731:1: warning:
 symbol 'ptlrpc_lprocfs_svc_req_history_seek' was not declared. Should it be static?

Signed-off-by: Jon Bernard <jbernard@tuxion.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Dan Carpenter
052f4f61ec staging: lustre: remove the CFS_HOP() macro
CFS_HOP() is a terrible macro.  It chops the struct member name in half
so that it's not possible to use tools like grep or to search for how
a function pointer is used.

I removed a couple calls to:

	LASSERT(CFS_HOP(hs, put_locked) != NULL);

because they isn't a need for them.  Anyway dereferencing a NULL pointer
generates a pretty good stack trace already without adding extra debug
code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:15 +08:00
Loic Pefferkorn
f8bd34d216 staging: lustre: fix sparse warnings related to lock context imbalance
Applies against next-20150120.

Add __acquires() and __releases() function annotations, to fix sparse warnings related to lock context imbalance.

This patch fixes the following warnings:

drivers/staging/lustre//lustre/libcfs/linux/linux-tracefile.c:153:5: warning: context imbalance in 'cfs_trace_lock_tcd' - wrong count at exit
drivers/staging/lustre//lustre/libcfs/linux/linux-tracefile.c:171:39: warning: context imbalance in 'cfs_trace_unlock_tcd' - unexpected unlock
drivers/staging/lustre//lustre/libcfs/hash.c:128:1: warning: context imbalance in 'cfs_hash_spin_lock' - wrong count at exit
drivers/staging/lustre//lustre/libcfs/hash.c:134:1: warning: context imbalance in 'cfs_hash_spin_unlock' - unexpected unlock
drivers/staging/lustre//lustre/libcfs/hash.c:142:9: warning: context imbalance in 'cfs_hash_rw_lock' - wrong count at exit
include/linux/rwlock_api_smp.h:219:9: warning: context imbalance in 'cfs_hash_rw_unlock' - unexpected unlock
drivers/staging/lustre//lustre/obdclass/cl_object.c:195:6: warning: context imbalance in 'cl_object_attr_lock' - wrong count at exit
drivers/staging/lustre//lustre/obdclass/cl_object.c:204:6: warning: context imbalance in 'cl_object_attr_unlock' - unexpected unlock

Signed-off-by: Loic Pefferkorn <loic@loicp.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:15 +08:00
Luca Ceresoli
f3731cdb23 staging: lustre: lnet: declare internal symbols as static
Fixes sparse warnings like:
  warning: symbol '...' was not declared. Should it be static?

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peng Tao <bergwolf@gmail.com>
Cc: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Srikrishan Malik <srikrishanmalik@gmail.com>
Cc: HPDD-discuss@lists.01.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:15 +08:00
Luca Ceresoli
02a7b84301 staging: lustre: fld: declare internal symbols as static
Fixes sparse warnings like:
  warning: symbol '...' was not declared. Should it be static?

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peng Tao <bergwolf@gmail.com>
Cc: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Srikrishan Malik <srikrishanmalik@gmail.com>
Cc: HPDD-discuss@lists.01.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:15 +08:00
Luca Ceresoli
920b4f2eca staging: lustre: llite: declare internal symbols as static
Fixes sparse warnings like:
  warning: symbol '...' was not declared. Should it be static?

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peng Tao <bergwolf@gmail.com>
Cc: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Srikrishan Malik <srikrishanmalik@gmail.com>
Cc: HPDD-discuss@lists.01.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:15 +08:00
Luca Ceresoli
2a74b9bda6 staging: lustre: libcfs: declare internal symbols as static
Fixes sparse warnings like:
  warning: symbol '...' was not declared. Should it be static?

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peng Tao <bergwolf@gmail.com>
Cc: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Srikrishan Malik <srikrishanmalik@gmail.com>
Cc: HPDD-discuss@lists.01.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:15 +08:00
Luca Ceresoli
5dc8d7b436 staging: lustre: lmv: declare internal symbols as static
Fixes sparse warnings like:
  warning: symbol '...' was not declared. Should it be static?

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peng Tao <bergwolf@gmail.com>
Cc: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Srikrishan Malik <srikrishanmalik@gmail.com>
Cc: HPDD-discuss@lists.01.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:14 +08:00
Luca Ceresoli
f6219c16b1 staging: lustre: mdc: declare internal symbols as static
Fixes sparse warnings like:
  warning: symbol '...' was not declared. Should it be static?

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peng Tao <bergwolf@gmail.com>
Cc: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Srikrishan Malik <srikrishanmalik@gmail.com>
Cc: HPDD-discuss@lists.01.org
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:14 +08:00
Jeremiah Mahler
a1ccbf9cc4 staging: lustre: fix min() comparison types lacks cast build warning
Recent changes to use the builtin min functions [1] introduced
type checking which wasn't present before.  This resulted in
"comparision of distinct pointer types lacks a cast" build
warnings on non X86 architectures [2,3].

  [1]: https://lkml.org/lkml/2014/12/25/145
  [2]: https://lists.01.org/pipermail/kbuild-all/2015-January/008588.html
  [3]: https://lists.01.org/pipermail/kbuild-all/2015-January/008589.html

The call to min() which resulted in this warning took the result
of kiblnd_rd_frag_size(), which returned a __u32, and the
variable 'resid', which is an int.  'resid' is inside a while
loop which is only entered if it is positive.  Casting it as a
__u32 can be perormed without a loss of data or change in
functionality.

Fix the warning by casting 'resid' as a __u32.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:14 +08:00
Tristan Lelong
41dff7ac1a staging: lustre: remove kmalloc from fld_proc_hash_seq_write
This patch simplifies the fld_proc_hash_seq_write function
by removing the dynamic memory allocation.
The longest fh_name used so far in lustre is 4 characters.
We use a 8 bytes variable to be on the safe side.

Signed-off-by: Tristan Lelong <tristan@lelong.xyz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:14 +08:00
jitendra kumar khasdev
9ef6a83312 Staging: comedi: fix line over 80 characters warning
This is patch to file jr3_pci.h that fix up warning line
over 80 character which is found by checkpatch tool.

Signed-off-by: Jitendra Kumar Khasdev <jkhasdev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:14 +08:00
H Hartley Sweeten
a4a75b2101 staging: comedi: vmk80xx: tidy up vmk80xx_cnt_insn_config()
Tidy up this (*insn_config) function to follow the normal format in
comedi drivers.

INSN_CONFIG_RESET instructions do not have any extra parameters (insn->n is
always 1) so the for loop used to write the packet doesn't make any sense.
Remove it and just write the single packet.

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>
2015-01-25 19:59:14 +08:00
H Hartley Sweeten
8518a52c44 staging: comedi: vmk80xx: GPCT_RESET is not an (*insn_config) instruction
The data[0] parameter to (*insn_config) functions is the "configuration instruction"
that should be handled. These are defined by the enum configuration_ids in comedi.h.

This driver is currently checking the data[0] value to be INSN_CONFIG_RESET or
GPCT_RESET in order to reset a counter channel. GPCT_RESET is defined as 0x0001
which would match the configuration instruction INSN_CONFIG_DIO_OUTPUT. That doesn't
make any sense for a counter.

Remove GPCT_RESET from the insn_cmd test.

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>
2015-01-25 19:59:13 +08:00
H Hartley Sweeten
c79089c8d6 staging: comedi: ni_labpc_common: use the cfc_check_trigger_arg_*() helpers
For aesthetics, use the helper functions to check the min/max divisor values.
Remove the const int local variables and open code the values.

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>
2015-01-25 19:59:13 +08:00
H Hartley Sweeten
b35759de97 staging: comedi: ni_labpc_common: use DIV_ROUND_CLOSEST to round divisor values
Use the DIV_ROUND_CLOSEST macro to clarify the (((x) + ((divisor) / 2)) / (divisor))
calculations.

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>
2015-01-25 19:59:13 +08:00
H Hartley Sweeten
bcdf8b5d01 staging: comedi: ni_labpc_common: use DIV_ROUND_UP to round divisor values
Use the DIV_ROUND_UP macro to clarify the (((n) + (d) - 1) / (d)) calculations.

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>
2015-01-25 19:59:13 +08:00
H Hartley Sweeten
aae59483bc staging: comedi: ni_labpc: remove unnecessary private data validation
The labpc_free_dma_chan() function validates the private data. Remove the
unnecessary validation in labpc_datach().

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>
2015-01-25 19:59:13 +08:00
H Hartley Sweeten
67a0149ee6 staging: comedi: ni_labpc_cs: remove unnecessary includes
This driver includes a number of unnecessary headers. 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>
2015-01-25 19:59:13 +08:00
H Hartley Sweeten
83d682bda1 staging: comedi: ni_labpc_common: move comedi_alloc_devpriv() to common code
The ni_labpc_common module is used by the ni_labpc, ni_labpc_pci, and ni_labpc_cs
drivers to provide the common code support. Those drivers currently all call
comedi_alloc_devpriv() to allocate the private data before calling the common
attach function.

For aesthetics, move the private data allocation into the common 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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
c0e4a8decb staging: comedi: adv_pci1710: absorb move_block_from_fifo()
This function is only called by pci1710_handle_fifo(). Absorb it and clean up
pci1710_handle_fifo().

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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
d6c42d78c0 staging: comedi: adv_pci1710: transfer all ai samples in one step
The two step process to transfer the ai samples in pci1710_handle_fifo() doesn't
make any sense. If the async buffer does not have enough room for the samples the
core will set the async event COMEDI_CB_OVERFLOW which will cause the async command
to cancel. Splitting the transfer doesn't add any value.

Transfer all the samples in one step to simplify 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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
f01663ec35 staging: comedi: adv_pci1710: remove 'turn' param from move_block_from_fifo()
This parameter is not used in the function. It was only used in some debug
messages that were previously removed. Remove 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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
d61b786ab0 staging: comedi: adv_pci1710: do comedi_handle_events() in common code patch
The pci1710_handle_every_sample() and pci1710_handle_fifo() helpers, called by
the interrupt handler, both have multiple comedi_handle_events() calls. Remove
these and just do a single comedi_handle_events() at the end of the interrupt
handler.

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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
7fd2dae250 staging: comedi: adv_pci1710: introduce pci171x_ai_read_sample()
Introduce a helper function to read an analog input sample, check for
channel dropout, and mask the sample to the maxdata of the subdevice.

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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
a65e1419e6 staging: comedi: adv_pci1710: tidy up setup_channel_list()
Rename this function so it has namespace associated with the driver.

Tidy up the code to clarify the function. Remove the unnecessary static const
array muxonechan[].

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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
133dfbfb22 staging: comedi: adv_pci1710: clarify the 'act_chanlist'
This driver saves the channel list of a scan in the private data and uses
that list to check analog input samples for data dropout.

Currently the channel numbers are shifted 12 bits so that they match the
channel number in the samples that are read from the board. All of the
shifts make the driver a bit harder to follow.

Store the channel numbers directly to the 'act_chanlist' and shift the
sample value instead when checking for the dropout. Add a comment for
clarity.

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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
e4451eeb45 staging: comedi: adv_pci1710: refactor boardinfo 'cardtype'
The 'cardtype' in the boardinfo is only used to:

 1) determine if the board is a pci1720 during the attach of the driver
    and when reseting the board
 2) determine is the board is not a pci1713 when checking for analog input
    data dropout

There is also an unnecessary use of the 'cardtype' when canceling an analog
input async command.

Remove the 'cardtype' member and add two bit-field flags, 'is_pci1713' and
'is_pci1720'. Refactor the driver to use the new flags.

Remove the unnecessary cardtype handling in pci171x_ai_cancel().

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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
7a772eea0c staging: comedi: adv_pci1710: remove boardinfo 'rangelist_ao'
This boardinfo is not necessary. All the boards with analog outputs have
the same range options except for the pci1720 board. That board type is
already handled specially during the driver attach.

Remove the boardinfo and add the subdevice range_table initialization in
the cardtype switch.

Rename the range tables to clarify that they are "analog output" ranges.

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>
2015-01-25 19:59:12 +08:00
H Hartley Sweeten
76201d0516 staging: comedi: adv_pci1710: update the MODULE_DESCRIPTION
Change the MODULE_DESCRIPTION to something more useful than the generic
"Comedi low-level driver".

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
6e7862fc10 staging: comedi: adv_pci1710: remove function separation comments
Remove the remaining, unnecessary, function separation comments.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
383fab4074 staging: comedi: adv_pci1710: rename 'this_board' local variables
For aesthetics, rename all the 'this_board' local variables to simply
'board'. That's more common in comed 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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
fc8e86898f staging: comedi: adv_pci1710: tidy up analog input subdevice init
For aesthetics, add some whitespace to the analog input subdevice init and
rename the (*insn_read) support function. Also remove the unnecessary comments.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
b420eeaf10 staging: comedi: adv_pci1710: tidy up analog output subdevice init
For aesthetics, add some whitespace to the analog output subdevice init.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
1fbe6e91a0 staging: comedi: adv_pci1710: tidy up digital input and output subdevice init
For aesthetics, add some whitespace to the digital input and output subdevice
init and rename the support functions. Also remove the unnecessary comment.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
db2c4a0536 staging: comedi: adv_pci1710: tidy up counter subdevice init
For aesthetics, add some whitespace to the counter subdevice init and
rename the support functions. Also remove the unnecessary comments.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
2d21fc2280 staging: comedi: adv_pci1710: tidy up pci171x_insn_write_ao()
For aesthetics, rename this function and tidy it up.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
3e5cf6d4ed staging: comedi: adv_pci1710: tidy up pci1720_insn_write_ao()
For aesthetics, rename this function and tidy it up.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
e4623cee9e staging: comedi: adv_pci1710: use comedi_subdevice 'readback'
Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

The board is "reset" prior to the subdevice init. Part of this reset
sets all the analog output channels to 0V. Move the initialization of
the 'readback' values after the 'readback' member has been allocated.

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>
2015-01-25 19:59:11 +08:00
H Hartley Sweeten
87abf66091 staging: comedi: adv_pci1710: change boardinfo 'n_aochan' to 'has_ao'
Some of the boards supported by this driver have analog outputs. The pci1720
board has 4 analog output channels and the others have 2.

For aesthetics, change the 'n_aochan' member to a bit-field flag 'has_ao' and
refactor the board attach accordingly. Remove the unnecessary initialization
of the subdevice 'len_chanlist'. That member is only used by subdevices that
support async commands.

Also, remove the unnecessary 'number of channels' check in pci171x_reset().
The boards that used this function, and have analog outputs, always have 2
channels.

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>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
7bd428c434 staging: comedi: adv_pci1710: change boardinfo 'fifo_half_size' to 'has_large_fifo'
The boards supported by this driver have a 4K or 1K FIFO that is used when reading
analog input samples when running an async command. The maximum number of samples
in the FIFO is half the FIFO size due to the 2 bytes/sample (12-bit resolution).

For aesthetics, change the 'fifo_half_size' member to a bit-field flag 'has_large_fifo'
and add a new member to the private data to hold the 'max_samples' available in the
FIFO. Refactor the board attach and pci1710_handle_fifo() accordingly.

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>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
abd2839c59 staging: comedi: adv_pci1710: remove boardinfo 'ai_ns_min'
The minimum analog input conversion time is 10000 ns for all board types. Remove
this unnecessary 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>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
177a072964 staging: comedi: adv_pci1710: change boardinfo 'n_aichand' to 'has_diff_ai'
The 'n_aichand' member of the boardinfo is actually a flag indicating that the
board supports differential analog inputs. The number of channels is always
half the single-ended number of channels.

For aesthetics, change the 'n_aichand' member to a bit-field flag 'has_diff_ai'.

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>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
af9408e5df staging: comedi: adv_pci1710: remove boardinfo 'ao_maxdata'
The analog output resolution is always 12-bits in this driver. Remove the
unnecessary 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>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
853bbcc263 staging: comedi: adv_pci1710: remove boardinfo 'ai_maxdata'
The analog input resolution is always 12-bits in this driver. Remove the
unnecessary 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>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
0b25aa79cc staging: comedi: adv_pci1710: rename boardinfo 'have_irq'
For aesthetics, rename this member of the boardinfo to 'has_irq' 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>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
068de2b65b staging: comedi: adv_pci1710: simplify digital input and output boardinfo
The boards that have digital inputs and outputs always have 16 input channels and
16 output channels.

Replace the 'n_dichan' and 'n_dochan' members of the boardinfo with the fit-field
flag 'has_di_do' and refactor the board attach accordingly.

Remove the unnecessary initialization of the subdevice 'len_chanlist'. That
member is only used by subdevices that support async commands.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:10 +08:00
H Hartley Sweeten
c5b6b54488 staging: comedi: adv_pci1710: change boardinfo 'n_counter' to 'has_counter'
The 'n_counter' member of the boardinfo is actually a flag indicating that the
board exposes a single channel counter subdevice.

For aesthetics, change the 'n_counter' member to a bit-field flag 'has_counter'
and refactor the board attach accordingly.

Remove the unnecessary initialization of the subdevice 'len_chanlist'. That
member is only used by subdevices that support async commands.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:10 +08:00