summaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'iio-for-4.3b-2' of ↵Greg Kroah-Hartman2015-08-1211-236/+288
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of new device support, features and cleanup for the 4.3 cycle. Take 2 also includes a fix set that was too late for the 4.2 cycle. As we had a lot of tools and docs work in this set, I have broken those out into their own categories in this description. Fixes from the pull request '4th set of IIO fixes for the 4.2 cycle'. * Poll functions for both event chardev and the buffer one were returning negative error codes (via a positive value). * A recent change to lsiio adding some error handling that was wrong and stopped the tool working. * bmg160 was missing some dependencies in Kconfig * berlin2-adc had a misshandled register (wrote a value rather than a bitmap) New device support * TI opt3001 light sensor * TXC PA12 ALS and proximity sensor. * mcp3301 ADC support (in mcp320x driver) * ST lsm303agr accelerometer and magnetometer drivers (plus some st-sensors common support to allow different WHOAMI register addresses, devices with fixed scale and allow interrupt equiped magnetometers). * ADIS16305, ADIS16367, ADIS16445IMUs (in the adis16400 driver) * ADIS16266 gyro (in the adis16260 driver) * ADIS16137 gyro (in the adis16136 driver) New functionality * mmc35240 DT bindings. * Inverse unit conversion macros to aid handing of values written to sysfs attributes. Core cleanup * Forward declaration of struct iio_trigger to avoid a compile warning. Driver cleanup / fixes * mxs-lradc - Clarify which parts are supported. - Fix spelling erorrs. - Missing/extra includes - reorder includes - add datasheet name listings for all usable channels (to allow them to be bound by name from consumer drivers) * acpi-als - add some function prefixes as per general iio style. * bmc150_magn - replace a magic value with the existing define. * vf610 - determine possible sample frequencies taking into account the electrical characteristics (defining a minimum sample time) * dht11 - whitespace - additional docs - avoid mulitple assignments in one line - Use the new funciton ktime_get_resolution_ns to cleanup a nasty trick previously used for timing. * Fix all drivers that consider 0 a valid IRQ for historical reasons. * Export I2C module alias info where previously missing (to allow autoprobing) * Export OF module alias info where previously missing. * mmc35240 - switch some variables into arrays to improve readability. * mlx90614 - define some magic numbers for readability. * bmc150_magn - expand area locked by a mutex to cover all the use of the data->buffer. - use descriptive naming for a mask instead of a magic value. * berin2-adc - pass up an error code rather that a generic error - constify the iio_chan_spec - some other little tidy ups. * stk8312 - fix a dependency on triggered buffers in kconfig - add a check for invalid attribute values - improve error handling by returning error codes where possible and return immediately where relevant - rework macro defs to use GENMASK etc - change some variable types to reduce unnecessary casting - clean up code style - drop a local buffer copy for bulk reads and use the one in data->buffer instead. * adis16400 - the adis16448 gyroscope scale was wrong. * adis16480 - some more wrong scales for various parts. * adis16300 - has an undocumented product id and serial number registers so use them. * iio_simple_dummy - fix some wrong code indentation. * bmc150-accel - use the chip ID to detect the chip present rather than verifying the expected part was there. This was in response to a wrong ACPI entry on the WinBook TW100. * mma8452 - fix _get_hp_filter_index - drop a double include - pass up an error code rather than rewriting it - range check input values to attribute writes - register defs tidy up using GENMASK and reordering them to be easier to follow. - various coding style cleanups - put the Kconfig entry in the write place (alphabetically). Tools related * Tools cleanup - drop an explicity NULL comparison, some unnecessary braces, use the ARRAY_SIZE macro, send error messages to stderr instead of dropping them in the middle of normal output. * Fix tools to allow that scale and offset attributes are optional. * More tools fixes including allowing true 32bit data (previously an overflow prevented more than 31bits) * Drop a stray header guard that ended up in a c file. * Make calc_digits static as it isn't exported or in the header. * Set ci_array pointer to NULL after free as a protection against non safe usage of the tools core code. Also convert a double pointer to a single one as the extra level of indirection was unnecessary. Docs * DocBook introduction by Daniel Baluta. Glad we are beginning to draw together some more introductory docs to suplement the various tools / examples. * Drop bytes_per_datum sysfs attribute docs as it no longer exists. * A whole load of missing / fixing of kernel-doc for the core of IIO. * Document the trigger name sysfs attribute in the ABI docs. * Minor typos in the ABI docs related to power down modes.
| * iio:accel:mma8452: reorder Kconfig entryHartmut Knaack2015-08-081-12/+12
| | | | | | | | | | | | | | Move the entry in Kconfig to its alphabetically correct position. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:mma8452: coding style cleanupHartmut Knaack2015-08-081-38/+68
| | | | | | | | | | | | | | | | | | | | Some coding style cleanups, mainly indicated by checkpatch.pl, which includes indentation changes, drop spaces after casts and befor tabs. Also insert empty lines after logical blocks and before unconditional returns. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:mma8452: rework register definitionsHartmut Knaack2015-08-081-48/+45Star
| | | | | | | | | | | | | | | | | | Rework register definitions to be sorted by register and bit number, with bit definitions cascaded under the appropriate register, use GENMASK for consecutive bitmasks and realign properly. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:mma8452: check values to be writtenHartmut Knaack2015-08-081-3/+5
| | | | | | | | | | | | | | Check values to be written to the device for valid lower and upper bounds. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:mma8452: pass up real error codeHartmut Knaack2015-08-081-3/+3
| | | | | | | | | | | | | | Pass up the error code provided by functions. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:mma8452: drop double includeHartmut Knaack2015-08-081-1/+0Star
| | | | | | | | | | | | | | | | One inclusion of linux/iio/trigger_consumer.h is sufficient. Fixes: ae6d9ce05691b ("iio: mma8452: Add support for interrupt driven triggers.") Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:mma8452: fix _get_hp_filter_indexHartmut Knaack2015-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | To iterate through the available frequencies of mma8452_hp_filter_cutoff[], the array size of a row of that table needs to be provided to _get_int_plus_micros_index(). Fixes: 1e79841a00e46 ("iio: mma8452: Add highpass filter configuration.") Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:bmc150-accel: Use the chip ID to detect sensor variantBastien Nocera2015-08-081-27/+19Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using the I2C or ACPI ID to determine which variant of the chipset to use, determine that from the chip ID. Under Windows, the same driver is used for those variants and, despite incorrect ACPI data, it is able to load and operate the accelerometer. Fixes the accelerometer failing with: bmc150_accel i2c-BMA250E:00: Invalid chip f8 on the WinBook TW100 Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:bmc150-accel: Move bmc150_accel_chip_init()Bastien Nocera2015-08-081-57/+57
| | | | | | | | | | | | | | | | Move bmc150_accel_chip_init() so that we can use bmc150_accel_chip_info_tbl[] in it. Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:stk8312: drop local bufferHartmut Knaack2015-08-081-5/+1Star
| | | | | | | | | | | | | | | | | | Drop the local buffer in stk8312_trigger_handler() and use data->buffer instead for bulk reads. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:stk8312: code style cleanupHartmut Knaack2015-08-081-3/+2Star
| | | | | | | | | | | | | | Adjust some indentation issues to make checkpatch.pl happy in strict mode. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:stk8312: use appropriate variable typesHartmut Knaack2015-08-081-4/+4
| | | | | | | | | | | | | | | | Adapt some variable types to reduce unnecessary casting. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:stk8312: rework macro definitionsHartmut Knaack2015-08-081-12/+13
| | | | | | | | | | | | | | | | | | | | Make use of BIT to describe register bits, GENMASK for consecutive bitmasks, rename and sort existing definitions, replace magic value with an expressive definition, drop an unused definition. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:stk8312: improve error handlingHartmut Knaack2015-08-081-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve error handling in the following ways: - set return value on error condition to an appropriate error code - return error code immediately in case of an error (slightly changes code structure) - pass up real error code - add missing error handling - return 0 when error have been caught already - put device back in active mode after error occurs Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:stk8312: check for invalid valueHartmut Knaack2015-08-021-0/+2
| | | | | | | | | | | | | | | | | | Revision 1.2 of the datasheet recommends on page 22 to only write non-zero values read from OTP register 0x70 into AFECTRL register. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:accel:stk8312: add triggered buffer dependencyHartmut Knaack2015-08-021-0/+2
| | | | | | | | | | | | | | | | | | | | Add the still missing dependencies for triggered buffer support. Fixes: 95c12bba51c37 ("iio: accel: Add buffer mode for Sensortek STK8312") Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Export OF module alias information in missing driversJavier Martinez Canillas2015-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So technically there's no need for a driver to export the OF table since currently it's not used. In fact, the I2C device ID table is mandatory for I2C drivers since a i2c_device_id is passed to the driver's probe function even if the I2C core used the OF table to match the driver. And since the I2C core uses different tables, OF-only drivers needs to have duplicated data that has to be kept in sync and also the dev node compatible manufacturer prefix is stripped when reporting the MODALIAS. To avoid the above, the I2C core behavior may be changed in the future to not require an I2C device table for OF-only drivers and report the OF module alias. So, it's better to also export the OF table to prevent breaking module autoloading if that happens. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Export I2C module alias information in missing driversJavier Martinez Canillas2015-08-022-0/+2
| | | | | | | | | | | | | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So the driver needs to export the I2C table and this be built into the module or udev won't have the necessary information to auto load the correct module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: st-accel: add support for lsm303agr accelerometerGiuseppe Barba2015-07-234-0/+8
| | | | | | | | | | | | | | | | This adds support for the lsm303agr accelerometer. Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: st-sensors: add configuration for WhoAmI addressGiuseppe Barba2015-07-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | This patch permits to configure the WhoAmI register address because some device could have not a standard address for this register. Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Reviewed-by: Denis Ciocca <denis.ciocca@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: fix drivers that consider 0 as a valid IRQ in client->irqOctavian Purdila2015-07-233-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since patch "i2c / ACPI: Use 0 to indicate that device does not have interrupt assigned" [1], 0 is not a valid i2c client irq anymore, so change all driver's checks accordingly. The same issue occurs when the device is instantiated via device tree with no IRQ, or from the i2c sysfs interface, even before the patch above. [1] http://lkml.kernel.org/g/<1430908148-201129-3-git-send-email-mika.westerberg@linux.intel.com> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | Merge 4.2-rc4 into staging-nextGreg Kroah-Hartman2015-07-271-4/+4
|\ \ | | | | | | | | | | | | | | | We want the iio and other fixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | iio: mma8452: use iio event type IIO_EV_TYPE_MAGMartin Kepplinger2015-07-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IIO_EV_TYPE_THRESH in rising direction describes an event where the threshold is crossed in rising direction, positive or negative values being possible. This is not the case here. Since the threshold is no signed value and only the magnitude is compared, IIO_EV_TYPE_MAG is what describes the behaviour of these devices, see the sysfs-bus-iio ABI Documentation. Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | iio:accel:bmc150-accel: fix counting directionHartmut Knaack2015-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In bmc150_accel_unregister_triggers() triggers should be unregistered in reverse order of registration. Trigger registration starts with number 0, counting up. In consequence, trigger number needs to be count down here. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Octavian Purdila <octavian.purdila@intel.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | Merge 4.2-rc3 into staging-nextGreg Kroah-Hartman2015-07-201-1/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Merge tag 'iio-fixes-for-4.2a' of ↵Greg Kroah-Hartman2015-07-131-1/+1
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First set of IIO fixes for the 4.2 cycle. * Fix a regression in hid sensors suspend time as a result of adding runtime pm. The normal flow of waking up devices in order to go into suspend (given the devices are normally suspended when not reading) to a regression in suspend time on some laptops (reports of an additional 8 seconds). Fix this by checking to see if a user action resulting in the wake up, and make it a null operation if it didn't. Note that for hid sensors, there is nothing useful to be done when moving into a full suspend from a runtime suspend so they might as well be left alone. * rochip_saradc: fix some missing MODULE_* data including the licence so that the driver does not taint the kernel incorrectly and can build as a module. * twl4030 - mark irq as oneshot as it always should have been. * inv-mpu - write formats for attributes not specified, leading to miss interpretation of the gyro scale channel when written. * Proximity ABI clarification. This had snuck through as a mess. Some drivers thought proximity went in one direction, some the other. We went with the most common option, documented it and fixed up the drivers going the other way. Fix for sx9500 included in this set. * ad624r - fix a wrong shift in the output data. * at91_adc - remove a false limit on the value of the STARTUP register applied by too small a type for the device tree parameter. * cm3323 - clear the bits when setting the integration time (otherwise we can only ever set more bits in the relevant field). * bmc150-accel - multiple triggers are registered, but on error were not being unwound in the opposite order leading to removal of triggers that had not yet successfully been registered (count down instead of up when unwinding). * tcs3414 - ensure right part of val / val2 pair read so that the integration time is not always 0. * cc10001_adc - bug in kconfig dependency. Use of OR when AND was intended.
| | * iio:accel:bmc150-accel: fix counting directionHartmut Knaack2015-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In bmc150_accel_unregister_triggers() triggers should be unregistered in reverse order of registration. Trigger registration starts with number 0, counting up. In consequence, trigger number needs to be count down here. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Octavian Purdila <octavian.purdila@intel.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-112-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: kxcjk-1013: Remove blank linesAna Calinov2015-07-111-3/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the the following errors given by checkpatch.pl with --strict: Please don't use multiple blank lines. Blank lines aren't necessary after an open brace '{'. Signed-off-by: Ana Calinov <ana.calinov@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: Add sampling rate support for STK8312Tiberiu Breana2015-07-051-14/+82
| | | | | | | | | | | | | | | | | | | | | | | | Added support for setting the STK8312 accelerometer's sampling rate. Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: Add buffer mode for Sensortek STK8312Tiberiu Breana2015-07-051-35/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added triggered buffer mode support for the STK8312 accelerometer. Additional changes: - set_mode now sets operation mode directly, no longer masking the register's previous value - read_accel now returns raw acceleration data instead of the sign_extend32 value - read_raw will now enable/disable the sensor with each reading Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: Add trigger support for STK8BA50Tiberiu Breana2015-07-051-25/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add data-ready interrupts and trigger support for STK8BA50. Additional changes: - read_accel now returns raw acceleration data instead of the sign_extend32 value - read_raw will now enable/disable the sensor with each reading Change-Id: I9c2d7be4256b2dcc5546e4432308ea54f8004333 Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio:accel:bmc150-accel: code style cleanupHartmut Knaack2015-06-211-42/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the following coding style changes as indicated by checkpatch.pl in strict mode: - Please don't use multiple blank lines - braces {} should be used on all arms of this statement (if/else) - Alignment should match open parenthesis - Please don't use multiple blank lines - Blank lines aren't necessary after an open brace '{' - Missing a blank line after declarations - No space is necessary after a cast Also wrap/consolidate error messages to fit 80 characters per line and rework a comment. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio:accel:bmc150-accel: make use of mask definitionHartmut Knaack2015-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BMC150_ACCEL_SLOPE_THRES_MASK was defined some time ago, but its 'magic' value got used instead in bmc150_accel_write_event(). Make use of it for improved readability. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: STK8BA50: suspend sensor on init errorsTiberiu Breana2015-06-211-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Put chip in 'suspend' mode in case something goes wrong during probe. Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: mma9553: document use of mutexIrina Tirdea2015-06-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix checkpatch.pl --strict check: CHECK: struct mutex definition without comment + struct mutex mutex; Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: mma9553: fix alignment issuesIrina Tirdea2015-06-143-47/+43Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix code alignment and wrap parameters. Fix issues reported by checkpatch.pl --strict. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Suggested-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: mma9551_core: use size in words for word buffersIrina Tirdea2015-06-142-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the prototype for the mma9551_read/write_*_words functions to receive the length of the buffer in words (instead of bytes) since we are using a word buffer. This will prevent users from sending an odd number of bytes for a word array. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: Add sampling rate support for STK8BA50Tiberiu Breana2015-06-141-7/+50
| | | | | | | | | | | | | | | | | | | | | | | | Added support for setting the STK8BA50 accelerometer's sampling rate. Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | iio: accel: STK8BA50: replace scale table with a structTiberiu Breana2015-06-141-4/+7
|/ / | | | | | | | | | | | | | | Replaced the stk8ba50_scale_table with an identically named struct in order to make the code a bit more readable. Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | Merge tag 'iio-for-v4.2c' of ↵Greg Kroah-Hartman2015-06-114-7/+579
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Third round of new IIO drivers, cleanups and functionality for the 4.2 cycle. Given Linus announced a 4.8rc coming up, hopefully time for one more lot of IIO patches this cycle. Some of these are actually improvements / fixes for patches earlier in the cycle. New device support * st_accel driver - support devices with 8 bit channels. Cleanup * A general cleanup of the iio tools under /tools/ from Hartmut. I'm more than a little embarassed by how bad some of these were! Are well, much more refined and less bug prone now. These cover lots of stuff like unhandled error returns, memory leaks as well as general refactoring to tidy the code up. * iio_simple_dummy - fix memory leaks in the init functions, drop some pointless error returns from functions that never generate errors and make the module parameter explicitly unsigned. * More buffer handling reworks from Lars-Peter, this time targetting hardware buffers (a little used corner that looks likely to get more use in the near future). Specifically: - Always compute the masklength as inkernel buffer users may need it. - Add a means of labeling which buffer modes a given buffer implementation supports. - In the case of hardware buffers, require strict scan matching rather than matching to a superset. Currently the demux is bypassed by these drivers (this may well not change for efficiency reasons) so allowing a superset of channels to be selected would otherwise lead to more data than requested confusing userspace. Driver funcationality improvments * mmc35240 - adds a compensation to the raw values as borrowed form Memsic's own input driver. * mma8452 - event support - event debouncing - high pass filter configuration - triggers * vf610 - allow conversion mode to be adjusted Fixlets * mmc35240 - Off by one error that by coincidence had no real effect. - i2c_device_name should be lowercase. - Lack of null terminator at end of attributes array. - Avoid computing the fractional part of the magnetic field by moving the scaling into userspace where floating point is available to simplify the maths. - Use a smaller sleep before assuming the measurement is done. This is safe and improves the possible polling rate. - Fix sensitivity on z-axis - datasheet disagrees with Memsic's releasedd code and the value used in the code seems to be correct. * stk3310 - make a local variable signed to ensure error handling works. * twl4030 - fix calculation of the temperature sense current - bug unlikely to have ever been noticed as the difference is small. - Fix errors in descriptions.
| * | iio: st_accel: support the LIS331DL sensorLinus Walleij2015-06-083-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the LIS331DL sensor version. This is a simple 8bit-only accelerometer. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | iio: st_accel: support 8bit channel dataLinus Walleij2015-06-071-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some sensors like the LIS331DL only support 8bit data by a single register per axis. These utilize the MSB byte. Make it possible to register these apropriately. A oneliner change is needed in the ST sensors core to handle 8bit reads as this is the first supported 8bit sensor. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | iio: mma8452: Add support for interrupt driven triggers.Martin Fuzzey2015-06-071-6/+91
| | | | | | | | | | | | | | | | | | | | | | | | Implement interrupt driven trigger for data ready. This allows more efficient access to the sample data. Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | iio: mma8452: Add highpass filter configuration.Martin Fuzzey2015-06-071-4/+136
| | | | | | | | | | | | | | | | | | | | | Allow the cutoff frequency of the high pass filter to be configured. Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | iio: mma8452: Add support for transient event debouncingMartin Fuzzey2015-06-071-11/+65
| | | | | | | | | | | | | | | | | | | | | | | | Allow the debouce counter for transient events to be configured using the sysfs attribute events/in_accel_thresh_rising_period Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | iio: mma8452: Basic support for transient events.Martin Fuzzey2015-06-071-1/+211
| | | | | | | | | | | | | | | | | | | | | | | | The event is triggered when the highpass filtered absolute acceleration exceeds the threshold. Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | Merge tag 'iio-for-v4.2b' of ↵Greg Kroah-Hartman2015-05-247-32/+816
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of new driver, functionality and cleanups for IIO in the 4.2 cycle. Core functionality * i and q modifiers from quadrature channels. * IIO_CHAN_INFO_OVERSAMPLING_RATIO added. * High pass filter attributes added to mirror the existing low pass filter ones. Core cleanups * Make IIO tools building more cross compiler friendly. * Substantial rework of the function __iio_update_buffers to greatly simplify a hideously evolved function. New drivers and support * ACPI0008 ambient light sensor driver. This one has been around a long time to will be good to finally get it into mainline. * Berlin SOC ADC support. * BMC150 magnetometer. The accelerometer in the same package has been supported for quite some time, so good to have this half as well. * m62332 DAC driver * MEMSIC MMC35420 magnetometer. * ROHM BH1710 and similar ambient light sensors. * Sensortek STK3310 light sensor. * Sensortek STK8312 accelerometer. * Sensortek STK8BA50 accelerometer. * ti-adc128s052 gains support form the adc122s021 2 channel ADC. Driver cleanups and functionality. * Allow various drivers to compile with !GPIOLIB if COMPILE_TEST enabled. * bmc150 - decouple trigger from buffer to allow other triggers to be used. * bmg160 - decouple trigger from buffer to allow other triggers to be used. Fix a trivial unused field. * Constify a load of platform_device_id structures. * inv_mpu6050 - device tree bindings. * hid-sensors - fix a memory leak during probe if certain errors occur. * ltr501 - illuminance channel derived (in an non obvious fashion) from the intensity channels. * ltr501 - fix a boundary check on the proximity threshold. * mlx90614 - drop a pointless return. * mma8452 - Debugfs register access and fix a bug that had no effect (by coincidence) * ti_am335x_adc - add device tree bindings for sample-delay, open-delay and averaging. The ideal settings for these tend to be board design specific.
| * | iio: accel: Add support for Sensortek STK8BA50Tiberiu Breana2015-05-233-0/+313
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minimal implementation of an IIO driver for the Sensortek STK8BA50 3-axis accelerometer. Datasheet: http://szgsensor.com/uploads/soft/141229/STK8BA50%D2%E5%BC%CE.pdf Includes: - ACPI support; - read_raw for x,y,z axes; - reading and setting the scale (range) parameter. - power management Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>