openwrt/staging/blogic.git
12 years agoiio: isl29018: Support suspend and resume.
Bryan Freed [Wed, 24 Oct 2012 23:39:00 +0000 (00:39 +0100)]
iio: isl29018: Support suspend and resume.

The driver leaves the device in power-down state anyway,
so there is nothing to do on suspend.
On resume, we just have to make sure the range and ADC
values are updated in the device since it may have been
powered down in suspend.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agoiio: Accept a leading '+' sign when parsing fixed point numbers
Lars-Peter Clausen [Mon, 22 Oct 2012 11:15:00 +0000 (12:15 +0100)]
iio: Accept a leading '+' sign when parsing fixed point numbers

If we encounter a leading '+' sign just skip over it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agoiio: Reject trailing garbage when parsing fixed point numbers
Lars-Peter Clausen [Mon, 22 Oct 2012 11:15:00 +0000 (12:15 +0100)]
iio: Reject trailing garbage when parsing fixed point numbers

When parsing a fixed point number IIO stops parsing the string once it has
reached the last requested decimal place. This means that the remainder of the
string is silently accepted regardless, of whether it is part of a valid number
or not. This patch modifies the code to scan the whole string and only accept
valid numbers. Since fract_mult is 0 after the last decimal place any digit that
may follows won't affect the result.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agoiio: Do not accept multiple '.' in fixed point numbers
Lars-Peter Clausen [Mon, 22 Oct 2012 11:15:00 +0000 (12:15 +0100)]
iio: Do not accept multiple '.' in fixed point numbers

Currently when parsing a fix-point number we silently skip any additional '.'
found in the string.  E.g. '1.2.3.4' gets parsed as '1.234'. This patch
disallows this and returns an error if more than one '.' is encountered.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agostaging: iio: adc: ad7280a.c: fixed macro coding style
Kumar Amit Mehta [Fri, 2 Nov 2012 07:28:00 +0000 (07:28 +0000)]
staging: iio: adc: ad7280a.c: fixed macro coding style

remove unnecessary semicolon from the macro definition

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agoiio:dac:ad5449: unlock on error path
Dan Carpenter [Wed, 24 Oct 2012 07:13:00 +0000 (08:13 +0100)]
iio:dac:ad5449: unlock on error path

There is an unlock missing on this error path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agoRevert "iio: at91_adc: Use devm_kcalloc to allocate arrays"
Axel Lin [Mon, 29 Oct 2012 08:25:00 +0000 (08:25 +0000)]
Revert "iio: at91_adc: Use devm_kcalloc to allocate arrays"

This reverts commit 45259859492812c8b700ae1d157be01a8d2babfe.
This fixes build error because devm_kcalloc does not exist in current tree.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agostaging:iio: Consolidate adt7310 and adt7410 driver
Lars-Peter Clausen [Mon, 22 Oct 2012 09:42:00 +0000 (10:42 +0100)]
staging:iio: Consolidate adt7310 and adt7410 driver

The adt7310 is the SPI version of the adt7410, so there is no need to have a
separate driver for it. The register map layout is a bit different, i.e. the
addresses of the register differ, but the individual register layouts are
identical. We solve this by adding a small look-up table, which translates
adt7410 register addresses to ad7310 register addresses.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
12 years agoStaging: bcm: Remove typedef stLocalSFAddRequestAlt.
Kevin McKinney [Wed, 31 Oct 2012 01:50:44 +0000 (21:50 -0400)]
Staging: bcm: Remove typedef stLocalSFAddRequestAlt.

This patch removes typedef
stLocalSFAddRequestAlt in CmHost.h.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoStaging: bcm: Remove typedef for stLocalSFAddIndicationAlt and call directly.
Kevin McKinney [Wed, 31 Oct 2012 01:50:43 +0000 (21:50 -0400)]
Staging: bcm: Remove typedef for stLocalSFAddIndicationAlt and call directly.

This patch removes typedef for
stLocalSFAddIndicationAlt, changes the
name of the struct to bcm_add_indication_alt,
and removes a comment. In addition, any
calls to typedef stLocalSFAddIndicationAlt
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: csr_log_configure.h: remove a bunch of function protos
Devendra Naga [Tue, 30 Oct 2012 19:18:43 +0000 (15:18 -0400)]
staging: csr: csr_log_configure.h: remove a bunch of function protos

