- 19 10月, 2021 40 次提交
-
-
由 Uwe Kleine-König 提交于
When an i2c or spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead in the remove callbacks. As the return value of bma400_remove() is unused then, change the function to not yield a return value. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NAlexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20211013203223.2694577-2-u.kleine-koenig@pengutronix.deSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Mihail Chindris 提交于
This chip is able to generate waveform and using an with the output trigger buffer will be easy to generate one. Signed-off-by: NMihail Chindris <mihail.chindris@analog.com> Reviewed-by: NAlexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20211007080035.2531-7-mihail.chindris@analog.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Alexandru Ardelean 提交于
Now that output (kfifo) buffers are supported, we need to extend the {devm_}iio_triggered_buffer_setup_ext() parameter list to take a direction parameter. This allows us to attach an output triggered buffer to a DAC device. Unfortunately it's a bit difficult to add another macro to avoid changing 5 drivers where {devm_}iio_triggered_buffer_setup_ext() is used. Well, it's doable, but may not be worth the trouble vs just updating all these 5 drivers. Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: NMihail Chindris <mihail.chindris@analog.com> Link: https://lore.kernel.org/r/20211007080035.2531-4-mihail.chindris@analog.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Lars-Peter Clausen 提交于
Add output buffer support to the kfifo buffer implementation. The implementation is straight forward and mostly just wraps the kfifo API to provide the required operations. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: NMihail Chindris <mihail.chindris@analog.com> Link: https://lore.kernel.org/r/20211007080035.2531-3-mihail.chindris@analog.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Mihail Chindris 提交于
Currently IIO only supports buffer mode for capture devices like ADCs. Add support for buffered mode for output devices like DACs. The output buffer implementation is analogous to the input buffer implementation. Instead of using read() to get data from the buffer write() is used to copy data into the buffer. poll() with POLLOUT will wakeup if there is space available. Drivers can remove data from a buffer using iio_pop_from_buffer(), the function can e.g. called from a trigger handler to write the data to hardware. A buffer can only be either a output buffer or an input, but not both. So, for a device that has an ADC and DAC path, this will mean 2 IIO buffers (one for each direction). The direction of the buffer is decided by the new direction field of the iio_buffer struct and should be set after allocating and before registering it. Co-developed-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Co-developed-by: NAlexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: NMihail Chindris <mihail.chindris@analog.com> Link: https://lore.kernel.org/r/20211007080035.2531-2-mihail.chindris@analog.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Roan van Dijk 提交于
Add entries from Documentation/ABI/testing/sysfs-bus-iio-scd30 to Documentation/ABI/testing/sysfs-bus-iio. The attributes of the scd4x and scd30 are common. Remove Documentation/ABI/testing/sysfs-bus-iio-scd30. Signed-off-by: NRoan van Dijk <roan@protonic.nl> Link: https://lore.kernel.org/r/20211008101706.755942-5-roan@protonic.nlSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Roan van Dijk 提交于
This is a driver for the SCD4x CO2 sensor from Sensirion. The sensor is able to measure CO2 concentration, temperature and relative humdity. The sensor uses a photoacoustic principle for measuring CO2 concentration. An I2C interface is supported by this driver in order to communicate with the sensor. Signed-off-by: NRoan van Dijk <roan@protonic.nl> Link: https://lore.kernel.org/r/20211008101706.755942-4-roan@protonic.nlSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Roan van Dijk 提交于
Signed-off-by: NRoan van Dijk <roan@protonic.nl> Link: https://lore.kernel.org/r/20211008101706.755942-3-roan@protonic.nlSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Roan van Dijk 提交于
Add documentation for the SCD4x carbon dioxide sensor from Sensirion. Reviewed-by: NRob Herring <robh@kernel.org> Signed-off-by: NRoan van Dijk <roan@protonic.nl> Link: https://lore.kernel.org/r/20211008101706.755942-2-roan@protonic.nlSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928014156.1491-4-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928014156.1491-2-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928014403.1563-2-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928014403.1563-1-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928014055.1431-2-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928014055.1431-1-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928013902.1341-8-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928013902.1341-7-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928013902.1341-6-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928013902.1341-5-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928013902.1341-4-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Reviewed-by: NMarcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/20210928013902.1341-3-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928013902.1341-2-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Cai Huoqing 提交于
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: NCai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210928013902.1341-1-caihuoqing@baidu.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Florian Boor 提交于
New binding documentation for AD799x series of I²C ADC ICs. Signed-off-by: NFlorian Boor <florian.boor@kernelconcepts.de> Reviewed-by: NRob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210930104249.2924336-2-florian.boor@kernelconcepts.deSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Florian Boor 提交于
iio: adc: ad799x: Implement selecting external reference voltage input on AD7991, AD7995 and AD7999. Make use of the AD7991_REF_SEL bit and support using the external reference voltage if 'vref-supply' is present. Use VCC voltage supply as reference if no extra reference is supplied. Signed-off-by: NFlorian Boor <florian.boor@kernelconcepts.de> Link: https://lore.kernel.org/r/20210930104249.2924336-1-florian.boor@kernelconcepts.deSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Dan Carpenter 提交于
Return -ETIMEDOUT on timeout instead of success. Fixes: 1f7b4048 ("iio: adc: max1027: Use the EOC IRQ when populated for single reads") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Jonathan Cameron 提交于
iio_push_to_buffers_with_timestamp() requires that the buffer is 8 byte alignment to ensure an inserted timestamp is naturally aligned. This requirement was not met here when burst mode is in use beause of a leading u16. Use the new iio_push_to_buffers_with_ts_unaligned() function that has more relaxed requirements. It is somewhat complex to access that actual data length, but a safe bound can be found by using scan_bytes - sizeof(timestamp) so that is used in this path. More efficient approaches exist, but this ensure correctness at the cost of using a bounce buffer. Fixes: 5075e072 ("iio: imu: adis: generalize burst mode support") Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: NNuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210613151039.569883-5-jic23@kernel.org
-
由 Jonathan Cameron 提交于
Fix a set of closely related issues. 1. When using fifo_values() there was not enough space for the timestamp to be inserted by iio_push_to_buffers_with_timestamp() 2. fifo_values() did not meet the alignment requirement of iio_push_to_buffers_with_timestamp() 3. hw_values did not meet the alignment requirement either. 1 and 2 fixed by using new iio_push_to_buffers_with_ts_unaligned() which has no alignment or space padding requirements. 3 fixed by introducing a structure that makes the space and alignment requirements explicit. Fixes: 3904b28e ("iio: gyro: Add driver for the MPU-3050 gyroscope") Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210613151039.569883-4-jic23@kernel.org
-
由 Jonathan Cameron 提交于
Use the newly introduce iio_push_to_buffers_with_ts_unaligned() function to ensure a bounce buffer is used to provide the required alignment and space padding needed by the IIO core which requires the timestamp is naturally aligned. There will be a performance cost to this change but it will ensure the driver works on platforms that do not support unaligned 8 byte assignments, and with consumer drivers that may assume natural alignment of the timestamp. Issue found as part of an audit of all calls to iio_push_to_buffers_with_timestamp() Fixes: 7e87d11c ("iio: adc: Add support for TI ADC108S102 and ADC128S102") Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Jan Kiszka <jan.kiszka@siemens.com> Link: https://lore.kernel.org/r/20210613151039.569883-3-jic23@kernel.org
-
由 Jonathan Cameron 提交于
Whilst it is almost always possible to arrange for scan data to be read directly into a buffer that is suitable for passing to iio_push_to_buffers_with_timestamp(), there are a few places where leading data needs to be skipped over. For these cases introduce a function that will allocate an appropriate sized and aligned bounce buffer (if not already allocated) and copy the unaligned data into that before calling iio_push_to_buffers_with_timestamp() on the bounce buffer. We tie the lifespace of this buffer to that of the iio_dev.dev which should ensure no memory leaks occur. Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: NNuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210613151039.569883-2-jic23@kernel.org
-
由 Randy Dunlap 提交于
Fix kconfig symbol dependency warning: WARNING: unmet direct dependencies detected for REGMAP_I2C Depends on [n]: I2C [=n] Selected by [y]: - SENSEAIR_SUNRISE_CO2 [=y] && IIO [=y] Fixes: c397894e ("iio: chemical: Add Senseair Sunrise 006-0-007 drive") Signed-off-by: NRandy Dunlap <rdunlap@infradead.org> Cc: Jacopo Mondi <jacopo@jmondi.org> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: linux-iio@vger.kernel.org Link: https://lore.kernel.org/r/20211002232803.5108-1-rdunlap@infradead.orgSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Colin Ian King 提交于
There is a spelling mistake in a dev_warn message. Fix it. Signed-off-by: NColin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20211001120018.17570-1-colin.king@canonical.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Alexandru Ardelean 提交于
This is a simple conversion for to device-managed with using devm_request_threaded_irq(), disabling the regulator via a devm_add_action_or_reset() hook and finally using devm_iio_device_register(). The i2c_set_clientdata() call is removed as it becomes redundant after this change. Signed-off-by: NAlexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210926194315.7742-1-aardelean@deviqon.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Alexandru Ardelean 提交于
Otherwise most build checks will omit this driver from a compile-test due to it's dependency only on the BERLIN_ARCH symbol. Signed-off-by: NAlexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210926192642.4051329-2-aardelean@deviqon.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Alexandru Ardelean 提交于
This driver requires only a devm_add_action_or_reset() hook for the power-down of the device, and then devm_iio_device_register() can be used directly. Signed-off-by: NAlexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210926192642.4051329-1-aardelean@deviqon.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Alexandru Ardelean 提交于
This driver already hooks a similar unwind callback via devm_add_action_or_reset(). They pretty much do the same thing, so this change converts it to the devm_iio_map_array_register(). Signed-off-by: NAlexandru Ardelean <aardelean@deviqon.com> Reviewed-by: NAndreas Kemnade <andreas@kemnade.info> Link: https://lore.kernel.org/r/20210926162859.3567685-1-aardelean@deviqon.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Alexandru Ardelean 提交于
For this conversion, the 2 regulators (being enabled) require each a devm_add_action_or_reset() hook registration. For the other functions, there are device-managed variants. Signed-off-by: NAlexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210926162110.3536436-1-aardelean@deviqon.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Alexandru Ardelean 提交于
This is a trivial conversion to device-managed functions. The mutex_destroy() calls are redundant, as the data will be free'd anyway. And the IRQ and IIO register functions both have device-managed equivalents. Signed-off-by: NAlexandru Ardelean <aardelean@deviqon.com> Reviewed-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210926154932.3287590-1-aardelean@deviqon.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Nuno Sá 提交于
The library can now handle enabling/disabling IRQs for devices that cannot unmask the data ready pin. Hence there's no need to provide an 'enable_irq' callback anymore. The library will also automatically request the IRQ with 'IRQF_NO_AUTOEN' so that we can also remove that from the driver. Signed-off-by: NNuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210903141423.517028-5-nuno.sa@analog.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Nuno Sá 提交于
The library can now handle enabling/disabling IRQs for devices that cannot unmask the data ready pin. Hence there's no need to provide an 'enable_irq' callback anymore. The library will also automatically request the IRQ with 'IRQF_NO_AUTOEN' so that we can also remove that from the driver. Signed-off-by: NNuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210903141423.517028-4-nuno.sa@analog.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-