- 10 1月, 2018 1 次提交
-
-
由 Arnaud Pouliquen 提交于
Extend the inkern API with functions for reading and writing attribute of iio channels. Signed-off-by: NArnaud Pouliquen <arnaud.pouliquen@st.com> Reviewed-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 7月, 2017 1 次提交
-
-
由 Rob Herring 提交于
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: NRob Herring <robh@kernel.org> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Cc: Carlo Caione <carlo@caione.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: linux-iio@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 15 7月, 2017 1 次提交
-
-
由 Gaurav Gupta 提交于
When adding maps to the list, they were added using list_add, which adds them in LIFO order. When parsing using iio_channel_get_all(), these elements are hence returned in reverse order. As a result, the iio_hwmon mapping maps the first entry to the last channel and so on. Signed-off-by: NGaurav Gupta <gauragup@cisco.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 03 6月, 2017 1 次提交
-
-
由 Peter Rosin 提交于
Extend the inkern api with functions for reading and writing ext_info of iio channels. Acked-by: NJonathan Cameron <jic23@kernel.org> Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 26 4月, 2017 1 次提交
-
-
由 Peter Rosin 提交于
Avoid this smatch error: drivers/iio/inkern.c:751 iio_read_avail_channel_raw() error: double unlock 'mutex:&chan->indio_dev->info_exist_lock' Fixes: 00c5f80c ("iio: inkern: add helpers to query available values from channels") Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 14 1月, 2017 1 次提交
-
-
由 Linus Walleij 提交于
When a consumer calls iio_read_channel_processed() the IIO core tries to apply scaling to the value, but if the channel only supports reading raw values, we should return that raw value to the cosumer instead of an error. This is what userspace is expected to do with sensors only providing raw values so the kernel should do the same, so as to avoid adding scaling boilerplate to drivers for hardware that actually return processed values from raw reads. A sensor not providing a scale, but providing a _raw attribute could be valid if for example the scale is the default of 1, but an offset needs to be applied to convert to the _processed form. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 13 11月, 2016 1 次提交
-
-
由 Peter Rosin 提交于
Specifically a helper for reading the available maximum raw value of a channel and a helper for forwarding read_avail requests for raw values from one iio driver to an iio channel that is consumed. These rather specific helpers are in turn built with generic helpers making it easy to build more helpers for available values as needed. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 28 9月, 2016 1 次提交
-
-
由 Matt Ranostay 提交于
Allow access to underlying channel IIO_CHAN_INFO_OFFSET from a consumer. Signed-off-by: NMatt Ranostay <matt@ranostay.consulting> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 20 4月, 2016 2 次提交
-
-
由 Laxman Dewangan 提交于
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: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Laxman Dewangan 提交于
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: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 16 4月, 2016 1 次提交
-
-
由 Slawomir Stepien 提交于
This fixes the error reported by checkpatch.pl: ERROR: space required before the open parenthesis '(' Signed-off-by: NSlawomir Stepien <sst@poczta.fm> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 30 1月, 2016 1 次提交
-
-
由 Dan Carpenter 提交于
In twl4030_bci_probe() there are some failure paths where we call iio_channel_release() with a NULL pointer. (Apparently, that driver can opperate without a valid channel pointer). Let's fix it by adding a NULL check in iio_channel_release(). Fixes: 2202e1fc ('drivers: power: twl4030_charger: fix link problems when building as module') Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Cc: <Stable@vger.kernel.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 13 12月, 2015 1 次提交
-
-
由 Anshul Garg 提交于
Use list_for_each_entry_safe instead of list_for_each_safe and list_entry call. Signed-off-by: NAnshul Garg <aksgarg1989@gmail.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 06 1月, 2015 1 次提交
-
-
由 Stefan Wahren 提交于
If the DT contains an invalid channel specifier then the probe of iio_hwmon fails with the following message: iio_hwmon: probe of iio_hwmon failed with error -22 So it's better to print out the relevant channel specifier in error case to locate the problem. Signed-off-by: NStefan Wahren <stefan.wahren@i2se.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 01 1月, 2015 1 次提交
-
-
由 Fabien Proriol 提交于
When xilinx-xadc is used with hwmon driver to read voltage, offset used for temperature is always applied whatever the channel. iio_channel_read must return an error to avoid offset for channel without IIO_CHAN_INFO_OFFSET property. Signed-off-by: NFabien Proriol <fabien.proriol@jdsu.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 12 12月, 2014 1 次提交
-
-
由 Dmitry Eremin-Solenikov 提交于
Introduce API for easy in-kernel setting of DAC values. Signed-off-by: NDmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 25 10月, 2014 1 次提交
-
-
由 Ivan T. Ivanov 提交于
When #iio-cells is greater than '0', the driver could provide a custom of_xlate function that reads the *args* and returns the appropriate index in registered IIO channels array. Add simple translation function, suitable for the most 1:1 mapped channels in IIO chips, and use it when driver did not provide custom implementation. Signed-off-by: NIvan T. Ivanov <iivanov@mm-sol.com> Reviewed-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 25 8月, 2014 1 次提交
-
-
由 Johannes Pointner 提交于
Fixes: a2c12493 ('iio: of_iio_channel_get_by_name() returns non-null pointers for error legs') which improperly assumes that of_iio_channel_get_by_name must always return NULL and thus now hides -EPROBE_DEFER. Signed-off-by: NJohannes Pointner <johannes.pointner@br-automation.com> Reviewed-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NJonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
-
- 21 6月, 2014 1 次提交
-
-
由 Adam Thomson 提交于
Currently in the inkern.c code for IIO framework, the function of_iio_channel_get_by_name() will return a non-NULL pointer when it cannot find a channel using of_iio_channel_get() and when it tries to search for 'io-channel-ranges' property and fails. This is incorrect behaviour as the function which calls this expects a NULL pointer for failure. This patch rectifies the issue. Signed-off-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
-
- 30 4月, 2014 1 次提交
-
-
由 Srinivas Pandruvada 提交于
This callback is introduced to overcome some limitations of existing read_raw callback. The functionality of both existing read_raw and read_raw_multi is similar, both are used to request values from the device. The current read_raw callback allows only two return values. The new read_raw_multi allows returning multiple values. Instead of passing just address of val and val2, it passes length and pointer to values. Depending on the type and length of passed buffer, iio client drivers can return multiple values. Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 17 3月, 2014 1 次提交
-
-
由 Sebastian Reichel 提交于
Add iio_read_channel_average_raw to support reading averaged raw values in consumer drivers. Signed-off-by: NSebastian Reichel <sre@debian.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 04 7月, 2013 1 次提交
-
-
由 Alexandre Belloni 提交于
When reading IIO_CHAN_INFO_OFFSET, the return value of iio_channel_read() for success will be IIO_VAL*, checking for 0 is not correct. Without this fix the offset applied by iio drivers will be ignored when converting a raw value to one in appropriate base units (e.g mV) in a IIO client drivers that use iio_convert_raw_to_processed including iio-hwmon. Cc: <stable@vger.kernel.org> # 3.10.x Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 05 6月, 2013 2 次提交
-
-
由 Michael Hennerich 提交于
Signed-off-by: NMichael Hennerich <michael.hennerich@analog.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Joe Perches 提交于
The code uses return foo; goto err_type; when instead the form should have been ret = foo; goto err_type; Here this causes a useful iio_device_put to be skipped. Signed-off-by: NJoe Perches <joe@perches.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 16 3月, 2013 1 次提交
-
-
由 Guenter Roeck 提交于
Provide bindings and parse OF data during initialization. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 07 2月, 2013 1 次提交
-
-
由 Guenter Roeck 提交于
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: NGuenter Roeck <linux@roeck-us.net> Acked-by: NAnton Vorontsov <anton@enomsg.org> Acked-by: NChanwoo Choi <cw00.choi@samsung.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 02 2月, 2013 2 次提交
-
-
由 Guenter Roeck 提交于
Instead of requiring the map to unregister, simply unregister all map entries associated with the given iio device. This simplifies map removal and also works for maps generated through devicetree. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Guenter Roeck 提交于
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: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 10 11月, 2012 1 次提交
-
-
由 Jonathan Cameron 提交于
Used to allow information about a given channel mapping to be passed through from board files to the consumer drivers. Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 20 10月, 2012 1 次提交
-
-
由 Lars-Peter Clausen 提交于
For ADCs or DACs the denominator for fractional types often is a power of two. In this case we can use a shift operation instead of the rather expensive 64 bit division. This patch adds a new fractional type which expects the denominator to be specified as the log2 of the actual denominator. E.g. for ADCs and DACs this will usually be the number of significant bits. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 19 10月, 2012 1 次提交
-
-
由 Lars-Peter Clausen 提交于
Fixes the following warnings from coccicheck: drivers/iio/inkern.c:81:6-14: WARNING: Comparison to bool drivers/iio/dac/ad5686.c:191:5-11: WARNING: Comparison to bool Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 22 9月, 2012 2 次提交
-
-
由 Kim, Milo 提交于
When the IIO consumer tries to get specific IIO channel, few error cases can be happened. (a) Memory allocation failure (b) No matched ADC channel error (c) Invalid input arguments This patch enables cleaning up error handling in case of (a) and (b). In error handling code, (a): the reference count of the IIO device should be decreased. (b): the allocated memory should be freed with restoring the reference count. Therefore iio_deivce_put() is called in both cases. This can be handled in the last error statement. Additionally, integer variable is used for stating each error case explicitly. Then, the error returns as ERR_PTR() with this value. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Kim, Milo 提交于
The reference count of the IIO device is increased if the IIO map has matched consumer name. After then, it tries to allocate the iio_channel which is used by the consumer. If it fails to allocate memory, the reference count should be decreased. This patch enables restoring the reference count of the IIO device. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 18 9月, 2012 2 次提交
-
-
由 Lars-Peter Clausen 提交于
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: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Kim, Milo 提交于
The datasheet name is defined in the IIO driver. On the other hand, the adc_channel_label is configured in the platform side. If the datasheet name is not matched with any adc_channel_label, the iio_channel_get() should be returned as error for preventing invalid channel data access. This can be handled either way. (a) checking null data when using it : in the xxx_read_raw() or (b) error returns when the channel is requested : this patch The IIO consumer can't use the channel with invalid channel spec. Therefore case (b) is more reasonable. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 15 9月, 2012 1 次提交
-
-
由 Kim, Milo 提交于
Use kzalloc() rather than kmalloc() for initializing the iio_channel structure. This patch enables the iio_dev and iio_chan_spec are set to NULL. This may prevent the page fault problem because the pointer of iio_chan_spec is initialized as NULL. The iio_chan_spec is updated only in case that the IIO map has specific channel label. When the map has no ADC channel label, then the value of iio_chan_spec remains as invalid pointer. To prevent this problem, the pointer should be initialized as NULL. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 28 8月, 2012 1 次提交
-
-
由 Kim, Milo 提交于
(a) For better readability, replace 0 with IIO_CHAN_INFO_RAW. (b) Make same line-format as other apis() : iio_read_channel_scale() and iio_read_channel_offset() Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 13 7月, 2012 1 次提交
-
-
由 Dan Carpenter 提交于
We should be holding the mutex when we goto error_free_chans. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 09 7月, 2012 1 次提交
-
-
由 Jonathan Cameron 提交于
The device_get is after this point so on error we should not be removing it. Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 30 6月, 2012 1 次提交
-
-
由 Jonathan Cameron 提交于
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: NJonathan Cameron <jic23@kernel.org>
-