all protos that are removed does not have a function definition
so remove all of them together

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: remove csr_lib.h
Devendra Naga [Tue, 30 Oct 2012 19:18:42 +0000 (15:18 -0400)]
staging: csr: remove csr_lib.h

remove this header file as no struct or no function is
defined else where in csr.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: os.c: remove braces around single statement blocks
Devendra Naga [Tue, 30 Oct 2012 19:18:41 +0000 (15:18 -0400)]
staging: csr: os.c: remove braces around single statement blocks

remove all braces around single statement if blocks

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: os.c: remove col variable
Devendra Naga [Tue, 30 Oct 2012 19:18:40 +0000 (15:18 -0400)]
staging: csr: os.c: remove col variable

theres no point in checking the col variable,
its always zero, and wont print a new line, actually
its better to have a new line after a set of characters
printed, instead of confusing with the concatenated
characters when called multiple times at a time.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: drv.c: replace spaces with tabs in uf_destroy_device_nodes
Devendra Naga [Tue, 30 Oct 2012 19:18:39 +0000 (15:18 -0400)]
staging: csr: drv.c: replace spaces with tabs in uf_destroy_device_nodes

replace spaces at the start of line with tabs

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: drv.c: replace spaces with tabs
Devendra Naga [Tue, 30 Oct 2012 19:18:38 +0000 (15:18 -0400)]
staging: csr: drv.c: replace spaces with tabs

replace spaces at the start of the line with tabs

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: csr: io.c: replace spaces with tabs
Devendra Naga [Tue, 30 Oct 2012 19:18:37 +0000 (15:18 -0400)]
staging: csr: io.c: replace spaces with tabs

replace the spaces with the tabs at the start of line

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: et131x: Remove unnecessary PHY register write
Mark Einon [Tue, 30 Oct 2012 18:38:58 +0000 (18:38 +0000)]
staging: et131x: Remove unnecessary PHY register write

The PHY registers are now being controlled from the connected phydev,
so there shouldn't be any reason for the et131x code to perform any
extra setup. Removing the interrupt setup code, and register defines
that are now unused.

On testing, no changes in behaviour were experienced.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: et131x: Remove unnecessary NULL pointer assignments
Mark Einon [Tue, 30 Oct 2012 18:38:57 +0000 (18:38 +0000)]
staging: et131x: Remove unnecessary NULL pointer assignments

During a previous refactoring excerise, two NULL pointer assingments
were moved to their respective pointer declarations. Dan Carpenter
correctly points out that these assignments are not needed.
Removing them.

Also two small whitespace changes - rejoining split lines, as they are
now less than 80 chars.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: et131x: Update TODO list in README
Mark Einon [Tue, 30 Oct 2012 18:38:56 +0000 (18:38 +0000)]
staging: et131x: Update TODO list in README

-Added some extra items to the TODO list.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: et131x: Refactor nic_rx_pkts() to remove indenting
Mark Einon [Tue, 30 Oct 2012 18:38:55 +0000 (18:38 +0000)]
staging: et131x: Refactor nic_rx_pkts() to remove indenting

In nic_rx_pkts() some large chunks of code are indented in 'if (len)'
sections. Refactor the code to remove these indents and re-join longer
split lines.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: et131x: Remove duplicate code for fbr[0, 1]
Mark Einon [Tue, 30 Oct 2012 18:38:54 +0000 (18:38 +0000)]
staging: et131x: Remove duplicate code for fbr[0, 1]

Several places in et131x.c code is duplicated for fbr[0] and fbr[1].
Remove the duplicate lines and use loops to run over both indicies.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: drm/imx: add support for ARCH_MULTIPLATFORM
Rob Clark [Mon, 29 Oct 2012 08:31:14 +0000 (09:31 +0100)]
staging: drm/imx: add support for ARCH_MULTIPLATFORM

No dependency on plat headers, so only needs Kconfig update to
build for ARCH_MULTIPLATFORM.

Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: drm/omap: add support for ARCH_MULTIPLATFORM
Rob Clark [Mon, 29 Oct 2012 08:31:12 +0000 (09:31 +0100)]
staging: drm/omap: add support for ARCH_MULTIPLATFORM

