openwrt/staging/blogic.git
12 years agostaging: r8712u: cleanup pointer type in r8712_setassocsta_cmd()
Dan Carpenter [Thu, 25 Oct 2012 12:30:06 +0000 (15:30 +0300)]
staging: r8712u: cleanup pointer type in r8712_setassocsta_cmd()

This seems like a cut and paste bug.  Smatch complains that we don't
allocate enough memory for a set_stakey_rsp struct.  In fact this is
used as a set_assocsta_rsp struct throughout and that also matches the
name of the function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: remove some obvious comments
H Hartley Sweeten [Thu, 25 Oct 2012 22:11:52 +0000 (15:11 -0700)]
staging: comedi: me_daq: remove some obvious comments

These comments are just extra cruft.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: cleanup me_ai_insn_read()
H Hartley Sweeten [Thu, 25 Oct 2012 22:11:38 +0000 (15:11 -0700)]
staging: comedi: me_daq: cleanup me_ai_insn_read()

Fix the use of insn->chanspec with the CR_CHAN, CR_RANGE, and CR_AREF
macros. insn->chanspec is an unsigned int not an array.

Cleanup the comments when creating the 'val' to write to the channel
list fifo so that the code is a bit more readable.

Use the 'val' variable when getting the value from the ADC fifo and
then munging the data. This cleans up the goofy line breaks.

This function still does not follow the expectations of the comedi core.
It is supposed to read insn->n values from the channel and return those
values. Currently it only reads a single value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: cleanup me_dio_insn_bits()
H Hartley Sweeten [Thu, 25 Oct 2012 22:11:23 +0000 (15:11 -0700)]
staging: comedi: me_daq: cleanup me_dio_insn_bits()

This function only needs to update the output channel state when
the 'mask' (data[0]) indicates that the state is changing. It's
also supposed to return the state for all the input and output
channels in data[1].

This function appears to work correctly but it's coded quite
differently form the other comedi drivers. Rework the function so
it follows the normal form. Also, use a couple local variables
for the mmio addresses used to read/write the dio ports.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: fix me_dio_insn_config()
H Hartley Sweeten [Thu, 25 Oct 2012 22:11:07 +0000 (15:11 -0700)]
staging: comedi: me_daq: fix me_dio_insn_config()

Currently this function does not work like the comedi code expects.

Fix the function so that it checks the instruction, data[0], and
does the correct action based on it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: simplify analog output boardinfo
H Hartley Sweeten [Thu, 25 Oct 2012 22:10:52 +0000 (15:10 -0700)]
staging: comedi: me_daq: simplify analog output boardinfo

The boards supported by this driver either have analog outputs or don't
have them. Add a new boardinfo value, 'has_ao', to indicate this.

The boards that have analog outputs always have 4, 12-bit channels. Remove
the unnecessary boardinfo and just open-code the values in the subdevice
initialization.

The boards with analog outputs also share the same output range capabilities.
Rename the comedi_lrange to make it common for all board types.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: all boards have the same analog input specs
H Hartley Sweeten [Thu, 25 Oct 2012 22:10:35 +0000 (15:10 -0700)]
staging: comedi: me_daq: all boards have the same analog input specs

All the boards supported by this driver have the same analog input
specifications. Remove the unnecessary boardinfo and just open-code
the values in the subdevice initialization.

The boards also share the same analog input range capabilities. Remove
one of the duplicate tables and rename the other to make it common for
all board types.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: cleanup the copyright and comedi comments
H Hartley Sweeten [Thu, 25 Oct 2012 22:10:19 +0000 (15:10 -0700)]
staging: comedi: me_daq: cleanup the copyright and comedi comments

Reformat the copyright and driver description comments to follow the
preferred block comment style. Reword the driver description to follow
comedi style described in the skel driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: remove incomplete analog input command support
H Hartley Sweeten [Thu, 25 Oct 2012 22:10:03 +0000 (15:10 -0700)]
staging: comedi: me_daq: remove incomplete analog input command support

The analog input subdevice functions me_ai_do_cmd_test() and me_ai_do_cmd()
are only stubbed in. They both just return 0.

The me_ai_cancel() function does have code to stop any running conversions
but the me_ai_insn_read() function does that also.

Just remove the incomplete functions and remove SDF_CMD_READ from the
subdevice_flags.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: fix me_ao_insn_write()
H Hartley Sweeten [Thu, 25 Oct 2012 22:09:47 +0000 (15:09 -0700)]
staging: comedi: me_daq: fix me_ao_insn_write()

