aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/kmx61.c
Commit message (Collapse)AuthorAge
* Merge 4.0-rc7 into staging-nextGreg Kroah-Hartman2015-04-07
|\ | | | | | | | | | | | | We want those fixes (iio primarily) into the -next branch to help with merge and testing issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * iio: fix drivers that check buffer->scan_maskOctavian Purdila2015-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the in-kernel push interface is used we may have a different masks on the device buffer and the kernel buffer and in this case the device should generate data for the reunion of the buffers, which is available at indio_dev->active_scan_mask. Compiled tested only except for bmc150-accel which was tested at runtime with the hardware. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: improve usage of gpiod APIUwe Kleine-König2015-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for outputs. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: imu: kmx61: Drop odr_bits from kmx61_samp_freq_tableDaniel Baluta2015-02-03
|/ | | | | | | | | odr_bits values are between 0 and 11, so we can use the index in kmx61_samp_freq_table instead of odr_bits structure member. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio kmx61 / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMDaniel Baluta2015-01-20
| | | | | | | | | | | | | After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under drivers/iio/imu/kmx61.c Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Use correct base when reading dataDaniel Baluta2015-01-05
| | | | | | | | | We have two IIO devices and we need to adjust the base when reading data. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Remove unnecessary REG_INS1 readDaniel Baluta2015-01-05
| | | | | | | | Useful in the debugging phase, not needed now. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Fix device initialization when setting trigger stateDaniel Baluta2015-01-05
| | | | | | Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Use false instead of 0 for ev_enable_stateDaniel Baluta2015-01-05
| | | | | | Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Drop unused device parameterDaniel Baluta2015-01-05
| | | | | | Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Fixup parameters alignmentDaniel Baluta2015-01-05
| | | | | | Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Enhance error handlingDaniel Baluta2015-01-05
| | | | | | | | | | | | | | | This fixes parts of kmx61 error handling to make code easier to read and to be more consistent with IIO coding conventions: * prefer as single point for error handling instead of duplicating code for each function * directly return a value from a case branch instead of breaking * fix error message for writing REG_CTRL1 Also, add separate error paths for kmx61_trigger_setup/iio_triggered_buffer_setup calls. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Don't ignore kmx61_set_power_state errorsDaniel Baluta2015-01-05
| | | | | | | | | ..except while in an error handler, where there is nothing to be done anyway. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Save odr_bits for later useDaniel Baluta2015-01-05
| | | | | | Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: kmx61_set_wake_up_odr() can be statickbuild test robot2014-12-12
| | | | | | | | drivers/iio/imu/kmx61.c:422:5: sparse: symbol 'kmx61_set_wake_up_odr' was not declared. Should it be static? Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Add support for any motion triggerDaniel Baluta2014-12-12
| | | | | | | | We use WUFE (Wake Up from Sleep Engine) and BTSE (Back to Sleep Engine) to detect general motion input. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Add support for data ready triggersDaniel Baluta2014-12-12
| | | | | | | This creates a data ready trigger per IIO device. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Add PM sleep supportDaniel Baluta2014-12-12
| | | | | | | | | Per sensor state (ACTIVE/STANDBY) is saved in driver's private data (acc_stby/mag_stby) and restored when resume is called. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Add PM runtime supportDaniel Baluta2014-12-12
| | | | | | | | By default both sensors are ACTIVE, in this way the driver will work even if CONFIG_PM_RUNTIME is not selected. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: kmx61: Add acpi supportDaniel Baluta2014-12-12
| | | | | Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: imu: Add support for Kionix KMX61 sensorDaniel Baluta2014-12-12
| | | | | | | | | | | | | Minimal implementation for KMX61 6-axis accelerometer/magnetometer. It exports raw accel/magn readings together with scale and sampling frequency. This driver uses two IIO devices one for accelerometer and one for magnetometer. Datasheet will be available at: http://www.kionix.com/6-axis-accelerometer-magnetometer/kmx61 Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Revert "iio: imu: Add support for Kionix KMX61 sensor"Jonathan Cameron2014-12-12
| | | | | | | The two halves of this part can run largely independently. Hence a version 4 of this patch followed that reorganized things completely. This reverts commit d7d787d29148cde12958c2e3765ad3a55dc55eaf.
* iio: imu: Add support for Kionix KMX61 sensorDaniel Baluta2014-11-22
Minimal implementation for KMX61 6-axis accelerometer/magnetometer. It exports raw accel/magn readings together with scale and sampling frequency. Datasheet will be available at: http://www.kionix.com/6-axis-accelerometer-magnetometer/kmx61 Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>