Remove usage of plat/cpu.h and get information from platform data
instead.  This enables omapdrm to be built with ARCH_MULTIPLATFORM.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: drm/omap: remove global drm_device ptr
Rob Clark [Mon, 29 Oct 2012 08:27:50 +0000 (09:27 +0100)]
staging: drm/omap: remove global drm_device ptr

Not actually used anymore.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: ced1401: remove useless value cast on kmalloc()
Fengguang Wu [Sat, 27 Oct 2012 03:29:03 +0000 (11:29 +0800)]
staging: ced1401: remove useless value cast on kmalloc()

Casting value returned by k[cmz]alloc to (struct page * *) is useless.

Generated by: scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: drm/omap: only advertise rotation prop if supported
Rob Clark [Thu, 25 Oct 2012 22:14:13 +0000 (17:14 -0500)]
staging: drm/omap: only advertise rotation prop if supported

For hardware that does not have DMM/TILER, there is no rotation,
so no point in getting userspace's hopes up.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi/drivers: use auto_attach instead of attach_pci
Ian Abbott [Tue, 30 Oct 2012 13:30:04 +0000 (13:30 +0000)]
staging: comedi/drivers: use auto_attach instead of attach_pci

Change comedi drivers for PCI boards to use the new `auto_attach()`
method instead of the `attach_pci()` method.  I plan to remove the
`attach_pci()` and `attach_usb()` methods from `struct comedi_driver`
once nothing is using them.

Tag the functions with `__devinit` where they are not already so tagged,
as they are only called during PCI probe.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi/drivers: use auto_attach instead of attach_usb
Ian Abbott [Tue, 30 Oct 2012 13:30:03 +0000 (13:30 +0000)]
staging: comedi/drivers: use auto_attach instead of attach_usb

Change the usbdux, usbduxfast and usbduxsigma drivers to use the new
`auto_attach()` method instead of the `attach_usb()` method.  I plan to
remove the `attach_usb()` and `attach_pci()` methods from `struct
comedi_driver` once nothing is using them.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agostaging: comedi: addi_eeprom: don't pass the eeprom 'type'
H Hartley Sweeten [Tue, 30 Oct 2012 00:10:14 +0000 (17:10 -0700)]
staging: comedi: addi_eeprom: don't pass the eeprom 'type'

The eeprom 'type' can be found from the boardinfo when needed.
Finding it when needed also makes it clearer what this value is.

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_eeprom: fix remaining checkpatch.pl issues
H Hartley Sweeten [Tue, 30 Oct 2012 00:09:54 +0000 (17:09 -0700)]
staging: comedi: addi_eeprom: fix remaining checkpatch.pl issues

Fix the following checkpatch.pl issues:

ERROR: code indent should use tabs where possible
WARNING: please, no spaces at the start of a line
WARNING: line over 80 characters

This file is now checkpatch.pl clean.

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_eeprom: cleanup the defines
H Hartley Sweeten [Tue, 30 Oct 2012 00:09:39 +0000 (17:09 -0700)]
staging: comedi: addi_eeprom: cleanup the defines

Fix the whitespace in the defines. This also fixes a couple
checkpatch.pl issues.

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_eeprom: reformat driver comment
H Hartley Sweeten [Tue, 30 Oct 2012 00:09:25 +0000 (17:09 -0700)]
staging: comedi: addi_eeprom: reformat driver comment

Reformat the driver description comment to use the preferred block
comment style.

The second driver comment block contains the same information as
the first one. Remove 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: addi_eeprom: cleanup i_EepromReadMainHeader()
H Hartley Sweeten [Tue, 30 Oct 2012 00:09:11 +0000 (17:09 -0700)]
staging: comedi: addi_eeprom: cleanup i_EepromReadMainHeader()

Add namespace by renaming this CamelCase function to
addi_eeprom_read_info().

Remove the 'type' parameter. This parameter is a char pointer to the
string name of the eeprom type used on the board. This can be found
when needed using the dev pointer.

Change the parameter order so that the comedi_device pointer is passed
first.

The return value is always 0 and it's never checked. Change it to void.

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_eeprom: cleanup i_EepromReadTimerHeader()
H Hartley Sweeten [Tue, 30 Oct 2012 00:08:55 +0000 (17:08 -0700)]
staging: comedi: addi_eeprom: cleanup i_EepromReadTimerHeader()

Use this function to set the private data instead of doing it in the
i_EepromReadMainHeader() function. Keep the eeprom read code #if 0'ed
out for now.

