1
0
Fork 0
Commit Graph

603044 Commits (ace4cdfe67be24463ad694105533e5319674f022)

Author SHA1 Message Date
Zhiyong Tao ace4cdfe67 iio: adc: mt2701: Add Mediatek auxadc driver for mt2701.
Add Mediatek auxadc driver based on iio.
It will register a device in iio and support iio.
So thermal can read auxadc channel to sample data by iio device.
It is tested successfully on mt2701 platform.
Mt8173 and mt6577 platforms are not tested.
But the expectation is compatible.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 19:54:30 +01:00
Zhiyong Tao 3ad16a39ed dt-bindings: auxadc: Add binding document for Mediatek auxadc.
The commit adds the device tree binding documentation for the mediatek
auxadc found on Mediatek MT2701.
Thermal gets auxadc sample data by iio device.
So the commit changes auxadc device tree binding documentation from
/soc/mediatek/auxadc.txt to /iio/adc/mt6577_auxadc.txt.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 19:53:11 +01:00
Alison Schofield e24544553b iio: temperature: add Kconfig selects for triggered buffer
Select IIO_BUFFER and IIO_TRIGGERED_BUFFER to compile maxim_thermocouple.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 19:50:44 +01:00
Alison Schofield 197399dcd7 iio: magnetometer: mag3110: claim direct mode during raw reads
Driver was checking for direct mode but not locking it.  Use
claim/release helper functions to guarantee the device stays
in direct mode during raw reads.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 19:37:35 +01:00
Johanna Abrahamsson d1682a9a7a staging: iio: ade7854: checkpatch fixes (alignment of parameters)
CHECK: Alignment should match open parenthesis

Signed-off-by: Johanna Abrahamsson <johanna@mjao.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 12:23:29 +01:00
Matt Ranostay ce08cc986e iio: chemical: atlas-ph-sensor: add ORP feature
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 11:59:53 +01:00
Matt Ranostay d7c0e5ae70 iio: chemical: atlas-ph-sensor: switch to REGCACHE_NONE regmap tree
Since there are overlapping volatile regions between parts, and only
register that isn't volatile is the temperature compensation provided
from userspace.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 11:57:59 +01:00
Matt Ranostay b015b3e321 iio: chemical: atlas-ph-sensor: switch to iio_device_*_direct_mode helpers
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 11:55:30 +01:00
Matt Ranostay 4d671b71be iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs
Add support for Texas Instruments ADC141S626, and ADC161S626 chips.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 11:50:59 +01:00
Matt Ranostay adca058b56 iio: buffer-callback: allow getting underlying iio_dev
Add iio_channel_cb_get_iio_dev function to allow getting the
underlying iio_dev. This is useful for setting the trigger of the
consumer ADC device.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 11:47:19 +01:00
Jelle van der Waa a4fa6509dd iio: accel: add support for the Domintech DMARD09 3-axis accelerometer
Minimal implementation of an IIO driver for the Domintech DMARD09 3-axis
accelerometer. Only supports reading the x,y,z axes at the moment.

Implementation based on the Android driver from the Acer Liquid E2
kernel sources.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 10:52:08 +01:00
Aleksei Mamlin b1b79f5327 iio: accel: Add support for Domintech DMARD06 accelerometer
This patch add support for Domintech DMARD05, DMARD06 and DMARD07
accelerometers.

Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 10:52:02 +01:00
Aleksei Mamlin 0363dfc585 devicetree: bindings: Add vendor prefix for Domintech Co., Ltd.
Add vendor-prefix for Domintech Co., Ltd.

Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-21 10:51:54 +01:00
Matt Ranostay 6df1dc05e7 tools: iio: lsiio: enumerate processed channels
Enumerate the processed channels (e.g. *_input) as well the raw channels.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15 18:33:23 +01:00
Daniel Wagner 8c11e16177 iio: sx9500: Use complete() instead of complete_all()
There is only one waiter for the completion, therefore there
is no need to use complete_all(). Let's make that clear by
using complete() instead of complete_all().

The usage pattern of the completion is:

waiter context                          waker context

sx9500_read_proximity()
  sx9500_inc_chan_users()
  sx9500_inc_data_rdy_users()
  wait_for_completion_interruptible()

                                        s9500_irq_thread_handler()
                                          complete()

  reinit_completion()

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15 18:01:27 +01:00
Daniel Wagner cba4985ed5 iio: adc: Use complete() instead of complete_all()
There is only one waiter for the completion, therefore there
is no need to use complete_all(). Let's make that clear by
using complete() instead of complete_all().

The usage pattern of the completion is:

waiter context                          waker context

