Convert the driver to use regmap instead of I2C-specific functions. This
is done in preparation for splitting this driver into core and
I2C-specific code as well as introduction of SPI driver.
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add the device tree binding documentation for the ADXL345 3-axis digital
accelerometer.
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The contents of the header file are used only by this single
source file. Move content into .c file and remove header.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The contents of the header file are used only by this single
source file. Move content into .c file and remove header.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Moved the contents of the header(ad9834.h) into the corresponding source
file with the exception of the platform data struct which is supposed to be
used from somewhere else other than the driver.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Moved the contents of the header(ad9832.h) into the corresponding source file
with the exception of the platform data struct which is supposed to be
used from somewhere else other than the driver.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The contents of the header file are used only by this single source
file. Moved content into adis16203_core.c file and removed adis16203.h
file. Arranged #include files in alphabetical order.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The contents of the header file are used only by this single
source file. Move content into .c and remove .h.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Replace left shifting on 1 with the BIT(x) macro as suggested by
checkpatch.pl.
Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add HID_USAGE_SENSOR_HUMAN_PRESENCE support for Human Presence sensitivity
parsing, in case some implementation uses it as sensitivity modifier.
Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
After sampling there should always be only one value in the FIFO.
This also applies to averaging mode as the averaging is done
chip-internally. So we don't have to loop and let the driver
complain if there's not exactly one value in the FIFO.
If the value belongs to a different channel then don't silently
swallow the value but complain.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Switch from polling to interrupt mode.
Successfully tested on a S905GXBB-based Odroid C2.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Change permissions to octal style.
Found using checkpatch
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Simplify function returns by merging assignment and return.
Found with Coccinelle.
Semantic patch:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The patch resolves following checkpatch issue:
WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using
octal permissions '0444'.
Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
There are a few more little cleanups that could be done on this driver, but
I don't think any are sufficient to justify not moving it out of staging.
It's a very simple driver (presumably for a simple part) so not much that can
go wrong. I think it was only ever in staging because that's where IIO was
as a whole at the time and then we forgot about it!
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Roland Stigge <stigge@antcom.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Previously it was called _info with instances as info. This caused some
confusion against the info structure that are used in the core of IIO.
Since this driver was written it's become a fairly strong convention to
use _state and st for instances so change to that.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
There are some unanswered questions due to disagreements between the code
and various datasheets (including between different datasheets for the same
part).
I don't think that is necessarily a reason to keep it in staging however.
I'm partly posting this patch inorder to reignite debate and with a bit
of luck find someone who has one of these to test!
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The ACCES 104-QUAD-8 IIO driver did not appear in the 4.9 version of the
Linux kernel. This patch fixes the KernelVersion lines of the 104-QUAD-8
sysfs ABI documentation.
Fixes: 28e5d3bb03 ("iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8")
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The IIO counter driver support did not appear in the 4.9 version of the
Linux kernel. This patch fixes the KernelVersion lines of the relevant
IIO counter sysfs ABI documentation.
Fixes: 1a8f324aa1 ("iio: Implement counter channel type and info constants")
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add entry for the in_proximity_sampling_frequency_available sysfs
entry to the existing sampling_frequency_available ABI documentation.
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add Brian Masney's copyright to the header for the several rounds of
staging cleanups that has been done to this driver.
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
With the introduction of runtime power management in commit 2db5054ac2
("staging: iio: isl29028: add runtime power management support"), the
system could go to sleep and turn off the device without notifying the
runtime power management code. This patch changes the system suspend
and resume to go through the runtime power management.
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
When proximity is enabled in isl29028_enable_proximity(), the function
msleep() is called with the sampling frequency, which is not correct.
This patch changes the code to sleep the specified amount of time listed
in the datasheet instead.
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This driver in some cases can busy wait for upwards of 100 ms. Since the
kernel at this point is not running in atomic context, and is running in
process context, we can safely use msleep() instead. This patch changes
the two occurrences of mdelay() to msleep().
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Changed file permissions to octal.
Found with checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds ALERT irq and limit threshold events support for TI TMP007 - 16 bit IR thermopile sensor with integrated
math engine.
Following threshold events are supported:
1. TObj high limit
2. TObj low limit
3. TDie high limit
4. TDie low limit
Signed-off-by: Manivannan Sadhasivam <manivannanece23@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
MAX30102 is an heart rate and pulse oximeter sensor that works using
two LEDS of different wavelengths, and detecting the light reflected
back.
This patchset adds support for both IR and RED LED channels which can
be processed in userspace to determine heart rate and blood oxygen
levels. The MAX30102 part isn't completely register and functional
compatible with the existing MAX30100 driver.
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Replaced the symbolic permission references S_IRUGO and S_IWUSR with their
octal counterparts.
Signed-off-by: Artur Lorincz <larturus@yahoo.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add basic IIO support for the Analog Devices ADXL345 3-axis accelerometer.
The datasheet can be found here:
http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Handle Light and Proximity sensors presented by the ChromeOS EC Sensor hub.
Creates an IIO device for each functions.
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support to STM LSM6DS3H 6-axis (acc + gyro) Mems sensor
http://www.st.com/resource/en/datasheet/lsm6ds3h.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support to STM LSM6DSL 6-axis (acc + gyro) Mems sensor
http://www.st.com/resource/en/datasheet/lsm6dsl.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add capability to support multiple devices with the same
st_lsm6dsx_settings like LSM6DSM/LSM6DSL
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds support for the ultrasonic ranger srf04 of devantech.
This device is measuring the distance of objects in a range between 1 cm
and 3 meters and a theoretical resolution of 3 mm.
There are two GPIOs used:
- trigger: set as output to the device when the measurement should start
- echo: set by the device when the ultrasonic wave is sent out and reset
when the echo is recognized; this needs to be an interrupt input
The time between setting and resetting the echo pin is the time the
waveform needed for one round trip. This time is recorded in the interrupt
handler.
The distance is calculated in the read function by using the ultrasonic
speed at 20 degrees celsius which is about 343 m/s.
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds dt binding for devantech ultrasonic ranger srf04.
The vendor "devantech" was already added to the vendor list with
"[PATCH v4 1/3] iio: distance: srf08: add trivial DT binding"
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Changed symbolic permissions to octal permissions.
Found using checkpatch
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>