This function is supposed to write to a single analog output channel.
The channel number is packed in insn->chanspec, which is an unsigned
int, and unpacked using the CR_CHAN() macro.

Currently this function is trying to use the chanspec as an array.
This works only if a single value is written.

Fix the function so that the desired channel is determined and all
the data is written to that channel.

Also, fix the return. The comedi core expects insn_read functions to
return the number of data values (insn->n).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: fix me_ao_insn_read()
H Hartley Sweeten [Thu, 25 Oct 2012 22:09:33 +0000 (15:09 -0700)]
staging: comedi: me_daq: fix me_ao_insn_read()

This function is supposed to return the analog output value for
a specified channel. The channel number is packed in insn->chanspec,
which is an unsigned int, and unpacked using the CR_CHAN() macro.

Currently this function is trying to use the chanspec as an array.
This works only if a single data value is read.

Fix the function so that the desired channel is determined and all
the data returned is from that channel.

Also, fix the return. The comedi core expects insn_read functions to
return the number of data values (insn->n).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: remove pci_dev_put() in detach
H Hartley Sweeten [Thu, 25 Oct 2012 22:09:18 +0000 (15:09 -0700)]
staging: comedi: me_daq: remove pci_dev_put() in detach

This driver uses the comedi auto config mechanism and does not
walk the pci bus to find the pci_dev. It should not be calling
pci_dev_put() to decrement the ref count.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: add some whitespace to the subdevice init
H Hartley Sweeten [Thu, 25 Oct 2012 22:09:02 +0000 (15:09 -0700)]
staging: comedi: me_daq: add some whitespace to the subdevice init

To improve the readability, add some whitespace to the subdevice
init.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: cleanup the range tables
H Hartley Sweeten [Thu, 25 Oct 2012 22:08:42 +0000 (15:08 -0700)]
staging: comedi: me_daq: cleanup the range tables

Fix the whitespace.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: cleanup the boardinfo
H Hartley Sweeten [Thu, 25 Oct 2012 22:08:25 +0000 (15:08 -0700)]
staging: comedi: me_daq: cleanup the boardinfo

Rename the boardinfo variables so they are a bit more concise.

Remove the unnecessary comments in the boardinfo.

Add some whitespace to make the code more readable.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: remove dio_channel_nbr from boardinfo
H Hartley Sweeten [Thu, 25 Oct 2012 22:08:09 +0000 (15:08 -0700)]
staging: comedi: me_daq: remove dio_channel_nbr from boardinfo

All the boards supported by this driver have 32 dio channels.
Remove the boardinfo and just open code the value in the attach.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: remove {ao,ai}_resoultion_mask
H Hartley Sweeten [Thu, 25 Oct 2012 22:07:52 +0000 (15:07 -0700)]
staging: comedi: me_daq: remove {ao,ai}_resoultion_mask

These values can be determined from the {ao,ai}_resolution.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: remove '0' and 'NULL' entries in boardinfo
H Hartley Sweeten [Thu, 25 Oct 2012 22:07:36 +0000 (15:07 -0700)]
staging: comedi: me_daq: remove '0' and 'NULL' entries in boardinfo

These entries will default to '0' or 'NULL' as appropriate.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: analog output subdevice could be unused
H Hartley Sweeten [Thu, 25 Oct 2012 22:07:17 +0000 (15:07 -0700)]
staging: comedi: me_daq: analog output subdevice could be unused

One of the boards supported by this driver does not have analog
outputs. Fix the attach code to account for this.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: factor out the PLX bug workaround
H Hartley Sweeten [Thu, 25 Oct 2012 22:06:58 +0000 (15:06 -0700)]
staging: comedi: me_daq: factor out the PLX bug workaround

Factor out the code in me_attach_pci() that handles the PLX-Bug
workaround to a separate function.

This looks odd. It appears that the bug workaround either swaps
PCI bars 0 and 5 or it modifies PCI bar 0. Shouldn't this happen
before PCI bar 0 is ioremap'ed?

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: pass on the error from comedi_pci_enable()
H Hartley Sweeten [Thu, 25 Oct 2012 22:06:37 +0000 (15:06 -0700)]
staging: comedi: me_daq: pass on the error from comedi_pci_enable()

Instead of returning -EIO when comedi_pci_enable() fails, pass on
the actual error code. Also, remove the kernel noise when the
function fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: replace 'result' and 'error' with 'ret'
H Hartley Sweeten [Thu, 25 Oct 2012 22:06:20 +0000 (15:06 -0700)]
staging: comedi: me_daq: replace 'result' and 'error' with 'ret'