Add namespace by renaming this CamelCase function to
addi_eeprom_read_timer_info().

Remove the unused str_TimerMainHeader and str_TimerDetails structs.

The return value is always 0 and it's never checked. Change it to void.

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_eeprom: cleanup i_EepromReadAnlogInputHeader()
H Hartley Sweeten [Tue, 30 Oct 2012 00:08:40 +0000 (17:08 -0700)]
staging: comedi: addi_eeprom: cleanup i_EepromReadAnlogInputHeader()

Add namespace by renaming this CamelCase function to
addi_eeprom_read_ai_info().

Refactor the function so that it stores the data from the eeprom directly
in the private data instead of using the a struct to pass the data back
to i_EepromReadMainHeader(). This allows removing the str_AnalogInputHeader
struct.

The return value is always 0 and it's never checked. Change it to void.

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_eeprom: cleanup i_EepromReadAnlogOutputHeader()
H Hartley Sweeten [Tue, 30 Oct 2012 00:08:17 +0000 (17:08 -0700)]
staging: comedi: addi_eeprom: cleanup i_EepromReadAnlogOutputHeader()

Add namespace by renaming this CamelCase function to
addi_eeprom_read_ao_info().

Refactor the function so that it stores the data from the eeprom directly
in the private data instead of using the a struct to pass the data back
to i_EepromReadMainHeader(). This allows removing the str_AnalogOutputHeader
struct.

The return value is always 0 and it's never checked. Change it to void.

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_eeprom: cleanup i_EepromReadDigitalOutputHeader()
H Hartley Sweeten [Tue, 30 Oct 2012 00:08:00 +0000 (17:08 -0700)]
staging: comedi: addi_eeprom: cleanup i_EepromReadDigitalOutputHeader()

Add namespace by renaming this CamelCase function to
addi_eeprom_read_do_info().

Refactor the function so that it stores the data from the eeprom directly
in the private data instead of using the a struct to pass the data back
to i_EepromReadMainHeader(). This allows removing the str_DigitalOutputHeader
struct.

The return value is always 0 and it's never checked. Change it to void.

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_eeprom: cleanup i_EepromReadDigitalInputHeader()
H Hartley Sweeten [Tue, 30 Oct 2012 00:07:45 +0000 (17:07 -0700)]
staging: comedi: addi_eeprom: cleanup i_EepromReadDigitalInputHeader()

Add namespace by renaming this CamelCase function to
addi_eeprom_read_di_info().

Refactor the function so that it stores the data from the eeprom directly
in the private data instead of using the a struct to pass the data back
to i_EepromReadMainHeader(). This allows removing the str_DigitalInputHeader
struct.

Leave the reads of the unused eeprom data for now.

The return value is always 0 and it's never checked. Change it to void.

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_eeprom: cleanup i_EepromReadMainHeader()
H Hartley Sweeten [Tue, 30 Oct 2012 00:07:30 +0000 (17:07 -0700)]
staging: comedi: addi_eeprom: cleanup i_EepromReadMainHeader()

Consolidate the two loops used to read the main header data and the
individual function header data from the eeprom.

The structs used to read the main header are not used outside this
function so remove them by reading the eeprom data into local
variables used in the loop.

Consolidate the 'timer' function cases.

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_eeprom: move the eeprom offset to addi_eeprom_readw()
H Hartley Sweeten [Tue, 30 Oct 2012 00:07:11 +0000 (17:07 -0700)]
staging: comedi: addi_eeprom: move the eeprom offset to addi_eeprom_readw()

All the addi_eeprom_readw() calls have the offset to the start of user
data (0x100) as part of the address calculation. Create a define for this
constant and move it's addition to the address into addi_eeprom_readw().

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_eeprom: cleanup v_EepromReadWord()
H Hartley Sweeten [Tue, 30 Oct 2012 00:06:57 +0000 (17:06 -0700)]
staging: comedi: addi_eeprom: cleanup v_EepromReadWord()

Add namespace to the function by renaming the CamelCase function to
addi_eeprom_readw().

Rename the CamelCase parameters and local variables.

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_eeprom: use AMCC_OP_REG_* defines
H Hartley Sweeten [Tue, 30 Oct 2012 00:06:42 +0000 (17:06 -0700)]
staging: comedi: addi_eeprom: use AMCC_OP_REG_* defines

