summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/accel
Commit message (Collapse)AuthorAgeFilesLines
* staging: iio: Fix comment style warningCristina Moraru2015-10-021-2/+4
| | | | | | | | Move final */ to the next line, in accordance with the suggestion of checkpatch Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: Specify supported modes for buffersLars-Peter Clausen2015-06-011-0/+2
| | | | | | | | | | | | | | | For each buffer type specify the supported device modes for this buffer. This allows us for devices which support multiple different operating modes to pick the correct operating mode based on the modes supported by the attached buffers. It also prevents that buffers with conflicting modes are attached to a device at the same time or that a buffer with a non-supported mode is attached to a device (e.g. in-kernel callback buffer to a device only supporting hardware mode). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven2015-05-101-1/+1
| | | | | | | | | | | | | | | The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Jonathan Cameron <jic23@kernel.org> Cc: linux-iio@vger.kernel.org Cc: devel@driverdev.osuosl.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: accel: Remove explicit NULL comparisonCristina Opriceana2015-04-011-3/+3
| | | | | | | | | | | | | | | This patch removes explicit NULL comparison and writes it in its equivalent shorter form. Done with coccinelle. @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'iio-for-4.1b' of ↵Greg Kroah-Hartman2015-04-011-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of new devices, functionality and cleanup for IIO in the 4.1 cycle. New Functionality * Watermark logic for buffers. Allows for blocking reads to block until their requested amount is available - previously they only blocked until a single scan of data was available. Also allows for polling for a watermark amount of data to be available. This feature was first proposed some time ago to good responses, but not taken further by the original author Octavian has picked up the gauntlet and taken it through to merging (along with the hardware fifo support that follows). * New approach to hardware fifo handling - in particular handling the interaction of a hardware fifo feeding into a software fifo and their watershed events. We don't have every possible case well covered yet, but this is certainly a good, flexible starting point. This will replace the previous approach used in ancient drivers (sca3000) where we just exposed the hardware buffer directly to userspace. Very few pieces of hardware have sufficiently long buffers for that to be an adequate solution. * bmc150_accel - hardware fifo support. * mlx90614 - support dual IR sensor devices + some refactoring to clean up the code and allow some other functionality currently under review. * L3GD20H gyroscope support added to the st_gyro driver. * lis3lv02d accelerometer added to the st_gyro driver. Note this part is also supported by the older lis3 driver under misc. A lengthy discussion took place and concluded that holding parts out on the basis that whole driver would be subsumed into this one was counter productive. Better to add part support and add additional features as people need them. Basically there was not advantage in not merging the support. * max517 driver gains support for MAX520 and MAX521 DACs. Documentation * 3.20 -> 4.0 renaming for recent docs. Whilst technically a fix, I think people will cope until the next merge merge window. * An ABI typo hat -> What: More ABIs should have hats. * Document in_rot_offset, illuminance_raw and illuminance_scale. Cleanups * Fix a scale extraction bug in generic_buffer.c example. * Constify a load of device tree related structures.
| * iio: add watermark logic to iio read and pollJosselin Costanzi2015-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the IIO buffer blocking read only wait until at least one data element is available. This patch makes the reader sleep until enough data is collected before returning to userspace. This should limit the read() calls count when trying to get data in batches. Co-author: Yannick Bedhomme <yannick.bedhomme@mobile-devices.fr> Signed-off-by: Josselin Costanzi <josselin.costanzi@mobile-devices.fr> [rebased and remove buffer timeout] Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | Staging: iio: Add braces on all arms of if statementHaneen Mohammed2015-03-261-4/+6
| | | | | | | | | | | | | | | | The following patch adds braces on all arms of if statement. Issue addressed by checkpatch.pl. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: iio: add blank line after function declarationHaneen Mohammed2015-03-261-0/+2
| | | | | | | | | | | | | | | | This patch adds blank line after function declaration. Issue addressed by checkpatch.pl. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: iio: remove multible blank linesHaneen Mohammed2015-03-263-6/+0Star
| | | | | | | | | | | | | | | | This patch removes extra blank lines to address checkpatch.pl warnings regarding that. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: iio: Adjust alignment for function parametersHaneen Mohammed2015-03-268-44/+49
|/ | | | | | | | This patch adjust parameters alignment in functions to match open parenthesis. Issue addressed by checkpatch.pl. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: iio: use the BIT macro in .h filesHaneen Mohammed2015-03-236-78/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replace bit shifting on 1, 2, and 3 with the BIT(x) macro. Issue addressed by checkpatch.pl with --strict flag. This was done with the help of Coccninelle: @r1@ constant int g; @@ ( 0<<g | 1<<g | 2<<g | 3<<g ) @script:python b@ g2 <<r1.g; y; @@ coccinelle.y = int(g2) + 1 @c@ constant int r1.g; identifier b.y; @@ ( -(1 << g) +BIT(g) | -(0 << g) + 0 | -(2 << g) +BIT(y) | -(3 << g) +(BIT(y)| BIT(g)) ) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: iio: Remove parentheses around right side an assignmentHaneen Mohammed2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Parentheses are not needed around the right hand side of an assignment. This patch remove parenthese of such occurenses. Issue was detected and solved using the following coccinelle script: @rule1@ identifier x, y, z; expression E1, E2; @@ ( x = (y == z); | x = (E1 == E2); | x = -( ... -) ; ) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: iio: Use kcalloc instead of kzallocNavya Sri Nizamkari2015-03-151-1/+1
| | | | | | | | This patch uses kcalloc instead of kzalloc function. A coccinelle script was used to make this change. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: staging: iio: accel: Removed unnecessary variableTina Johnson2015-03-091-4/+2Star
| | | | | | | | | | | | | | | | | | | Variable len is used only to store the return value. Hence len is removed and the return statement modified. Coccinelle was used to detect such removable variables: @rule1@ identifier ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: iio: Change data type to u16 to avoid unnecessary typecastSomya Anand2015-03-091-4/+3Star
| | | | | | | | | | | | | | | | | In the adis16220_read16bit() function we earlier used a s16 value 'val' which is used by the adis_read_reg_16 function to read data and takes a u16 value as a parameter. So, this patch changes the data type of 'val' from s16 to u16. It is safe to remove the extra sign extension, since the user of the function uses it to read a 10 unsigned value which will lead to the same result in both cases. Further this patch removes the unnecessary typecast for the simplification of code. In addition to this, initialization of 'val' to 0 is also dropped. This is due to the fact that not initializing helps the compiler provide useful warnings if the code gets changed to return an otherwise uninitialized result. Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: iio: Added define guards where neededCristina Opriceana2015-03-061-1/+4
| | | | | | | | The following files were added define guards to prevent multiple inclusion. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: iio: accel: sca3000_core.c: Remove unused functionRickard Strandqvist2014-12-261-27/+0Star
| | | | | | | | | Remove the function sca3000_check_status() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: kfifo: Remove unused argument in iio_kfifo_allocateKarol Wrona2014-12-261-1/+1
| | | | | | | | | | indio_dev was unused in function body plus some small style fix - add new lines after "if(sth) return sth" and before the last return statement. The argument was removed also in its client. Signed-off-by: Karol Wrona <k.wrona@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: buffer: Drop get_length callbackLars-Peter Clausen2014-12-121-7/+1Star
| | | | | | | | | | | | | We already do have the length field in the struct iio_buffer which is expected to be in sync with the current size of the buffer. And currently all implementations of the get_length callback either return this field or a constant number. This patch removes the get_length callback and replaces all occurrences in the IIO core with directly accessing the length field of the buffer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: buffer: Allocate standard attributes in the coreLars-Peter Clausen2014-12-121-12/+2Star
| | | | | | | | | | All buffers want at least the length and the enable attribute. Move the creation of those attributes to the core instead of having to do this in each individual buffer implementation. This allows us to get rid of some boiler-plate code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Remove get_bytes_per_datum() from iio_buffer_access_funcsLars-Peter Clausen2014-12-121-7/+0Star
| | | | | | | | | | | There haven't been any users of the get_bytes_per_datum() callback for a while. The core assumes that the number of bytes per datum can be calculated based on the enabled channels and the storage size of the channel and iio_compute_scan_bytes() is used to compute this number. So remove the callback. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Move buffer registration to the coreLars-Peter Clausen2014-12-122-21/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | Originally device and buffer registration were kept as separate operations in IIO to allow to register two distinct sets of channels for buffered and non-buffered operations. This has since already been further restricted and the channel set registered for the buffer needs to be a subset of the channel set registered for the device. Additionally the possibility to not have a raw (or processed) attribute for a channel which was registered for the device was added a while ago. This means it is possible to not register any device level attributes for a channel even if it is registered for the device. Also if a channel's scan_index is set to -1 and the channel is registered for the buffer it is ignored. So in summary it means it is possible to register the same channel array for both the device and the buffer yet still end up with distinctive sets of channels for both of them. This makes the argument for having to have to manually register the channels for both the device and the buffer invalid. Considering that the vast majority of all drivers want to register the same set of channels for both the buffer and the device it makes sense to move the buffer registration into the core to avoid some boiler-plate code in the device driver setup path. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:sca3000: Register same channels for device and bufferLars-Peter Clausen2014-12-121-3/+4
| | | | | | | | | | In preparation for moving the buffer registration to the core make sure to register the same channel array for the device and the buffer. Currently the temperature channel is not registered for the buffer, setting its scan index to -1 will make sure that it is skipped for the buffer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:sca3000: Don't enable channels by defaultLars-Peter Clausen2014-12-121-5/+0Star
| | | | | | | | The convention for IIO devices is that all channels are disabled by default. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Merge tag 'iio-for-3.19a' of ↵Greg Kroah-Hartman2014-11-051-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First round of new drivers, features and cleanups for IIO in the 3.19 cycle. New drivers / supported parts * rockchip - rk3066-tsadc variant * si7020 humidity and temperature sensor * mcp320x - add mcp3001, mcp3002, mcp3004, mcp3008, mcp3201, mcp3202 * bmp280 pressure and temperature sensor * Qualcomm SPMI PMIC current ADC driver * Exynos_adc - support exynos7 New features * vf610-adc - add temperature sensor support * Documentation of current attributes, scaled pressure, offset and scaled humidity, RGBC intensity gain factor and scale applied to differential voltage channels. * Bring iio_event_monitor up to date with newer modifiers. * Add of_xlate function to allow for complex channel mappings from the device tree. * Add -g parameter to generic_buffer example to allow for devices with directly fed (no trigger) buffers. * Move exynos driver over to syscon for PMU register access. Cleanups, fixes for new drivers * lis3l02dq drop an unneeded else. * st sensors - renam st_sensors to st_sensor_settings (for clarity) * st sensors - drop an unused parameter from all the probe utility functions. * vf610 better error handling and tidy up. * si7020 - cleanups following merge * as3935 - drop some unnecessary semicolons. * bmp280 - fix the pressure calculation.
| * staging: iio: accel: remove unnecessary syntaxChris Ruffin2014-09-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | The else clause in the conditional of lis3l02dq_data_rdy_trig_poll() does not make consistent use of braces with the rest of the conditional. Fix this coding style problem by removing the unnecessary conditional altogether. Signed-off-by: Chris Ruffin <cmruffin@gmail.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | staging: iio: accel: Update Kconfig description with module name informationTapasweni Pathak2014-10-201-8/+31
| | | | | | | | | | | | | | | | This patch fixes checkpatch.pl warning. WARNING: please write a paragraph that describes the config symbol fully Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: iio: accel: Removed unnecessary else expression.Gulsah Kose2014-10-021-8/+7Star
| | | | | | | | | | | | | | | | This patch fixes "else is not generally useful after a break or return" checkpatch.pl warning in adis16220_core.c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: iio: accel: Use __be16 instead of u16Aybuke Ozdemir2014-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | This patch fixes these warning messages found by sparse: drivers/staging/iio/accel/sca3000_ring.c:120:61: warning: incorrect type in argument 1 (different base types) drivers/staging/iio/accel/sca3000_ring.c:120:61: expected restricted __be16 const [usertype] *p drivers/staging/iio/accel/sca3000_ring.c:120:61: got unsigned short [usertype] * Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: iio: accel: remove else after returnTapasweni Pathak2014-09-222-4/+3Star
| | | | | | | | | | | | | | | | This patch fixes checkpatch.pl warning in files of iio: accel WARNING : else is not generally useful after a break or return Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: iio: accel: Replace msleep with usleep for given rangeDarshana Padmadas2014-09-221-1/+1
|/ | | | | | | | | | | This patch fixes checkpatch.pl warning: WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt As per Documentation/timers/timers-howto.txt usleep_range should be used for sleeping for 10us-20ms Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: iio: accel: Add blank lines between declarations and codeMurilo Opsfelder Araujo2014-08-078-2/+14
| | | | | | | | This patch adds missing blank lines between declarations and code and fixes lines starting by spaces, satisfying checkpatch.pl. Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: accel: sca3000_core.c: Adjust code to fit 80-chars limitMurilo Opsfelder Araujo2014-08-071-1/+2
| | | | | Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adis: Switch sampling frequency attr to core support.Jonathan Cameron2014-07-075-32/+35
| | | | | | | | | | | | | | | By using the info_mask_shared_by_all element of the channel spec, acce to the sampling frequency becomes available to in kernel users of the driver. It also shortens and simplifies the code. This particular conversion was made more complicated by the shared library and the fact that a number of the drivers do not actually have support for setting or reading the sampling frequency. The hardware, in those cases investigated supports it. It's just never been implemented. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
* iio: staging: sca3000: hide stufftoread logicJosselin Costanzi2014-06-291-0/+6
| | | | | | | | Change sca3000_ring implementation so that it exports a data_available function to iio. Signed-off-by: Josselin Costanzi <josselin.costanzi@mobile-devices.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Remove timestamp argument from iio_trigger_poll() and ↵Peter Meerwald2014-06-141-1/+1
| | | | | | | | | iio_trigger_poll_chained() argument has been ignored; adjust drivers accordingly Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio/accel: Fix Prefer netdev_warn(netdev, ...then dev_warn(dev, ... ↵Monam Agarwal2014-03-071-1/+1
| | | | | | | | | | then pr_warn(... to printk(KERN_INFO ... in sca3000_ring.c This patch fixes the following checkpatch.pl warning in sca3000_ring.c WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:iio:accel:sca3000: Cleanup sca3000.hPeter Meerwald2014-01-181-10/+16
| | | | | | | kerneldoc and comment formating, typos Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:accel:sca3000: Move temperature attribute to channelsPeter Meerwald2014-01-181-77/+48Star
| | | | | | | differantiate between channels with_temp and without Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:accel:sca3000: Channels missing in temp_output casePeter Meerwald2014-01-181-4/+3Star
| | | | | | | | issues introduced here 25888dc5, staging:iio:sca3000 extract old event handling and move to poll for events Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:accel:sca3000: Event_attribute_group seems to be missing for ↵Peter Meerwald2014-01-181-0/+1
| | | | | | | | | | _info_with_temp issue introduced here 6fe8135f: staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:accel:sca3000: Fix format of commentsPeter Meerwald2014-01-181-23/+29
| | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:accel:sca3000: Fix kerneldocPeter Meerwald2014-01-181-5/+4Star
| | | | | | | match function names with kerneldoc Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Remove support for the legacy event config interfaceLars-Peter Clausen2013-12-082-12/+12
| | | | | | | | | | Now that all drivers have been converted to the new event config interface we can remove for the legacy event config interface. Also drop the '_new' suffix for the event config interface callbacks, since those are the only callbacks now. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: adis16220: Use devm_iio_device_registerSachin Kamat2013-11-241-5/+2Star
| | | | | | | devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: fix printk(KERN_ERR .. in lis3l02dq_core.cEbru Akagunduz2013-10-271-1/+1
| | | | | | | | | | Fix checkpatch.pl issues with prefer netdev_err(netdev, .. then dev_err(dev, .. then pr_err(.. to printk(KERN_ERR in lis3l02dq_core.c Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'iio-for-3.12d' of ↵Greg Kroah-Hartman2013-10-194-49/+89
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Fourth round of IIO new drivers, functionality and cleanups for the 3.13 cycle. New Drivers * cm36651 combined RGB light and proximity sensor. Core improvements * Some more fixes and cleanups related to buffers. These include the second half of a series which went is as fixes. The basis for delaying until the next merge window is that some are too invasive for this late in a cycle and others only effect code paths current unused in the mainline tree. In this case we have: * protecting against concurrent userspace access * fixing a memory leak if a device goes away * avoiding always reallocating the buffer whether or not it has changed (a bug fix, but one with no functional changes other than a small speed improvement.) * Add reference counting for buffers to ensure they hang around if open from userspace or in kernel when the device is forcefully removed. * Return -ENODEV for buffer access operations when the device has gone away. * Add proper locking for iio_update_buffers (currently we only have one buffer per device in mainline, but an input bridge driver is under development which would make this bug 'real'.) * Wake up anyone waiting on a buffer if the device is unregistered. A subsequent read will fail, notifying userspace that the device is no longer there rather than having it wait possibly for ever. * Move the iio_sw_preenable functionality into the core. This avoids drivers having to 'know' about how the buffers are implemented and is called by almost all drivers anyway. Those that don't call it are not harmed by it being called. * New registration approach for information (i.e. sysfs attributes) about events. Much more generic and now similar to how the equivalent is handled for channel information. The events infrastructure had been left behind by other changes so this brings it back in line. * Using the new events registration approach, add a hysterisis event_info element and apply this to those drivers with this property. * A little unitialized variable bug in the generic_buffer.c example. * Factor out the code for freeing lists of IIO Device attributes to avoid some repitition. Driver cleanups * At91 driver gains touch screen support and some related fixes. * Follow up series of patches removing the now redundant iio_sw_buffer_preenable calls. * Lots of conversions to the new event registration methods. * Another round of hmc5843 cleanups as that driver moves towards graduating from staging. * Make some SoC drivers buildable if COMPILE_TEST is used. Follow up fixes for a few bits and bobs that revealed. * Add explicit includes of linux/of.h to those drivers making us of linux/of.h
| * staging:iio:lis3l02dq: Remove redundant call to iio_sw_buffer_preenable().Lars-Peter Clausen2013-10-161-1/+0Star
| | | | | | | | | | | | | | | | The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core, so there is no need to do this from the driver anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging:iio:sca3000: Switch to new config interfaceLars-Peter Clausen2013-10-121-22/+36
| | | | | | | | | | | | | | | | Switch the sca3000 driver to the new IIO event config interface as the old one is going to be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging:iio:lis2l02dq: Share threshold value between axisLars-Peter Clausen2013-10-121-4/+4
| | | | | | | | | | | | | | | | The threshold event can be enabled/disabled separately, but the threshold value is shared between all three axis. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>