nau7802_read_irq()
  reinit_completion()
  nau7802_read_conversion()
  wait_for_completion_interruptible_timeout()

                                        nau7802_eoc_trigger()
                                          complete()

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15 18:01:27 +01:00
Alison Schofield b75b58b46b iio: accel: bma180: use iio helper function to guarantee direct mode
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-08-15 17:12:43 +01:00
Alison Schofield ca1902ff98 iio: humidity: hdc100x: add HDC1000 and HDC1008 to Kconfig
hdc100x supports Texas Instruments HDC1000 and HDC1008 relative
humidity and temperature sensors. Add these product names to
Kconfig.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15 17:10:56 +01:00
Christophe JAILLET 281269f8a0 iio: light: us5182d: Add missing error code assignment before test
It is likely that checking the result of 'pm_runtime_set_active' is
expected here.

Fixes: f0e5f57d3a ("iio: light: us8152d: Add power management support")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15 16:49:43 +01:00
Linus Walleij 7c94a8b2ee iio: magn: add a driver for AK8974
This adds a driver for the Asahi Kasei AK8974 and its sibling
AMI305 magnetometers. It was deployed on scale in 2009 on a
multitude of devices. It is distincly different from AK8973
and AK8975 and needs its own driver.

This patch is based on the long lost work of Samu Onkalo at Nokia,
who made a misc character device driver for the Maemo/MeeGo Nokia
devices, before the time of the IIO subsystem. It was mounted in e.g.
the Nokia N950, N8, N86, N97 etc. It is also mounted on the
ST-Ericsson HREF reference designs.

It works nicely in sysfs:

$ cat in_magn_x_raw && cat in_magn_y_raw && cat in_magn_z_raw
-55
-101
161

And with buffered reads using a simple HRTimer trigger:
$ generic_buffer -c10 -a -n ak8974 -t foo
iio device number being used is 3
iio trigger number being used is 2
No channels are enabled, enabling all channels
Enabling: in_magn_x_en
Enabling: in_magn_y_en
Enabling: in_magn_z_en
Enabling: in_timestamp_en
/sys/bus/iio/devices/iio:device3 foo
-58.000000 -102.000000 157.000000 946684970985321044
-60.000000 -98.000000 159.000000 946684971012237548
-60.000000 -106.000000 163.000000 946684971032257080
-62.000000 -94.000000 169.000000 946684971052185058
-58.000000 -98.000000 163.000000 946684971072204589
-54.000000 -100.000000 163.000000 946684971092224121
-53.000000 -103.000000 164.000000 946684971112731933
-50.000000 -102.000000 165.000000 946684971132232666
-61.000000 -101.000000 164.000000 946684971152191162
-57.000000 -99.000000 168.000000 946684971172210693
Disabling: in_magn_x_en
Disabling: in_magn_y_en
Disabling: in_magn_z_en
Disabling: in_timestamp_en

I cannot currently scale these raw values to gauss. This is
because of lack of documentation. I have sent a request for
a datasheet to Asahi Kasei.

The driver can optionally use a DRDY line IRQ to capture data,
else it will sleep and poll.

Cc: Samu Onkalo <samu.onkalo@intel.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Tested-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15 16:49:39 +01:00
Linus Walleij bcdf177d04 iio: magn: DT bindings for AK8974
This adds device tree bindings for the AK8974 magnetometer, similar
to those for the AK8975.

Cc: devicetree@vger.kernel.org
Cc: Samu Onkalo <samu.onkalo@intel.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15 16:49:37 +01:00
William Breathitt Gray 3b8df5fd52 iio: Add IIO support for the Measurement Computing CIO-DAC family
The Measurement Computing CIO-DAC is a family of 16-bit and 12-bit
analog output devices. The analog outputs are from AD660BN/AD7237
converters with each output buffered by an OP-27. Voltage ranges are
configured via physical jumpers on the device.

This driver does not support the devices' simulataneous update mode; the
XFER jumper option should be deselected for all analog output channels.