Use the AMCC_OP_REG_* register offset defines for the magic numbers
used to read the nvram data.

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_eeprom: factor out the nvram read code
H Hartley Sweeten [Tue, 30 Oct 2012 00:06:14 +0000 (17:06 -0700)]
staging: comedi: addi_eeprom: factor out the nvram read code

Factor the code that reads the word from the nvram out of the
w_EepromReadWord() function.

Cleanup the factored out code so it's 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: addi_eeprom: cleanup v_EepromWaitBusy()
H Hartley Sweeten [Tue, 30 Oct 2012 00:05:59 +0000 (17:05 -0700)]
staging: comedi: addi_eeprom: cleanup v_EepromWaitBusy()

Add namespace to the function by renaming the CamelCase function to
addi_eeprom_nvram_wait().

Rename the CamelCase local variable.

Refactor the do {} while 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: addi_eeprom: cleanup v_EepromCs76Read()
H Hartley Sweeten [Tue, 30 Oct 2012 00:05:43 +0000 (17:05 -0700)]
staging: comedi: addi_eeprom: cleanup v_EepromCs76Read()

Add namespace to the function by renaming the CamelCase function to
addi_eeprom_read_93c76().

Change the return type of the function to unsigned short and just
return the read value instead of passing it through a pointer.

Rename the CamelCase parameters and local variables.

Make addi_eeprom_cmd_93c76() return the last value so it does not
need to be calculated.

Rename the EE_READ and EE76_CMD_LEN defines so they have namespace
associated with the other 93c76 defines.

Cleanup the loop that reads the eeprom bits so it's 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: addi_eeprom: cleanup v_EepromSendCommand76()
H Hartley Sweeten [Tue, 30 Oct 2012 00:05:17 +0000 (17:05 -0700)]
staging: comedi: addi_eeprom: cleanup v_EepromSendCommand76()

Add namespace to the function by renaming the CamelCase function to
addi_eeprom_cmd_93c76().

Rename the CamelCase parameters and local variables.

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_eeprom: cleanup v_EepromClock76()
H Hartley Sweeten [Tue, 30 Oct 2012 00:05:03 +0000 (17:05 -0700)]
staging: comedi: addi_eeprom: cleanup v_EepromClock76()

Add namespace to the function by renaming the CamelCase function to
addi_eeprom_clk_93c76().

Rename the CamelCase parameter, dw_RegisterValue, to simply 'val'.

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_eeprom: add defines for the 93c76 eeprom bits
H Hartley Sweeten [Tue, 30 Oct 2012 00:04:48 +0000 (17:04 -0700)]
staging: comedi: addi_eeprom: add defines for the 93c76 eeprom bits

Define the magic values used for the clock, chip-select, data out,
and data in signals to the 93c76 eeprom.

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_eeprom: rename 'pc_PCIChipInformation'
H Hartley Sweeten [Tue, 30 Oct 2012 00:04:33 +0000 (17:04 -0700)]
staging: comedi: addi_eeprom: rename 'pc_PCIChipInformation'

This variable is the pointer to the string name of the eeprom type
found on the board. This name comes from the boardinfo of the
driver.

For aesthetic reasons, rename it to simply 'type'.

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_eeprom: rename 'dw_Address'/'w_PCIBoardEepromAddress'
H Hartley Sweeten [Tue, 30 Oct 2012 00:04:10 +0000 (17:04 -0700)]
staging: comedi: addi_eeprom: rename 'dw_Address'/'w_PCIBoardEepromAddress'

This variable is actually the PCI bar 0 i/o address of the device found
with pci_resource_start().

For aesthetic reasons, rename it to 'iobase' and change to type to an
unsigned long.

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_eeprom: remove the last forward declarations
H Hartley Sweeten [Tue, 30 Oct 2012 00:03:54 +0000 (17:03 -0700)]
staging: comedi: addi_eeprom: remove the last forward declarations

None of the functions in this file are exported. Make them static and
remove the unnecessary 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: addi_eeprom: make the eeprom helper functions static
H Hartley Sweeten [Tue, 30 Oct 2012 00:03:36 +0000 (17:03 -0700)]
staging: comedi: addi_eeprom: make the eeprom helper functions static

The functions used to read the eeprom header information blocks are
only used in this file. Move them to remove the need for the forward
declarations.

