aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro
Commit message (Collapse)AuthorAge
* iio: hid-sensor-gyro-3d: Fix return valuesSachin Kamat2014-07-05
| | | | | | | | | | | | IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored the actual return values (which could be -EINVAL) and instead returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO upon success. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: hid-sensors: Gyro 3D: Raw read supportSrinivas Pandruvada2014-05-05
| | | | | | | | Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: hid-sensors: Add API to power on/offSrinivas Pandruvada2014-05-05
| | | | | | | | | Added an API to allow client drivers to turn ON and OFF sensors for quick read. Added data_read as counting varaible instead of boolean, so that sensor is powered off only when last user released it. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: hid-sensors: Gyro 3D : adjust scale and offsetSrinivas Pandruvada2014-05-05
| | | | | | | | Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st_sensors: move regulator retrieveal to coreLinus Walleij2014-04-26
| | | | | | | | | | | | | | | | | | | | Currently the pressure sensor has code to retrieve and enable two regulators for Vdd and Vdd IO, but actually these voltage inputs are found on all of these ST sensors, so move the regulator handling to the core and make sure all the ST sensors call these functions on probe() and remove() to enable/disable power. Here also mover over to obtaining the regulator from the *parent* device of the IIO device, as the IIO device is created on-the-fly in this very subsystem it very unlikely evert have any regulators attached to it whatsoever. It is much more likely that the parent is a platform device, possibly instantiated from a device tree, which in turn have Vdd and Vdd IO supplied assigned to it. Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st_sensors: announce registered sensorsLinus Walleij2014-04-26
| | | | | | | | | | | It is pretty helpful to know already from dmesg that a certain device is successfully registered, instead of having to browse sysfs to see if it's actually there. Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:gyro:itg3200 - drop unreachable return ret. Highlighted by smatchJonathan Cameron2014-03-16
| | | | | | | | | CHECK drivers/iio/gyro/itg3200_core.c drivers/iio/gyro/itg3200_core.c:114 itg3200_read_raw() info: ignoring unreachable code. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Neil Brown <neilb@suse.de> Cc: Dan Carpenter <dan.carpenter@oracle.com>
* iio:gyro: bug on L3GD20H gyroscope supportDenis CIOCCA2014-02-18
| | | | | | | | | | | The driver was not able to manage the sensor: during probe function and wai check, the driver stops and writes: "device name and WhoAmI mismatch." The correct value of L3GD20H wai is 0xd7 instead of 0xd4. Dropped support for the sensor. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Merge v3.13-rc2 into staging-nextGreg Kroah-Hartman2013-12-02
|\ | | | | | | | | | | we want these fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * iio: hid_Sensors: fix crash during trigger unregisterSrinivas Pandruvada2013-11-02
| | | | | | | | | | | | | | | | | | | | | | We can't store the trigger instance created by iio_trigger_alloc, in trig field of iio_device structure. This needs to be stored in the driver private data. Othewise it can result in crash during module unload. Hence created a trig_ptr in the common data structure for each HID sensor IIO driver and storing here. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: gyro: adxrs450: Use devm_iio_device_registerSachin Kamat2013-11-24
| | | | | | | | | | | | | | devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: gyro: adis16130: Use devm_iio_device_registerSachin Kamat2013-11-24
| | | | | | | | | | | | | | devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: hid-sensors: gyro : Add sensitivitySrinivas Pandruvada2013-11-05
|/ | | | | | | | | | A number of Properties that can be applied to Data Fields are per data field basis or for all data fields. Adding sensitivity field for all gyro fields, which is most commonly used in currently available sensor hubs. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:st_gyro: Remove redundant call to iio_sw_buffer_preenable().Lars-Peter Clausen2013-10-16
| | | | | | | | | 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> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adis16130: Use spi_sync_transfer()Lars-Peter Clausen2013-10-05
| | | | | | | | Use the spi_sync_transfer() helper function instead of open-coding it. Makes the code a bit shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adxrs450: Use spi_sync_transfer()Lars-Peter Clausen2013-10-05
| | | | | | | | Use the spi_sync_transfer() helper function instead of open-coding it. Makes the code a bit shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adis16080: Use spi_sync_transfer()Lars-Peter Clausen2013-10-05
| | | | | | | | Use the spi_sync_transfer() helper function instead of open-coding it. Makes the code a bit shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:gyro: Register buffer also without specific triggerDenis CIOCCA2013-09-21
| | | | | | | This patch fix buffer registration that allows to use generic IIO trigger. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro-core: st: Clean up error handling in probe()Lee Jones2013-09-21
| | | | | | | | | Reduce the amount of those unnecessary goto calls, as in most cases we can simply return immediately. We also only call for the IRQ number once and use that value throughout. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:itg3200: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-21
| | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Remove unnecessary casts for iio_push_to_buffers()Lars-Peter Clausen2013-09-15
| | | | | | | | Now that iio_push_to_buffers() takes a void pointer for the data parameter we can remove those casts to u8*. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adxrs450: Remove redundant breakSachin Kamat2013-09-14
| | | | | | | 'break' after return is redundant. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adis16260: Remove redundant breakSachin Kamat2013-09-14
| | | | | | | 'break' after return is redundant. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adis16130: Remove redundant breakSachin Kamat2013-09-14
| | | | | | | 'break' after return is redundant. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Remove unnecessary _write_raw_get_fmt() in several hid-sensor driversPeter Meerwald2013-08-19
| | | | | | | | IIO_VAL_INT_PLUS_MICRO is the default, no need to return it explicitly Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: srinivas pandruvada <srinivas.pandruvada@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: st_gyro: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: itg3200_core: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Christian Strobel <christian.strobel@iis.fraunhofer.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adxrs450: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: hid-sensor-gyro-3d: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Srinivas Pandruvada <srinivas.pandruvada@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adis16260: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adis16136: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adis16130: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: gyro: adis16080: Use devm_iio_device_allocSachin Kamat2013-08-17
| | | | | | | | Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:adis16260: Move out of stagingLars-Peter Clausen2013-08-03
| | | | | | | | The drivers is in more or less good shape, conforms to the IIO ABI and none of the default static code checker report any problems, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Add a comment to about alphabetical order to Kconfigs and MakefilesLars-Peter Clausen2013-08-03
| | | | | | | | | | | | Keeping Makefile and Kconfig entries in alphabetical order usually works better than just appending new entries at the end, since it reduces the amount of conflicts. This patch adds a comment to the IIO Kconfig and Makefile files to document that the entries should be kept in alphabetical order. Also reorder those entries which weren't in alphabetical order yet. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: hid-sensor-gyro-3d: add module alias for autoloadAlexander Holler2013-08-03
| | | | | | | | | | | | Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically load the driver. This makes it also possible to use the usual driver name instead of HID-SENSOR-2000xx which isn't very descriptive in kernel messages. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: reword help text of several IIO_ST driversPeter Meerwald2013-08-03
| | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: "Denis Ciocca" <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Added ST-sensors platform data to select the DRDY interrupt pinDenis CIOCCA2013-08-03
| | | | | | | | This patch add support to redirect the DRDY interrupt on INT1 or INT2 on accelerometer and pressure sensors. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:adis16130: Move out of stagingLars-Peter Clausen2013-06-11
| | | | | | | | The adis16130 driver is fairly simple and it a good shape now, so move it out of staging. Remove an outdated FIXME along the way. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:common: Removed stuff macros, added num_data_channels on st_sensors ↵Denis CIOCCA2013-06-05
| | | | | | | | | | | | | | struct and added support on one-shot sysfs reads to 3 byte channel This patch introduce num_data_channels variable on st_sensors struct to manage different type of channels (size or number) in st_sensors_get_buffer_element function. Removed ST_SENSORS_NUMBER_DATA_CHANNELS and ST_SENSORS_BYTE_FOR_CHANNEL and used struct iio_chan_spec const *ch to catch data. Added 3 byte channel data support on one-shot reads. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:common: ST_SENSORS_LSM_CHANNELS macro changedDenis CIOCCA2013-06-04
| | | | | Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: STMicroelectronics: remove three useless selectsPaul Bolle2013-05-22
| | | | | | | | | | | Drivers for STMicroelectronics accelerometers, gyroscopes, and magnetometers were added in v3.9. They all have a (similar) select statement in their Kconfig files for a non-existant Kconfig symbol. These select statements can safely be removed. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:trigger: Introduce iio_tigger_{set,get}_drvdataLars-Peter Clausen2013-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce iio_tigger_{set,get}_drvdata which allows to attach driver specific data to a trigger. The functions wrap access to the triggers private_data field and all current users are updated to use iio_tigger_{set,get}_drvdata instead of directly accessing the private_data field. This is the first step towards removing the private_data field from the iio_trigger struct. The following coccinelle script has been used to update the drivers: <smpl> @@ struct iio_trigger *trigger; expression priv; @@ -trigger->private_data = priv +iio_trigger_set_drv_data(trigger, priv) @@ struct iio_trigger *trigger; @@ -trigger->private_data +iio_trigger_get_drv_data(trigger) </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:gyro:itg3200_core move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-17
| | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
* iio:gyro:adxrs450 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-17
| | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
* iio:gyro:adis16136 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-17
| | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
* iio:gyro:adis16080 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-17
| | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
* iio:hid_sensors move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-17
| | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:st_sensors fix build when !CONFIG_IIO_TRIGGERJonathan Cameron2013-02-09
| | | | | | | | | | | Partly a case of removing unused headers and partly a case of ifdefing out the iio_trigger_ops structures. This has come about because of an 'unusual' separation of code in this driver. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Denis Ciocca <denis.ciocca@st.com>
* iio: Use spi_sync_transfer()Lars-Peter Clausen2013-02-09
| | | | | | | Use the new spi_sync_transfer() helper function instead of open-coding it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>