summaryrefslogtreecommitdiffstats
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
* iio: dac: ad5446: Add support for AD5641Aida Mynzhasova2013-09-232-1/+7
| | | | | | | | | This patch adds support for the AD5641 single channel, 14-bit, buffered voltage output DAC. Signed-off-by: Aida Mynzhasova <aida.mynzhasova@skitlab.ru> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: pressure-core: st: Provide support for the Vdd_IO power supplyLee Jones2013-09-231-1/+12
| | | | | | | | | | | The power to some of the sensors are controlled by regulators. In most cases these are 'always on', but if not they will fail to work until the regulator is enabled using the relevant APIs. This patch allows for the Vdd_IO power supply to be specified by either platform data or Device Tree. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: pressure-core: st: Provide support for the Vdd power supplyLee Jones2013-09-231-0/+28
| | | | | | | | | | | The power to some of the sensors are controlled by regulators. In most cases these are 'always on', but if not they will fail to work until the regulator is enabled using the relevant APIs. This patch allows for the Vdd power supply to be specified by either platform data or Device Tree. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Merge tag 'iio-for-3.13a' of ↵Greg Kroah-Hartman2013-09-2256-489/+3445
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First round of new drivers, functionality and cleanups for IIO in the 3.13 cycle A number of new drivers and some new functionality + a lot of cleanups all over IIO. New Core Elements 1) New INT_TIME info_mask element for integration time, which may have different effects on measurement noise and similar, than an amplifier and hence is different from existing SCALE. Already existed in some drivers as a custom attribute. 2) Introduce a iio_push_buffers_with_timestamp helper to cover the common case of filling the last 64 bits of data to be passed to the buffer with a timestamp. Applied to lots of drivers. Cuts down on repeated code and moves a slightly fiddly bit of logic into a single location. 3) Introduce info_mask_[shared_by_dir/shared_by_all] elements to allow support of elements such as sampling_frequency which is typically shared by all input channels on a device. This reduces code and makes these controls available from in kernel consumers of IIO devices. New drivers 1) MCP3422/3/4 ADC 2) TSL4531 ambient light sensor 3) TCS3472/5 color light sensor 4) GP2AP020A00F ambient light / proximity sensor 5) LPS001WP support added to ST pressure sensor driver. New driver functionality 1) ti_am335x_adc Add buffered sampling support. This device has a hardware fifo that is fed directly into an IIO kfifo buffer based on a watershed interrupt. Note this will act as an example of how to handle this increasingly common type of device. The only previous example - sca3000 - take a less than optimal approach which is largely why it is still in staging. A couple of little cleanups for that new functionality followed later. Core cleanups: 1) MAINTAINERS - Sachin actually brought my email address up to date because I said I'd do it and never got around to it :) 2) Assign buffer list elements as single element lists to simplify the iio_buffer_is_active logic. 3) wake_up_interruptible_poll instead of wake_up_interruptible to only wake up threads waiting for poll notifications. 4) Add O_CLOEXEC flag to anon_inode_get_fd call for IIO event interface. 5) Change iio_push_to_buffers to take a void * pointer so as to avoid some annoying and unnecessary type casts. 6) iio_compute_scan_bytes incorrectly took a long rather than unsigned long. 7) Various minor tidy ups. Driver cleanups (in no particular order) 1) Another set of devm_ allocations patches from Sachin Kamat. 2) tsl2x7x - 0 to NULL cleanup. 3) hmc5843 - fix missing > in MODULE_AUTHOR 4) Set of strict_strto* to kstrto* conversions. 5) mxs-lradc - fix ordering of resource removal to match creation 6) mxs-lradc - add MODULE_ALIAS 7) adc7606 - drop a work pending test duplicated in core functions. 8) hmc5843 - devm_ allocation patch 9) Series of redundant breaks removed. 10) ad2s1200 - pr_err -> dev_err 11) adjd_s311 - use INT_TIME 12) ST sensors - large set of cleanups from Lee Jones and removed restriction to using only triggers provided by the st_sensors themselves from Dennis Ciocca. 13) dummy and tmp006 provide sampling_frequency via info_mask_shared_by_all. 14) tcs3472 - fix incorrect buffer size and wrong device pointer used in suspend / resume functions. 15) max1363 - use defaults for buffer setup ops as provided by the triggered buffer helpers as they are the same as were specified in max1363 driver. 16) Trivial tidy ups in a number of other drivers.
| * iio: ti_am335x_adc: cleanup error caseZubair Lutfullah2013-09-221-10/+0
| | | | | | | | | | | | | | Driver is functional without this error case. Cleaned up. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ti_am335x_adc: cleanup trigger related codeZubair Lutfullah2013-09-221-4/+0
| | | | | | | | | | | | | | | | Trigger related headers and variables are not needed as driver is now based on INDIO_BUFFER_HARDWARE mode Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ti_am335x_adc: fix static in function headerZubair Lutfullah2013-09-221-1/+1
| | | | | | | | | | | | | | | | Static is missing in function header. Corrected. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:press: Register buffer also without specific triggerDenis CIOCCA2013-09-211-9/+8
| | | | | | | | | | | | | | 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:magn: Register buffer also without specific triggerDenis CIOCCA2013-09-211-8/+8
| | | | | | | | | | | | | | 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: Register buffer also without specific triggerDenis CIOCCA2013-09-211-9/+8
| | | | | | | | | | | | | | 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:accel: Register buffer also without specific triggerDenis CIOCCA2013-09-211-9/+8
| | | | | | | | | | | | | | 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: magn-core: st: Clean up error handling in probe()Lee Jones2013-09-211-9/+10
| | | | | | | | | | | | | | | | | | 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: gyro-core: st: Clean up error handling in probe()Lee Jones2013-09-211-9/+10
| | | | | | | | | | | | | | | | | | 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: accel-core: st: Clean up error handling in probe()Lee Jones2013-09-211-9/+10
| | | | | | | | | | | | | | | | | | 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: pressure: st: Add support for new LPS001WP pressure sensorLee Jones2013-09-213-0/+86
| | | | | | | | | | | | | | | | Here we use existing practices to introduce support for another pressure/temperature sensor, the LPS001WP. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: pressure-core: st: Clean-up probe() functionLee Jones2013-09-211-13/+15
| | | | | | | | | | | | | | | | This patch contains some pretty basic clean-ups in probe() pertaining to the simplification of error handling and a couple of readability adaptions. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data()Lee Jones2013-09-211-5/+3
| | | | | | | | | | | | | | Gets rid of those unnecessary gotos. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: sensors-core: st: Clean-up error handling in st_sensors_init_sensor()Lee Jones2013-09-211-5/+4
| | | | | | | | | | | | | | | | | | Strip out all those unnecessary gotos and just return the error right away. Aids to simplicity and reduces code. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: sensors-core: st: Support sensors which don't have a Data Ready pinLee Jones2013-09-212-12/+24
| | | | | | | | | | | | | | | | Not all ST's sensors support data ready, so let's make the declaration of one conditional. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:gp2ap020a00f: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-7/+2
| | | | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:tcs3472: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-4/+2
| | | | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adjd_s311: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-4/+1
| | | | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:mpu6050: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-4/+2
| | | | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Ge Gao <ggao@invensense.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adis_lib: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-7/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adis16400: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-7/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:itg3200: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-4/+1
| | | | | | | | | | | | | | | | 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:st_sensors: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-5/+2
| | | | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Denis Ciocca <denis.ciocca@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:max1363: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-6/+1
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:at91_adc: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-7/+1
| | | | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Josh Wu <josh.wu@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad_sigma_delta: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-5/+1
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad7923: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-8/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad7887: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-8/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad7476: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-7/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad7298: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-8/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad7266: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-3/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:bma180: Use iio_push_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-5/+2
| | | | | | | | | | | | | | | | 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>
| * iio: Pass scan mask as unsigned longPeter Meerwald2013-09-211-2/+2
| | | | | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Fix tcs3472 dev-to-indio_dev conversion in suspend/resumePeter Meerwald2013-09-211-2/+5
| | | | | | | | | | | | | | dev_to_iio_dev() is a false friend Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ti_am335x_adc: Add continuous sampling supportZubair Lutfullah2013-09-212-5/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the driver had only one-shot reading functionality. This patch adds continuous sampling support to the driver. Continuous sampling starts when buffer is enabled. HW IRQ wakes worker thread that pushes samples to userspace. Sampling stops when buffer is disabled by userspace. Patil Rachna (TI) laid the ground work for ADC HW register access. Russ Dill (TI) fixed bugs in the driver relevant to FIFOs and IRQs. I fixed channel scanning so multiple ADC channels can be read simultaneously and pushed to userspace. Restructured the driver to fit IIO ABI. And added INDIO_BUFFER_HARDWARE mode. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Russ Dill <Russ.Dill@ti.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ti_am335x_adc: optimize memory usageZubair Lutfullah2013-09-211-2/+2
| | | | | | | | | | | | | | | | 12 bit ADC data is stored in 32 bits of storage. Change from u32 to u16 to reduce wasted memory. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: at91_adc: Cocci spatch "noderef"Thomas Meyer2013-09-201-1/+1
| | | | | | | | | | | | | | | | | | sizeof when applied to a pointer typed expression gives the size of the pointer. Found by coccinelle spatch "misc/noderef.cocci" Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Make available scan_masks const in ad7266Peter Meerwald2013-09-181-4/+4
| | | | | | | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Minor cleanups of industrialio-bufferPeter Meerwald2013-09-181-5/+8
| | | | | | | | | | | | | | | | adding one return value check fix one kerneldoc Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:max1361: Use default triggered buffer setup opsLars-Peter Clausen2013-09-161-7/+1
| | | | | | | | | | | | | | | | | | The max1361 driver uses the same callbacks as the triggered buffer default buffer setup ops, so just remove the max1361 specific ops and let it use the default ops. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Remove unnecessary casts for iio_push_to_buffers()Lars-Peter Clausen2013-09-1513-21/+25
| | | | | | | | | | | | | | | | 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: iio_push_to_buffers(): Change type of 'data' to const void *Lars-Peter Clausen2013-09-153-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the type of the 'data' parameter for iio_push_to_buffers() from 'u8 *' to 'const void *'. Drivers typically use the correct type (e.g. __be16 *) for their data buffer. When passing the buffer to iio_push_to_buffers() it needs to be cast to 'u8 *' for the compiler to not complain (and also having to add __force if we want to keep sparse happy as well). Since the buffer implementation should not care about the data layout (except the size of one sample) using a void pointer is the correct thing to do. Also make it const as the buffer implementations are not supposed to modify it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:buffer_cb: Constify iio_cb_accessLars-Peter Clausen2013-09-151-1/+1
| | | | | | | | | | | | | | The iio_cb_access struct is never modified so we can mark it as const. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Fix tcs3472 buffer sizePeter Meerwald2013-09-151-4/+1
| | | | | | | | | | | | | | and drop obsolete #define Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:temperature:tmp006 put sampling_frequency in info_mask_shared_by_allJonathan Cameron2013-09-151-30/+27
| | | | | | | | | | | | | | | | Doing this makes it possible to access this control from within the kernel. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Peter Meerwald <pmeerw@pmeerw.net> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
| * iio: add info_mask_[shared_by_dir/shared_by_all]Jonathan Cameron2013-09-151-0/+30
| | | | | | | | | | | | | | | | | | | | | | These two additional info_mask bitmaps should allow all 'standard' numeric attributes to be handled using the read_raw and write_raw callbacks. Whilst this should reduce code, the more important element is that this makes these values easily accessible to in kernel users of IIO devices. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
OpenPOWER on IntegriCloud