Commit Graph

335864 Commits

Author SHA1 Message Date
Jonathan Cameron
0d9fa2ce93 staging:iio:adc:max1363 white space cleanup
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:30 +00:00
Jonathan Cameron
2593b13a62 staging:iio:adc:max1363 make docs match the contents of max1363_chip_info
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:29 +00:00
Jonathan Cameron
ec44372865 staging:iio:adc:max1363 drop references to 'ring' given now using a fifo
Seems worth clearing the old naming out to avoid any confusion in the future.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:29 +00:00
Jonathan Cameron
b3bcbfcfec staging:iio:adc:max1363 consolidate files.
For a long while now the max1363 core has selected the
buffer anyway. For a while I meant to make the separation
work again, but given how long it has been it is probably
time to conclude it will never happen and settle for tidying
up what we have.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:28 +00:00
Jonathan Cameron
0d331e4fd2 staging:iio:adc:max1363 ring_sw->kfifo conversion
We are moving towards scrapping ring_sw so this move
is necessary.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:28 +00:00
Jonathan Cameron
92d1079b28 staging:iio: add a callback buffer for in kernel push interface
This callback buffer is meant to be opaque to users, but basically
adds a very simple pass through buffer to which data may be
pushed when it is inserted into the buffer list.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:27 +00:00
Jonathan Cameron
0464415dd2 staging:iio:in kernel users: Add a data field for channel specific info.
Used to allow information about a given channel mapping to be passed
through from board files to the consumer drivers.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:27 +00:00
Jonathan Cameron
84b36ce5f7 staging:iio: Add support for multiple buffers
Route all buffer writes through the demux.
Addition or removal of a buffer results in tear down and
setup of all the buffers for a given device.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Tested-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
2012-11-10 10:17:21 +00:00
Lars-Peter Clausen
4eb3ccf157 staging:iio: Move the ad7887 driver out of staging
The driver does not expose any custom API to userspace and none of the standard
static code checker tools report any issues, so move it out of staging.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05 20:39:54 +00:00
Lars-Peter Clausen
98efb70add staging:iio:ad7887: Use passed in chan spec in ad7887_read_raw
Use the passed in chan spec in ad7887_read_raw instead of alawys using the first
chan spec entry from the chip info data. Since all channels have the same shift
and realbits from a functional point of view it does not matter which chan spec
is used, but the patch makes the a bit more clear.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05 20:39:53 +00:00
Lars-Peter Clausen
fce7c3eac7 staging:iio:ad7887: Allow to use internal ref in two channel mode
While it is not recommended to use the internal reference in two channel mode in
order to obtain optimal performance it is still possible to use it.

While we are at it also get rid of the duplicate tx_cmd_buf entries. There are
only two unique entries. One for channel 1 and one for channel 2.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05 20:39:53 +00:00
Lars-Peter Clausen
5daa751f89 staging:iio:ad7887: Use proper kernel doc
Use proper kernel doc to document the platform data struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05 20:39:52 +00:00
Lars-Peter Clausen
65dd3d3d7a staging:iio:ad7887: Squash everything into one file
The recent cleanups have decimated the drivers code size by quite a bit. It is
only a few hundred lines in total now and we also always build buffer support,
so there really is no need to spread the driver out over multiple files. Putting
everything into one file also allows to reduce the code size a bit more by
removing a few lines of boilerplate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05 20:39:52 +00:00
Lars-Peter Clausen
bf5d2613c9 staging:iio:ad7887: Rework regulator handling
Rework the regulator handling of the ad7887 driver to match more closely what we
do for other drivers. Only request the regulator if a external reference is
used, but treat it as an error if requesting the regulator fails. Also remove
the possibility to specify the reference voltage via platform data and always
use the regulator for this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05 20:39:52 +00:00
Lars-Peter Clausen
bd6880477a staging:iio:ad7887: Preallocate sample buffer
We know that the sample buffer will at most need to hold two 16 bit samples and
the 64 bit aligned 64 bit timestamp. Preallocate a buffer large enough to hold
this instead of allocating and freeing it each time a sample is read.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05 20:39:51 +00:00
Lars-Peter Clausen
3c7f0c2b11 staging:iio:adis16400: Set the PROD_ID flag for the adis16334
The adis16334 has the PROD_ID register so set the PROD_ID flag in its chip info.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-04 15:55:44 +00:00
Lars-Peter Clausen
a7462e640d staging:iio:adis16400: Remove now duplicated chip_table entry
The ADIS1360 and ADIS13605 are very similar and do have the same software
interface. The only difference is the contents of the PROD_ID register. Since we
now read the product id from the device name instead of the chip_info struct we
can use the same chip_table entry for both the ADIS1360 and ADIS13605.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-04 15:55:40 +00:00
Lars-Peter Clausen
fc8850c0a1 staging:iio:adis16400: Fix product id check
The product id check currently ANDs the read id with 0xF000 and compares the
result to the product id from the chip info. Since none of the product ids in
the chip info table end in 0x000 the check will always fail. Furthermore it is
also wrong, the product id in the PROD_ID register will always match the part
number of the device.

