- 30 Jun, 2024 13 commits
-
-
Nuno Sa authored
Using dev_err_cast_probe() to simplify the code. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240606-dev-add_dev_errp_probe-v3-3-51bb229edd79@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Use dev_err_probe() (and variants) in the probe() path. While at it, made some simple improvements: * Explicitly included the err.h and errno.h headers; * Removed some unnecessary line breaks; * Removed a redundant 'else'; * Added some missing \n to prink. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240606-dev-add_dev_errp_probe-v3-2-51bb229edd79@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
This is similar to dev_err_probe() but for cases where an ERR_PTR() or ERR_CAST() is to be returned simplifying patterns like: dev_err_probe(dev, ret, ...); return ERR_PTR(ret) or dev_err_probe(dev, PTR_ERR(ptr), ...); return ERR_CAST(ptr) Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240606-dev-add_dev_errp_probe-v3-1-51bb229edd79@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Sean Anderson authored
Label all the channels using names from the reference manual. Some of the "control" channels are duplicates of other channels. The reference manual describes it like: > The AMS register set includes several measurement registers that are > written to by the PS SYSMON unit using the single-channel mode > (sequencer off). These voltage measurements are performed using the > unipolar sampling circuit with a 0 to 3V range and do not have alarms > or minimum/maximum registers. So I think these really are measuring the same voltages but in a different location. In which case, sharing labels makes sense to me. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Link: https://patch.msgid.link/20240620204842.817237-1-sean.anderson@linux.devSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Use new devm_spi_optimize_message() helper to simplify repeated code in the ad7944 driver. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240624-devm_spi_optimize_message-v3-2-912138c27b66@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
spi: add devm_spi_optimize_message() helper Helper from David Lechner <dlechner@baylibre.com>: In the IIO subsystem, we are finding that it is common to call spi_optimize_message() during driver probe since the SPI message doesn't change for the lifetime of the driver. This patch adds a devm_spi_optimize_message() helper to simplify this common pattern.
-
Paul Cercueil authored
Document the new DMABUF based API. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Co-developed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Nuno Sa <nuno.sa@analog.com> Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://patch.msgid.link/20240620122726.41232-7-paul@crapouillou.netSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Paul Cercueil authored
Use the functions provided by the buffer-dma core to implement the DMABUF userspace API in the buffer-dmaengine IIO buffer implementation. Since we want to be able to transfer an arbitrary number of bytes and not necesarily the full DMABUF, the associated scatterlist is converted to an array of DMA addresses + lengths, which is then passed to dmaengine_prep_slave_dma_array(). Signed-off-by: Paul Cercueil <paul@crapouillou.net> Co-developed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240620122726.41232-6-paul@crapouillou.netSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Paul Cercueil authored
Implement iio_dma_buffer_attach_dmabuf(), iio_dma_buffer_detach_dmabuf() and iio_dma_buffer_transfer_dmabuf(), which can then be used by the IIO DMA buffer implementations. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Co-developed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240620122726.41232-5-paul@crapouillou.netSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Paul Cercueil authored
Add the necessary infrastructure to the IIO core to support a new optional DMABUF based interface. With this new interface, DMABUF objects (externally created) can be attached to a IIO buffer, and subsequently used for data transfer. A userspace application can then use this interface to share DMABUF objects between several interfaces, allowing it to transfer data in a zero-copy fashion, for instance between IIO and the USB stack. The userspace application can also memory-map the DMABUF objects, and access the sample data directly. The advantage of doing this vs. the read() interface is that it avoids an extra copy of the data between the kernel and userspace. This is particularly userful for high-speed devices which produce several megabytes or even gigabytes of data per second. As part of the interface, 3 new IOCTLs have been added: IIO_BUFFER_DMABUF_ATTACH_IOCTL(int fd): Attach the DMABUF object identified by the given file descriptor to the buffer. IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd): Detach the DMABUF object identified by the given file descriptor from the buffer. Note that closing the IIO buffer's file descriptor will automatically detach all previously attached DMABUF objects. IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *): Request a data transfer to/from the given DMABUF object. Its file descriptor, as well as the transfer size and flags are provided in the "iio_dmabuf" structure. These three IOCTLs have to be performed on the IIO buffer's file descriptor, obtained using the IIO_BUFFER_GET_FD_IOCTL() ioctl. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Co-developed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240620122726.41232-4-paul@crapouillou.netSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Dmaengine topic - New device_prep_peripheral_dma_vec, documentation and user
-
Alisa-Dariana Roman authored
Alexandru Tachici has not been active. Also the email address included is not reachable anymore. I was assigned to work on the driver instead. Remove Alexandru Tachici and add myself as maintainer of AD7192 driver. Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20240624124941.113010-7-alisa.roman@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
This makes use of the new devm_regulator_get_enable_read_voltage() function to reduce boilerplate code. Error messages have changed slightly since there are now fewer places where we print an error. The rest of the logic of selecting which supply to use as the reference voltage remains the same. Also 1000 is replaced by MILLI in a few places for consistency. Signed-off-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20240624124941.113010-2-alisa.roman@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 29 Jun, 2024 4 commits
-
-
Kaustabh Chakraborty authored
Hard matching against the WhoAmI values isn't ideal for using devices which are compatible with existing ones. Instead of raising an error, issue a warning instead, thus allowing the driver to continue probing. Suggested-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Link: https://patch.msgid.link/20240625082800.62305-1-kauschluss@disroot.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Subhajit Ghosh authored
Add myself as maintainer of APDS9306 ambient light sensor driver. Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> Link: https://patch.msgid.link/20240626135231.8937-1-subhajit.ghosh@tweaklogic.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Guillaume Stols authored
AD7606-8 is referred to as AD7606 by Analog Devices. This comment aims to avoid confusion. Also the compatible names were not sorted by alphabetical order. Signed-off-by: Guillaume Stols <gstols@baylibre.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240628-cleanup-ad7606-v2-2-96e02f90256d@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Guillaume Stols authored
Add AD7606-5 datasheet link. Signed-off-by: Guillaume Stols <gstols@baylibre.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240628-cleanup-ad7606-v2-1-96e02f90256d@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 28 Jun, 2024 4 commits
-
-
Sean Anderson authored
Add labels from IIO channels to our channels. This allows userspace to display more meaningful names instead of "in0" or "temp5". Although lm-sensors gracefully handles errors when reading channel labels, the ABI says the label attribute > Should only be created if the driver has hints about what this voltage > channel is being used for, and user-space doesn't. Therefore, we test to see if the channel has a label before creating the attribute. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20240624174601.1527244-3-sean.anderson@linux.devSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Sean Anderson authored
It can be convenient for other in-kernel drivers to reuse IIO channel labels. Export the iio_read_channel_label function to allow this. The signature is different depending on where we are calling it from, so the meat is moved to do_iio_read_channel_label. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://patch.msgid.link/20240624174601.1527244-2-sean.anderson@linux.devSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Picked up by sparse. Cc: Liam Beguin <liambeguin@gmail.com> Reviewed-by: Liam Beguin <liambeguin@gmail.com> Link: https://patch.msgid.link/20240624193210.347434-1-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Olivier Moysan authored
Fix warnings on DFSDM dtbs check Unevaluated properties are not allowed ('dfsdm-dai' was unexpected) 'port' does not match any of the regexes: 'pinctrl-[0-9]+' Fixes: 11183ac0 ("dt-bindings: stm32: convert dfsdm to json-schema") Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240618115912.706912-1-olivier.moysan@foss.st.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 25 Jun, 2024 19 commits
-
-
David Lechner authored
Use devm_regulator_get_enable_read_voltage() to simplify the code. Error message is slightly changed since there is only one error return now. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-10-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
By using a few devm_ functions, we can simplify the driver and remove the ads8688_remove() function. spi_set_drvdata() is removed since there are no more callers of spi_get_drvdata(). Also use dev_err_probe() to simplify error return. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-9-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Use devm_regulator_get_enable_read_voltage() to simplify the code. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-8-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Use devm_regulator_get_enable_read_voltage() to simplify the code. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-7-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Use devm_regulator_get_enable_read_voltage() to simplify the code. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-6-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Use devm_regulator_get_enable_read_voltage() to simplify the code. Error message is changed since there is only one error return now. LTC2309_INTERNAL_REF_MV macro is added to make the internal reference voltage value self-documenting. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-5-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Use dev_err_probe() to simplify error returns in the probe function. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andreas Klinger <ak@it-klinger.de> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-4-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
By using a few more devm_ functions, we can remove the hx711_remove() function in the hx711 driver. platform_set_drvdata() is also removed since there are no more callers of platform_get_drvdata(). Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andreas Klinger <ak@it-klinger.de> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-3-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Use the devm_regulator_get_enable_read_voltage() helper to simplify the code. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andreas Klinger <ak@it-klinger.de> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-2-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
This makes use of the devm_regulator_get_enable_read_voltage() helper function to simplify the code. The error return is moved closer to the function call to make it easier to follow the logic. And a few blank lines are added for readability. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au> Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-1-49e50cd0b99a@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Since all users were converted to the new cleanup based helper, adis_dev_lock() and adis_dev_unlock() can now be removed from the lib. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-9-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Use the new auto cleanup based locks so error paths are simpler. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-8-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Use the new auto cleanup based locks so error paths are simpler. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-7-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Use the new auto cleanup based locks so error paths are simpler. While at it, removed 'ret' from adis16400_write_raw() by doing return adis_write_reg_16(); instead of ret = adis_write_reg_16(); return ret; Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-6-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Use the new auto cleanup based locks so error paths are simpler. While at it, reduce a bit the scope of the lock as we did not needed it protecting all the data in the switch() branch. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-5-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Use the new auto cleanup based locks so error paths are simpler. While at it, turned a sprintf() call into sysfs_emit(). Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-4-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Add two new lock helpers that make use of the cleanup guard() and scoped_guard() macros. Thus, users won't have to worry about unlocking which is less prone to errors and allows for simpler error paths. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-3-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
This makes locking and handling error paths simpler. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-2-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Split trigger handling for devices that have paging and need to select the correct page to get the data. Although this actually introduces more LOC, it makes the code and the locking clear. It will also make the following move to the cleanup magic cleaner. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240618-dev-iio-adis-cleanup-v1-1-bd93ce7845c7@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-