- 20 Apr, 2024 4 commits
-
-
Thomas Haemmerle authored
Align the check of return values `regmap_read` so that it's consistent across this driver code. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> Link: https://lore.kernel.org/r/20240415105030.1161770-4-thomas.haemmerle@leica-geosystems.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Thomas Haemmerle authored
Align error handling with `dps310_calculate_temp`, where it's not possible to differentiate between errors and valid calculations by checking if the returned value is negative. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> Link: https://lore.kernel.org/r/20240415105030.1161770-3-thomas.haemmerle@leica-geosystems.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Thomas Haemmerle authored
The current implementation interprets negative values returned from `dps310_calculate_temp` as error codes. This has a side effect that when negative temperature values are calculated, they are interpreted as error. Fix this by using the return value only for error handling and passing a pointer for the value. Fixes: ba6ec48e ("iio: Add driver for Infineon DPS310") Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> Link: https://lore.kernel.org/r/20240415105030.1161770-2-thomas.haemmerle@leica-geosystems.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Chris Morgan authored
Add support for the GPADC for the Allwinner H616. It is identical to the existing ADC for the D1/T113s/R329/T507 SoCs. Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240417170423.20640-3-macroalpha82@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 13 Apr, 2024 8 commits
-
-
Krzysztof Kozlowski authored
Store pointers to chip info (struct ad5755_chip_info) in driver match data, instead of enum, so every value will be != 0, populate the of_device_id table and use it in driver. Even though it is one change, it gives multiple benefits: 1. Allows to use spi_get_device_match_data() dropping local 'type' variable. 2. Makes both ID tables usable, so kernel can match via any of these methods. 3. Code is more obvious as both tables are properly filled. 4. Fixes W=1 warning: ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable] Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240413154511.52576-1-krzysztof.kozlowski@linaro.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Add ICM-42688-P support inside driver. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Link: https://lore.kernel.org/r/20240408090720.847107-3-inv.git-commit@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Add bindings for ICM-42688-P chip. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240408090720.847107-2-inv.git-commit@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Lechner authored
Since commit 6020ca4d ("iio: adc: ad7944: use spi_optimize_message()"), The helper functions wrapping spi_sync() for 3-wire and 4-wire modes are virtually identical. Since gpiod_set_value_cansleep() does a NULL check internally, we can consolidate the two functions into one and avoid switch statements at the call sites. The default cases of the removed switch statement were just to make the compiler happy and are not reachable since the mode is validated in the probe function. So removing those should be safe. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20240412-ad7944-consolidate-msg-v1-1-7fdeff89172f@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Luca Weiss authored
Before all supported sensors except for MPU{9150,9250,9255} were not allowed to use i2c-gate in the bindings which excluded quite a few supported sensors where this functionality is supported. Switch the list of sensors to ones where the Linux driver explicitly disallows support for the auxiliary bus ("inv_mpu_i2c_aux_bus"). Since the driver is also based on "default: return true" this should scale better into the future. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240408-mpu6050-i2c-gate-v1-1-621f051ce7de@z3ntu.xyzSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Switching to the _scoped() version removes the need for manual calling of fwnode_handle_put() in the paths where the code exits the loop early. In this case that's all in error paths. A slightly less convincing usecase than many as all the failure paths are wrapped up in a call to a per fwnode_handle utility function. The complexity in that function is sufficient that it makes sense to factor it out even if it this new auto cleanup would enable simpler returns if the code was inline at the call site. Hence I've left it alone. Cc: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240330185305.1319844-3-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Switching to the _scoped() version removes the need for manual calling of fwnode_handle_put() in the paths where the code exits the loop early. In this case that's all in error paths. Note this would have made the bug fixed in the previous path much less likely as it allows for direct returns. Took advantage of dev_err_probe() to futher simplify things given no longer a need for the goto err. Cc: Olivier Moysan <olivier.moysan@foss.st.com> Tested-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Acked-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/20240330185305.1319844-5-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
This path would result in returning 0 / success on an error path. Cc: Olivier Moysan <olivier.moysan@foss.st.com> Fixes: 95bc8184 ("iio: adc: stm32-adc: add support of generic channels binding") Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/20240330185305.1319844-4-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 06 Apr, 2024 23 commits
-
-
Luca Weiss authored
For example the BMP280 barometric pressure sensor on Qualcomm MSM8974-based Nexus 5 smartphone exposes such file in sysfs. Document it. Whilst here, fix up incorrect repeated use of X as a wildcard for in_tempY_input. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Link: https://lore.kernel.org/r/20240406-in_temp_input-v1-1-a1744a4a49e3@z3ntu.xyzSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Subhajit Ghosh authored
Simplify event configuration flow. Suggested-by: Jonathan Cameron <jic23@kernel.org> Link: https://lore.kernel.org/all/20240310124237.52fa8a56@jic23-huawei/Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> Link: https://lore.kernel.org/r/20240405104641.29478-1-subhajit.ghosh@tweaklogic.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Add support for the power supply regulator. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240404-ltc2983-misc-improv-v5-2-c1f58057fcea@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Nuno Sa authored
Add a property for the VDD power supply regulator. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240404-ltc2983-misc-improv-v5-1-c1f58057fcea@analog.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Dan Carpenter authored
This was obviously supposed to be a bitwise negate instead of logical. Fixes: 76a1e6a4 ("iio: adc: ad7173: add AD7173 driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/5401c681-c4aa-4fab-8c8c-8f0a379e2687@moroto.mountainSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Dan Carpenter authored
The > comparison needs to be >= to prevent an out of bounds access. Fixes: 620d1e6c ("iio: light: Add support for APDS9306 Light Sensor") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com> Link: https://lore.kernel.org/r/69c5cb83-0209-40ff-a276-a0ae5e81c528@moroto.mountainSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Add a setup function implementation to the spi module to enable spi-3wire when specified in the device-tree. If spi-3wire is not specified in the device-tree, NULL is returned as bus pre-initialization. This behavior is identical to the i2c initialization, hence the default initialization. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://lore.kernel.org/r/20240401194906.56810-9-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Add a comment to the probe() function to describe the passed function pointer argument in particular. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://lore.kernel.org/r/20240401194906.56810-8-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Bring indio_dev, setup() and data initialization to begin of the probe() function to increase readability. Access members through data pointer to assure implicitely the driver's data instance is correctly initialized and functional. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://lore.kernel.org/r/20240401194906.56810-7-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Provide a way for bus specific pre-configuration by adding a function pointer argument to the driver core's probe() function, and keep the driver core implementation bus independent. In case NULL was passed, a regmap_write() shall initialize all bits of the data_format register, else regmap_update() is used. In this way spi and i2c are covered. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://lore.kernel.org/r/20240401194906.56810-6-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Add spi-3wire because the device allows to be configured for spi 3-wire communication. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240401194906.56810-5-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Move defines from core to the header file. Keep the defines block together in one location. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://lore.kernel.org/r/20240401194906.56810-4-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Group the indio_dev initialization and bus configuration for improved readability. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://lore.kernel.org/r/20240401194906.56810-3-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Lothar Rubusch authored
Replace write() data_format by regmap_update_bits() to keep bus specific pre-configuration which might have happened before on the same register. The bus specific bits in data_format register then need to be masked out, Remove the data_range field from the struct adxl345_data, because it is not used anymore. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://lore.kernel.org/r/20240401194906.56810-2-l.rubusch@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Also change both firmware parsing functions to return meaningful errors. Whilst for the ACPI case this isn't that useful, for the generic fwnode case we can return the errors coming from the property parsing instead of just whether we succeeded or not. Cc: Marius Cristea <marius.cristea@microchip.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330190849.1321065-9-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
By using this scoped based cleanup direct returns on errors are enabled simplifying the code. Cc: Mihail Chindris <mihail.chindris@analog.com> Cc: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330190849.1321065-8-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
This loop definition automatically release the fwnode_handle on early exit simplifying error handling paths. Cc: Kim Seer Paller <kimseer.paller@analog.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330190849.1321065-7-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
This loop definition automatically releases the fwnode_handle on early exit such as the error cases seen here. This reducing boilerplate and the chance of a resource leak being introduced in future. Cc: Dumitru Ceclan <mitrutzceclan@gmail.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330190849.1321065-6-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
This loop definition removes the need for manual releasing of the fwnode_handle in early exit paths (here an error path) allow simplfication of the code and reducing the chance of future modificiations not releasing fwnode_handle correctly. Cc: Cosmin Tanislav <demonsingur@gmail.com> Cc: Nuno Sa <nuno.sa@analog.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330190849.1321065-5-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
This new loop definition automatically releases the handle on early exit reducing the chance of bugs that cause resource leaks. Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330190849.1321065-4-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Seems these got renamed at somepoint but the documentation wasn't updated to match. Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330190849.1321065-3-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Switching to the _scoped() version removes the need for manual calling of fwnode_handle_put() in the paths where the code exits the loop early. In this case that's all in error paths. Cc: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330185305.1319844-9-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jonathan Cameron authored
Switching to the _scoped() version removes the need for manual calling of fwnode_handle_put() in the paths where the code exits the loop early. In this case that's all in error paths. Removing the goto err; statements also allows more extensive use of dev_err_probe() further simplifying the code. Cc: Mihail Chindris <mihail.chindris@analog.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240330185305.1319844-8-jic23@kernel.orgSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 30 Mar, 2024 1 commit
-
-
David Lechner authored
This modifies the ad7944 driver to use spi_optimize_message() to reduce CPU usage and increase the max sample rate by avoiding repeating validation of the spi message on each transfer. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20240328-ad7944-spi-optimize-message-v2-1-a142b2576379@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 28 Mar, 2024 4 commits
-
-
David Lechner authored
This simplifies the adi,spi-mode property parsing by using device_property_match_property_string() instead of two separate functions. Also, the error return value is now more informative in cases where there was a problem parsing the property. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20240325-ad7944-cleanups-v3-1-3a19120cdd06@baylibre.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Laurent Pinchart authored
The DAC081C081 is a TI DAC whose software interface is compatible with the DAC5571. It is the 8-bit version of the DAC121C081, already supported by the DAC5571 driver. Extends the driver to support this chip. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sean Nyekjaer <sean@geanix.com <mailto:sean@geanix.com>> Link: https://lore.kernel.org/r/20240325203245.31660-3-laurent.pinchart@ideasonboard.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Laurent Pinchart authored
The DAC081C081 is a TI DAC whose software interface is compatible with the DAC5571. It is the 8-bit version of the DAC121C081, already supported by the DAC5571 bindings. Extends the bindings to support this chip. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sean Nyekjaer <sean@geanix.com> Link: https://lore.kernel.org/r/20240325203245.31660-2-laurent.pinchart@ideasonboard.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Javier Carrasco authored
The Maxim max30101 is the replacement for the max30105, which is no longer recommended for future designs. Their internal structure is identical, as well as the register map, configuration options and sensitivity, which allows for code recycling. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://lore.kernel.org/r/20240324-max30101-v2-2-611deb510c97@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-