summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tools: iio: iio_generic_buffer: rename and change type of force variableEva Rachel Retuya2016-10-231-4/+5
| | | | | | | | | Replace the type of 'force' flag from int to bool and at the same time rename it to 'force_autochannels' for better readability. Suggested-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Documentation: dt: iio: humidity: add hts221 sensor device bindingLorenzo Bianconi2016-10-231-0/+22
| | | | | | Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: humidity: add support to hts221 rh/temp combo deviceLorenzo Bianconi2016-10-237-0/+1193
| | | | | | | | | | | | | | Add support to STM HTS221 humidity + temperature sensor http://www.st.com/resource/en/datasheet/hts221.pdf - continuous mode support - i2c support - spi support - trigger mode support Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: light: ltr501: claim direct mode during raw writesAlison Schofield2016-10-231-30/+51
| | | | | | | | | | Driver was checking for direct mode but not locking it. Use claim/release helper functions to guarantee the device stays in direct mode during all raw write operations. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: light: ltr501: claim direct mode during select raw readsAlison Schofield2016-10-231-10/+20
| | | | | | | | | | Driver was checking for direct mode but not locking it. Use claim/release helper functions to guarantee the device stays in direct mode during required raw read cases. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:accel:sca3000 Move out of staging.Jonathan Cameron2016-10-235-13/+14
| | | | | | | | Now the driver is in a reasonable state, lets get it (finally) out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 kernel docify comments that were nearly kernel doc.Jonathan Cameron2016-10-231-29/+77
| | | | | | | Basic tidy up of comments to bring them into a standard style. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 small checkpatch fixes (alignment etc)Jonathan Cameron2016-10-231-2/+2
| | | | | | | | Tidied up where checkpatch warning suppressions doesn't effect the readability of the code. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 Tidy up probe order to avoid a race.Jonathan Cameron2016-10-231-8/+6
| | | | | | | | | Previously the device was exposed to userspace and in kernel consumers before the interrupts had been configured. As nothing stopped them being enabled in the interval this could cause unhandled interrupts. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 replace non standard revision attr with dev_info ↵Jonathan Cameron2016-10-231-14/+12
| | | | | | | | | | | on probe There seems little point in being able to query the part revision number via sysfs. Hence just put it in the kernel logs during probe incase anyone ever wants to know. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 Drop custom measurement mode attributesJonathan Cameron2016-10-231-139/+0
| | | | | | | | | | This is now represented by the standard 3db filter frequency controls. Things get complex wrt to the sampling frequency as these modes change but that is fine under the IIO ABI where any value is allowed to effect any other. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 Add write support to the low pass filter controlJonathan Cameron2016-10-231-0/+55
| | | | | | | | | Also includes an available attribute. The ordering of values appears a bit random, but as the ABI doesn't specify this and we already have both rising and falling lists I think this is fine. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000: Fix off by one error in axis due to IIO_NO_MODJonathan Cameron2016-10-231-10/+11
| | | | | | | | Given the introduction of IIO_NO_MOD was prior to the first submission prior to IIO entering staging this has been broken for a while. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 add readback of the 3db low pass filter frequencyJonathan Cameron2016-10-231-1/+47
| | | | | | | Driving towards getting rid of the non standard mode control interface. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 Clean up register defines.Jonathan Cameron2016-10-231-163/+165
| | | | | | | | | Introduce some more masks and generally drive towards consistent naming. Note the small indents used to indicate parts of registers + parts of multiplexed registers. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 use a 'fake' channel to handle freefall event ↵Jonathan Cameron2016-10-231-148/+155
| | | | | | | | | | | registration. This is an approach used in some newer drivers as it exposes the compound channel events to the core rather than hiding their control in sysfs attributes entirely via the driver. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 drop some unused variables.Jonathan Cameron2016-10-231-5/+0
| | | | | Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 move to hybrid hard / soft buffer design.Jonathan Cameron2016-10-233-214/+72
| | | | | | | | | | | | | | In a similar fashion to other newer drivers (e.g. ti_am335x), instead of using the hardware buffer support in IIO to directly access the hardware fifo, insert a software fifo and feed that from the hardware one when interrupts occur. This gives a simpler structure to the data flows and allows more flexibility over how often data is shipped to userspace etc. This was also the only direct user of the simplistic generalization found in ring_hw.h so that header is removed. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 Drop custom ABI for watersheds.Jonathan Cameron2016-10-231-70/+41
| | | | | | | | For now we support only the 50% watershed interrupt and start and stop it as part of the buffer bring up. The 75% case may come back in future. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 Fix clearing of flag + setting of size of scan.Jonathan Cameron2016-10-231-0/+13
| | | | | | | | | | | | | Not clearing the stuff_to_read flag can lead to a false flag being set on restarting the buffer if the data was not all read the previous time. The size of the scan is needed to ensure the function iio_buffer_read_first_n_outer actually tries to read the data. This stuff has been broken for some time so not stable material. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 drop sca3000_register_ring_funcsJonathan Cameron2016-10-231-6/+1
| | | | | | | | This was needed when the buffer support was optional. Pointless wrapper now so drop it. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 merge files into one.Jonathan Cameron2016-10-234-633/+495
| | | | | | | | | | | | | | In the early days of IIO we were much more inclined to keep the impact of the core IIO elements to the minimum. As time has moved on it has become clear that hardly any builds are done without buffer support and that it adds considerable complexity to the drivers. Hence merge down the buffer and non buffer elements of the sca3000 driver also allowing us to drop the header file used for the interfaces between the two. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging:iio:accel:sca3000 Fix a use before setting of the indio_dev->buffer ↵Jonathan Cameron2016-10-231-1/+1
| | | | | | | pointer. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* staging: iio: isl29018: move out of stagingBrian Masney2016-10-235-13/+13
| | | | | | | Move ISL29018/ISL29023/ISL29035 driver out of staging into mainline. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: add ABI documentation for infrared suppressionBrian Masney2016-10-231-0/+19
| | | | | | | | | Add ABI documentation from the ISL29018 Data Sheet (FN6619.4, Oct 8, 2012) about the infrared suppression that can be controlled with the proximity_on_chip_ambient_infrared_suppression sysfs attribute. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: pressure: mpl3115: claim direct mode during raw readsAlison Schofield2016-10-231-9/+17
| | | | | | | | | 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> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: accel: mma8452: claim direct mode during write rawJonathan Cameron2016-10-231-22/+38
| | | | | | | | | Driver was checking for direct mode but not locking it. Use claim/release helper functions to guarantee the device stays in direct mode during all write raw operations. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: accel: mma8452: claim direct mode during raw readsAlison Schofield2016-10-231-2/+4
| | | | | | | | | 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> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: iio_generic_buffer: add -A to force-enable all channelsEva Rachel Retuya2016-10-231-5/+12
| | | | | | | | | | | | | | If attribute/s is/are already enabled (by default or via scripts or manual interaction), issuing -a will fail to enable the channels thereby one has to manually disable the said attribute/s before proceeding with auto-enabling. Add a command-line option -A to force-activate all channels regardless of their current state. Suggested-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: dac: mcp4725: use regulator frameworkTomas Novotny2016-10-232-10/+37
| | | | | | | | | | | | | | Use a standard framework to get the reference voltage. It is done that way in the iio subsystem and it will simplify extending of the driver. Structure mcp4725_platform_data is left undeleted because it used in the next patch. This change breaks the current users of the driver, but there is no mainline user of struct mcp4725_platform_data. Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: ms65611_core: Fixes dereferencing regulator pointerCrt Mori2016-10-231-11/+8
| | | | | | | | | | | | | | | Change in handling of the regulator description means that static checkers correctly assume we could be using dereferenced pointer to the regulator. In reality we will never get the -ENODEV error, as current behavior flow does not predict it, because: If the device tree or board file does not define suitable regulators for the component, it will be substituted by a dummy regulator, or, if regulators are disabled altogether, by stubs. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Suggested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Crt Mori <cmo@melexis.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: fix a MAINTAINERS entryDan Carpenter2016-10-231-1/+1
| | | | | | | The "drivers/" part of the path name was missing. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: bmi160_core: Fix sparse warning due to incorrect type in assignmentsayli karnik2016-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | There is a type mismatch between the buffer which is of type s16 and the samples stored, which are declared as __le16. Fix the following sparse warning: drivers/iio/imu/bmi160/bmi160_core.c:411:26: warning: incorrect type in assignment (different base types) drivers/iio/imu/bmi160/bmi160_core.c:411:26: expected signed short [signed] [short] [explicitly-signed] <noident> drivers/iio/imu/bmi160/bmi160_core.c:411:26: got restricted __le16 [addressable] [usertype] sample This is a cosmetic-type patch since it does not alter code behaviour. The le16 is going into a 16bit buf element, and is labelled as IIO_LE in the channel buffer definition. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: rename description in Kconfig for consistencyBrian Masney2016-10-231-1/+1
| | | | | | | | Rename description from "ISL 29018" to "Intersil 29018" in Kconfig for consistency with other drivers in mainline. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: remove blank line for consistencyBrian Masney2016-10-231-1/+0
| | | | | | | | Remove blank line between MODULE_DEVICE_TABLE() and its corresponding structure for consistency with the other device table entries. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: combine two return statements into oneBrian Masney2016-10-231-4/+2
| | | | | | | | | Use the return value from isl29018_set_integration_time() as the return value for isl29018_chip_init() since this is the last piece of work inside that function. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: fix multiline comment syntaxBrian Masney2016-10-231-3/+6
| | | | | | | | | | | | | | | | | | | | Change multiline comments from: /* line1 * line2 * ... */ to /* * line1 * line2 * ... */ Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: fix poorly named functionBrian Masney2016-10-231-25/+19
| | | | | | | | isl29035_detect() did not just do chip detection. Move functionality directly into isl29018_chip_init() to avoid naming confusion. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: add newlines to improve readabilityBrian Masney2016-10-231-0/+6
| | | | | | | | Add newlines to improve code readability in preparation for moving the driver out of staging. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:TODO drop outdated entries in this todo.Jonathan Cameron2016-10-231-69/+1
| | | | | | | | | | There is still stuff to be done in the remaining drivers but pretty much nothing was left from this original TODO. Sorry Greg, should have been keeping this up to date. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: iio: cdc: ad7152: Replace mlock with a local mutex locksayli karnik2016-10-231-11/+13
| | | | | | | | | mlock is intended to protect only switches between modes. Given this driver doesn't support more than one mode (sysfs polled reads only), replace mlock with a local mutex lock. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: cdc: ad7746: implement IIO_CHAN_INFO_SAMP_FREQEva Rachel Retuya2016-10-231-70/+50
| | | | | | | | | | | | | | | | This driver predates the availability of IIO_CHAN_INFO_SAMP_FREQ attribute wherein usage has some advantages like it can be accessed by in-kernel consumers as well as reduces the code size. Therefore, use IIO_CHAN_INFO_SAMP_FREQ to implement the sampling_frequency attribute instead of using IIO_DEVICE_ATTR() macro. Move code from the functions associated with IIO_DEVICE_ATTR() into respective read and write hooks with the mask set to IIO_CHAN_INFO_SAMP_FREQ. Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: cdc: ad7152: Implement IIO_CHAN_INFO_SAMP_FREQ attributesayli karnik2016-10-231-51/+67
| | | | | | | | | | | | | | | Attributes that were once privately defined become standard with time and hence a special global define is used. Hence update driver ad7152 to use IIO_CHAN_INFO_SAMP_FREQ which is a global define instead of IIO_DEV_ATTR_SAMP_FREQ. Move functionality from IIO_DEV_ATTR_SAMP_FREQ attribute into IIO_CHAN_INFO_SAMP_FREQ to implement the sampling_frequency attribute. Modify ad7152_read_raw() and ad7152_write_raw() to allow reading and writing the element as well. Also add a lock in the driver's private data. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: add documentation about the infrared suppressionBrian Masney2016-10-111-0/+18
| | | | | | | | | Add documentation from the ISL29018 Data Sheet (FN6619.4, Oct 8, 2012) about the infrared suppression that can be controlled with the proximity_on_chip_ambient_infrared_suppression sysfs attribute. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: isl29018: document device tree bindingsBrian Masney2016-10-111-0/+28
| | | | | | | | | | | | | | Fix the following warnings from checkpatch: WARNING: DT compatible string "isil,isl29018" appears un-documented -- check ./Documentation/devicetree/bindings/ WARNING: DT compatible string "isil,isl29023" appears un-documented -- check ./Documentation/devicetree/bindings/ WARNING: DT compatible string "isil,isl29035" appears un-documented -- check ./Documentation/devicetree/bindings/ Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: meter: ade7758_core: implement IIO_CHAN_INFO_SAMP_FREQSandhya Bankar2016-10-111-23/+63
| | | | | | | | | | | | | This driver predates the availability of IIO_CHAN_INFO_SAMP_FREQ attribute wherein usage has some advantages like it can be accessed by in-kernel consumers as well as reduces the code size. Hence moving functionality from IIO_DEV_ATTR_SAMP_FREQ attribute into IIO_CHAN_INFO_SAMP_FREQ handlers. Also Adding ade7758_read_raw() and ade7758_write_raw() to allow reading/writing the element as well. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* dt: bindings: vendor-prefix: Add 3 accelerometer vendor prefixesHans de Goede2016-10-111-0/+3
| | | | | | | | | | | | | | | | | Recently the kernel has gotten support in the iio subsystem for a number of new accelerometers from mCube, Memsic and MiraMEMS. This commit adds the vendor prefixes already used for these vendors in Documentation/devicetree/bindings/i2c/trivial-devices.txt to vendor-prefixes.txt. The "full" company names were taken from the company's websites: http://www.mcubemems.com/ http://www.memsic.com/ http://www.miramems.com/en/ Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: accel: Add driver for the MiraMEMS DA280 3-axis 14-bit digital ↵Hans de Goede2016-10-114-0/+196
| | | | | | | | | | | | | | accelerometer Add an iio driver for the MiraMEMS DA280 3-axis 14-bit accelerometer, as well as for the DA226 which is a fully compatible 2-axis version. Datasheets for the DA280 and DA226 can be found at the manufacturers site: http://www.miramems.com/en/products.asp?list=1 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQEva Rachel Retuya2016-10-112-55/+30
| | | | | | | | | | | | | | | | | This driver predates the availability of IIO_CHAN_INFO_SAMP_FREQ attribute wherein usage has some advantages like it can be accessed by in-kernel consumers as well as reduces the code size. Therefore, use IIO_CHAN_INFO_SAMP_FREQ to implement the sampling_frequency attribute instead of using IIO_DEV_ATTR_SAMP_FREQ() macro. Move code from the functions associated with IIO_DEV_ATTR_SAMP_FREQ() into respective read and write hooks with the mask set to IIO_CHAN_INFO_SAMP_FREQ. Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: accel: Add driver for the MiraMEMS DA311 3-axis 12-bit digital ↵Hans de Goede2016-10-114-0/+317
| | | | | | | | | | | | | | accelerometer This driver is based on the DA311 Android driver which can be found here: https://git.matricom.net/Firmware/kernel_amlogic_meson-common/tree/1e70113a5befd07debb68f537156def84c5be57a/drivers/amlogic/input/sensor the mir3da_* files are the DA311 driver. Unfortunately there is no datasheet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>