Age | Commit message (Collapse) | Author |
|
After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.
Convert all platform drivers below drivers/iio/ to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.
While touching these files, make indention of the struct initializer
consistent in several files.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20241009060056.502059-2-u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
BMI323_STEP_SC1_REG was defined twice.
Redundant definition has been removed
Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Link: https://patch.msgid.link/20241009111828.43371-1-tarang.raval@siliconsignals.io
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Use dev_err_probe() to simplify probe() error handling. While at it, add
some error log in case we fail to get clkin.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-4-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
We already cache clkin rate during probe and then never use the clk
object again. Hence, no point in saving in our global state struct.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-3-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
spi_set_drvdata() is not needed as there's no spi_get_drvdata() call in
the code.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-2-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
To use spi_get_device_match_data(), add the chip_info structure to the
of_device_id table which is always a good thing to do.
While at it, added dedicated variables for each chip (instead of the
harder to maintain array) and added a new string variable for the part
name.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-1-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Add AD7944_ namespace to T_QUIET_NS. This is the preferred style. This
way the bad style won't be copied when we add more T_ macros.
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-iio-adc-ad7944-add-namespace-to-t_quiet_ns-v1-1-a216357a065c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
There is a check on non-zero ret that is redundant because the
same check is being performed in a previous if statement and
also before that. The check is not required, remove it.
Signed-off-by: Colin Ian King <colin.i.king@intel.com>
Link: https://patch.msgid.link/20241010170835.772764-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Implement SPI driver for the Bosch BMI270 6-axis IMU. Provide raw read
write access to acceleration and angle velocity measurements via the SPI
interface on the device.
Signed-off-by: Alex Lanzano <lanzano.alex@gmail.com>
Link: https://patch.msgid.link/20241002033628.681812-1-lanzano.alex@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The veml6035 is an ALS that shares most of its functionality with the
veml6030, which allows for some code recycling.
Some chip-specific properties differ and dedicated functions to get and
set the sensor gain as well as its initialization are required.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-9-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The veml6035 is a similar ambient light sensor to the veml6030, and
from the bindings point of view, it shares the same properties. Its
only difference in that respect is a different I2C address.
Estend the existing bindings to support the veml6035 ALS.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-8-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Move devm_add_action_or_reset() with a device shut down action to the
hardware initialization function to ensure that any error path after
powering on the device leads to a power off. Add struct device *dev
to the argument list to clarify the device the action is registered
against, and use it wherever &client->dev was used.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-7-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The resolution of the WHITE channel is not provided by the manufacturer,
neither in the datasheet nor in the application note (even their
proprietary application only processes the ALS channel, giving raw
values for WHITE).
The current implementation assumes that both resolutions are identical,
which is extremely unlikely, especially for photodiodes with different
spectral responses.
Drop the processed information as it is meaningless.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-6-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Drop custom attributes by using the standard read_avail() callback to
read scale and integration time. When at it, add the integration time
and scale attributes fro the WHITE channel, as they modify its value as
well. To avoid breaking the current ABI, these attributes must be kept
as separate for both channels even though they are shared under the
hood.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-5-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Use the device managed function from the regulator API to get and enable
a regulator powering the device.
Use "vdd" as the ID to account for the provided name in the datasheet.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-4-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Add vdd-supply to account for the sensor's power source.
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-3-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Use the more convenient dev_err_probe() to get rid of the dev_err() +
return sequence in the probe error paths.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-2-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The veml6030 requires a delay of 4 ms after activating the sensor. That
is done correctly during the hw initialization, but it's missing after
resuming.
Move the delay to the power on function to make sure that it is always
observerd. When at it, use fsleep() instead of usleep_range() as such a
narrow range is not required.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-1-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
As it was reported and discussed here [1], storing the sensor data in an
endian aware s32 buffer is not optimal. Advertising the timestamp as an
addition of 2 s32 variables which is also implied is again not the best
practice. For that reason, change the s32 sensor_data buffer to a u8
buffer and align it properly.
[1]: https://lore.kernel.org/linux-iio/73d13cc0-afb9-4306-b498-5d821728c3ba@stanley.mountain/
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240930202353.38203-3-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The adc values coming directly from the sensor in the BM{E,P}{2,3}xx
sensors are unsigned values so treat them as such.
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240930202353.38203-2-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Fix maximum SPI clock speed, as per datasheet (Rev. B, page 6).
Fixes: b0a96c5f599e ("dt-bindings: iio: dac: Add adi,ad3552r.yaml")
Cc: stable@vger.kernel.org
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241003-wip-bl-ad3552r-axi-v0-iio-testing-v4-4-ceb157487329@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Add entry for inv_mpu6050 iio driver supporting InvenSense MPU-6xxx
and ICM-206xxx devices.
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20241003-invn-maintainers-email-update-v2-3-ca5a4928eb22@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Migrate maintainer email to TDK domain.
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241003-invn-maintainers-email-update-v2-2-ca5a4928eb22@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
InvenSense is part of TDK group. Update email address to use the
TDK domain.
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20241003-invn-maintainers-email-update-v2-1-ca5a4928eb22@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
After contributing the driver, add myself as the maintainer for the
GE HealthCare PCM ADC IIO driver.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Link: https://patch.msgid.link/20241003114641.672086-5-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The GE HealthCare PMC Analog to Digital Converter (ADC) is a 16-Channel
(voltage and current), 16-Bit ADC with an I2C Interface.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241003114641.672086-4-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The GE HealthCare PMC Analog to Digital Converter (ADC) is a 16-Channel
(voltage and current), 16-Bit ADC with an I2C Interface.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20241003114641.672086-3-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Add the "gehc" entry for GE HealthCare.
https://www.gehealthcare.com
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Link: https://patch.msgid.link/20241003114641.672086-2-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Clarify the instruction for disabling autocalibration by adding the word
"by"
Signed-off-by: Ivin Joel Abraham <ivinjabraham@gmail.com>
Link: https://patch.msgid.link/20241002100341.110435-1-ivinjabraham@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Some of the includes were not in alphabetical order, this commit fixes
it.
Signed-off-by: Guillaume Stols <gstols@baylibre.com>
Link: https://patch.msgid.link/20241004-ad7606_add_iio_backend_support-v3-5-38757012ce82@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
The parallel driver's name is ad7606_par and not ad7606_parallel.
Fixes: 0046a46a8f93 ("staging/ad7606: Actually build the interface modules")
Signed-off-by: Guillaume Stols <gstols@baylibre.com>
Link: https://patch.msgid.link/20241004-ad7606_add_iio_backend_support-v3-1-38757012ce82@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
In the event that no channels (child nodes) are defined, the adc5 driver
will provide a generic error message indicating that adc5_get_fw_data()
returned -EINVAL. In all other error cases we get two error messages,
one helpful and the generic one.
Add a specific error message for the no channels case, and drop the
generic one, in order to improve the generates log prints in both cases.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Link: https://patch.msgid.link/20241004-spmi-adc5-no-channel-error-v1-1-1a43d13ae967@oss.qualcomm.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Many explicit casts were introduced to address Wconversion and
Wsign-compare warnings. Remove them to improve readability.
Link: https://lore.kernel.org/linux-iio/1fa4ab12-0939-477d-bc92-306fd32e4fd9@stanley.mountain/
Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240930-iio-pac1921-nocast-v2-1-cc349e137f75@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Drop the common 'dev_err() + return' combination in the probe function
and use 'return dev_err_probe()' instead.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-7-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Register the compatible from the dt-bindings.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-6-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
This UVA device with I2C has the same properties as the veml6075, and
the same dt-bindings can cover it too.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-5-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Add support for a device-managed regulator with the reference name
provided in the datasheet (vdd).
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-4-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Simplify the code by using devm_iio_device_register(), which removes the
need for a 'remove' function, as there are no more actions to take.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-3-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Simplify the mutext handling by using a guard to automate the mutex
unlocking.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-2-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Simplify the code by adding an action to call i2c_unregister_device(),
which removes the need for a 'fail' label, gotos to it, and an explicit
call in veml6070_remove().
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-1-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Convert the manual shifting to use `get_unaligned_le16` api.
Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20240928161805.165543-1-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Changed the manual shifting and adding of bytes to use
get_unaligned_be16() api instead.
Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20240928161108.163647-1-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
This commit fixes several typographical errors in comments within
the drivers/iio/adc directory. No functional changes are made.
Detected using codespell.
Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
Link: https://patch.msgid.link/20240926034411.3482986-1-yujiaoliang@vivo.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Compatible 'ltr,ltrf216a' is used by Valve's Steamdeck device
via the ACPI + PRP0001 mechanism.
Document this info alongside the compatible.
Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com>
Link: https://patch.msgid.link/20240923131527.1408691-1-shreeya.patel@collabora.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
IAM-20680HT & HP are 2 variants of IAM-20680 with better specs,
wider temperature range, and a bigger FIFO (4k).
Fully compatible with IAM-20680, FIFO is 512 bytes by default and
with correct register setting we expand it to full 4k.
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20240923-inv-mpu6050-add-iam20680-ht-hp-v2-2-48290e0b9931@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
IAM-20680HT & HP are 2 variants of IAM-20680 that are backwards compatible.
They just have better specs, temperature range and a bigger FIFO.
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240923-inv-mpu6050-add-iam20680-ht-hp-v2-1-48290e0b9931@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Switch to device_for_each_child_node_scoped() to simplify the code by
removing the need for calls to fwnode_handle_put() in the error path, in
this particular case dropping the jump to error_out as well.
This prevents possible memory leaks if new error paths are added without
the required call to fwnode_handle_put().
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240926-iio_device_for_each_child_node_scoped-v1-4-64ca8a424578@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Switch to device_for_each_child_node_scoped() to simplify the code by
removing the need for calls to fwnode_handle_put() in the error path.
This prevents possible memory leaks if new error paths are added without
the required call to fwnode_handle_put().
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://patch.msgid.link/20240926-iio_device_for_each_child_node_scoped-v1-3-64ca8a424578@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Switch to device_for_each_child_node_scoped() to simplify the code by
removing the need for calls to fwnode_handle_put() in the error path.
This prevents possible memory leaks if new error paths are added without
the required call to fwnode_handle_put().
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240926-iio_device_for_each_child_node_scoped-v1-2-64ca8a424578@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
Switch to device_for_each_child_node_scoped() to simplify the code by
removing the need for calls to fwnode_handle_put() in the error path.
This prevents possible memory leaks if new error paths are added without
the required call to fwnode_handle_put().
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240926-iio_device_for_each_child_node_scoped-v1-1-64ca8a424578@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|