The i_EepromReadTimerHeader() function is currently not being used.
Block it out with and #if 0/#endif until it's determined if it should
be removed.

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_eeprom: make the 93c76 eeprom functions static
H Hartley Sweeten [Tue, 30 Oct 2012 00:03:20 +0000 (17:03 -0700)]
staging: comedi: addi_eeprom: make the 93c76 eeprom functions static

The functions used to read the 93c76 eeprom are only used in this file.
Move them to remove the need for the forward declarations.

Also, remove some of the more obvious comments and fix a couple coding
style issues while moving the 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: addi_eeprom: make v_EepromWaitBusy() static
H Hartley Sweeten [Tue, 30 Oct 2012 00:03:05 +0000 (17:03 -0700)]
staging: comedi: addi_eeprom: make v_EepromWaitBusy() static

This function is only used in this file. Move it to remove the need
for the forward declaration.

Also, remove the comment about an error in the data book. It's not
really an error just someones misunderstanding about doing a byte
read of a dword register.

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_eeprom: remove extra whitespace and comment cruft
H Hartley Sweeten [Tue, 30 Oct 2012 00:02:42 +0000 (17:02 -0700)]
staging: comedi: addi_eeprom: remove extra whitespace and comment cruft

Remove the extra whitespace and the comment cruft in this file.

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: APCI1710_Ttl: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:58:10 +0000 (16:58 -0700)]
staging: comedi: APCI1710_Ttl: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: APCI1710_Tor: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:57:52 +0000 (16:57 -0700)]
staging: comedi: APCI1710_Tor: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: APCI1710_Ssi: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:57:34 +0000 (16:57 -0700)]
staging: comedi: APCI1710_Ssi: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: APCI1710_Inp_cpt: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:57:17 +0000 (16:57 -0700)]
staging: comedi: APCI1710_Inp_cpt: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: APCI1710_Dig_io: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:56:58 +0000 (16:56 -0700)]
staging: comedi: APCI1710_Dig_io: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_APCI1710: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:56:40 +0000 (16:56 -0700)]
staging: comedi: hwdrv_APCI1710: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci3501: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:56:19 +0000 (16:56 -0700)]
staging: comedi: hwdrv_apci3501: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci2200: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:56:02 +0000 (16:56 -0700)]
staging: comedi: hwdrv_apci2200: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci2032: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:55:43 +0000 (16:55 -0700)]
staging: comedi: hwdrv_apci2032: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci2016: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:55:24 +0000 (16:55 -0700)]
staging: comedi: hwdrv_apci2016: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci16xx: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:55:05 +0000 (16:55 -0700)]
staging: comedi: hwdrv_apci16xx: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci1564: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:54:46 +0000 (16:54 -0700)]
staging: comedi: hwdrv_apci1564: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci1516: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:54:26 +0000 (16:54 -0700)]
staging: comedi: hwdrv_apci1516: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci1500: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:54:08 +0000 (16:54 -0700)]
staging: comedi: hwdrv_apci1500: remove forward declarations

Remove the unnecessary 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: hwdrv_apci1032: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:53:53 +0000 (16:53 -0700)]
staging: comedi: hwdrv_apci1032: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: hwdrv_apci035: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:53:33 +0000 (16:53 -0700)]
staging: comedi: hwdrv_apci035: remove forward declarations

None of the functions in this file are exported. Make all of them
static and remove the unnecessary 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: addi_common: remove forward declarations
H Hartley Sweeten [Mon, 29 Oct 2012 23:53:14 +0000 (16:53 -0700)]
staging: comedi: addi_common: remove forward declarations

Move some of the functions in this file 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: addi_common: remove the extra cruft
H Hartley Sweeten [Mon, 29 Oct 2012 23:52:58 +0000 (16:52 -0700)]
staging: comedi: addi_common: remove the extra cruft

The individual addi-data files all define ADDIDATA_DRIVER_NAME. Remove
the #ifndef/#define for it in addi_common.c.

Remove the commented out MODULE_* stuff. The individual addi-data drivers
have this information.

Remove the, badly formatted, function comments. The functions are
obvious.

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-data: remove the boardinfo #ifdef'ery
H Hartley Sweeten [Mon, 29 Oct 2012 23:52:36 +0000 (16:52 -0700)]
staging: comedi: addi-data: remove the boardinfo #ifdef'ery