Two local variables are used in me_attach_pci() to check for errors
when calling other functions, 'result' and 'error'. Remove both of
them and just use a common 'ret' variable.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: cleanup ioremap of PCI bar 2
H Hartley Sweeten [Thu, 25 Oct 2012 22:06:02 +0000 (15:06 -0700)]
staging: comedi: me_daq: cleanup ioremap of PCI bar 2

PCI bar 2 is the main i/o address for this driver. Currently the
pci_resource_len of the bar is stored in the private data but
it is never used.

Remove 'me_regbase_size' from the private data. Also, remove the
local variables used for the pci_resource_start and _len. Just
pass the values directly to the ioremap().

Remove the kernel noise when the ioremap fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: me_daq: fix pointer dereference in me_detach()
H Hartley Sweeten [Thu, 25 Oct 2012 22:05:46 +0000 (15:05 -0700)]
staging: comedi: me_daq: fix pointer dereference in me_detach()

As pointed out by Dan Carpenter, dev_private could be NULL when it
is checked before calling comedi_pci_disable(). The private data
variable 'plx_regbase_size' is only used to see if the pci device
has been enabled.

Remove that variable from the private data and just use the unused
dev->iobase variable to let the detach know that the pci device
is enabled.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: change return type of dt3k_send_cmd to void
H Hartley Sweeten [Fri, 26 Oct 2012 00:27:12 +0000 (17:27 -0700)]
staging: comedi: dt3000: change return type of dt3k_send_cmd to void

None of the callers check the return value. Just make it a void.

Flip the status check at the end of the function to check for an
error before outputing the dev_dbg(). Use __func__ for the function
name in the message.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: remove empty 'else' code
H Hartley Sweeten [Fri, 26 Oct 2012 00:26:54 +0000 (17:26 -0700)]
staging: comedi: dt3000: remove empty 'else' code

There are a number of:

} else {
/* not supported */
}

cases in this driver. Remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: remove dev_dbg() noise
H Hartley Sweeten [Fri, 26 Oct 2012 00:26:40 +0000 (17:26 -0700)]
staging: comedi: dt3000: remove dev_dbg() noise

Remove most of the dev_dbg() output from this driver. Most of it
is just noise.

For now I have left the dev_dbg() in the dt3k_send_cmd() function.
I still have not quite figured out how the low-level i/o works in
this driver...

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: add some whitespace to the subdevice init
H Hartley Sweeten [Fri, 26 Oct 2012 00:26:25 +0000 (17:26 -0700)]
staging: comedi: dt3000: add some whitespace to the subdevice init

To improve the readability, add some whitespace to the subdevice
init.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: add a simple dev_info() when attached
H Hartley Sweeten [Fri, 26 Oct 2012 00:26:10 +0000 (17:26 -0700)]
staging: comedi: dt3000: add a simple dev_info() when attached

When the board is finished with the attach output a simple dev_info()
message.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: cleanup the boardinfo
H Hartley Sweeten [Fri, 26 Oct 2012 00:25:53 +0000 (17:25 -0700)]
staging: comedi: dt3000: cleanup the boardinfo

Add some whitespace to make the code more readable.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: remove '0' entries in boardinfo
H Hartley Sweeten [Fri, 26 Oct 2012 00:25:38 +0000 (17:25 -0700)]
staging: comedi: dt3000: remove '0' entries in boardinfo

These entries will default to '0'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: remove forward declarations
H Hartley Sweeten [Fri, 26 Oct 2012 00:25:23 +0000 (17:25 -0700)]
staging: comedi: dt3000: remove forward declarations

Move some of the functions to remove the need for the forward
declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: add defines for the PCI device ids
H Hartley Sweeten [Fri, 26 Oct 2012 00:25:09 +0000 (17:25 -0700)]
staging: comedi: dt3000: add defines for the PCI device ids

The PCI device ids supported by this driver are used multiple
places in the code. To improve maintainability, create #define's
for them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: cleanup the range tables
H Hartley Sweeten [Fri, 26 Oct 2012 00:24:53 +0000 (17:24 -0700)]
staging: comedi: dt3000: cleanup the range tables

Use the BIP_RANGE() macro instead of the more generic RANGE()
macro.