Some of the ADIS16XXX devices are identical from a software point of
view with the product id register having a different content. If we keep the
current scheme of storing the product id in the chip info table this would
require us to have multiple almost identical chip info table entries. So instead
this patch changes the code to parse the product id from the device name.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-04 15:55:37 +00:00
Lars-Peter Clausen
ea2ccb3e02 staging:iio:adis16400: Fix adis16334 sampling frequency control
Setting the sampling frequency for the adis16334 differs from the other devices.
This patch introduces two new callback functions to the adis16400 chip_info
struct which are used to specify how to read and write the current sample rate.
The patch also introduces the proper implementations for these callbacks for the
adis16334.

Related to this is that the adis16334 has no slow mode and so we do not limit
the SPI clock rate to 300kHz during initialization. The patch adds a new flag
for devices which do have a slow mode.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-04 15:55:32 +00:00
Ian Abbott
15358a7f77 staging: comedi: adl_pci9118: support auto-attachment
Support auto-attachment of supported PCI devices by adding the
`auto_attach()` hook (`pci9118_auto_attach()`) to the `struct
comedi_driver`.  This is called via `comedi_pci_auto_attach()` at PCI
probe time.

Previously, the driver's call to `comedi_pci_auto_config()` would fall
back to the old method of auto-attaching devices and would fail because
it couldn't find a board name matching the driver name.  The new method
doesn't care about that.

There are still a few problems.  All the boards supported by this driver
have the same PCI vendor and device ID, so it will just pick the first
supported board type, "pci9118dg".  (Other supported board types have
different AI ranges or different AI speeds, but are otherwise the same.)
Also, manual attachment of devices allows several optional features to
be configured, such as use of an external multiplexord, specified
sample&hold delays and options to ignore certain hardware errors.  These
will all be set to defaults for auto-attached devices.  A future version
of the driver may address these issues via configurable device
attributes.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:39:38 -07:00
Ian Abbott
00d9319475 staging: comedi: adl_pci9118: cards have same vendor ID
Don't bother recording the PCI vendor ID of each board in `boardtypes[]`
as they are all the same and the code doesn't use it anyway.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:39:38 -07:00
Ian Abbott
f3b81d5458 staging: comedi: adl_pci9118: split pci9118_attach()
Split most of the functionality of the attach routine `pci9118_attach()`
into a new function `pci9118_common_attach()` that can be called when
auto-attachment of devices is supported.  Move the enabling of the PCI
device and its i/o regions into this function.  Do the requesting of the
interrupt near the end of the function so it doesn't get enabled before
the device is ready.

