aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)AuthorFilesLines
2023-06-05Merge 6.4-rc5 into driver-core-nextGreg Kroah-Hartman18-82/+195
We need the driver core fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-06-04iio: adc: ad7192: Fix internal/external clock selectionFabrizio Lamarque1-1/+1
Fix wrong selection of internal clock when mclk is defined. Resolve a logical inversion introduced in c9ec2cb328e3. Fixes: c9ec2cb328e3 ("iio: adc: ad7192: use devm_clk_get_optional() for mclk") Signed-off-by: Fabrizio Lamarque <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: adc: ad7192: Fix null ad7192_state pointer accessFabrizio Lamarque1-3/+3
Pointer to indio_dev structure is obtained via spi_get_drvdata() at the beginning of function ad7192_setup(), but the spi->dev->driver_data member is not initialized, hence a NULL pointer is returned. Fix by changing ad7192_setup() signature to take pointer to struct iio_dev, and get ad7192_state pointer via st = iio_priv(indio_dev); Fixes: bd5dcdeb3fd0 ("iio: adc: ad7192: convert to device-managed functions") Signed-off-by: Fabrizio Lamarque <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: addac: ad74413: don't set DIN_SINK for functions other than digital inputRasmus Villemoes1-5/+6
Apparently, despite the name Digital Input Configuration Register, the settings in the DIN_CONFIGx registers also affect other channel functions. In particular, setting a non-zero value in the DIN_SINK field breaks the resistance measurement function. Now, one can of course argue that specifying a drive-strength-microamp property along with a adi,ch-func which is not one of the digital input functions is a bug in the device tree. However, we have a rather complicated setup with instances of ad74412r on external hardware modules, and have set a default drive-strength-microamp in our DT fragments describing those, merely modifying the adi,ch-func settings to reflect however the modules have been wired up. And restricting this setting to just being done for digital input doesn't make the driver any more complex. Fixes: 504eb485589d1 (iio: ad74413r: wire up support for drive-strength-microamp property) Signed-off-by: Rasmus Villemoes <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: adc: rockchip_saradc: Use dev_err_probeShreeya Patel1-25/+20
Use dev_err_probe instead of dev_err in probe function, which simplifies code a little bit and prints the error code. Signed-off-by: Shreeya Patel <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: adc: rockchip_saradc: Match alignment with open parenthesisShreeya Patel1-3/+2
Match alignment with open parenthesis for improving the code readability. Signed-off-by: Shreeya Patel <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: adc: rockchip_saradc: Use of_device_get_match_dataShreeya Patel1-4/+4
Use of_device_get_match_data() to simplify the code. Signed-off-by: Shreeya Patel <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: adc: rockchip_saradc: Make use of devm_clk_get_enabledShreeya Patel1-48/+8
Use devm_clk_get_enabled() to avoid manually disabling the clock. Signed-off-by: Shreeya Patel <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: adc: rockchip_saradc: Add support for RK3588Simon Xue1-0/+70
Add new start and read functions to support rk3588 device. Also, add a device compatible string for the same. Signed-off-by: Simon Xue <[email protected]> Signed-off-by: Shreeya Patel <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-06-04iio: adc: rockchip_saradc: Add callback functionsSimon Xue1-12/+52
Add start, read and power_down callback functions, which will help in adding new rockchip device support cleanly. Signed-off-by: Simon Xue <[email protected]> Signed-off-by: Shreeya Patel <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-30iio: adc: Use devm_krealloc_arrayJames Clark2-16/+10
Now that it exists, use it instead of doing the multiplication and checking for overflow manually. Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: James Clark <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-05-28iio: temperature: tmp006: Add OF device matching supportAnup Sharma1-0/+8
Adds an of_device_id table entry to the driver, enabling device matching through device tree. With this update, the driver can now match devices using both the i2c_device_id entry and the newly added of_device_id table. Signed-off-by: Anup Sharma <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/72746bdfd8f74171943e41759b891c7af40627ec.1684579603.git.anupnewsmail@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-28iio: amplifiers: ad8366 Fix whitespace issueFranziska Naepelt1-1/+1
This removes the following checkpatch issue: - ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Franziska Naepelt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: imu: inv_icm42600: avoid frequent timestamp jitterJean-Baptiste Maneyrol1-23/+26
We are currently synchronizing every time the data timestamp with the IT timestamp, leading to system jitter jamming timestamps. To fix that and keep it simple, let's just synchronize when the delta is bigger than the acceptable jitter, and keep synchronization at the jitter value. The result is much stable timestamps reflecting better the real physical value. Example @50Hz delta timestamp, * before: 20.123ms, 19.721ms, 20.023ms, 20.353ms, 19.821ms, ... * after: 20.173ms, 20.173ms, 20.173ms, 20.40ms, 20.173ms, ... Refactorize code and delete the unnecessary handling of multiple FIFO data. Signed-off-by: Jean-Baptiste Maneyrol <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: light: ROHM BU27008 color sensorMatti Vaittinen3-0/+1041
The ROHM BU27008 is a sensor with 5 photodiodes (red, green, blue, clear and IR) with four configurable channels. Red and green being always available and two out of the rest three (blue, clear, IR) can be selected to be simultaneously measured. Typical application is adjusting LCD backlight of TVs, mobile phones and tablet PCs. Add initial support for the ROHM BU27008 color sensor. - raw_read() of RGB and clear channels - triggered buffer w/ DRDY interrtupt Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/2594162f0e44148cffb1fb05f1d6edfde6bd11bc.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: kx022a: Use new iio_validate_own_trigger()Matti Vaittinen1-12/+1
The new generic iio_validate_own_trigger() can be used as validate_trigger callback for verifying the used trigger belongs to same device as the iio_dev. Use the generic function instead of rolling own one. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/cbd585e4787f62dc1a343a51b629ce73dd7d5426.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: trigger: Add simple trigger_validation helperMatti Vaittinen1-1/+21
Some triggers can only be attached to the IIO device that corresponds to the same physical device. Implement generic helper which can be used as a validate_trigger callback for such devices. Suggested-by: Jonathan Cameron <[email protected]> Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/51cd3e3e74a6addf8d333f4a109fb9c5a11086ee.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: mlx90614: Add MLX90615 supportMarek Vasut1-4/+44
Add support for MLX90615 Infra Red Thermometer, which seems to be the predecesor of MLX90614 . There are significant differences in the register layout compared to MLX90614, but the functionality of the device is virtually identical. The following differences have been identified: - RAM/EEPROM/SLEEP access opcodes are different - RAM/EEPROM registers are at different offsets - EEPROM emissivity and configuration registers are at different offsets - EEPROM configuration register bits are shuffled around - EEPROM emissivity settings are 14 bit on MLX90615 , 16 bit on MLX90614 - MLX90615 can only ever support one sensor, MLX90614 could support two - FIR filter is set to fixed settings on MLX90615 - IIR filter coefficients are different This patch fills in the MLX90615 specific description and quirk handling. The IIR filter coefficients were provided by Melexis as follows: 0b0000 - Forbidden value 0b0001 - 100% - settling time = refresh rate = 205ms (around 5Hz) 0b0010 - 50% - settling time = 2050ms (around 0.5Hz) 0b0011 - 33% - settling time = 36900ms (around 0.3Hz) 0b0100 - 25% - settling time = 5125ms (around 0.2Hz) 0b0101 - 20% - settling time = 6355ms (around 0.15Hz) 0b0110 - 17% - settling time = 7790ms (around 0.13Hz) 0b0111 - 14% - settling time = 9225ms (around 0.1Hz) Signed-off-by: Marek Vasut <[email protected]> Acked-by: Crt Mori <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: mlx90614: Factor our register IO and constants into model specific ↵Marek Vasut1-59/+122
descriptor Factor out all the differences between MLX90614 and other similar chips into a structure which describes the chip and allows abstracting out the differences from the driver code. No functional change. This patch moves all the RAM and EEPROM IO opcodes into the descriptor structure and combines them, instead of combining the opcode and offset in macros. Acked-by: Crt Mori <[email protected]> Tested-by: Crt Mori <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: mlx90614: Drop MLX90614_CONST_EMISSIVITY_RESOLUTIONMarek Vasut1-3/+3
The MLX90614_CONST_EMISSIVITY_RESOLUTION can be calculated from MLX90614_CONST_RAW_EMISSIVITY_MAX, perform the calculation inline and drio the MLX90614_CONST_EMISSIVITY_RESOLUTION. Signed-off-by: Marek Vasut <[email protected]> Acked-by: Crt Mori <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: mlx90614: Drop unused register macrosMarek Vasut1-4/+0
To simplify addition of support for new parts, drop unused register macros. No functional change. Acked-by: Crt Mori <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-23iio: mlx90614: Sort headersMarek Vasut1-3/+3
Sort the headers alphabetically. No functional change. Acked-by: Crt Mori <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-21iio: pressure: Honeywell mprls0025pa pressure sensorAndreas Klinger3-0/+464
Honeywell mprls0025pa is a series of pressure sensors. Add initial I2C support. Note: - IIO buffered mode is supported - SPI mode is not supported Signed-off-by: Andreas Klinger <[email protected]> Link: https://lore.kernel.org/r/ZGNp3SqyOJeEcLsj@arbad Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-21iio: Switch i2c drivers back to use .probe()Uwe Kleine-König192-192/+192
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-20iio: imu: inv_icm42600: fix timestamp resetJean-Baptiste Maneyrol1-5/+5
Timestamp reset is not done in the correct place. It must be done before enabling buffer. The reason is that interrupt timestamping is always happening when the chip is on, even if the corresponding sensor is off. When the sensor restarts, timestamp is wrong if you don't do a reset first. Fixes: ec74ae9fd37c ("iio: imu: inv_icm42600: add accurate timestamping") Signed-off-by: Jean-Baptiste Maneyrol <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-20iio: ad7606: Kconfig: add HAS_IOPORT dependenciesNiklas Schnelle1-1/+1
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Niklas Schnelle <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-20iio: potentiometer: Add support for the Renesas X9250 potentiometersHerve Codina3-0/+231
The Renesas X9250 integrates four digitally controlled potentiometers. On each potentiometer, the X9250T has a 100 kOhms total resistance and the X9250U has a 50 kOhms total resistance. Signed-off-by: Herve Codina <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-20iio: adc: ad_sigma_delta: Fix IRQ issue by setting IRQ_DISABLE_UNLAZY flagMasahiro Honda1-0/+4
The Sigma-Delta ADCs supported by this driver can use SDO as an interrupt line to indicate the completion of a conversion. However, some devices cannot properly detect the completion of a conversion by an interrupt. This is for the reason mentioned in the following commit. commit e9849777d0e2 ("genirq: Add flag to force mask in disable_irq[_nosync]()") A read operation is performed by an extra interrupt before the completion of a conversion. At this time, the value read from the ADC data register is the same as the previous conversion result. This patch fixes the issue by setting IRQ_DISABLE_UNLAZY flag. Fixes: 0c6ef985a1fd ("iio: adc: ad7791: fix IRQ flags") Fixes: 1a913270e57a ("iio: adc: ad7793: Fix IRQ flag") Fixes: e081102f3077 ("iio: adc: ad7780: Fix IRQ flag") Fixes: 89a86da5cb8e ("iio: adc: ad7192: Add IRQ flag") Fixes: 79ef91493f54 ("iio: adc: ad7124: Set IRQ type to falling") Signed-off-by: Masahiro Honda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: dac: mcp4725: Fix i2c_master_send() return value handlingMarek Vasut1-2/+14
The i2c_master_send() returns number of sent bytes on success, or negative on error. The suspend/resume callbacks expect zero on success and non-zero on error. Adapt the return value of the i2c_master_send() to the expectation of the suspend and resume callbacks, including proper validation of the return value. Fixes: cf35ad61aca2 ("iio: add mcp4725 I2C DAC driver") Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: accel: kx022a fix irq gettingMatti Vaittinen1-1/+1
The fwnode_irq_get_byname() was returning 0 at device-tree mapping error. If this occurred, the KX022A driver did abort the probe but errorneously directly returned the return value from fwnode_irq_get_byname() from probe. In case of a device-tree mapping error this indicated success. The fwnode_irq_get_byname() has since been fixed to not return zero on error so the check for fwnode_irq_get_byname() can be relaxed to only treat negative values as errors. This will also do decent fix even when backported to branches where fwnode_irq_get_byname() can still return zero on error because KX022A probe should later fail at IRQ requesting and a prober error handling should follow. Relax the return value check for fwnode_irq_get_byname() to only treat negative values as errors. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Matti Vaittinen <[email protected]> Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer") Link: https://lore.kernel.org/r/b45b4b638db109c6078d243252df3a7b0485f7d5.1683875389.git.mazziesaccount@gmail.com Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: bu27034: Ensure reset is writtenMatti Vaittinen1-1/+11
The reset bit must be always written to the hardware no matter what value is in a cache or register. Ensure this by using regmap_write_bits() instead of the regmap_update_bits(). Furthermore, the SWRESET bit may be self-clearing, so mark the SYSTEM_CONTROL register volatile to guarantee we do also read the right state - should we ever need to read it. Finally, writing the SWRESET bit will restore the default register values. This can cause register cache to be outdated if there are any register values cached. Rebuild register cache after SWRESET and use regmap_update_bits() when performing the reset. Signed-off-by: Matti Vaittinen <[email protected]> Fixes: e52afbd61039 ("iio: light: ROHM BU27034 Ambient Light Sensor") Link: https://lore.kernel.org/r/ZFjWhbfuN5XcKty+@fedora Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: dac: build ad5758 driver when AD5758 is selectedLukas Bulwahn1-1/+1
Commit 28d1a7ac2a0d ("iio: dac: Add AD5758 support") adds the config AD5758 and the corresponding driver ad5758.c. In the Makefile, the ad5758 driver is however included when AD5755 is selected, not when AD5758 is selected. Probably, this was simply a mistake that happened by copy-and-paste and forgetting to adjust the actual line. Surprisingly, no one has ever noticed that this driver is actually only included when AD5755 is selected and that the config AD5758 has actually no effect on the build. Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support") Signed-off-by: Lukas Bulwahn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: imu: mpu6050: Add support for the ICM 20600 IMUHermes Zhang5-2/+25
The Invensense ICM-20600 is a 6-axis MotionTracking device that combines a 3-axis gyroscope and an 3-axis accelerometer. It is very similar to the ICM20602 imu which is already supported by the mpu6050 driver. The main difference is that the ICM-20600 has a different WHOAMI value. Signed-off-by: Hermes Zhang <[email protected]> Acked-by: Jean-Baptiste Maneyrol <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: adc: qcom-spmi-vadc: Propagate fw node label to userspaceMarijn Suijten1-1/+18
Set the read_label() callback to return a friendly name provided in DT (firmware), in order to make in_{therm,voltage}X_label attributes show up in sysfs for userspace to consume a channel name. This is particularly useful for custom thermistors being attached to otherwise generically named GPIOs, where the name is known by the board DT. If the channel name isn't set in DT, use the datasheet_name hardcoded in the driver instead. Note that this doesn't fall back to fwnode_get_name() as that provides suboptimally readable names, with an @xx address suffix from board DT. Signed-off-by: Marijn Suijten <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-5-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: adc: qcom-spmi-adc5: Remove unnecessary datasheet_name NULL checkMarijn Suijten1-2/+1
datasheet_name is statically filled by a macro for every channel, and is nor should ever be set to NULL. Signed-off-by: Marijn Suijten <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-4-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: adc: qcom-spmi-adc5: Fall back to datasheet_name instead of fwnode nameMarijn Suijten1-1/+1
Since the migration to fwnode_get_name in commit 4f47a236a23d ("iio: adc: qcom-spmi-adc5: convert to device properties") the resulting adc5_channel_prop::channel_name (renamed from datasheet_name in the previous patch) - which is propagated into iio_chan_spec::extend_name - was containing the DT node name including @xx suffix if a "label" property is not present, while adc5_channels::datasheet_name was thus far set by the macros but always remained unread. Put it to use instead of using a confusing name containing @xx in sysfs filenames (again, when "label" is not set). Signed-off-by: Marijn Suijten <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-3-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: adc: qcom-spmi-adc5: Use driver datasheet_name instead of DT labelMarijn Suijten1-5/+5
iio_chan_spec::datasheet_name expects a channel/pin name on the hardware part, i.e. from its datasheet, instead of a friendly name from DT which typically describes the use of said channel. GPIO channels are commonly specialized in QCOM board DTS based on what a - typically thermistor - is connected to. Also rename adc5_channel_prop::datasheet_name to channel_name to that effect. Signed-off-by: Marijn Suijten <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-2-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: kx022a: Probe asynchronouslyMatti Vaittinen2-0/+2
Devices which may take a while to initialize during probe and which have no strong reason to probe synchronously can request asynchronous probing as default probe strategy. This can speed-up start times on some platforms. The KX022A gets probe delayed for at least two reasons. It enables the supply regulator, (which is likely to have ramp-up delay if it was disabled) and additionally it delays while the sensor itself is initializing. Changing to asynchronous probing may cause problems. Some of which are discussed in: https://lore.kernel.org/all/[email protected]/ Enable asynchronous probing for KX022A. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/24cea76c282a28b7a4dba297ab627176f8097907.1683185765.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: bu27034: Probe asynchronouslyMatti Vaittinen1-0/+1
Devices which may take a while to initialize during probe and which have no strong reason to probe synchronously can request asynchronous probing as default probe strategy. This can speed-up start times on some platforms. The BU27034 gets probe delayed for at least two reasons. It enables the supply regulator, (which is likely to have ramp-up delay if it was disabled) and additionally it delays while the sensor itself is initializing. Changing to asynchronous probing may cause problems. Some of which are discussed in: https://lore.kernel.org/all/[email protected]/ Enabling async probing for the ROHM BU27034 should be fairly safe to try though as there is no in-tree users for it yet. If the async probing appears to be an issue we can switch easily back to synchronous (or better yet, fix the actual problem). Enable asynchronous probing for BU27034. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/e7088793e1868c77b1894b30cd026e8ed043ea7c.1683185765.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: buffer: fix coding style warningsNuno Sá1-49/+49
Just cosmetics. No functional change intended... Signed-off-by: Nuno Sá <[email protected]> Reviewed-by: Lars-Peter Clausen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: light: Add support for TI OPT4001 light sensorStefan Windfeldt-Prytz3-0/+479
This driver uses the continuous mode of the chip and integration time can be configured through sysfs. The constants for calculating lux value differs between packaging so it uses different compatible string for the two versions "ti,opt4001-picostar" and "ti,opt4001-sot-5x3" since the device id is the same. Datasheet: https://www.ti.com/lit/gpn/opt4001 Signed-off-by: Stefan Windfeldt-Prytz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: adc: palmas: Remove the unneeded include <linux/i2c.h>Christophe JAILLET1-1/+0
This driver does not use i2c, so there is no point in including <linux/i2c.h> Remove it. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/9d23cd04d7f99dc8d813584aae5268b57f92fcd8.1682320298.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: adc: stm32-adc: add debug info if dt uses legacy channel configSean Nyekjaer1-0/+2
Since nearly all stm32 dt's are using the legacy adc channel config, we should warn users about using it. Signed-off-by: Sean Nyekjaer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: light: al3320a: Handle ACPI device CALS0001Marius Hoch1-0/+8
This sensor can be found as CALS0001 on the Lenovo Yoga Tablet 2 series. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch <[email protected]> Tested-by: Hans de Goede <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: accel: bma400: Simplify an error messageChristophe JAILLET1-2/+1
dev_err_probe() already display the error code. There is no need to duplicate it explicitly in the error message. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/9373d41b0a1f3dc3fc0d31c1daaa19d9a7ec4dcd.1681575924.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU driverMarius Hoch1-0/+7
The lsm303d can be found as ACCL0001 on various Lenovo devices, including the Lenovo Yoga Tablet 2 1051-F, where I tested this patch. Dropped SPI support as per discussion in thread linked below. Signed-off-by: Marius Hoch <[email protected]> Acked-by: Linus Walleij <[email protected]> Tested-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driverMarius Hoch3-1/+12
The lsm303d is basically the lsm9ds0 without the gyroscope (which the LSM9DS0 IMU driver doesn't handle), as far as I can tell. Signed-off-by: Marius Hoch <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Tested-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: magnetometer: st_accel: Add LSM303DMarius Hoch1-0/+1
The lsm303d has the same register mapping as the lsm9ds0, thus we can just re-use that. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Tested-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: accel: st_accel: Add LSM303DMarius Hoch1-0/+1
The lsm303d has the same register mapping as the lsm9ds0, thus we can just re-use that. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Tested-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-13iio: addac: ad74413: fix resistance input processingRasmus Villemoes1-1/+1
On success, ad74413r_get_single_adc_result() returns IIO_VAL_INT aka 1. So currently, the IIO_CHAN_INFO_PROCESSED case is effectively equivalent to the IIO_CHAN_INFO_RAW case, and we never call ad74413r_adc_to_resistance_result() to convert the adc measurement to ohms. Check ret for being negative rather than non-zero. Fixes: fea251b6a5dbd (iio: addac: add AD74413R driver) Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>