Cleanup the whitespace.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: convert driver to attach_pci
H Hartley Sweeten [Fri, 26 Oct 2012 00:24:39 +0000 (17:24 -0700)]
staging: comedi: dt3000: convert driver to attach_pci

Convert this driver to use the comedi PCI auto config mechanism
by adding an attach_pci callback.

Since this driver requires no extra configuration options, and
the attach callback is now optional, remove it.

Remove the kernel noise that is output when the attach fails
for various reasons.

Use the found 'dev->board_name' for the resource name passed to
comedi_pci_enable() and request_irq().

Pass on the error returned from request_irq() instead of returning
-EINVAL on error.

Since this driver no longer walks the pci bus to find the pci_dev,
remove the pci_dev_put() in the detach.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dt3000: remove this_board macro
H Hartley Sweeten [Fri, 26 Oct 2012 00:24:23 +0000 (17:24 -0700)]
staging: comedi: dt3000: remove this_board macro

This macro relies on a local variable having a specific name.
Remove it and use the comedi_board() helper to get the pointer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: skel: use module_comedi_driver to simplify the code
Wei Yongjun [Fri, 26 Oct 2012 15:24:46 +0000 (23:24 +0800)]
staging: comedi: skel: use module_comedi_driver to simplify the code

Use the module_comedi_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: use module_comedi_driver to simplify the code
Wei Yongjun [Fri, 26 Oct 2012 15:23:00 +0000 (23:23 +0800)]
staging: comedi: use module_comedi_driver to simplify the code

Use the module_comedi_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: ced1401: usb1401: remove unused including <linux/version.h>
Wei Yongjun [Fri, 26 Oct 2012 14:36:45 +0000 (22:36 +0800)]
staging: ced1401: usb1401: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/comedi: Use pr_ or dev_ printks in drivers/gsc_hpdi.c
YAMANE Toshiaki [Fri, 26 Oct 2012 00:21:45 +0000 (09:21 +0900)]
staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hpdi.c

fixed below checkpatch warning.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

some of them have been replaced by dev_dbg.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove csrPanic and CSR_LOG_ASSERT and CSR_LOG_ASSERT_ENABLE
Devendra Naga [Fri, 26 Oct 2012 11:01:57 +0000 (07:01 -0400)]
staging: csr: remove csrPanic and CSR_LOG_ASSERT and CSR_LOG_ASSERT_ENABLE

these are not called at anypoint or enabled at anyplace in the code,
remove them

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove all prototypes of not defined functions
Devendra Naga [Thu, 25 Oct 2012 20:57:16 +0000 (16:57 -0400)]
staging: csr: remove all prototypes of not defined functions

these prototypes doesn't have function definitions in any of the
c files

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove CsrMutexCreate function
Devendra Naga [Thu, 25 Oct 2012 20:56:38 +0000 (16:56 -0400)]
staging: csr: remove CsrMutexCreate function

nobody are calling this function in here, so remove this

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove CsrMutexDestroy function
Devendra Naga [Thu, 25 Oct 2012 20:55:59 +0000 (16:55 -0400)]
staging: csr: remove CsrMutexDestroy function

this function never gets called from anywhere, so remove this too.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove CsrMutexUnlock function
Devendra Naga [Thu, 25 Oct 2012 20:55:27 +0000 (16:55 -0400)]
staging: csr: remove CsrMutexUnlock function

Nobody is using this function inside the csr directory, so remove this function also

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove CsrMutexLock function
Devendra Naga [Thu, 25 Oct 2012 20:54:48 +0000 (16:54 -0400)]
staging: csr: remove CsrMutexLock function

nobody inside the csr directory is calling this function, so remove this

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: remove rts_pstor driver
Greg Kroah-Hartman [Fri, 26 Oct 2012 16:03:21 +0000 (09:03 -0700)]
Staging: remove rts_pstor driver

Support for this hardware is now included in a "real" driver in the
kernel, so it is safe to remove the staging driver now.

Cc: wwang <wei_wang@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: csr_log.h: Fix coding style
SeongJae Park [Thu, 25 Oct 2012 06:54:53 +0000 (15:54 +0900)]
staging: csr: csr_log.h: Fix coding style

Fix coding style for csr_log.h

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: csr: bh.c: fixing spaces coding style issues
Chihau Chau [Thu, 25 Oct 2012 06:37:38 +0000 (03:37 -0300)]
Staging: csr: bh.c: fixing spaces coding style issues

Fixed some coding style issues replacing spaces for tab at the beginning
of some lines

