aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel/stk8312.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330Thomas Gleixner1-4/+1
Based on 1 normalized pattern(s): this file is subject to the terms and conditions of version 2 of the gnu general public license see the file copying in the main directory of this archive for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 55 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000436.108941081@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22iio:accel: drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron1-2/+0
The equivalent of both of these are now done via macro magic when the relevant register calls are made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-04-03iio: remove unused gpio consumer.h includeIrina Tirdea1-1/+0
GPIO handling code has been removed from the drivers (since this is now handled by the ACPI core) in commit 0f0796509c07 ("iio: remove gpio interrupt probing from drivers that use a single interrupt"). Remove the include for linux/gpio/consumer.h since it is no longer used. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-03iio: remove gpio interrupt probing from drivers that use a single interruptOctavian Purdila1-28/+0
Commit 845c877009cf014b ("i2c / ACPI: Assign IRQ for devices that have GpioInt automatically") automatically assigns the first ACPI GPIO interrupt in client->irq, so we can remove the probing code from drivers that use only one interrupt. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-03iio: fix drivers that use 0 as a valid IRQ in client->irq (part 2)Octavian Purdila1-1/+1
Since commit dab472eb931bc291 ("i2c / ACPI: Use 0 to indicate that device does not have interrupt assigned") 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. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-08-08iio:accel:stk8312: drop local bufferHartmut Knaack1-5/+1
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>
2015-08-08iio:accel:stk8312: code style cleanupHartmut Knaack1-3/+2
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>
2015-08-08iio:accel:stk8312: use appropriate variable typesHartmut Knaack1-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>
2015-08-08iio:accel:stk8312: rework macro definitionsHartmut Knaack1-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>
2015-08-08iio:accel:stk8312: improve error handlingHartmut Knaack1-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>
2015-08-02iio:accel:stk8312: check for invalid valueHartmut Knaack1-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>
2015-08-02iio: Export I2C module alias information in missing driversJavier Martinez Canillas1-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 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>
2015-07-05iio: accel: Add sampling rate support for STK8312Tiberiu Breana1-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>
2015-07-05iio: accel: Add buffer mode for Sensortek STK8312Tiberiu Breana1-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>
2015-05-17iio: accel: Add support for Sensortek STK8312Tiberiu Breana1-0/+390
Minimal implementation of an IIO driver for the Sensortek STK8312 3-axis accelerometer. Datasheet: http://www.syi-group.com/uploadpic/data/201361817562681623.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>