summaryrefslogtreecommitdiffstats
path: root/include/linux/iio/consumer.h
Commit message (Collapse)AuthorAgeFilesLines
* iio: core: Add devm_ APIs for iio_channel_{get,release}_allLaxman Dewangan2016-04-191-0/+26
| | | | | | | | | | | | | | | | | | Some of kernel driver uses the IIO framework to get the sensor value via ADC or IIO HW driver. The client driver get iio channel by iio_channel_get_all() and release it by calling iio_channel_release_all(). Add resource managed version (devm_*) of these APIs so that if client calls the devm_iio_channel_get_all() then it need not to release it explicitly, it can be done by managed device framework when driver get un-binded. This reduces the code in error path and also need of .remove callback in some cases. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: core: Add devm_ APIs for iio_channel_{get,release}Laxman Dewangan2016-04-191-0/+27
| | | | | | | | | | | | | | | | Some of kernel driver uses the IIO framework to get the sensor value via ADC or IIO HW driver. The client driver get iio channel by iio_channel_get() and release it by calling iio_channel_release(). Add resource managed version (devm_*) of these APIs so that if client calls the devm_iio_channel_get() then it need not to release it explicitly, it can be done by managed device framework when driver get un-binded. This reduces the code in error path and also need of .remove callback in some cases. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* include: linux: iio: Fix function parameter name in kernel docCristina Opriceana2015-08-021-1/+1
| | | | | | | Fix buffer name from kernel doc according to the function parameter. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: consumer.h: Fix scale factor in function commentIvan T. Ivanov2014-12-121-1/+1
| | | | | | | 1 milivolt is equal to 1000000 nanovolts. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: inkern: add iio_write_channel_rawDmitry Eremin-Solenikov2014-12-121-0/+10
| | | | | | | Introduce API for easy in-kernel setting of DAC values. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: inkern: add iio_read_channel_average_rawSebastian Reichel2014-03-161-0/+13
| | | | | | | | Add iio_read_channel_average_raw to support reading averaged raw values in consumer drivers. Signed-off-by: Sebastian Reichel <sre@debian.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: iio_push_to_buffers(): Change type of 'data' to const void *Lars-Peter Clausen2013-09-151-1/+1
| | | | | | | | | | | | | | 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: Update iio_channel_get API to use consumer device pointer as argumentGuenter Roeck2013-02-061-2/+3
| | | | | | | | | | For iio_channel_get to work with OF based configurations, it needs the consumer device pointer instead of the consumer device name as argument. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Anton Vorontsov <anton@enomsg.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Update iio_channel_get_all and iio_channel_get_all_cb APIGuenter Roeck2013-02-021-4/+5
| | | | | | | | | Pass device pointer instead of device name as parameter to iio_channel_get_all and iio_channel_get_all_cb. This will enable us to use OF information to retrieve consumer channel information. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* IIO: fix build error in lp8788-charger.cGreg Kroah-Hartman2012-11-131-0/+2
| | | | | | | | | Turns out that consumer.h needs to include types.h on some platforms to build properly (like powerpc). Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:iio: add a callback buffer for in kernel push interfaceJonathan Cameron2012-11-101-0/+46
| | | | | | | | This callback buffer is meant to be opaque to users, but basically adds a very simple pass through buffer to which data may be pushed when it is inserted into the buffer list. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging:iio:in kernel users: Add a data field for channel specific info.Jonathan Cameron2012-11-101-0/+2
| | | | | | | Used to allow information about a given channel mapping to be passed through from board files to the consumer drivers. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:inkern: Add function to read the processed valueLars-Peter Clausen2012-09-171-0/+38
| | | | | | | | | | | | | Add a function to read a processed value from a channel. The function will first attempt to read the IIO_CHAN_INFO_PROCESSED attribute. If that fails it will read the IIO_CHAN_INFO_RAW attribute and convert the result from a raw value to a processed value. The patch also introduces a function to convert raw value to a processed value and exports it, in case a user needs or wants to do the conversion by itself. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: consumer.h: Fix kernel doc incosistencyLars-Peter Clausen2012-09-171-2/+2
| | | | | | | | | | | | | | | | For the iio_read_channel_raw and iio_read_channel_scale the kerneldoc comment refers to an argument called "channel", while the argument is called "chan" in the function signature. This leads to the following warnings from kerneldoc: Warning(include/linux/iio/consumer.h:71): No description found for parameter 'chan' Warning(include/linux/iio/consumer.h:71): Excess function parameter 'channel' description in 'iio_read_channel_raw' Warning(include/linux/iio/consumer.h:109): No description found for parameter 'chan' Warning(include/linux/iio/consumer.h:109): Excess function parameter 'channel' description in 'iio_read_channel_scale' This patch fixes the warnings by naming them consistently. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:consumer.h: Fix include guardLars-Peter Clausen2012-08-271-1/+1
| | | | | | | | The symbol name for the #ifndef and the #define of the include guard do not match and thus it becomes quite ineffective. Add the missing '_' to fix this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Rename _st_ functions to loose the bit that meant the staging version.Jonathan Cameron2012-06-301-17/+17
| | | | | | | | | These were originally introduced when the plan was to have parallel IIO cores in and out of staging with a slow move between them. Now we have reached the point where the whole core has moved, they need clearing up! Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* IIO: Move core headers to include/linux/iioJonathan Cameron2012-04-251-0/+96
Step 1 in moving the IIO core out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud