summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/accel
AgeCommit message (Collapse)AuthorFilesLines
2013-05-09Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linuxLinus Torvalds1-1/+1
Pull removal of GENERIC_GPIO from Grant Likely: "GENERIC_GPIO now synonymous with GPIOLIB. There are no longer any valid cases for enableing GENERIC_GPIO without GPIOLIB, even though it is possible to do so which has been causing confusion and breakage. This branch does the work to completely eliminate GENERIC_GPIO." * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux: gpio: update gpio Chinese documentation Remove GENERIC_GPIO config option Convert selectors of GENERIC_GPIO to GPIOLIB blackfin: force use of gpiolib m68k: coldfire: use gpiolib mips: pnx833x: remove requirement for GENERIC_GPIO openrisc: default GENERIC_GPIO to false avr32: default GENERIC_GPIO to false xtensa: remove explicit selection of GENERIC_GPIO sh: replace CONFIG_GENERIC_GPIO by CONFIG_GPIOLIB powerpc: remove redundant GENERIC_GPIO selection unicore32: default GENERIC_GPIO to false unicore32: remove unneeded select GENERIC_GPIO arm: plat-orion: use GPIO driver on CONFIG_GPIOLIB arm: remove redundant GENERIC_GPIO selection mips: alchemy: require gpiolib mips: txx9: change GENERIC_GPIO to GPIOLIB mips: loongson: use GPIO driver on CONFIG_GPIOLIB mips: remove redundant GENERIC_GPIO select
2013-04-16Convert selectors of GENERIC_GPIO to GPIOLIBAlexandre Courbot1-1/+1
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca>
2013-03-25iio:trigger: Introduce iio_tigger_{set,get}_drvdataLars-Peter Clausen1-3/+3
Introduce iio_tigger_{set,get}_drvdata which allows to attach driver specific data to a trigger. The functions wrap access to the triggers private_data field and all current users are updated to use iio_tigger_{set,get}_drvdata instead of directly accessing the private_data field. This is the first step towards removing the private_data field from the iio_trigger struct. The following coccinelle script has been used to update the drivers: <smpl> @@ struct iio_trigger *trigger; expression priv; @@ -trigger->private_data = priv +iio_trigger_set_drv_data(trigger, priv) @@ struct iio_trigger *trigger; @@ -trigger->private_data +iio_trigger_get_drv_data(trigger) </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:accel:sca3000 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-3/+2
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:accel:lis3l02dq move to info_mask_(shared_by_type/separate)Jonathan Cameron1-7/+4
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:accel:adis16220 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-13/+13
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:accel:adis move to info_mask_(shared_by_type/separate)Jonathan Cameron5-18/+13
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-02-11staging: Remove unnecessary OOM messagesJoe Perches1-4/+1
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 Clausen3-31/+6
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-01-26iio:accel:kxsd9 move out of stagingJonathan Cameron3-300/+0
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 Cameron1-5/+5
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:accel:lis3l02dq remove sw_ring support.Jonathan Cameron3-34/+4
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>
2012-11-21staging: iio: remove use of __devexit_pBill Pemberton9-9/+9
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devexitBill Pemberton9-9/+9
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devinitBill Pemberton9-10/+10
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-19staging:iio: Move adis library out of stagingLars-Peter Clausen6-6/+6
Now that the adis library no longer depends on the sw_ring buffer implementation we can move it out of staging. While we are at it also sort the entries in the iio Kconfig and Makefile to be in alphabetical order. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis: Preallocate transfer messageLars-Peter Clausen5-0/+5
Currently the driver reads out all sample registers of the device and throws away those which it does not need. Furthermore the SPI message is constructed each time the trigger handler is run, although it will be the same each time. This patch preallocates and pre-constructs the SPI message in the "update_scan_mode" callback. Only those register which are actually selected for sampling are included in the message. The patch also gets rid of the conversion of the sample data from big endian to the native endianness and instead marks the channel as big endian in its scan type. This allows to directly push the SPI transfer buffer to the IIO buffer without the need to post-process it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16240: Use adis libraryLars-Peter Clausen6-691/+77
Use the new adis library for the adis16240 driver. This allows us to completely scrap the adis16240 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16220: Use adis libraryLars-Peter Clausen2-240/+60
Use the new adis library for the adis16220 driver. The adis16220 driver is a bit special and so we can only make use of the generic register access and control functions for now. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16209: Use adis libraryLars-Peter Clausen6-699/+74
Use the new adis library for the adis16209 driver. This allows us to completely scrap the adis16209 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16204: Use adis libraryLars-Peter Clausen6-672/+70
Use the new adis library for the adis16204 driver. This allows us to completely scrap the adis16204 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16203: Use adis libraryLars-Peter Clausen6-653/+66
Use the new adis library for the adis16203 driver. This allows us to completely scrap the adis16203 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16201: Use adis libraryLars-Peter Clausen6-697/+69
Use the new adis library for the adis16201 driver. This allows us to completely scrap the adis16201 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio: Add support for multiple buffersJonathan Cameron6-6/+6
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-10-29Merge 3.7-rc3 into staging-nextGreg Kroah-Hartman6-57/+69
This resolves the conflict with: drivers/staging/comedi/drivers/amplc_dio200.c and syncs up the changes that happened in the staging directory for 3.7-rc3. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-19staging:iio: Fix adis16240 channel offsets and scalesLars-Peter Clausen1-11/+12
Most of the channel offsets and scales in the adis16240 are incorrect: * Temperature scale is of by a factor of 1000 * Voltage scale is of by a factor of 1000 * Temperature offset is completely wrong * Peak scale is completely wrong This patch fixes these issues. Also use the IIO_G_TO_M_S_2 macro for the acceleration scale since this makes it much easier to compare it to the value given in the datasheet. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Fix adis16220 channel offsets and scalesLars-Peter Clausen1-8/+11
Most of the channel offsets and scales in the adis16220 are incorrect: * Temperature scale is off by a factor of 1000 * Voltage scale is off by a factor of 1000 * Acceleration seems to have a typo "187042" since it should be instead of "1887042" * Temperature offset is completely wrong This patch fixes these issues. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Fix adis16209 channel offsets and scalesLars-Peter Clausen1-8/+10
Most of the channel offsets and scales in the adis16209 are incorrect: * Temperature scale is of by a factor of 1000 * Voltage scale is of by a factor of 1000 * Temperature offset is completely wrong * Rotational position scale is missing This patch fixes these issues. Also use the IIO_G_TO_M_S_2 macro for the acceleration scale since this makes it much easier to compare it with the value given in the datasheet. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Fix adis16204 channel offsets and scalesLars-Peter Clausen1-10/+12
Most of the channel offsets and scales in the adis16204 are incorrect: * Temperature scale is off by a factor of 1000 * Voltage scale is off by a factor of 1000 * Acceleration is scale is in g instead of m/(s**2) * Temperature offset is completely wrong This patch fixes these issues. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Don't compare boolean values with true/falseLars-Peter Clausen1-1/+1
Fixes the following coccicheck warnings: drivers/staging/iio/accel/lis3l02dq_ring.c:240:5-10: WARNING: Comparison to bool drivers/staging/iio/iio_dummy_evgen.c:111:6-25: WARNING: Comparison to bool Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging/iio/lis3l02dq: fix building without irq_to_gpioArnd Bergmann3-5/+8
The driver has not been building for some time after the irq_to_gpio function has been removed from the kernel. The only board in the upstream kernel that provides this device is the "Stargate 2", which is also maintained by Jonathan Cameron. Rather than working around the problem by adding new platform data for this driver, this patch uses the of_gpio framework to get to the gpio number. However, the stargate2 code does not (yet) use DT based probing, so it is still broken, but at least building allyesconfig works again. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Remove unused DRIVER_NAME definesLars-Peter Clausen5-10/+0
Some drivers define a DRIVER_NAME, but never use the define. This patch removes defines. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging iio: use iio_trigger_generic_data_rdy_poll() in ↵Peter Meerwald2-20/+2
accel/adis16209,adis16240 driver Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19drivers/staging/iio: Remove unnecessary semicolonPeter Senna Tschudin4-6/+6
A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r1@ statement S; position p,p1; @@ S@p1;@p @script:python r2@ p << r1.p; p1 << r1.p1; @@ if p[0].line != p1[0].line_end: cocci.include_match(False) @@ position r1.p; @@ -;@p // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Fix adis16203 channel offsets and scalesLars-Peter Clausen1-9/+11
Most of the channel offsets and scales in the adis16203 are incorrect: * Temperature scale is off by a factor of 1000 * Voltage scale is off by a factor of 1000 * Temperature offset is completely wrong This patch fixes these issues. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Fix adis16201 channel offsets and scalesLars-Peter Clausen1-11/+13
Most of the channel offsets and scales in the adis16201 are incorrect: * Temperature scale is off by a factor of 1000 * Voltage scale is off by a factor of 1000 * Acceleration scale is in g instead of m/(s**2) * Temperature offset is completely wrong This patch fixes these issues. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22staging:iio:sca3000: Do not return a error in remove functionLars-Peter Clausen1-4/+2
In the Linux device driver model the remove callback is not allowed to fail and the device will be removed regardless of the return value of the remove callback. So if we abort in the remove function and do not free all resources we will create a resource leak. Also all kinds of undefined behaviour are expected to happen since the IIO device is still there while its parent is already gone. The errors which the driver tries to handle in the remove function are non-critical, so we can just ignore them and continue to free all resources and remove the IIO device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22staging:iio:lis3l02dq: Do not return a error in remove functionLars-Peter Clausen1-10/+4
In the Linux device driver model the remove callback is not allowed to fail and the device will be removed regardless of the return value of the remove callback. So if we abort in the remove function and do not free all resources we will create a resource leak. Also all kinds of undefined behaviour are expected to happen since the IIO device is still there while its parent is already gone. The errors which the driver tries to handle in the remove function are non-critical, so we can just ignore them and continue to free all resources and remove the IIO device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-16Merge 3.6-rc6 into staging-nextGreg Kroah-Hartman1-1/+3
This pulls in the staging tree fixes in 3.6-rc6 into our branch to resolve the merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-08iio: Drop timestamp parameter from buffer store_to callbackLars-Peter Clausen6-6/+6
Drop timestamp parameter from buffer store_to callback and subsequently from iio_push_to_buffer. The timestamp parameter is unused and it seems likely that it will stay unused in the future, so it should be safe to remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-06staging:iio: Use iio_push_to_bufferLars-Peter Clausen6-14/+6
Consistently use iio_push_to_buffer instead of manually calling the buffers store_to callback. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-03staging:iio: Update email address for Jonathan Cameron.Jonathan Cameron6-9/+9
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-03staging iio: lis3l02dq cleanupPeter Meerwald3-22/+22
fixes some typos, whitespace, comments Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-27staging iio: fix potential memory leak in lis3l02dq_ring.cPeter Meerwald1-1/+3
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-27staging:iio: Add missing __devinit and __devexit annotationsLars-Peter Clausen8-8/+8
Autogenerated using the following coccinelle semantic patch: // <smpl> @r1@ identifier driver; identifier fn; position p; type T; @@ T driver = { .remove = ( fn@p | __devexit_p(fn@p) ) }; @r2@ identifier r1.fn; position p != r1.p; @@ fn@p @r3@ identifier r1.fn; position r1.p; @@ ( __devexit_p(fn@p) | -fn@p +__devexit_p(fn) ) @depends on !r2@ identifier r1.fn; @@ static -int fn +int __devexit fn (...) { ... } @r11@ identifier driver; identifier fn; position p; type T; @@ T driver = { .probe = fn@p }; @r12@ identifier r11.fn; position p != r11.p; @@ fn@p @depends on !r12@ identifier r11.fn; @@ static -int fn +int __devinit fn (...) { ... } // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-14staging:iio: Constify static iio_chan_spec arraysLars-Peter Clausen8-8/+8
The per driver iio_chan_spec arrays are usually shared between multiple device instances. So a single device instance may not modify the iio_chan_spec array since this would also affect the other device instances. To make this restriction explicit mark the per driver iio_chan_spec arrays as const. Conversion was done automatically using the following coccinelle semantic patch: // <smpl> @disable optional_qualifier@ identifier channels; @@ static +const struct iio_chan_spec channels[] = ...; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-14staging:iio:adis16220: Use kobj_to_dev instead of open-coding itLars-Peter Clausen1-6/+3
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-15iio staging: fix cast warning and cleanup alignment codePeter Meerwald1-2/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging:iio:accel:adis16xxx: Do not return error code in the interrupt handlerLars-Peter Clausen5-10/+15
The interrupt handler should only ever return one of the three irqreturn_t constants and not an error code. Also make sure to always call iio_trigger_notify_done before leaving the trigger handler. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging:iio:lis3l02dq: Do not return error code in interrupt handlerLars-Peter Clausen1-2/+3
The interrupt handler should only ever return one of the three irqreturn_t constants and not an error code. Also make sure to always call iio_trigger_notify_done before leaving the trigger handler. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>