summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
AgeCommit message (Collapse)Author
2013-02-21Merge tag 'staging-3.9-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging tree update from Greg Kroah-Hartman: "Here's the big staging tree merge for 3.9-rc1 Lots of cleanups and updates for drivers all through the staging tree. We are pretty much "code neutral" here, adding just about as many lines as we removed. All of these have been in linux-next for a while." * tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits) staging: comedi: vmk80xx: wait for URBs to complete staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon staging: et131x: Update TODO list staging: et131x: Remove assignment of skb->dev staging: wlan-ng: hfa384x.h: fix for error reported by smatch staging/zache checkpatch ERROR: spaces prohibited around that staging/ozwpan: Mark read only parameters and structs as const staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat staging/ozwpan: Mark local functions as static (fix sparse warnings) staging/ozwpan: Add missing header includes staging/usbip: Mark local functions as static (fix sparse warnings) staging/xgifb: Remove duplicated code in loops. staging/xgifb: Consolidate return paths staging/xgifb: Remove code without effect staging/xgifb: Remove unnecessary casts staging/xgifb: Consolidate if/else if with identical code branches staging: vt6656: replaced custom TRUE definition with true staging: vt6656: replaced custom FALSE definition with false staging: vt6656: replace custom BOOL definition with bool staging/rtl8187se: Mark functions as static to silence sparse ...
2013-02-21Merge tag 'driver-core-3.9-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core patches from Greg Kroah-Hartman: "Here is the big driver core merge for 3.9-rc1 There are two major series here, both of which touch lots of drivers all over the kernel, and will cause you some merge conflicts: - add a new function called devm_ioremap_resource() to properly be able to check return values. - remove CONFIG_EXPERIMENTAL Other than those patches, there's not much here, some minor fixes and updates" Fix up trivial conflicts * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits) base: memory: fix soft/hard_offline_page permissions drivercore: Fix ordering between deferred_probe and exiting initcalls backlight: fix class_find_device() arguments TTY: mark tty_get_device call with the proper const values driver-core: constify data for class_find_device() firmware: Ignore abort check when no user-helper is used firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER firmware: Make user-mode helper optional firmware: Refactoring for splitting user-mode helper code Driver core: treat unregistered bus_types as having no devices watchdog: Convert to devm_ioremap_resource() thermal: Convert to devm_ioremap_resource() spi: Convert to devm_ioremap_resource() power: Convert to devm_ioremap_resource() mtd: Convert to devm_ioremap_resource() mmc: Convert to devm_ioremap_resource() mfd: Convert to devm_ioremap_resource() media: Convert to devm_ioremap_resource() iommu: Convert to devm_ioremap_resource() drm: Convert to devm_ioremap_resource() ...
2013-02-20Merge branch 'irq-core-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq core changes from Ingo Molnar: "The biggest changes are the IRQ-work and printk changes from Frederic Weisbecker, which prepare the code for 'full dynticks' (the ability to stop or slow down the periodic tick arbitrarily, not just in idle time as today): - Don't stop tick with irq works pending. This fix is generally useful and concerns archs that can't raise self IPIs. - Flush irq works before CPU offlining. - Introduce "lazy" irq works that can wait for the next tick to be executed, unless it's stopped. - Implement klogd wake up using irq work. This removes the ad-hoc printk_tick()/printk_needs_cpu() hooks and make it working even in dynticks mode. - Cleanups and fixes." * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq: Export enable/disable_percpu_irq() arch Kconfig: Remove references to IRQ_PER_CPU irq_work: Remove return value from the irq_work_queue() function genirq: Avoid deadlock in spurious handling printk: Wake up klogd using irq_work irq_work: Make self-IPIs optable irq_work: Warn if there's still work on cpu_down irq_work: Flush work on CPU_DYING irq_work: Don't stop the tick with pending works nohz: Add API to check tick state irq_work: Remove CONFIG_HAVE_IRQ_WORK irq_work: Fix racy check on work pending flag irq_work: Fix racy IRQ_WORK_BUSY flag setting
2013-02-11staging: Remove unnecessary OOM messagesJoe Perches
alloc failures already get standardized OOM messages and a dump_stack. For the affected mallocs around these OOM messages: Converted kzallocs with multiplies to kcalloc. Converted kmallocs with multiplies to kmalloc_array. Converted a kmalloc/strlen/strncpy to kstrdup. Moved a spin_lock below a removed OOM message and removed a now unnecessary spin_unlock. Neatened alignment and whitespace. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-09staging:iio: Use spi_sync_transfer()Lars-Peter Clausen
Use the new spi_sync_transfer() helper function instead of open-coding it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-09iio: mxs-lradc: Fix 'duplicate const' warningFabio Estevam
The following warning is generated by sparse: drivers/staging/iio/adc/mxs-lradc.c:118:47: warning: duplicate const Remove the duplicate const. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02iio: Update iio_channel_get_all and iio_channel_get_all_cb APIGuenter Roeck
Pass device pointer instead of device name as parameter to iio_channel_get_all and iio_channel_get_all_cb. This will enable us to use OF information to retrieve consumer channel information. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging/iio: (iio_hwmon) Basic devicetree supportGuenter Roeck
Add 'iio-hwmon' OF compatibility table entry to enable OF matches. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging/iio: (iio_hwmon) Add support for sysfs name attributeGuenter Roeck
The 'name' attribute is mandatory for hwmon devices. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging/iio: (iio_hwmon) Use devm_kzallocGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio: Move adxrs450 driver out of stagingLars-Peter Clausen
The adxrs450 is in a reasonable shape now. It follows the IIO ABI and non of the standard code checker tools report any issue, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Move header file contents to main fileLars-Peter Clausen
The contents of the adxrs450 header file is not used outside the main drivers file, so just move the contents from the header file into the drivers main file. Also rename the adxrs450 driver file from adxrs450_core.c to adxrs450.c. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Fixup kernel doc commentsLars-Peter Clausen
Fix the name of the iio_device parameter for a few functions and add documentation for one missing function parameter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Use usleep_range for the sequential transfer dealyLars-Peter Clausen
The adxrs450 requires a delay of at least 0.1 ms between register writes. Using msleep() for such small delays is not recommended. So use usleep_range instead. Fixes the following checkpatch warning: WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt + msleep(1); Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Don't split string across multiple linesLars-Peter Clausen
This is one of the exceptions to the 80 chars per line rule since breaking the string in half it badly affects the grep-ability. Fixes the following checkpatch warning: WARNING: quoted string split across lines #203: FILE: staging/iio/gyro/adxrs450_core.c:203: + dev_warn(&st->us->dev, "The initial power on response " + "is not correct! Restart without reset?\n"); Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Reflow overlong linesLars-Peter Clausen
Reflow two lines to meet the 80 characters per line limit. Fixes the following checkpatch warnings: WARNING: line over 80 characters #29: FILE: staging/iio/gyro/adxrs450_core.c:29: + * @reg_address: the address of the lower of the two registers,which should be an even address, WARNING: line over 80 characters #81: FILE: staging/iio/gyro/adxrs450_core.c:81: + * @reg_address: the address of the lower of the two registers,which should be an even address, Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Don't spam the bootlogLars-Peter Clausen
Don't spam the bootlog with the devices part id and serial number. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Reject out of range calibscale valuesLars-Peter Clausen
Instead of silently discarding the upper bits reject out of range values for the calibscale property. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Perform sign extension for the calibbias registerLars-Peter Clausen
The calibbias (DNC) register contains a 10-bit twos complement value. Perform a proper sign extension when reading the register, otherwise negative will incorrectly be displayed as large positive values. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Make transfer buffers __be32Lars-Peter Clausen
Fixes the following sparse warnings: drivers/staging/iio/gyro/adxrs450_core.c:46:15: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:62:17: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:89:15: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:129:17: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:168:16: warning: cast to restricted __be32 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02Partially revert "staging:iio:gyro:adxrs450 make more use of spi_read and ↵Lars-Peter Clausen
spi_write." This partially reverts commit cb4496876f03631eff913b3c608c964d48d61eb9. There is no apparent reason why we should split a transaction which consists out of multiple transfers into multiple transactions each having one transfer. While this works it introduces a bunch of unnecessary context switch and additional setup costs. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-27iio:light:tsl2563 move out of stagingJonathan Cameron
This driver is simple, uses the latest interfaces and contains few if any controversial elements. All of its interfaces have been in place for a long time now. Hence let's move it out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26staging:iio:tsl2563 drop pointless forward declarationJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26staging:iio:tsl2563 Simplify exit path on error in read_interrupt_config.Jonathan Cameron
A rather over complicated exit path given there is only one exit route and nothing much is done after it. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26staging:iio:light:tsl2563 clean comments up.Jonathan Cameron
Fix formatting of some comments and drop a few generic information free ones. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26staging:iio:light:tsl2563 drop unnecessary brackets around constants.Jonathan Cameron
Not sure why these were ever there. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26staging:iio:adis16080: Move out of stagingLars-Peter Clausen
The driver is rather simple and in a good shape. It follows the IIO ABI and the standard codechecker tools do not report any issues, so move it out of staging. While moving it also remove one outdated 'fixme' comment. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Add scale and offset attributesLars-Peter Clausen
Report scale and offset for the velocity, voltage and temperature channels. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Remove unnecessary lockLars-Peter Clausen
All sections in which the transfer buffer is accessed are already protected by the IIO device's mlock. So we do not need the extra mutex protecting the buffer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: be16 cleanupsLars-Peter Clausen
The sample buffer contains big endian 16bit words. So use the be16 datatype for the buffer and use the proper helper functions for endianness conversion instead of openconding it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Cleanup SPI transferLars-Peter Clausen
During sampling the driver currently does a spi_read followed by a spi_write. This is not a problem per se, since CS needs to be deasserted between the two transfers. So even if another device claims the bus between the two transfers we should still get a result. But the code is actually spread out over multiple functions. E.g. the spi_read happens in one function the spi_write in another, this makes the code harder to follow. This patch re-factors the code to just use a single spi transaction to do both the read and the write transfer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Add device id table entry for the adis16100Lars-Peter Clausen
The adis16100 is very similar to the adis16080. The driver description already states that the driver supports the adis16100 as-well. But so far the there is no device id table for the adis16100 and the drivers does not bind to a device named adis16100. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26iio: mxs: Add MX23 support into the IIO driverMarek Vasut
This patch adds support for i.MX23 into the LRADC driver. The LRADC block on MX23 is not much different from the one on MX28, thus this is only a few changes fixing the parts that are specific to MX23. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging/iio: Use correct argument for sizeofPeter Huewe
found with coccicheck sizeof when applied to a pointer typed expression gives the size of the pointer The semantic patch that makes this output is available in scripts/coccinelle/misc/noderef.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26iio:accel:kxsd9 move out of stagingJonathan Cameron
This is a very simple driver giving basic access to this part over an spi bus. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:accel:kxsd9Jonathan Cameron
Remove an unneeded initialization and trivial reorder to ensure the device is ready when the device is registered. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio: drop sw_ring buffer implementation.Jonathan Cameron
Whilst this is IIO's oldest buffer implementation it is messy, poorly implemented and whilst it works, no one is entirely sure it always will. New IIO drivers have not been using this for some time and now all remaining old users have been converted to use the kfifo based alternative. Clearly a fifo isn't the same as a ring buffer but in many use cases it really doesn't matter. We also loose the watershed based poll implementation. However having poll effectively report data only when the buffer was half full was at best an 'unusual' use of the interface. At somepoint in the future we may bring watersheds back on a different buffer implementation, but then we will think a lot more about how to do the interface first. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:meter:ade7758 switch from sw_ring to kfifoJonathan Cameron
sw ring is going away so switch over to kfifo based buffer implementation. The only real change is that poll will return on some data there rather than buffer 50% full. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:impedance-analyzer switch from sw_ring to kfifo.Jonathan Cameron
sw_ring buffer implementation is going away so switch to the kfifo based alternative. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:accel:lis3l02dq remove sw_ring support.Jonathan Cameron
The sw_ring buffer is being removed in favour of the kfifo version. This is one of only a couple of driver still supporting its use. This driver will hopefully also be removed in favour of supporting the part in the unified ST accelerometer driver. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio: Move adis16400 out of stagingLars-Peter Clausen
This adis16400 driver is in pretty good shape now, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Code style cleanupLars-Peter Clausen
Do a set of minor miscellaneous code style cleanups for the adis16400 before moving it out of staging. Delete outdated comments, removed excess whitespace, add missing whitespace, replace u{8,16} with uint{8,16}_t. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Remove samplerate_available attributeLars-Peter Clausen
While the samplerate supported by the devices which are supported by this driver is not continuous it supports a wide range, much more than currently listed in the samplerate_available attribute. Also it accepts all values written to the samplerate attribute and will round-up them to the nearest supported sample rate. So remove the samplerate_available attribute. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Remove unit suffix from samplerate attributeLars-Peter Clausen
To be compliant to the IIO specification we should not include the "SPS" suffix in the "samplerate" attribute contents. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Preallocate transfer messageLars-Peter Clausen
Similar to like we already did for the generic adis library preallocate and pre-construct the SPI transfer message for the adis16400. For devices which do not support burst mode sampling does not differ from other adis devices and so we use the generic functions of the adis library in this case. In burst mode we can only sample all channels at once, so use the IIO cores demux facility instead of doing this manually. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Add helper macros for channel declarationLars-Peter Clausen
Most of the channels declared in the adis16400 driver look quite similar. This patch adds a bunch of helper macros to initialize the channel spec for this driver. This allows us to drastically reduce the number of lines of code needed for the channel spec declaration. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Use triggered buffer setup helper functionLars-Peter Clausen
Use the triggered buffer helper functions to setup and tear down the buffer for the adis16400 instead of doing this manually. This also means that we switch away from the deprecated sw_ring buffer and use the kfifo buffer now instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16400 driver. This allows us to completely scrap the adis16400 trigger code and more than half of the core driver code. For now we can not make use of the generic adis buffer implementation since the adis16400 driver has special requirements due to its burst mode support. But we will eventually get to this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Remove unused default_scan_maskLars-Peter Clausen
The chip_info struct for contains a defaul_scan_mask field. But it is never actually used in the code, so remove it from the chip_info struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Fix and cleanup 3db filter settingLars-Peter Clausen
The 3db divisors table is partially wrong and incomplete. Also the code rounds up to the next higher frequency if the requested frequency would matches one of the available frequencies. These two issues are fixed by this patch. The patch also changes the driver to round down the filter frequency if it is larger than the largest supported frequency instead of rejecting it as an invalid value. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>