Signed-off-by: Chihau Chau <chihau@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove panic at locking the mutex
Devendra Naga [Thu, 25 Oct 2012 05:50:58 +0000 (01:50 -0400)]
staging: csr: remove panic at locking the mutex

when down_interruptible fail, means a signal occur, or any other failure
we are panicing, and it seems that we should not panic, instead we would
have done a spinlock, but currently removing the panic call.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: ipu-v3: ipu-common: Indicate succesful probe
Fabio Estevam [Wed, 24 Oct 2012 23:36:47 +0000 (21:36 -0200)]
staging: ipu-v3: ipu-common: Indicate succesful probe

Indication of succesful probe is more useful than stating that the
driver is about to be probed.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: ipu-v3: ipu-common: Make it less verbose
Fabio Estevam [Wed, 24 Oct 2012 23:36:46 +0000 (21:36 -0200)]
staging: ipu-v3: ipu-common: Make it less verbose

IPU Interrupt numbers and the various IPU submodules base addresses are
more interesting for debugging purposes rather than normal use, so use
dev_dbg instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agodrivers/iio/dac: remove CONFIG_EXPERIMENTAL
Kees Cook [Tue, 23 Oct 2012 20:02:06 +0000 (13:02 -0700)]
drivers/iio/dac: remove CONFIG_EXPERIMENTAL

This config item has not carried much meaning for a while now and is
almost always enabled by default. As agreed during the Linux kernel
summit, remove it.

CC: Jonathan Cameron <jic23@cam.ac.uk>
CC: Lars-Peter Clausen <lars@metafoo.de>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Michael Hennerich <michael.hennerich@analog.com>
CC: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agovme: vme_tsi148.c: use module_pci_driver to simplify the code
Wei Yongjun [Thu, 18 Oct 2012 15:12:50 +0000 (23:12 +0800)]
vme: vme_tsi148.c: use module_pci_driver to simplify the code

Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agovme: vme_ca91cx42.c: use module_pci_driver to simplify the code
Wei Yongjun [Thu, 18 Oct 2012 15:13:37 +0000 (23:13 +0800)]
vme: vme_ca91cx42.c: use module_pci_driver to simplify the code

Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agovme: vme_vmivme7805.c: use module_pci_driver to simplify the code
Wei Yongjun [Thu, 18 Oct 2012 15:15:05 +0000 (23:15 +0800)]
vme: vme_vmivme7805.c: use module_pci_driver to simplify the code

Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging/comedi: Use pr_ or dev_ printks in drivers/serial2002.c
YAMANE Toshiaki [Thu, 25 Oct 2012 00:16:49 +0000 (09:16 +0900)]
staging/comedi: Use pr_ or dev_ printks in drivers/serial2002.c

fixed below checkpatch warning.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...

