summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/bma180.c
AgeCommit message (Collapse)Author
2017-03-19iio: accel: bma180: Add OF device ID tableJavier Martinez Canillas
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: accel: Prefer unsigned int to bare use of unsignedMiguel Robles
Fix checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Miguel Robles <miguel.robles@farole.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15iio: accel: bma180: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-30iio:core: timestamping clock selection supportGregor Boirie
Adds a new per-device sysfs attribute "current_timestamp_clock" to allow userspace to select a particular POSIX clock for buffered samples and events timestamping. Following clocks, as listed in clock_gettime(2), are supported: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and CLOCK_TAI. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-07-11iio: Drop owner assignment from i2c_driverKrzysztof Kozlowski
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>
2015-03-07iio: fix drivers that check buffer->scan_maskOctavian Purdila
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>
2014-09-22staging: iio: fix up merge errorGreg Kroah-Hartman
Fix up a build merge error in drivers/iio/accel/bma180.c that I caused. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-22Merge 3.17-rc6 into staging-next.Greg Kroah-Hartman
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-09-14iio:bma180: Add BMA250 chip supportPeter Meerwald
the BMA250 has only 10-bit resolution; while the data readout registers have identical layout, the configuration is completely different compared to the BMA180 datasheet: http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/BST-BMA250-DS002-05.pdf Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Implement _available sysfs attribute dynamicallyPeter Meerwald
makes it easier to add more chip variants and removes redundancy: scales and frequencies are now stated just once Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Prepare for accelerometer channels with different resolutionsPeter Meerwald
allow to specify channels resolution and compute shift assuming 16-bit registers and MSB allocation Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Introduce part-specific _config() and disable() codePeter Meerwald
move part of bma180_init() to bma180_config() (split initialization and configuration code); configuration is heavily chip-specific Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Introduce part_info to differentiate further chip variantsPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Drop _update_scan_mode()Peter Meerwald
statically allocate maximum size Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Expose temperature channelPeter Meerwald
8-bit signed; 0 LSB @ 24 °C, 0.5 °C per LSB Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Use bool instead of int for statePeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Rename BMA_180 to BMA180_Peter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Prefix remaining tables and functions with bma18_Peter Meerwald
and minor cleanups Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:bma180: Enable use of device without IRQPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-25iio: accel: bma180: Fix indio_dev->trig assignmentSrinivas Pandruvada
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-20iio:bma180: Missing check for frequency fractional partPeter Meerwald
val2 should be zero This will make no difference for correct inputs but will reject incorrect ones with a decimal part in the value written to the sysfs interface. Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
2014-07-20iio:bma180: Fix scale factors to report correct acceleration unitsPeter Meerwald
The userspace interface for acceleration sensors is documented as using m/s^2 units [Documentation/ABI/testing/sysfs-bus-iio] The fullscale raw values for the BMA80 corresponds to -/+ 1, 1.5, 2, etc G depending on the selected mode. The scale table was converting to G rather than m/s^2. Change the scaling table to match the documented interface. See commit 71702e6e, iio: mma8452: Use correct acceleration units, for a related fix. Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
2014-02-15iio:accel:bma180: Make LOW_PASS_FILTER_3DB_FREQUENCY shared_by_typePeter Meerwald
the property is not per-channel, but shared by type Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Kravchenko Oleksandr <x0199363@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-08iio:accel:bma180: Use modifier instead of index in channel specificationPeter Meerwald
This driver was not complying with the ABI and the purpose of this patch is to bring it inline so that userspace will correctly identify the channels. Should use channel modifiers (X/Y/Z), not channel indices timestamp channel has scan index 3, not 4 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Kravchenko Oleksandr <x0199363@ti.com> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-17iio:accel:bma180 replaces IIO_ST macro with explicit entries to struct scan_typeJonathan Cameron
The IIO_ST macro no longer covers all the elements of struct scan_type and has this has lead to some bugs being introduced. The drivers are easier to follow with this structure being directly filled so that is now preferred. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-09-25Merge 3.12-rc2 into staging-next.Greg Kroah-Hartman
This resolves the merge problem with two iio drivers that Stephen Rothwell pointed out. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-21iio:bma180: Use iio_push_buffers_with_timestamp()Lars-Peter Clausen
Makes the code shorter and a bit less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-21iio: Fix bma180 dev-to-indio_dev conversion in suspend/resumePeter Meerwald
dev_to_iio_dev() is a false friend Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-15iio: Remove unnecessary casts for iio_push_to_buffers()Lars-Peter Clausen
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>
2013-08-28iio: add Bosch BMA180 acceleration sensor driverOleksandr Kravchenko
This patch adds IIO driver for Bosch BMA180 triaxial acceleration sensor. http://dlnmh9ip6v2uc.cloudfront.net/datasheets/ Sensors/Accelerometers/BST-BMA180-DS000-07_2.pdf Signed-off-by: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>