Move the boardinfo for each addi-data driver from addi_common.c to
the individual driver files. This removes the need #ifdef'ery.

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-data: remove the MODULE_DEVICE_TABLE #ifdef'ery
H Hartley Sweeten [Mon, 29 Oct 2012 23:52:20 +0000 (16:52 -0700)]
staging: comedi: addi-data: remove the MODULE_DEVICE_TABLE #ifdef'ery

Move the MODULE_DEVICE_TABLE for each addi-data driver from addi_common.c
to the individual driver files. This removes the need #ifdef'ery.

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-data: remove the addi-data #include ifdef'ery
H Hartley Sweeten [Mon, 29 Oct 2012 23:52:03 +0000 (16:52 -0700)]
staging: comedi: addi-data: remove the addi-data #include ifdef'ery

Move the addi-data specific #include's from addi_common.h to the
individual driver files.

The apci-1710, apci-3200, and apci-3300 drivers still have floating
point code in them and are currently disabled in the Kconfig and
Makefile. For now, move the fpu_{begin,end} functions from addi_common.c
to the main driver file so we can get rid of the #ifdef'ery.

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-data: remove this_board macro
H Hartley Sweeten [Mon, 29 Oct 2012 23:51:47 +0000 (16:51 -0700)]
staging: comedi: addi-data: remove this_board macro

This macro relies on a local variable having a specific name. Remove 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: addi-data: move the main #include's to the drivers
H Hartley Sweeten [Mon, 29 Oct 2012 23:51:33 +0000 (16:51 -0700)]
staging: comedi: addi-data: move the main #include's to the drivers

The addi-data drivers are all built by the main driver files including
addi-data/addi_common.c. That file then includes other files depending
on what driver is being compiled. This is makes the code quite messy
and hard to follow.

Start cleaning it up by removing the unneeded #include's in addi_common.c
and moving the some of the comedi #include's into the individual driver
files.

This is the first step in getting rid of the #ifdef'ery in addi_common.c.

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: move module init code to EOF
H Hartley Sweeten [Mon, 29 Oct 2012 23:51:16 +0000 (16:51 -0700)]
staging: comedi: addi_common: move module init code to EOF

Move the module_{init,exit} code and associated variables to the end
of the file.

Use module_comedi_pci_driver() to remove the module init boilerplate.

For aesthetic reasons, rename the comedi_driver and pci_driver from
driver_* to *_driver.