and added pr_fmt.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_AMPLICON
H Hartley Sweeten [Thu, 25 Oct 2012 01:14:40 +0000 (18:14 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_AMPLICON

Add a define for the Amplicon Liveline Limited PCI vendor id.
Remove the duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: dyna_pci10xx: remove PCI_VENDOR_ID_DYNALOG
H Hartley Sweeten [Thu, 25 Oct 2012 01:14:19 +0000 (18:14 -0700)]
staging: comedi: dyna_pci10xx: remove PCI_VENDOR_ID_DYNALOG

The PCI chip used on this board is from PLX Technologies Inc. As stated
in the comments of this driver, Dynalog does not have a registered PCI
vendor id so this board uses the PLX vendor id. The kernel provides an
id for that vendor in pci_ids.h (PCI_VENDOR_ID_PLX). Use it instead of
creating a duplicate with a different name.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_AMCC
H Hartley Sweeten [Thu, 25 Oct 2012 01:14:00 +0000 (18:14 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_AMCC

Add a define for the Applied Micro Circuits Corp. PCI vendor id.
Remove the duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_RTD
H Hartley Sweeten [Thu, 25 Oct 2012 01:13:43 +0000 (18:13 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_RTD

Add a define for the RTD Embedded Technologies, Inc. PCI vendor id.
Remove the duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_IOTECH
H Hartley Sweeten [Thu, 25 Oct 2012 01:13:12 +0000 (18:13 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_IOTECH

Add a define for the Iotech Inc. PCI vendor id. Remove the duplicates
in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_KOLTER
H Hartley Sweeten [Thu, 25 Oct 2012 01:12:50 +0000 (18:12 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_KOLTER

Add a define for the Kolter Electronic PCI vendor id. Remove the
duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_DT
H Hartley Sweeten [Thu, 25 Oct 2012 01:12:34 +0000 (18:12 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_DT

Add a define for the Data Translation, Inc. PCI vendor id. Remove
the duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: addi_common: use PCI_VENDOR_ID_ADDIDATA_OLD
H Hartley Sweeten [Thu, 25 Oct 2012 01:12:17 +0000 (18:12 -0700)]
staging: comedi: addi_common: use PCI_VENDOR_ID_ADDIDATA_OLD

The kernel provides this id in pci_ids.h. Use it instead of creating
duplicates of the id with different names.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: addi_common: use PCI_VENDOR_ID_ADDIDATA
H Hartley Sweeten [Thu, 25 Oct 2012 01:11:59 +0000 (18:11 -0700)]
staging: comedi: addi_common: use PCI_VENDOR_ID_ADDIDATA

The kernel provides this id in pci_ids.h. Use it instead of creating
duplicates of the id with different names.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: hwdrv_APCI1710: remove APCI1710_BOARD_VENDOR_ID
H Hartley Sweeten [Thu, 25 Oct 2012 01:11:40 +0000 (18:11 -0700)]
staging: comedi: hwdrv_APCI1710: remove APCI1710_BOARD_VENDOR_ID

This vendor id exists in pci_ids.h as PCI_VENDOR_ID_ADDIDATA_OLD.
Use the kernels provided id instead.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_MEILHAUS
H Hartley Sweeten [Thu, 25 Oct 2012 01:11:21 +0000 (18:11 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_MEILHAUS

Add a define for the Meilhaus Electronic GmbH Germany PCI vendor id.
Remove the duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_ADVANTECH
H Hartley Sweeten [Thu, 25 Oct 2012 01:11:01 +0000 (18:11 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_ADVANTECH

Add a define for the Advantech Co., Ltd. PCI vendor id. Remove the
duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup cb_pcidda_calibrate()
H Hartley Sweeten [Wed, 24 Oct 2012 23:34:21 +0000 (16:34 -0700)]
staging: comedi: cb_pcidda: cleanup cb_pcidda_calibrate()

Refactor the function to make it a bit more concise and remove all
the one-line helper functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup cb_pcidda_ao_winsn()
H Hartley Sweeten [Wed, 24 Oct 2012 23:34:02 +0000 (16:34 -0700)]
staging: comedi: cb_pcidda: cleanup cb_pcidda_ao_winsn()

For aesthetic reasons, rename the function to help when searching
for 'insn_write' functions.

Remove the obvious comments and fix the return from the function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup DADATA define
H Hartley Sweeten [Wed, 24 Oct 2012 23:33:45 +0000 (16:33 -0700)]
staging: comedi: cb_pcidda: cleanup DADATA define

Rename the define used for the D/A Data register so that is has
namespace with this driver. Change the define so that it takes
the channel as a parameter to calculate the correct register
offset.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup DACCONTROL defines
H Hartley Sweeten [Wed, 24 Oct 2012 23:33:30 +0000 (16:33 -0700)]
staging: comedi: cb_pcidda: cleanup DACCONTROL defines

Rename the defines used for the D/A Control register so that they
have namespace with this driver. Cleanup the use of these defines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup the dio register defines
H Hartley Sweeten [Wed, 24 Oct 2012 23:33:13 +0000 (16:33 -0700)]
staging: comedi: cb_pcidda: cleanup the dio register defines

Remove the unused defines for the dio registers. Add two new
defines to document the iobase registers for the two 8255 devices.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup the boardinfo
H Hartley Sweeten [Wed, 24 Oct 2012 23:32:54 +0000 (16:32 -0700)]
staging: comedi: cb_pcidda: cleanup the boardinfo

For aesthetic reasons, add some whitespace to the boardinfo to
improve readability. Also, remove the cut-and-paste comment from
the skel driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: remove the private data 'status'
H Hartley Sweeten [Wed, 24 Oct 2012 23:32:03 +0000 (16:32 -0700)]
staging: comedi: cb_pcidda: remove the private data 'status'

This variable in the private data is only used to output some
kernel noise during the attach about certian board types not
being fully tested.

All of the boards supported by this driver share a common register
map and should be compatible. Just remove the 'status' and the
noise.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup the copyright and comedi comments
H Hartley Sweeten [Wed, 24 Oct 2012 23:31:47 +0000 (16:31 -0700)]
staging: comedi: cb_pcidda: cleanup the copyright and comedi comments

Reformat the copyright and driver description comments to follow the
preferred block comment style. Reword the driver description to follow
comedi style described in the skel driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup the analog output range
H Hartley Sweeten [Wed, 24 Oct 2012 23:31:31 +0000 (16:31 -0700)]
staging: comedi: cb_pcidda: cleanup the analog output range

All the boards supported by this driver have the same analog output
ranges. Remove the 'range' from the boardinfo and just use the
'cb_pcidda_ranges' directly when initializing the subdevice.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: check for subdev_8255_init() failure
H Hartley Sweeten [Wed, 24 Oct 2012 23:31:14 +0000 (16:31 -0700)]
staging: comedi: cb_pcidda: check for subdev_8255_init() failure

The subdev_8255_init() can fail, make sure to check for it.

This board has two 8255 subdevices, one at iobase PCI bar2 and one
at iobase PCI bar2 + 4. Init the subdevices using a for() loop to
make the code a bit more concise.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: rename local variable 'index'
H Hartley Sweeten [Wed, 24 Oct 2012 23:30:57 +0000 (16:30 -0700)]
staging: comedi: cb_pcidda: rename local variable 'index'

For aesthetic reasons, rename the local variable 'index' used in
the attach_pci function to simply 'i'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: remove the debug output of the eeprom data
H Hartley Sweeten [Wed, 24 Oct 2012 23:30:38 +0000 (16:30 -0700)]
staging: comedi: cb_pcidda: remove the debug output of the eeprom data

This is just noise.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: remove private data variable 'digitalio'
H Hartley Sweeten [Wed, 24 Oct 2012 23:30:21 +0000 (16:30 -0700)]
staging: comedi: cb_pcidda: remove private data variable 'digitalio'

The private data variable 'digitalio' is only used to hold the PCI
base address for the 8255 devices on the board. This value is then
passed to subdev_8255_init() and stored in it's own private data.
There is no need to keep the value in the private data for the board.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: cleanup the private data
H Hartley Sweeten [Wed, 24 Oct 2012 23:30:05 +0000 (16:30 -0700)]
staging: comedi: cb_pcidda: cleanup the private data

Remove the unused variables in the private data. Also remove
the cut-and-paste comment from the skel driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: remove private data variable 'dac'
H Hartley Sweeten [Wed, 24 Oct 2012 23:29:50 +0000 (16:29 -0700)]
staging: comedi: cb_pcidda: remove private data variable 'dac'

The private data variable 'dac' is used to hold the PCI base
address for the board. Use the 'iobase' variable provided by
the comedi_device instead.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedidev.h: add PCI_VENDOR_ID_CB
H Hartley Sweeten [Wed, 24 Oct 2012 23:29:32 +0000 (16:29 -0700)]
staging: comedi: comedidev.h: add PCI_VENDOR_ID_CB

Add a define for the ComputerBoards/Measurement Computing PCI
vendor id. Remove the duplicates in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: add defines for the PCI device ids
H Hartley Sweeten [Wed, 24 Oct 2012 23:29:16 +0000 (16:29 -0700)]
staging: comedi: cb_pcidda: add defines for the PCI device ids

The PCI device ids supported by this driver are used multiple
places in the code. To improve maintainability, create #define's
for them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: remove code in #if 0/#endif blocks
H Hartley Sweeten [Wed, 24 Oct 2012 23:28:57 +0000 (16:28 -0700)]
staging: comedi: cb_pcidda: remove code in #if 0/#endif blocks

The functions cb_pcidda_ai_cmd(), cb_pcidda_ai_cmdtest(), and
cb_pcidda_ns_to_timer() are all partially coded stubs for command
support with the analog output subdevice. Just remove the code
since it is #if 0'ed out. It can be added back later if command
support is completed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: cb_pcidda: fix error test in cb_pcidda_attach_pci()
H Hartley Sweeten [Wed, 24 Oct 2012 23:28:36 +0000 (16:28 -0700)]
staging: comedi: cb_pcidda: fix error test in cb_pcidda_attach_pci()

As pointed out by Fengguang Wu, the error test after finding the
boardinfo should be testing for (!thisboard).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: Kconfig: update COMEDI_AMPLC_DIO200_PCI option
Ian Abbott [Wed, 24 Oct 2012 15:48:14 +0000 (16:48 +0100)]
staging: comedi: Kconfig: update COMEDI_AMPLC_DIO200_PCI option

Update the prompt line and description for the COMEDI_AMPLC_DIO200_PCI
config option to add the new PCIe boards supported by the "amplc_dio200"
driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: support multiple read/write of counter
Ian Abbott [Wed, 24 Oct 2012 15:48:13 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: support multiple read/write of counter

Change the `insn_read` and `insn_write` handlers of the '8254' counter
subdevices to support reading and writing multiple data values.
(Writing multiple values isn't very useful, but if that's what the user
wants....)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedi.h: add clock sources for amplc_dio200 timer
Ian Abbott [Wed, 24 Oct 2012 15:48:12 +0000 (16:48 +0100)]
staging: comedi: comedi.h: add clock sources for amplc_dio200 timer

Add clock source constants for the timer subdevice of the PCIe cards
supported by the "amplc_dio200" driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: implement timer subdevice
Ian Abbott [Wed, 24 Oct 2012 15:48:11 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: implement timer subdevice

Implement the timer subdevice for the new PCIe boards.  The subdevice was
previously marked as unused, but was reserved for this purpose.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: add 32-bit register access functions
Ian Abbott [Wed, 24 Oct 2012 15:48:10 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: add 32-bit register access functions

These are currently unused but will be used to support extra features of
the PCIe boards.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: comedi.h: extra clock and gate sources for amplc_dio200
Ian Abbott [Wed, 24 Oct 2012 15:48:09 +0000 (16:48 +0100)]
staging: comedi: comedi.h: extra clock and gate sources for amplc_dio200

Add constants to "comedi.h" for the extra clock and gate sources
allowed by the new PCIe cards supported by the "amplc_dio200" driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: allow extra clock and gate sources
Ian Abbott [Wed, 24 Oct 2012 15:48:08 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: allow extra clock and gate sources

One of the enhancements of the new PCIe boards is the addition of extra
clock and gate sources.  Allow clock and gate sources up to 31 for these
boards (compared to 7 for the old boards) although most of those are
reserved for future use.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: enable enhanced features of PCIe boards
Ian Abbott [Wed, 24 Oct 2012 15:48:07 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: enable enhanced features of PCIe boards

The new PCIe boards PCIe215, PCIe236 and PCIe296 have some enhanced
features (over the older boards), although none of these features are
supported by this driver yet.

Enable the enhanced features in hardware and use `dio200_layouts[]` to
indicate which boards support the enhanced features.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: allow generation of PCIe interrupts
Ian Abbott [Wed, 24 Oct 2012 15:48:06 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: allow generation of PCIe interrupts

The new PCIe boards PCIe215, PCIe236 and PCIe296 need a special register
setting to allow generation of interrupts on the PCIe bus.  Add
`dio200_pcie_board_setup()` to do this and call it from
`dio200_attach_pci()` for those boards.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: support PCIe215, PCIe236 and PCIe296
Ian Abbott [Wed, 24 Oct 2012 15:48:05 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: support PCIe215, PCIe236 and PCIe296

Add preliminary support for the above PCIe boards.  The interrupt
subdevice is not working yet as the boards need some additional
initialization to enable interrupts.  Reserve an unused subdevice that
will eventually become a timer subdevice.

Some unused subdevices have been added between the used subdevices on
the PCIe215 and PCIe236.  This is so the subdevice numbers will match a
pattern-matching feature to be added at a later date, where the
pattern-match specifications for a subdevice include pattern-match
results from other subdevices, specified by index.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: add register shift to board info
Ian Abbott [Wed, 24 Oct 2012 15:48:04 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: add register shift to board info

Add `mainshift` member to `struct dio200_board` to hold the amount of
left-shift required for main register offsets.  This is 0 for all the
boards currently supported so it doesn't need initializing explicitly in
any current element of `dio200_boards[]`.  It will be non-zero for some
new boards to be supported by this driver.

Modify the register access functions `dio200_read8()` and
`dio200_write8()` to take the shift into account.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: amplc_dio200: add min register region size in board
Ian Abbott [Wed, 24 Oct 2012 15:48:03 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: add min register region size in board

Store the length of the main register region in new member `mainsize` of
`struct dio200_board` and initialize it in each element of
`dio200_boards[]`.  For all currently supported boards this is
initialized to `DIO200_IO_SIZE` (0x20), but will be different for newer
boards to be supported in the future.

For ISA boards, this is the actual region length requested, but for PCI
boards it's the minimum expected region length.  Verify that the PCI BAR
region length is sufficient in `dio200_attach_pci()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>