Note that auto-attachment of PCI devices is currently broken in this
driver because the list of board names referred to by the `struct
comedi_driver` does not contain a "wildcard" entry matching the comedi
driver name.  This won't be a problem once support for the
`auto_attach()` method is added.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:39:37 -07:00
Ian Abbott
f41d2573b2 staging: comedi: adl_pci9118: replace printks
Replace or remove the `printk()` calls in this driver.  Call new function
`pci9118_report_attach()` to report successful attachment of the board.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:39:37 -07:00
Kevin McKinney
38d6d8de76 Staging: bcm: Change ULONG to unsigned long in InterfaceAdapter.h
This patch changes ULONG to unsigned long
in InterfaceAdapter.h.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:47 -07:00
Kevin McKinney
85b331afb2 Staging: bcm: Remove typedef for _BULK_ENDP_IN and call directly.
This patch removes typedef for
_BULK_ENDP_IN, changes the name of the
struct to bcm_bulk_endpoint_in. In addition,
any calls to typedefs BULK_ENDP_IN, or
*PBULK_ENDP_IN are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:47 -07:00
Kevin McKinney
c1fa1eb38f Staging: bcm: Remove typedef for _BULK_ENDP_OUT and call directly.
This patch removes typedef for
_BULK_ENDP_OUT, changes the name of the
struct to bcm_bulk_endpoint_out. In addition,
any calls to typedefs BULK_ENDP_OUT, or
*PBULK_ENDP_OUT are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:47 -07:00
Kevin McKinney
89a02bfe0f Staging: bcm: Remove typedef for _INTR_ENDP_IN and call directly.
This patch removes typedef for
_INTR_ENDP_IN, changes the name of the
struct to bcm_intr_endpoint_in. In addition,
any calls to typedefs INTR_ENDP_IN, or
*PINTR_ENDP_IN are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:47 -07:00
Kevin McKinney
de89ec4556 Staging: bcm: Remove typedef for _INTR_ENDP_OUT and call directly.
This patch removes typedef for
_INTR_ENDP_OUT, changes the name of the
struct to bcm_intr_endpoint_out. In addition,
any calls to typedefs INTR_ENDP_OUT, or
*PINTR_ENDP_OUT are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
e8355aa36c Staging: bcm: Remove typedef for _USB_TCB and call directly.
This patch removes typedef for
_USB_TCB, changes the name of the
struct to bcm_usb_tcb. In addition,
any calls to typedefs USB_TCB, or
*PUSB_TCB are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
71dd092f36 Staging: bcm: Remove typedef for _USB_RCB and call directly.
This patch removes typedef for
_USB_RCB, changes the name of the
struct to bcm_usb_rcb. In addition,
any calls to typedefs USB_RCB, or
*PUSB_RCB are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
d6861cfef2 Staging: bcm: Remove typedef for _S_INTERFACE_ADAPTER and call directly.
This patch removes typedef for
_S_INTERFACE_ADAPTER, changes the
name of the struct to bcm_interface_adapter.
In addition, any calls to typedefs
S_INTERFACE_ADAPTER, or *PS_INTERFACE_ADAPTER
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
48df0187d4 Staging: bcm: Change BOOLEAN to bool in InterfaceAdapter.h
This patch changes BOOLEAN to bool
in InterfaceAdapter.h.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
60896e6b81 Staging: bcm: Change PVOID to void * in InterfaceAdapter.h
This patch changes PVOID to void *
in InterfaceAdapter.h.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
decb16b317 Staging: bcm: Change UINT to unsigned int in InterfaceAdapter.h
This patch changes UINT to unsigned int
in InterfaceAdapter.h.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
d231be5751 Staging: bcm: Change UCHAR to unsigned char in InterfaceAdapter.h
This patch changes UCHAR to unsigned char
in InterfaceAdapter.h.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:46 -07:00
Kevin McKinney
5806627215 Staging: bcm: Change PCHAR to char * in InterfaceAdapter.h
This patch changes PCHAR to char *
in InterfaceAdapter.h.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:45 -07:00
Kevin McKinney
5e1db5adb4 Staging: bcm: Correctly format braces in InterfaceAdapter.h
This patch correctly formats braces
in InterfaceAdapter.h as reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:45 -07:00
Kevin McKinney
d0d634d31a Staging: bcm: Correctly format comments in InterfaceAdapter.h
This patch correctly formats comments
in InterfaceAdapter.h as reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:45 -07:00
Kevin McKinney
5c032faa82 Staging: bcm: Fix all white space issues in InterfaceAdapter.h
This patch fixes all white space issues
in InterfaceAdapter.h as reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:45 -07:00
YAMANE Toshiaki
bb29ea142d staging/comedi: Use dev_ printks in ni_tiocmd.c
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_notice(netdev, ... then dev_notice(dev, ... then pr_notice(...  to printk(KERN_NOTICE ...

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:36:03 -07:00
Kumar Amit Mehta
32adf1e553 staging: wlan-ng: hfa384x_usb.c: fixed a coding style issue
checkpatch.pl throws error message for the current code. This patch fixes
coding style issue.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:30:19 -07:00
Mark Einon
f0ada6784f staging: et131x: Align ring_index and fbr[] indicies
A ring_index value of 0 is being used to reference the free buffer ring
fbr[1] and ring_index=1 is used to reference fbr[0]. Avoid this
confusing referencing by swapping the indicies so that ring_index=0
refers to fbr[0] and vice versa.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:30:19 -07:00
Mark Einon
4ab07c96d2 staging: et131x: Remove unused buffer[1,2] variables.
The fbr_lookup struct variables buffer1 and buffer2 are only assigned
and never used, so remove them.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:30:19 -07:00
H Hartley Sweeten
60eebfad7a staging: comedi: addi_apci_3120: cleanup addi_find_boardinfo()
This driver uses the comedi PCI auto attach mechanism and the comedi
core does not use the boardinfo during the attach.

Now that this driver has the attach separated from addi_common.c we
can remove passing the boardinfo in the comedi_driver and cleanup
the code that finds the boardinfo.

Also, rename addi_find_boardinfo() so it has namespace associated
with 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>
2012-11-02 11:23:51 -07:00
H Hartley Sweeten
7dd2358156 staging: comedi: addi_apci_3120: remove COMEDI_SUBD_TTLIO define
This define is not used by the driver. 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>
2012-11-02 11:23:50 -07:00
H Hartley Sweeten
97641816b5 staging: comedi: addi_apci_3120: cleanup apci3120_detach()
This driver always tried to allocate the dma buffers so they need to
be free'd when the board is detached.

Remove the unneeded tests for the eeprom chip and bring the code
back an indent.

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>
2012-11-02 11:23:50 -07:00
H Hartley Sweeten
0bb482e25c staging: comedi: addi_apci_3120: clarify AO subdevice init
Only the apci3120 board supports an analog output subdevice. The
boardinfo indicates this by setting the 'i_NbrAoChannel' value.

The range table as well as the function used for the insn_write
operation are fixed for the analog outputs. Remove this information
from the boardinfo and use it directly in 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>
2012-11-02 11:23:50 -07:00
H Hartley Sweeten
2e8fcd1820 staging: comedi: addi_apci_3120: remove 'b_AvailableConvertUnit'
This boardinfo value is not used by the driver. 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>
2012-11-02 11:23:50 -07:00
H Hartley Sweeten
dfb8a4abe9 staging: comedi: addi_apci_3120: remove 'ui_MinDelaytimeNs'
Both boards supported by this driver have the same minimum delay time.
Remove the boardinfo for it and just open code the value in
i_APCI3120_CommandTestAnalogInput().

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>
2012-11-02 11:23:50 -07:00
H Hartley Sweeten
97e998de5d staging: comedi: addi_apci_3120: remove 'ui_MinAcquisitiontimeNs'
Both boards supported by this driver have the same minimum acquisition
time.. Remove the boardinfo for it and just open code the value in
i_APCI3120_CommandTestAnalogInput().

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>
2012-11-02 11:23:50 -07:00