This driver provides IIO support for the Measurement Computing CIO-DAC
family: CIO-DAC16, CIO-DAC08, and PC104-DAC06. The base port addresses
for the devices may be configured via the base array module parameter.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-24 19:58:43 +01:00
Alison Schofield d02ec00d00 iio: adc: ad7298: use iio helper function to guarantee direct mode
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-07-24 19:58:42 +01:00
Alison Schofield b4d46409d6 iio: adc: ad7793: use iio helper function to guarantee direct mode
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-07-24 19:58:41 +01:00
Christophe Chapuis 4d19c48755 iio: accel: kxcjk-1013: add the "KIOX000A" ACPI id
On the Cube i9 tablet, the ACPI id for the Kionix kxcj9 accelerometer is
"KIOX000A" (as can be seen in the DSDT of the Cube i9 tablet).
It is the same accelerometer, so only adding the ACPI id is needed.

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-24 19:58:40 +01:00
Alison Schofield b75b23bc59 staging: iio: light: isl29018/28: remove I2C_CLASS_HWMON .class setting
I2C_CLASS_HWMON is for a hardware monitoring chip wanting
auto-detection.  IIO drivers don't typically use .class.
Remove it.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-24 19:58:40 +01:00
Peter Meerwald-Stadler f612770432 staging: iio: isl29028: Prefix functions
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:51:12 +01:00
Peter Meerwald-Stadler b9b689c127 staging: iio: isl29028: Expose scale and sample frequency available without comma
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:50:28 +01:00
Peter Meerwald-Stadler bafaa6debe staging: iio: isl29028: Prefix stuff
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:49:56 +01:00
Peter Meerwald-Stadler 3a37f1c259 staging: iio: isl29028: Prefix #defines
and drop unused PROX_DRIVE

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:49:27 +01:00
Peter Meerwald-Stadler 9219376d04 staging: iio: isl29018: Prefix remaining functions
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:49:21 +01:00
Peter Meerwald-Stadler 96273f43a8 staging: iio: isl29018: Cleanup of comments
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:48:40 +01:00
Peter Meerwald-Stadler c833c6926a staging: iio: isl29018: Drop newlines
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:48:38 +01:00
Peter Meerwald-Stadler ab5b9492c0 staging: iio: isl29018: Remove excessive output messages
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:48:35 +01:00
Peter Meerwald-Stadler 13e6d634c1 staging: iio: isl29018: Prefix #defines
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:48:29 +01:00
Peter Meerwald-Stadler ff34ed6d78 iio: light: vcnl4000: Add missing locking
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:44:06 +01:00
Peter Meerwald-Stadler 5d6931393f iio: light: vcnl4000: Cleanup read_raw() returns
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:44:05 +01:00
Peter Meerwald-Stadler ff6a52590c iio: light: vcnl4000: Use BIT() macro
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:44:05 +01:00
Peter Meerwald-Stadler d978bfdd0c iio: light: vcnl4000: Mention and check support for VCNL4010 and VCNL4020
VCNL4000, VCNL4010 and VCNL4020 chips are fairly compatible from a software
point of view, added features are not yet supported by the driver

patch adds a check for the product ID and demotes the corresponding
dev_info() to dev_dbg()

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:44:04 +01:00
Matt Ranostay 1f25ca11d8 iio: temperature: add support for Maxim thermocouple chips
Add initial driver support for MAX6675, and MAX31855 thermocouple chips.

Cc: Marek Vasut <marex@denx.de>
Cc: Matt Porter <mporter@konsulko.com>
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10 14:44:03 +01:00
Bijosh Thykkoottathil 0ddfd85713 drivers:iio:accel:mma8452: removed unwanted return statements
Removed unwanted return statements from the function
mma8452_set_freefall_mode.

Signed-off-by: Bijosh Thykkoottathil <bijosh.t@hotmail.com>
Acked-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-05 21:05:01 +01:00
Bijosh Thykkoottathil 1a965d405f drivers:iio:accel:mma8452: added cleanup provision in case of failure.
mma8452_set_freefall_mode can return -ve value in case if
i2c_smbus_read_byte_data fails. This function is called from mma8452_probe,
and returning -ve value from probe indicates probe failure. Need to call
iio_triggered_buffer_cleanup & iio_trigger_cleanup in this case.

Signed-off-by: Bijosh Thykkoottathil <bijosh.t@hotmail.com>
Acked-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-05 21:03:40 +01:00
Jonathan Cameron 21d41655f5 iio: Add iio.git tree to MAINTAINERS
The tree has been in the same location for a long time.  Putting it in
MAINTAINERS makes it easy for those new to, or less familiar with IIO
to find the correct tree to base patches on.

Mostly basing on staging-next is fine as well unless working on a very
active driver.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:19:16 +01:00
Gregor Boirie 060a518eda iio:st_pressure: clean useless static channel initializers
Some static channels are explicitly initialized with default values.
Remove them to enhance readability.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:13:54 +01:00
Gregor Boirie 85d79136d3 iio:st_pressure:lps22hb: temperature support
Implement lps22hb temperature sampling channel.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:13:02 +01:00
Gregor Boirie 05167cdce0 iio:st_pressure:lps22hb: open drain support
Add support for open drain interrupt line.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:12:21 +01:00
Gregor Boirie b4701fd692 iio:st_pressure: temperature triggered buffering
Enable support for triggered buffering of temperature samples.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:11:52 +01:00
Gregor Boirie 19b7b8a89b iio:st_pressure: document sampling gains
Details scaling factors and offsets applied to raw temperature and pressure
samples.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:11:26 +01:00
Gregor Boirie c9d5e5b97e iio:st_pressure: align storagebits on power of 2
Sampled pressure data are 24 bits long and should be stored in a 32 bits
word.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:11:07 +01:00
Gregor Boirie e7385de529 iio:st_sensors: align on storagebits boundaries
Ensure triggered buffering memory accesses are properly aligned on per
channel storagebits boundaries.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04 18:07:45 +01:00