Remove the forward declarations for i_ADDI_{Attach,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: rtd520: cleanup TS_* defines
H Hartley Sweeten [Mon, 29 Oct 2012 17:10:14 +0000 (10:10 -0700)]
staging: comedi: rtd520: cleanup TS_* defines

Convert these to bit shifts and cleanup the whitespace and comments.

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: rtd520: cleanup FS_* defines
H Hartley Sweeten [Mon, 29 Oct 2012 17:09:31 +0000 (10:09 -0700)]
staging: comedi: rtd520: cleanup FS_* defines

Convert these to bit shifts and cleanup the whitespace and comments.

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: rtd520: cleanup the LCFG_* defines
H Hartley Sweeten [Mon, 29 Oct 2012 17:09:04 +0000 (10:09 -0700)]
staging: comedi: rtd520: cleanup the LCFG_* defines

Fixes all the > 80 char checkpatch.pl issues with 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: rtd520: cleanup the LAS1_* defines
H Hartley Sweeten [Mon, 29 Oct 2012 17:08:48 +0000 (10:08 -0700)]
staging: comedi: rtd520: cleanup the LAS1_* defines

Fixes all the > 80 char checkpatch.pl issues with 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: rtd520: cleanup the LAS0_* defines
H Hartley Sweeten [Mon, 29 Oct 2012 17:08:24 +0000 (10:08 -0700)]
staging: comedi: rtd520: cleanup the LAS0_* defines

Fixes all the > 80 char checkpatch.pl issues with 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: rtd520: remove unused LAS0_SPARE_* defines
H Hartley Sweeten [Mon, 29 Oct 2012 17:08:07 +0000 (10:08 -0700)]
staging: comedi: rtd520: remove unused LAS0_SPARE_* defines

These register offset defines are not used. 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: rtd520: move #include's to top of file
H Hartley Sweeten [Mon, 29 Oct 2012 17:07:47 +0000 (10:07 -0700)]
staging: comedi: rtd520: move #include's to top of file

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: rtd520: add whitespace to the subdevice init
H Hartley Sweeten [Mon, 29 Oct 2012 17:07:21 +0000 (10:07 -0700)]
staging: comedi: rtd520: add 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: rtd520: remove 'aiMaxGain' from boardinfo
H Hartley Sweeten [Mon, 29 Oct 2012 17:07:01 +0000 (10:07 -0700)]
staging: comedi: rtd520: remove 'aiMaxGain' from boardinfo

This value is only used in the attach to determine which range
table the analog input subdevice uses. Remove this variable and
just pass the range table pointer in the boardinfo.

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: rtd520: remove 'aiChans' and 'aiBits' from boardinfo
H Hartley Sweeten [Mon, 29 Oct 2012 17:06:34 +0000 (10:06 -0700)]
staging: comedi: rtd520: remove 'aiChans' and 'aiBits' from boardinfo

All the boards supported by this driver have the same number of analog
input channels and resolution. Remove the boardinfo for this and just
open-code the values 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: rtd520: allow attaching without interrupt support
H Hartley Sweeten [Mon, 29 Oct 2012 17:06:03 +0000 (10:06 -0700)]
staging: comedi: rtd520: allow attaching without interrupt support

Interrupts ares only required for the ai subdevice command support.

Allow the driver to attach to the board even if request_irq() fails.
Only hook up the command support if the interrupt is available.

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: rtd520: fix > 80 char line checkpatch.pl issues
H Hartley Sweeten [Mon, 29 Oct 2012 17:05:44 +0000 (10:05 -0700)]
staging: comedi: rtd520: fix > 80 char line checkpatch.pl issues

This fixes all the remaining checkpatch.pl issues.

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: rtd520: remove 'intCount' from the private data
H Hartley Sweeten [Mon, 29 Oct 2012 17:04:58 +0000 (10:04 -0700)]
staging: comedi: rtd520: remove 'intCount' from the private data

This variable is cleared when an ai command is initiated and then
incremented with each interrupt. Other than that it's never used.
Just remove 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: rtd520: remove DPRINTK messages
H Hartley Sweeten [Mon, 29 Oct 2012 17:04:40 +0000 (10:04 -0700)]
staging: comedi: rtd520: remove DPRINTK messages

These are all development debug messages. A lot of them are in
the interrupt routine and probably shouldn't be there. Some of
the others are actually commented out.

Just remove all of 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: rtd520: remove code in #if 0/#endif blocks
H Hartley Sweeten [Mon, 29 Oct 2012 17:04:11 +0000 (10:04 -0700)]
staging: comedi: rtd520: remove code in #if 0/#endif blocks

All the #if 0'ed out code is either debug or incomplete. Just remove
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: rtd520: convert driver to attach_pci
H Hartley Sweeten [Mon, 29 Oct 2012 17:03:53 +0000 (10:03 -0700)]
staging: comedi: rtd520: 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.

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

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: rtd520: remove the board attach noise
H Hartley Sweeten [Mon, 29 Oct 2012 17:03:30 +0000 (10:03 -0700)]
staging: comedi: rtd520: remove the board attach noise

Remove all the kernel noise that is output as the board is
attached. Leave a simple dev_info() after the attach is complete.

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: rtd520: remove broken USE_DMA code
H Hartley Sweeten [Mon, 29 Oct 2012 17:03:01 +0000 (10:03 -0700)]
staging: comedi: rtd520: remove broken USE_DMA code

It appears the dma code in this driver is seriously broken.
Enabling USE_DMA causes the driver to not even compile.

Just remove all the dma code for now.

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: rtd520: factor out the board reset
H Hartley Sweeten [Mon, 29 Oct 2012 17:02:39 +0000 (10:02 -0700)]
staging: comedi: rtd520: factor out the board reset

Factor the common code that does the low-level reset of the board
out of rtd_init_board() and rtc_detach().

Fix the if test in rtd_detach() before doing the reset, devpriv->lcfg
could be NULL at this point.

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: rtd520: factor out the board init
H Hartley Sweeten [Mon, 29 Oct 2012 17:02:19 +0000 (10:02 -0700)]
staging: comedi: rtd520: factor out the board init

Factor the code that does the low-level init of the board out of
rtd_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>