aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-05-16iio: adis16400: Fix burst transfer for adis16448Lars-Peter Clausen3-2/+12
The adis16448, unlike the other chips in this family, in addition to the hardware channels also sends out the DIAG_STAT register in burst mode before them. Handle that case by skipping over the first 2 bytes before we pass the received data to the buffer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Fixes: 76ada52f7f5d ("iio:adis16400: Add support for the adis16448") Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-16iio: adis16400: Fix burst modePaul Cercueil1-7/+9
There are a few issues with the burst mode support. For one we don't setup the rx buffer, so the buffer will never be filled and all samples will read as the zero. Furthermore the tx buffer has the wrong type, which means the driver sends the wrong command and not the right data is returned. The final issue is that in burst mode all channels are transferred. Hence the length of the transfer length should be the number of hardware channels * 2 bytes. Currently the driver uses indio_dev->scan_bytes for this. But if the timestamp channel is enabled the scan_bytes will be larger than the burst length. Fix this by just calculating the burst length based on the number of hardware channels. Signed-off-by: Paul Cercueil <paul.cercueil@analog.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Fixes: 5eda3550a3cc ("staging:iio:adis16400: Preallocate transfer message") Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-16iio: adis16400: Compute the scan mask from channel indicesPaul Cercueil2-7/+19
We unfortunately can't use ~0UL for the scan mask to indicate that the only valid scan mask is all channels selected. The IIO core needs the exact mask to work correctly and not a super-set of it. So calculate the masked based on the channels that are available for a particular device. Signed-off-by: Paul Cercueil <paul.cercueil@analog.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Fixes: 5eda3550a3cc ("staging:iio:adis16400: Preallocate transfer message") Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-16iio: adis16400: Use != channel indices for the two voltage channelsPaul Cercueil1-4/+4
Previously, the two voltage channels had the same ID, which didn't cause conflicts in sysfs only because one channel is named and the other isn't; this is still violating the spec though, two indexed channels should never have the same index. Signed-off-by: Paul Cercueil <paul.cercueil@analog.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-16iio: adis16400: Report pressure channel scaleLars-Peter Clausen1-0/+5
Add the scale for the pressure channel, which is currently missing. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Fixes: 76ada52f7f5d ("iio:adis16400: Add support for the adis16448") Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-07Merge 4.0-rc7 into staging-nextGreg Kroah-Hartman4-39/+46
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>
2015-03-28iio: imu: Use iio_trigger_get for indio_dev->trig assignmentDarshana Padmadas1-1/+1
This patch uses iio_trigger_get to increment the reference count of trigger device, to avoid incorrect assignment. Can result in a null pointer dereference during removal if the trigger has been changed before removal. This patch refers to a similar situation encountered through the following discussion: http://www.spinics.net/lists/linux-iio/msg13669.html Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-24Merge tag 'iio-for-4.1a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman5-44/+249
Jonathan writes: First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle. New drivers * CM3323 color sensor. * MS5611 pressure and temperature sensor. New functionality * mup6050 - create mux clients for devices described via ACPI. The reasoning and approach taken in this patch are complex. Basically there is no otherway of finding out what is there than by some esoteric look ups in the ACPI data. * cm3232 - PM support * itg3200 - suspend/resume support * mcp320x - add more ADCs to the kconfig to reflect what the driver supports (this patch and the bindings got left behind when the support was added a while back). Docs / utils * ti-adc128s052 - DT bindings. * mcp3422 - DT bindings. * mcp320x - DT bindings * ABI docs for event threshold scale attributes, in_magn_offset, proximity scan_element and thresh falling/rising values for accelerometers. All elements long in use that have slipped by being explicitly documented. * Tidy up the tools previously in drivers/staging/iio/Documentation and move them out to /tools/iio. Yet another move that should have happened long ago. This time Roberta Dobrescu did the leg work. Thanks! Core Cleanups * Export userspace IIO headers. We should have done the appropriate header splitting a long time ago. Thanks to Daniel for sorting this out. * Refactor the registring of attributes for buffers to move all non-custom ones to a vector allowing easier additions to the current set in the future. Driver Cleanups * gpiod related cleanups. Make use of the additional parameter to specify initial direciton to avoid extra code. * bmc150 - Various refactorings to reduce code repitition and prepare for hardware buffer support. Some of these cleanups are good even without the new functionality. * kmx61 - direct use of index to an array avoiding a structure element which was always the index to an element in an array of that structure. * vf610 - avoid incorrect type for return from wait_for_completion_timeout. * gp2ap020a00f - use put_unaligned_le32 for slight code simplification. * ade7754 - improve error handling including suppressing some build warnings. * ade7759 - improve error handling including suppressing some build warnings. * hmc5843 - Long line and indentation fixes. Also some constifying of various constant data. * ade7854 - 80+ character line splitting. * ad2s1210 - fix wrong printf format string. * mxs-lradc - fix wrong printf format string. * ade7954-i2c - code alignment fixes and other trivial but worthwhile bits. * periodic rtc trigger - make the frequency type an unsigned int as it is always treated as such. * jsa1212 - constify struct regmap_config as it is constant. * ad7793 - typo in the MODULE_DESCRIPTION * mma9551 - check gpiod_to_irq errors. Note that this doesn't actually cause any trouble but is worth tidying up as obviously incorrect. * mlx90614 - refactor the register symbols to make it clear which reads are to RAM not PROM.
2015-03-14iio:inv-mpu6050: Fix inconsistency for the scale channelAdriana Reus1-26/+30
Fix inconsistency in the semantics of the scale attribute. For scale the write_raw function was considering the scale table index and writing the appropriate value into the range register, while for read_raw it was outputting the actual scale. Fix this behaviour and adhere to the iio ABI specification. Signed-off-by: Adriana Reus <adriana.reus@intel.com> Reviewed-by: Viorel Suman <viorel.suman@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-14iio: inv_mpu6050: Clear timestamps fifo while resetting hardware fifoViorel Suman1-11/+14
A hardware fifo reset always imply an invalidation of the existing timestamps, so we'll clear timestamps fifo on successfull hardware fifo reset. Signed-off-by: Viorel Suman <viorel.suman@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-07iio: fix drivers that check buffer->scan_maskOctavian Purdila1-1/+1
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>
2015-02-28Merge tag 'iio-fixes-for-4.0a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linusGreg Kroah-Hartman2-2/+7
Jonathan writes: First round of fixes for IIO in the 4.0 cycle. Note a followup set dependent on patches in the recent merge windows will follow shortly. * dht11 - fix a read off the end of an array, add some locking to prevent the read function being interrupted and make sure gpio/irq lines are not enabled for irqs during output. * iadc - timeout should be in jiffies not msecs * mpu6050 - avoid a null id from ACPI emumeration being dereferenced. * mxs-lradc - fix up some interaction issues between the touchscreen driver and iio driver. Mostly about making sure that the adc driver only affects channels that are not being used for the touchscreen. * ad2s1200 - sign extension fix for a result of c type promotion. * adis16400 - sign extension fix for a result of c type promotion. * mcp3422 - scale table was transposed. * ad5686 - use _optional regulator get to avoid a dummy reg being allocate which would cause the driver to fail to initialize. * gp2ap020a00f - select REGMAP_I2C * si7020 - revert an incorrect cleanup up and then fix the issue that made that cleanup seem like a good idea.
2015-02-25iio: imu: inv_mpu6050: Create mux clients for ACPISrinivas Pandruvada4-1/+222
This is a follow up patches after adding i2c mux adapter for bypass mode. Potentially many different types of sensor can be attached to INVMPU6XXX device, which can be connected to main cpu i2c bus in bypass mode. Why do we need this? The system ACPI table entry will consist of only one device for INV6XXX, assuming that this driver will handle all connected sensors. That is not true for the Linux driver. There are bunch of IIO drivers for each sensors, hence we created a mux on this device. So to load these additional drivers, we need to create i2c devices for them in this driver using this mux adapter. There are multiple options: 1. Use the auto detect feature, this needs a new i2c class for the adapter as the existing HWMON class is not acceptable. Also the autodetect has overhead of executing detect method for each matching class of adapters. This is a simple implementation. This option was previously submitted with not a happy feedback. 2. Option is use ACPI magic and parse the configuration data. What we need to create a i2c device at a minimum is address and a name. Address can be obtained for secondary device in more or less in a standard way from using _CRS element. But there is no name. To get name we need to process proprietary vendor data. Not having name is not fun, as you have to create device using the device name of INVN6XXXX, respecting driver duplicate name space restriction. Also each client driver needs to have this name in the id table. Since multiple driver can be loaded, the driver should be able to detect its presence and gracefully exit for the other client driver to take it over. So we use two step process: - Use DMI to id platform and parse propritery data. This is not uncommon for many x86 platform specific driver. We will get both name and address. The change created necessary infrastructure to add more properitery vendor data parsing. - If DMI match fails, then create device on INV6XXX-client (we can't create with same name as INV6XXX as it will cause duplicate name and driver model will reject.) With this each client sensor driver which needs to get attached via INV6XXXX, need this name in the id table and detect the physical presence of sensor in probe and exit if not found. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-22iio: improve usage of gpiod APIUwe Kleine-König1-5/+1
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>
2015-02-03iio: imu: kmx61: Drop odr_bits from kmx61_samp_freq_tableDaniel Baluta1-38/+26
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>
2015-01-27imu: inv_mpu6050: cleanup on error checkVarka Bhadram1-9/+8
Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-27imu: inv_mpu6050: use devm_request_irqVarka Bhadram1-8/+6
This patch use the devres API for requesting an IRQ. Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-27imu: inv_mpu6050: use devm_iio_trigger_allocVarka Bhadram1-7/+5
Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-26iio: imu: adis16400: Fix sign extensionRasmus Villemoes1-1/+2
The intention is obviously to sign-extend a 12 bit quantity. But because of C's promotion rules, the assignment is equivalent to "val16 &= 0xfff;". Use the proper API for this. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-20iio kmx61 / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMDaniel Baluta1-2/+2
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>
2015-01-10iio: imu: inv_mpu6050: Prevent dereferencing NULLSrinivas Pandruvada1-1/+5
When id is null, with ACPI enumeration, don't dereference it. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-05iio: imu: kmx61: Use correct base when reading dataDaniel Baluta1-1/+7
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>
2015-01-05iio: imu: kmx61: Remove unnecessary REG_INS1 readDaniel Baluta1-2/+0
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>
2015-01-05iio: imu: kmx61: Fix device initialization when setting trigger stateDaniel Baluta1-2/+1
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>
2015-01-05iio: imu: kmx61: Use false instead of 0 for ev_enable_stateDaniel Baluta1-1/+1
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>
2015-01-05iio: imu: kmx61: Drop unused device parameterDaniel Baluta1-3/+3
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>
2015-01-05iio: imu: kmx61: Fixup parameters alignmentDaniel Baluta1-9/+9
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>
2015-01-05iio: imu: kmx61: Enhance error handlingDaniel Baluta1-61/+43
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>
2015-01-05iio: imu: kmx61: Don't ignore kmx61_set_power_state errorsDaniel Baluta1-2/+9
..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>
2015-01-05iio: imu: kmx61: Save odr_bits for later useDaniel Baluta1-0/+2
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>
2014-12-26iio: imu: inv_mpu6050: ACPI enumerationSrinivas Pandruvada1-0/+9
Added changes so that the module can be enumerated via ACPI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-12-12iio: imu: kmx61: kmx61_set_wake_up_odr() can be statickbuild test robot1-1/+1
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>
2014-12-12iio: imu: kmx61: Add support for any motion triggerDaniel Baluta1-7/+426
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>
2014-12-12iio: imu: kmx61: Add support for data ready triggersDaniel Baluta2-1/+296
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>
2014-12-12iio: imu: kmx61: Add PM sleep supportDaniel Baluta1-0/+29
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>
2014-12-12iio: imu: kmx61: Add PM runtime supportDaniel Baluta1-2/+112
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>
2014-12-12iio: imu: kmx61: Add acpi supportDaniel Baluta1-0/+59
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-12-12iio: imu: Add support for Kionix KMX61 sensorDaniel Baluta3-0/+702
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>
2014-12-12Revert "iio: imu: Add support for Kionix KMX61 sensor"Jonathan Cameron3-777/+0
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.
2014-12-12iio: imu: inv_mpu6050: Add i2c mux for by passSrinivas Pandruvada3-6/+116
This chip allows some limited number of sensors connected to it as slaves, which can be directly accessed by register interface of this driver.But the current upstream driver doesn't support such mode. To attach such slaves to main processor i2c bus, chip has to be set up in bypass mode. This change adds i2c mux, which will enable/disable this mode for transaction to/from such slave devices. This was discussed for a while in mailing list, this was the outcome: Reference: http://www.spinics.net/lists/linux-iio/msg12126.html http://comments.gmane.org/gmane.linux.kernel.iio/11470 Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-22iio: imu: Add support for Kionix KMX61 sensorDaniel Baluta3-0/+777
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>
2014-09-22Merge 3.17-rc6 into staging-next.Greg Kroah-Hartman1-1/+1
We want the fixes in there, and it resolves a merge issue with drivers/iio/accel/bma180.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30iio: imu: inv_mpu6050: Remove casting the return value which is a void pointerJingoo Han1-2/+1
Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-25iio: inv_mpu6050: Fix indio_dev->trig assignmentSrinivas Pandruvada1-1/+1
This can result in wrong reference count for trigger device, call iio_trigger_get to increment reference. Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion with Jonathan. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
2014-07-07iio: imu: adis16480 switch sampling frequency attr to core supportJonathan Cameron1-60/+22
By using the info_mask_shared_by_all element of the channel spec, access to the sampling frequency becomes available to in kernel users of the driver. It also shortens and simplifies the code. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2014-07-07iio: imu: adis16400 switch sampling frequency attr to core support.Jonathan Cameron1-53/+25
By using the info_mask_shared_by_all element of the channel spec, access to the sampling frequency becomes available to in kernel users of the driver. It also shortens and simplifies the code. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2014-07-03iio: adis16400: Remove unused variableSachin Kamat1-2/+1
'rx' is not used in this function. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-22Merge 3.15-rc6 into staging-next.Greg Kroah-Hartman1-2/+5
This resolves the conflicts in the files: drivers/iio/adc/Kconfig drivers/staging/rtl8723au/os_dep/usb_ops_linux.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-26iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereferenceAtilla Filiz1-2/+5
The driver segfaults when the kernel boots with device tree as the platform data is then not present and the pointer is deferenced without checking it is not null. This patch introduces such a check avoiding the crash. Signed-off-by: Atilla Filiz <atilla.filiz@essensium.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
2014-03-29iio: imu: inv_mpu6050: Add compatibity with MPU6500Srinivas Pandruvada3-0/+4
Adding MPU6500 in target list for this driver. Description: Source Document: MPU-6500 Register Map and Descriptions Revision 2.1 Section 3: Register Map This section describes difference in terms device programmability between MPU6050 and MPU6500. These are different registers, which differs between MPU6050 and MPU6500. Addr Name --------------------- 1E LP_ACCEL_ODR 6C PWR_MGMT_2 77 XA_OFFSET_H 78 XA_OFFSET_L 7A YA_OFFSET_H 7B YA_OFFSET_L 7D ZA_OFFSET_H 7E ZA_OFFSET_L But the current MPU6050 driver doesn't use registers which are different except PWR_MGMT_2. The difference is support of "LP_WAKE_CTRL" at bit6-7 in MPU6050 mode. In MPU6500 they are not defined. In current mpu6050 driver, only values used for this register are for standby mode for gyro and accelerometer. In both case frequency of wakeups is set to default and not using bit 6-7. So this driver van as well support MPU6500. In addition MPU6500 can run MPU6050 mode by changing device trim settings. So changing config comments to allow MPU6500 to use this driver. When the driver is enhanced to support more functions, i2c driver data INV_MPU6500 or "WHO_AM_I" register can be used to add additional functionality. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>