Commit Graph

9600 Commits

Author SHA1 Message Date
Linus Torvalds
cb4eb6771c Char/Misc/IIO/and others driver updates for 7.1-rc1
Here is the char/misc/iio and other smaller driver subsystem updates for
 7.1-rc1.  Lots of stuff in here, all tiny, but relevant for the
 different drivers they touch.  Major points in here is:
   - the usual large set of new IIO drivers and updates for that
     subsystem (the large majority of this diffstat)
   - lots of comedi driver updates and bugfixes
   - coresight driver updates
   - interconnect driver updates and additions
   - mei driver updates
   - binder (both rust and C versions) updates and fixes
   - lots of other smaller driver subsystem updates and additions
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCaes/Ng8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymRBQCeOqRduhONI6LPIIvDDTaircoSib0AnRD8WwML
 RxHo3/WjEd7FEUqwHA+H
 =Heza
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char / misc / IIO / and others driver updates from Greg KH:
 "Here is the char/misc/iio and other smaller driver subsystem updates
  for 7.1-rc1. Lots of stuff in here, all tiny, but relevant for the
  different drivers they touch. Major points in here is:

   - the usual large set of new IIO drivers and updates for that
     subsystem (the large majority of this diffstat)

   - lots of comedi driver updates and bugfixes

   - coresight driver updates

   - interconnect driver updates and additions

   - mei driver updates

   - binder (both rust and C versions) updates and fixes

   - lots of other smaller driver subsystem updates and additions

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'char-misc-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (405 commits)
  coresight: tpdm: fix invalid MMIO access issue
  mei: me: add nova lake point H DID
  mei: lb: add late binding version 2
  mei: bus: add mei_cldev_uuid
  w1: ds2490: drop redundant device reference
  bus: mhi: host: pci_generic: Add Telit FE912C04 modem support
  mei: csc: wake device while reading firmware status
  mei: csc: support controller with separate PCI device
  mei: convert PCI error to common errno
  mei: trace: print return value of pci_cfg_read
  mei: me: move trace into firmware status read
  mei: fix idle print specifiers
  mei: me: use PCI_DEVICE_DATA macro
  sonypi: Convert ACPI driver to a platform one
  misc: apds990x: fix all kernel-doc warnings
  most: usb: Use kzalloc_objs for endpoint address array
  hpet: Convert ACPI driver to a platform one
  misc: vmw_vmci: Fix spelling mistakes in comments
  parport: Remove completed item from to-do list
  char: remove unnecessary module_init/exit functions
  ...
2026-04-24 13:23:50 -07:00
Linus Torvalds
46576fa329 hwmon updates for 7.1
* New drivers:
 
   - Add support for Lenovo Yoga/Legion fan monitoring (yogafan)
 
   - Add support for LattePanda Sigma EC
 
   - Add support for Infineon XDP720 eFuse
 
   - Add support for Microchip MCP998X
 
 * New device support:
 
   - Add support for TI INA234
 
   - Add support for Infineon XDPE1A2G5B/7B
 
   - Add support for Renesas RAA228942 and RAA228943 (isl68137)
 
   - Add support for Delta Q54SN120A1 and Q54SW120A7 (pmbus)
 
   - Add support for TI TMP110 and TMP113 (tmp102)
 
   - Add support for Sony APS-379 (pmbus)
 
   - Add support for ITE IT8689E (it87)
 
   - Add support for ASUS ROG STRIX Z790-H, X470-F, and CROSSHAIR X670E (asus-ec-sensors)
 
   - Add support for GPD Win 5 (gpd-fan)
 
 * Modernization and Cleanups:
 
   - Convert asus_atk0110 and acpi_power_meter ACPI drivers to platform drivers
 
   - Remove i2c_match_id() usage in many PMBus drivers
 
   - Use guard() for mutex protection in pmbus_core
 
   - Replace sprintf() with sysfs_emit() in ads7871, emc1403, max6650,
     ads7828, max31722, and tc74
 
   - Various markup and documentation improvements for yogafan and ltc4282
 
 * Bug fixes:
 
   - Fix use-after-free and missing usb_kill_urb on disconnect in powerz driver
 
   - Avoid cacheline sharing for DMA buffer in powerz driver
 
   - Fix integer overflow in power calculation on 32-bit in isl28022 driver
 
   - Fix bugs in pt5161l_read_block_data()
 
   - Propagate SPI errors and fix incorrect error codes in ads7871 driver
 
   - Fix i2c_smbus_write_byte_data wrapper argument type in max31785 driver
 
 * Device tree bindings:
 
   - Convert npcm750-pwm-fan to DT schema
 
   - Add bindings for Infineon XDP720, Microchip MCP998X, Sony APS-379,
     Renesas RAA228942/3, Delta Q54SN120A1/7, XDPE1A2G5B/7B,
     Aosong AHT10/20, DHT20, and TI INA234
 
   - Adapt moortec,mr75203 bindings for T-Head TH1520
 
 ----------------------------------------------------------------
 (Commits list will be generated by git request-pull or similar tool)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmncEakACgkQyx8mb86f
 mYFEYw/7BtjCrbSmrs178gjuICFbOOCBvyeEP/NqA3q2LLrf4KqdCncrP+FRlAYn
 3/Bhm1vM7hEvF5SwnYWxw874Sl7Ys6OfxgT0ipGKYEobcx3fYJKgfjiiIDfPXqbm
 Ewjd9WMkrsDmaNQj/ZHazFBd9Rjj169a4MtvbNyXe1ipaVjoNoojoCg/R6di8Y9S
 T4EMg/ok6i7jUGfY/KrtnRqAjsM447vNjSfaoDW0jvW//fgYxslzIvL/IMyYkaK/
 GViKuIgcAx96i95+uhNQl1K8DJqFkYt99fuZrteq8lE+VWBmjAXS2vYgIpvmNbt1
 PH30cqXId+EO6GIecyt2TDAW6xyJiU6H7ln5ethIKFX856QOuFhT3qhfqPFRSjx4
 EVwGYTxTlkmrDv6Z1nPdsBe3KmZ2GiG11bsq6O4SRGHqumKO1rEiEjuAsKvGnGMy
 JMV3GuuY5ngt7S6Pp5Hs/W1DFMJrGvFWyCMwUikmzG0YwfmYLjsBGOX5wpS1vw9s
 pQKdjV4eimy8UwdF++8sx/RytTmRM0CcNMZUHFPMZMymTZD68dXPlzhs/Mv/CQdU
 goFflxGP8bixr82Zbgzz/0l9jqUEH0IGDv1ojrMp3X8EXCFPNNPwJuvDuyWCd0P5
 WG5ydk0G0lH0aKC4izhZ0IkQVPo4Wlns1zNTF0pXmPrMY2fjupk=
 =ApnM
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:
 "New drivers:
   - Lenovo Yoga/Legion fan monitoring (yogafan)
   - LattePanda Sigma EC
   - Infineon XDP720 eFuse
   - Microchip MCP998X

  New device support:
   - TI INA234
   - Infineon XDPE1A2G5B/7B
   - Renesas RAA228942 and RAA228943 (isl68137)
   - Delta Q54SN120A1 and Q54SW120A7 (pmbus)
   - TI TMP110 and TMP113 (tmp102)
   - Sony APS-379 (pmbus)
   - ITE IT8689E (it87)
   - ASUS ROG STRIX Z790-H, X470-F, and CROSSHAIR X670E (asus-ec-sensors)
   - GPD Win 5 (gpd-fan)

  Modernization and Cleanups:
   - Convert asus_atk0110 and acpi_power_meter ACPI drivers to platform
     drivers
   - Remove i2c_match_id() usage in many PMBus drivers
   - Use guard() for mutex protection in pmbus_core
   - Replace sprintf() with sysfs_emit() in ads7871, emc1403, max6650,
     ads7828, max31722, and tc74
   - Various markup and documentation improvements for yogafan and
     ltc4282

  Bug fixes:
   - Fix use-after-free and missing usb_kill_urb on disconnect in powerz
     driver
   - Avoid cacheline sharing for DMA buffer in powerz driver
   - Fix integer overflow in power calculation on 32-bit in isl28022
     driver
   - Fix bugs in pt5161l_read_block_data()
   - Propagate SPI errors and fix incorrect error codes in ads7871
     driver
   - Fix i2c_smbus_write_byte_data wrapper argument type in max31785
     driver

  Device tree bindings:
   - Convert npcm750-pwm-fan to DT schema
   - Add bindings for Infineon XDP720, Microchip MCP998X, Sony APS-379,
     Renesas RAA228942/3, Delta Q54SN120A1/7, XDPE1A2G5B/7B, Aosong
     AHT10/20, DHT20, and TI INA234
   - Adapt moortec,mr75203 bindings for T-Head TH1520"

* tag 'hwmon-for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (82 commits)
  hwmon: (ina233) Don't check for specific errors when parsing properties
  hwmon: (isl28022) Don't check for specific errors when parsing properties
  hwmon: (pmbus/tps25990) Don't check for specific errors when parsing properties
  hwmon: (nct6683) Add customer ID for ASRock B650I Lightning WiFi
  hwmon:(pmbus/xdp720) Add support for efuse xdp720
  dt-bindings: hwmon/pmbus: Add Infineon XDP720
  hwmon: add support for MCP998X
  dt-bindings: hwmon: add support for MCP998X
  hwmon: (powerz) Avoid cacheline sharing for DMA buffer
  hwmon: (isl28022) Fix integer overflow in power calculation on 32-bit
  hwmon: (pt5161l) Fix bugs in pt5161l_read_block_data()
  hwmon: (powerz) Fix missing usb_kill_urb() on signal interrupt
  hwmon: (powerz) Fix use-after-free on USB disconnect
  hwmon: pmbus: Add support for Sony APS-379
  dt-bindings: trivial-devices: Add sony,aps-379
  hwmon: (yogafan) various markup improvements
  hwmon: (sparx5) Make it selectable for ARCH_LAN969X
  hwmon: (tmp102) add support for update interval
  hwmon: (yogafan) fix markup warning
  hwmon: (yogafan) Add support for Lenovo Yoga/Legion fan monitoring
  ...
2026-04-15 14:37:32 -07:00
Greg Kroah-Hartman
a521013548 Linux 7.0-rc7
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCgA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmnS4Y8eHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGe6AIAI4rjLLPlxUKQbx4
 JP9lsKH7vqeIVvuMqzFau7+B8ngJ+80OESnBF7n43oNEqdJ0NYiL+rPtcGgBjZDP
 yUu5DlzVSxpAIQBZe2Nc0dz/5NbT9QxKyC5Yl/whpNIR7UHx1RFvDJYxwN9xKxTw
 ggLQevKAnHrKjIOKjq70Yqz2T1JMXc9Wp/xpur0oGioiFW/lH24CgHDXjE2Ka9oD
 wqhotzThuSaaVDmqZ8WNFKxx2onR4r8/NpljaVT2mWRJ2+IMF4pMOBJZRQiNZtRa
 1CsoJ3aV6pslAsuC1dLboCMul48VUgyu7l3xQwXVuA5bRO1jqt5ILWC10g09OItU
 7CxGTno=
 =1TRg
 -----END PGP SIGNATURE-----

Merge tag 'v7.0-rc7' into char-misc-next

We need the char/misc/iio/comedi fixes in here as well for testing

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-04-06 09:04:53 +02:00
Bartosz Golaszewski
331e5fd5bf hwmon: (ina2xx) drop unused platform data
Nobody defines struct ina2xx_platform_data. Remove platform data support
from the drivers which still have it (it's effectively dead code) and
remove the header.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://lore.kernel.org/r/20260326-drop-ina2xx-pdata-v1-1-c159437bb2df@oss.qualcomm.com
[groeck: Fixed continuation line alignment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-03-30 19:45:06 -07:00
Greg Kroah-Hartman
80ffc54d04 IIO: 3rd set of fixes for the 7.0 cycle.
Note that this pull is in addition to the 2nd set of such fixes that are
 waiting to be picked up. Absolutely fine to queue these for the merge
 window if that makes more sense.
 
 Usual mixed back of ancient issues surfacing and newer problems.
 
 adi,ad57770r
 - Stop eating an error in read_raw.
 adi,adxl313
 - Check return of regmap_write() instead of ignoring it in one place.
 adi,adxl355
 - Fix the description of the temperature channel to be unsigned rather
   than signed.
 bosch,bmi160
 - Avoid use of uninitialized data.
 - Fix validation of small reference voltages.
 hid-sensor-rotation:
 - The timestamp location in this driver has unfortunately been broken for
   a long time. Given it was correct for 6 years and then broken for the
   next 6 years, use a one off hack to duplicate it in both locations.
   The issue was as a result of the unique nature of quaternion
   representation combined with large precision resulting in an
   128 bit aligned channel.
 nxp,sar-adc
 - Avoid leaking a dma channel.
 rfdigital,rfd77402
 - Close a race between reinit_completion() and the irq happening.
 ti,adc161s626
 - Fix up buffer handling on big endian hosts which was broken due to
   casting of pointers to different sized integers.
 - Ensure a DMA safe buffer is used.
 vishay,vcnl4035
 - Fix up buffer handling on big endian hosts which was broken due to
   casting of pointers to different sized integers.
 vishay,veml6070
 - Fix return value mess up that occurred when doing a guard() conversion.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmnJGFwRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0Foiz2Q//aVj7yTLqyki8lyjRIC6sJZBjELz1SOym
 NNtcKZMvhXQvFWmBXfZf2/3XcIgvaXqST+FVnUItTfoWFRKueduB4P02rRw9linG
 0oyZYVOJVBR9T4PK22IDdOEzS786UpkvIhuVUbYm2zFQrEl9aClU3tW8rNrc3lQu
 4FaHDH52OJAMumzbwmejLgR+AKywyzIPJwyB3PBux592Y+h5gkWMPqVBSRueGG8G
 JwI/vM3X9OkEYabSgitWnR9HpJwXMomF0p0g9tpjb7xvdzYD2qOb1X9QP0SZKWDS
 z+aacE2c2OqjQ+YALCkVAH1qzsnm1VIDIklZ4U9776LejII4ap6QObgNebNJdWV2
 ziUg1zlBuzXnnEdxaiWy1N+JZT7hpG8kHgzgmZj+yvETKfwt/ZGCbHvTaNsBAfNc
 i3O88OQJDiHIC9tlKJzjw+eXBgVkvjb3mJt0fnJlolfj6Tm/e08MO+bXsQtFVA4o
 DAcFW2aaKGWQ4OjvrTXlGoeN9ExE3hMRWC4j4wq2GpnZ1kzBwtUVB21O80H95FTl
 Cjgbqqe9YjSDXFzAZNSMY9ElLcfrwjVpq2PXp5hCblSOI77GFcxr+lN73u6XrtkM
 0VInTc/J5CqizIywanMB27XUe1c1o7e5vqWlUX+SSK2b193E0qnKZNYeptBUjve0
 txhekWre+Kg=
 =AXzp
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-7.0c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus

Jonathan writes:

IIO: 3rd set of fixes for the 7.0 cycle.

Note that this pull is in addition to the 2nd set of such fixes that are
waiting to be picked up. Absolutely fine to queue these for the merge
window if that makes more sense.

Usual mixed back of ancient issues surfacing and newer problems.

adi,ad57770r
- Stop eating an error in read_raw.
adi,adxl313
- Check return of regmap_write() instead of ignoring it in one place.
adi,adxl355
- Fix the description of the temperature channel to be unsigned rather
  than signed.
bosch,bmi160
- Avoid use of uninitialized data.
- Fix validation of small reference voltages.
hid-sensor-rotation:
- The timestamp location in this driver has unfortunately been broken for
  a long time. Given it was correct for 6 years and then broken for the
  next 6 years, use a one off hack to duplicate it in both locations.
  The issue was as a result of the unique nature of quaternion
  representation combined with large precision resulting in an
  128 bit aligned channel.
nxp,sar-adc
- Avoid leaking a dma channel.
rfdigital,rfd77402
- Close a race between reinit_completion() and the irq happening.
ti,adc161s626
- Fix up buffer handling on big endian hosts which was broken due to
  casting of pointers to different sized integers.
- Ensure a DMA safe buffer is used.
vishay,vcnl4035
- Fix up buffer handling on big endian hosts which was broken due to
  casting of pointers to different sized integers.
vishay,veml6070
- Fix return value mess up that occurred when doing a guard() conversion.

* tag 'iio-fixes-for-7.0c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: light: veml6070: fix veml6070_read() return value
  iio: adc: nxp-sar-adc: Fix DMA channel leak in trigger mode
  iio: accel: adxl313: add missing error check in predisable
  iio: dac: ad5770r: fix error return in ad5770r_read_raw()
  iio: accel: fix ADXL355 temperature signature value
  iio: light: vcnl4035: fix scan buffer on big-endian
  iio: adc: ti-adc161s626: use DMA-safe memory for spi_read()
  iio: adc: ti-adc161s626: fix buffer read on big-endian
  iio: dac: mcp47feb02: Fix Vref validation [1-999] case
  iio: imu: bmi160: Remove potential undefined behavior in bmi160_config_pin()
  iio: orientation: hid-sensor-rotation: add timestamp hack to not break userspace
  iio: proximity: rfd77402: Fix completion race condition in IRQ mode
2026-03-29 15:27:12 +02:00
Greg Kroah-Hartman
37276dd6b6 IIO: 2nd set of fixes for the 7.0 cycle
Usual mixed bag of fixes for recent code and much older issues that have
 surfaced. Biggest group are continued resolution of IRQF_ONE_SHOT
 being used incorrectly (which now triggers a warning)
 
 adi,ad4062
 - Replace IRQF_ONESHOT (as no threaded handler) with IRQF_NO_THREAD as
   the caller makes use of iio_trigger_poll() which cannot run from a
   thread.
 adi,ade9000
 - Move mutex_init() earlier to ensure it is available if spurious IRQ
   occurs.
 adi,adis16550
 - Fix swapped gyro and accel filter functions.
 adi,adxl3380
 - Fix some bit manipulation that was always resulting in 0.
 - Fix incorrect register map for calibbias on the active power channel.
 - Fix returning IRQF_HANDLED from a function that should return 0 or
   -ERRNO.
 aspeed,adc
 - Clear a reference voltage bit that might be set prior to driver load.
 bosch,bno055
 - Off by one channel buffer sizing. Benine due to padding prior to the
   subsequent timestamp.
 hid-sensors
 - A more complex fix to IRQF_ONESHOT warning as this driver had a trigger
   that was never actually used but the ABI that exposed had to be
   maintained to avoid regressions.
 hid-sensors-rotation
 - An obscure buffer alignment case that applies to quaternions only was
   recently broken resulting in writes beyond the end of the channel buffer.
   Add a new core macro and apply it in this driver to make it very clear
   what was going on.
 honeywell,abp2030pa
 - Remove meaningless IRQF_ONESHOT from a non threaded IRQ handler.
   Warning fix only.
 invense,mpu3050
 - Fix token passed to free_irq() to match the one used at setup.
 - Fix an irq resource leak in error path.
 - Reorder probe so that userspace interfaces are exposed only after
   everything else has finished.
 - Reorder remove slightly to cleanup the buffer only after irq removed
   ensuring reverse of probe sequence.
 microchip,mcp47feb02
 - Fix use of mutex before it was initialized by not performing unnecessary
   lock that was early enough in probe that all code was serial.
 st,lsm6dsx
 - Ensure that FIFO ODR is only controllable for accel and gyro channels
   avoiding incorrect register accesses.
 - Restrict separation of buffer sampling from main sampling rate to
   accelerometer. It is only useful for running event detection faster
   than the fifo and the only events are on the accelerometer.
 ti,ads1018
 - Fix overflow of u8 which wasn't big enough to store max data rate value.
 ti,ads1119:
 - Fix unbalanced pm in an error path.
 - IRQF_ONESHOT (as no threaded handler) replaced with IRQF_NO_THREAD
   (needed for iio_trigger_poll()).
 - Ensure complete reinitialized before reuse. Previously it would have
   completed immediate after the first time.
 ti,ads7950
 - Fix return value of gpio_get() to be 0 or 1.
 - Avoid accidental overwrite of state resulting in gpio_get() only
   returning 0 or -ERRNO but never 1.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmm1PpURHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FojACQ/8CkIpTOWqybGXUSiuv/MWkyaTrlh7wfAg
 esL4Wf1kfbtfnZ30uh8k8oLF3b40k1AjjjqtKVkc0Bu3SuOG9+KsSlgztbBxkBs4
 WWhBBW1ZFEOn6Yldu0zjF99CrnsK03uYbFruMUTh2H/dV47UX4e48ZoVmP5BZsjt
 zdwIvSf+GYZCP0LcYMeLJECknVEBMK7tpa1OMffVsyWcmt7b3FpTk25q4jrhvM6Z
 PaZLVkBBFxKdYDBBr2eIboS8+Lo55I1s6/FghY9MnlDFM41lPKlBT+GH0bUT2ion
 LIOjIyUVlN6+mZHCTB2TPUR0ywibG/IsjoSR8zYkJMQ1FBW6zUAItMyCofbQHL2e
 NrmviAUcSReEhvGjnOK4+OZlSGQbLMu8eoYFU857x0QVg7hcNzrVviIVZie1WlQS
 8Hd3Lm3sXaDC6oN1ULxDmXriOvaPDFxUqzn8AhlvAiOXNqnbBWFmdGosQ3q5rklW
 vjpZh/1YRJ1wActcGJoMCTfbfOuyCc7Xt4E8fqk3tNfJlXHEY0DYc5agjjdrGhzA
 mVtfm3Ab8glz/vcq72SUVcxL/qVqvZHjEVho701bySIMj+aZwQGwM8KnG/5QaazQ
 euBr5hcfc12JtbrjN3Jpn6Wog7pF+Xzqza7mUnkUYrNQ3s0mGewRgBr2EzeXvnot
 KWiLytre94M=
 =JTTZ
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-7.0b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linux

Jonathan writes:

IIO: 2nd set of fixes for the 7.0 cycle

Usual mixed bag of fixes for recent code and much older issues that have
surfaced. Biggest group are continued resolution of IRQF_ONE_SHOT
being used incorrectly (which now triggers a warning)

adi,ad4062
- Replace IRQF_ONESHOT (as no threaded handler) with IRQF_NO_THREAD as
  the caller makes use of iio_trigger_poll() which cannot run from a
  thread.
adi,ade9000
- Move mutex_init() earlier to ensure it is available if spurious IRQ
  occurs.
adi,adis16550
- Fix swapped gyro and accel filter functions.
adi,adxl3380
- Fix some bit manipulation that was always resulting in 0.
- Fix incorrect register map for calibbias on the active power channel.
- Fix returning IRQF_HANDLED from a function that should return 0 or
  -ERRNO.
aspeed,adc
- Clear a reference voltage bit that might be set prior to driver load.
bosch,bno055
- Off by one channel buffer sizing. Benine due to padding prior to the
  subsequent timestamp.
hid-sensors
- A more complex fix to IRQF_ONESHOT warning as this driver had a trigger
  that was never actually used but the ABI that exposed had to be
  maintained to avoid regressions.
hid-sensors-rotation
- An obscure buffer alignment case that applies to quaternions only was
  recently broken resulting in writes beyond the end of the channel buffer.
  Add a new core macro and apply it in this driver to make it very clear
  what was going on.
honeywell,abp2030pa
- Remove meaningless IRQF_ONESHOT from a non threaded IRQ handler.
  Warning fix only.
invense,mpu3050
- Fix token passed to free_irq() to match the one used at setup.
- Fix an irq resource leak in error path.
- Reorder probe so that userspace interfaces are exposed only after
  everything else has finished.
- Reorder remove slightly to cleanup the buffer only after irq removed
  ensuring reverse of probe sequence.
microchip,mcp47feb02
- Fix use of mutex before it was initialized by not performing unnecessary
  lock that was early enough in probe that all code was serial.
st,lsm6dsx
- Ensure that FIFO ODR is only controllable for accel and gyro channels
  avoiding incorrect register accesses.
- Restrict separation of buffer sampling from main sampling rate to
  accelerometer. It is only useful for running event detection faster
  than the fifo and the only events are on the accelerometer.
ti,ads1018
- Fix overflow of u8 which wasn't big enough to store max data rate value.
ti,ads1119:
- Fix unbalanced pm in an error path.
- IRQF_ONESHOT (as no threaded handler) replaced with IRQF_NO_THREAD
  (needed for iio_trigger_poll()).
- Ensure complete reinitialized before reuse. Previously it would have
  completed immediate after the first time.
ti,ads7950
- Fix return value of gpio_get() to be 0 or 1.
- Avoid accidental overwrite of state resulting in gpio_get() only
  returning 0 or -ERRNO but never 1.

* tag 'iio-fixes-for-7.0b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (25 commits)
  iio: imu: adis16550: fix swapped gyro/accel filter functions
  iio: adc: aspeed: clear reference voltage bits before configuring vref
  iio: adc: ti-ads1119: Reinit completion before wait_for_completion_timeout()
  iio: adc: ti-ads1018: fix type overflow for data rate
  iio: adc: ti-ads7950: do not clobber gpio state in ti_ads7950_get()
  iio: adc: ti-ads7950: normalize return value of gpio_get
  iio: orientation: hid-sensor-rotation: fix quaternion alignment
  iio: add IIO_DECLARE_QUATERNION() macro
  iio: adc: ti-ads1119: Replace IRQF_ONESHOT with IRQF_NO_THREAD
  iio: imu: bno055: fix BNO055_SCAN_CH_COUNT off by one
  iio: hid-sensors: Use software trigger
  iio: adc: ad4062: Replace IRQF_ONESHOT with IRQF_NO_THREAD
  iio: gyro: mpu3050: Fix out-of-sequence free_irq()
  iio: gyro: mpu3050: Move iio_device_register() to correct location
  iio: gyro: mpu3050: Fix irq resource leak
  iio: gyro: mpu3050: Fix incorrect free_irq() variable
  iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only
  iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope only
  iio: dac: mcp47feb02: Fix mutex used before initialization
  iio: adc: ade9000: fix wrong return type in streaming push
  ...
2026-03-29 14:49:21 +02:00
Rodrigo Alencar
d185324efa iio: amplifiers: ad8366: add support for adrf5702/3
Add chip info structs and device table entries for ADRF5702 and ADRF5703
Digital Step Attenuators.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-26 20:10:26 +00:00
Nick Xie
8175ffc989 iio: adc: meson-saradc: add support for Meson S4
Add support for the SARADC found on the Amlogic Meson S4 SoC.
According to the documentation and current testing, it is fully
compatible with the G12A parameter set, so we reuse
`meson_sar_adc_g12a_data` for this new compatible string.

Although the device tree fallback mechanism could handle the match,
a dedicated entry is added to ensure the userspace ABI correctly
reports the specific part name ("meson-s4-saradc"). This allows
userspace to accurately identify the exact device and maintains
consistency across different firmware types where automatic fallback
parsing might be problematic.

Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Nick Xie <nick@khadas.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-26 19:56:51 +00:00
Milan Misic
7913c1de9c iio: imu: st_lsm6dsx: Add ACPI ID for SHIFT13mi gyroscope
The SHIFT13mi or SHIFTbook tablet device by the German manufacturer
SHIFT contains an STM LSM6DSO IMU declared in the DSDT with the
hardware ID SMOCF00. Add this ID to the ACPI match table so that the
driver binds correctly to this device.

WHO_AM_I register returns 0x6c, confirming LSM6DSO.

Signed-off-by: Milan Misic <twoexem@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-26 19:55:30 +00:00
Aldo Conte
d0b224cf9a iio: light: veml6070: fix veml6070_read() return value
veml6070_read() computes the sensor value in ret but
returns 0 instead of the actual result. This causes
veml6070_read_raw() to always report 0.

Return the computed value instead of 0.

Running make W=1 returns no errors. I was unable
to test the patch because I do not have the hardware.
Found by code inspection.

Fixes: fc38525135 ("iio: light: veml6070: use guard to handle mutex")
Signed-off-by: Aldo Conte <aldocontelk@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-26 08:22:33 +00:00
Siratul Islam
128e5ebec8 iio: proximity: add driver for ST VL53L1X ToF sensor
Add support for the STMicroelectronics VL53L1X Time-of-Flight
ranging sensor with I2C interface.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Siratul Islam <email@sirat.me>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-26 08:22:00 +00:00
Giorgi Tchankvetadze
6b4cd7b76e iio: adc: max11410: make vref register name arrays static const
The vrefp_regs and vrefn_regs arrays are constant lookup tables and
are not modified.

Make them static const so they are not reinitialized on each probe
call and are placed in read-only memory. Mark the pointer array as
const as well to prevent unintended modification.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-25 20:27:13 +00:00
Gabriel Rondon
7198b881fb iio: accel: bmc150-accel-core: use sysfs_emit() in show functions
Replace sprintf() with sysfs_emit() in sysfs attribute show
callbacks. sysfs_emit() is the preferred API as it is aware of the
sysfs buffer page size limit.

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-25 20:23:06 +00:00
Neel Bullywon
8abf158b84 iio: frequency: adf4350: replace TODO with NOTE in adf4350_set_freq()
Replace the TODO comment in adf4350_set_freq() with a NOTE explaining
that a constant-time approach using fls_long() was attempted but deemed
more complex without meaningful benefit for initialization code.

Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-25 20:20:16 +00:00
Kyle Hsieh
8625d418d2 iio: adc: ltc2309: add support for ltc2305
Add support for the LTC2305 ADC to the LTC2309 driver. The LTC2305 is
a 2-channel, 12-bit SAR ADC that is register-compatible with the
LTC2309 but has a different channel selection mapping and count.

To support multiple chips in this family, introduce ltc2309_chip_info
struct to store chip-specific channel specifications and names.
The probe function now uses i2c_get_match_data() to retrieve the
correct configuration for the detected device.

Specific channel addresses for LTC2305 (CH0, CH1, and differential
pairs) are added based on the datasheet.

Signed-off-by: Kyle Hsieh <kylehsieh1995@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-25 19:48:45 +00:00
Kyle Hsieh
999ca38066 iio: adc: ltc2309: explicitly assign hex values to channel enums
The current ltc2309_channels enum relies on implicit sequential
assignment. While this works for the 8-channel LTC2309, it is
not intuitive and makes it difficult to support other chips in
the same family that might have different bit mappings.

Explicitly assign hex values to the enum members based on the
channel selection bits defined in the datasheet. This improves
code readability and provides a consistent pattern for future
chip support.

Signed-off-by: Kyle Hsieh <kylehsieh1995@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-25 19:48:45 +00:00
Nikhil Gautam
2f5bdca14c iio: accel: adxl380: fix typo in PART_ID register macro
Fix a typo in the ADXL380_PART_ID_REG macro name where it was
incorrectly defined as ADLX380_PART_ID_REG.

Also update its usage in adxl380_setup().

Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-25 16:33:36 +00:00
Oleksij Rempel
af980a79bf iio: dac: ds4424: add Rfs-based scale and per-variant limits
Parse optional maxim,rfs-ohms values to derive the per-channel output
current scale (mA per step) for the IIO current ABI.

Behavior changes:
- If maxim,rfs-ohms is present, IIO_CHAN_INFO_SCALE becomes available
  and reports mA/step derived from Rfs.
- If maxim,rfs-ohms is missing, SCALE is not exposed to keep older DTs
  working without requiring updates.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:44:23 +00:00
Oleksij Rempel
cfeae3ce3e iio: dac: ds4424: convert to regmap
Refactor the driver to use the regmap API.

Replace the driver-specific mutex and manual shadow buffers with the
standard regmap infrastructure for locking and caching.

This ensures the cache is populated from hardware at probe, preventing
state desynchronization (e.g. across suspend/resume).

Define access tables to validate the different register maps of DS44x2
and DS44x4.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:44:23 +00:00
Oleksij Rempel
8d68801a69 iio: dac: ds4424: support per-variant output range limits
The DS4402/DS4404 variants operate with a 5-bit resolution (31 steps),
whereas the DS4422/DS4424 support 7-bit (127 steps).

Previously, the driver enforced a hardcoded 7-bit mask (DS4424_DAC_MASK)
for all variants. This allowed users to write values exceeding the 5-bit
range to DS4402/DS4404 devices, resulting in silent truncation or
undefined behavior.

Add a `result_mask` field to the chip_info structure to define the valid
data range for each variant. Use this mask to:
1. Correctly mask register values in read_raw().
2. Return -EINVAL in write_raw() if the input value exceeds the
   variant's capabilities.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:43:48 +00:00
David Jander
1fa14dd130 iio: dac: ds4424: add DS4402/DS4404 device IDs
Add I2C/OF IDs for DS4402 and DS4404 and set the correct channel count.
Follow-up changes add per-variant scaling based on external Rfs.

Co-developed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: David Jander <david@protonic.nl>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:43:47 +00:00
Oleksij Rempel
5ff37a60b3 iio: dac: ds4424: use fsleep() instead of usleep_range()
The DS4422/DS4424 and DS4402/DS4404 datasheets do not specify a minimum
delay between power-up (POR) and the availability of the I2C interface.

The driver previously used `usleep_range(1000, 1200)` to enforce a ~1ms
delay. Replace this with `fsleep(1000)` to allow the kernel to select
the most efficient sleep mechanism while retaining the existing
conservative delay to ensure device readiness.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:43:47 +00:00
Oleksij Rempel
3784044607 iio: dac: ds4424: use device match data for chip info
Refactor the driver to use device match data instead of checking ID enums
in a switch statement.

Define a `ds4424_chip_info` structure to hold variant-specific attributes
(currently just the channel count) and attach it directly to the I2C and
OF device ID tables.

This simplifies the probe function and makes it easier to add support for
new variants like DS4402/DS4404.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:43:22 +00:00
Oleksij Rempel
d2d5a6cb28 iio: dac: ds4424: rename iio_info struct to avoid ambiguity
Rename the static `ds4424_info` structure to `ds4424_iio_info`.

The previous name was generic and could be confused with chip-specific
data structures (like the upcoming `ds4424_chip_info`). The new name
explicitly indicates that this structure holds the IIO framework
callbacks.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:43:22 +00:00
Oleksij Rempel
809b578b99 iio: dac: ds4424: sort headers alphabetically
Sort the header inclusions alphabetically. This improves readability and
simplifies adding new includes in the future.

Group subsystem-specific headers (linux/iio/*) separately at the end
to clarify subsystem context.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:43:22 +00:00
Oleksij Rempel
c071adeb72 iio: dac: ds4424: ratelimit read errors and use device context
Replace pr_err() with dev_err_ratelimited() in the RAW read path to avoid
log spam on repeated I2C failures and to include the device context.

Use %pe to print errno names for faster debugging. Use the parent
device context to identify the physical hardware causing the error.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:38:30 +00:00
Oleksij Rempel
a718013647 iio: dac: ds4424: refactor raw access to use bitwise operations
Refactor the raw access logic to use standard GENMASK() and BIT()
macros. Use abs() for magnitude calculation to simplify the logic and
make the data flow clearer.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:38:30 +00:00
Jonathan Cameron
9e4e86a604 Linux 7.0-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCgA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmm3G/UeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGZJUH/R0vQ3Vha48QDEic
 1NREwaHxAoTFi0i3y7OPPklqrP2V09D1qg4Q6fExYQVTQgV6F2DRjVbyPKrmr4ay
 BA6aHrUdnFngYHpDlI1b1r7rJiAIN4WFHl7StO70bS+EB+UPsP9cfP3CKXUfKfqT
 kyHXzUrd5QnjYmlb9rQw1E6rzsRamNtGUtZf7TwDidJYjtm3sPeDHUkjyRy4xkYd
 UouIu6W7UXoicl38bJAgaWBY5BiYtjN6ktnY4/gcqDeqYd7mTM3Eb1B+OSXgFfip
 F0OYfJhfWn+63WnPA+1I5jXWC1UrdVXTMK/NTYjhmGlfdmkLcWDlNGtu+qKZbpwj
 fmF3Kyo=
 =6nX1
 -----END PGP SIGNATURE-----

Merge tag 'v7.0-rc4' into togreg

Linux 7.0-rc4

Required for the ds4422 series which is build upon;
5187e03b81 ("iio: dac: ds4424: reject -128 RAW value")
2026-03-22 12:20:42 +00:00
Felix Gu
2452969ca1 iio: adc: nxp-sar-adc: Fix DMA channel leak in trigger mode
The DMA channel was requested in nxp_sar_adc_buffer_postenable() but
was only released in nxp_sar_adc_buffer_software_do_predisable().
This caused a DMA channel resource leak when operating in trigger mode.

Fix this by moving dma_request_chan() from
nxp_sar_adc_buffer_postenable() into
nxp_sar_adc_buffer_software_do_postenable(), ensuring the DMA channel
is only requested in software mode.

Fixes: 4434072a89 ("iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 12:15:31 +00:00
Antoniu Miclaus
9d3fa23d5d iio: accel: adxl313: add missing error check in predisable
Check the return value of the FIFO bypass regmap_write() before
proceeding to disable interrupts.

Fixes: ff8093fa6b ("iio: accel: adxl313: add buffered FIFO watermark with interrupt handling")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 11:48:12 +00:00
Antoniu Miclaus
c354521708 iio: dac: ad5770r: fix error return in ad5770r_read_raw()
Return the error code from regmap_bulk_read() instead of 0 so
that I/O failures are properly propagated.

Fixes: cbbb819837 ("iio: dac: ad5770r: Add AD5770R support")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 11:46:26 +00:00
Valek Andrej
4f51e6c0ba iio: accel: fix ADXL355 temperature signature value
Temperature was wrongly represented as 12-bit signed, confirmed by checking
the datasheet. Even if the temperature is negative, the value in the
register stays unsigned.

Fixes: 12ed27863e iio: accel: Add driver support for ADXL355
Signed-off-by: Valek Andrej <andrej.v@skyrain.eu>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 11:43:00 +00:00
Antoniu Miclaus
6849c6356b iio: frequency: ad9523: use dev_err_probe
Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 21:12:24 +00:00
Antoniu Miclaus
9582a65eda iio: frequency: ad9523: add dev variable
Introduce a local struct device variable in ad9523_probe() to simplify
subsequent conversions and improve code readability.

Split pdata declaration and assignment since the result is validated
immediately after.

No functional change.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 21:12:24 +00:00
Antoniu Miclaus
7428168fe1 iio: frequency: admv4420: use dev_err_probe
Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Also fix the format specifier for vco_freq_hz from %lld to %llu since
it is u64 (unsigned), and add missing newline to the error message.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 21:12:24 +00:00
Antoniu Miclaus
e81f3889c2 iio: frequency: admv4420: add dev variable
Introduce a local struct device variable in admv4420_probe() to
simplify subsequent conversions and improve code readability.

No functional change.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 21:12:23 +00:00
Giorgi Tchankvetadze
b37cce0bac iio: adc: ad_sigma_delta: Format block comments
Format the multi-line comment in ad_sd_set_comm() according to
the kernel multi-line comment style.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 21:07:00 +00:00
David Lechner
7806c060cc iio: adc: ti-ads7950: use iio_push_to_buffers_with_ts_unaligned()
Use iio_push_to_buffers_with_ts_unaligned() to avoid unaligned access
when writing the timestamp in the rx_buf.

The previous implementation would have been fine on architectures that
support 4-byte alignment of 64-bit integers but could cause issues on
architectures that require 8-byte alignment.

Fixes: 902c4b2446 ("iio: adc: New driver for TI ADS7950 chips")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 21:03:36 +00:00
David Lechner
fdc7aa54a5 iio: light: vcnl4035: fix scan buffer on big-endian
Rework vcnl4035_trigger_consumer_handler() so that we are not passing
what should be a u16 value as an int * to regmap_read(). This won't
work on bit endian systems.

Instead, add a new unsigned int variable to pass to regmap_read(). Then
copy that value into the buffer struct.

The buffer array is replaced with a struct since there is only one value
being read. This allows us to use the correct u16 data type and has a
side-effect of simplifying the alignment specification.

Also fix the endianness of the scan format from little-endian to CPU
endianness. Since we are using regmap to read the value, it will be
CPU-endian.

Fixes: 55707294c4 ("iio: light: Add support for vishay vcnl4035")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 20:59:50 +00:00
David Lechner
768461517a iio: adc: ti-adc161s626: use DMA-safe memory for spi_read()
Add a DMA-safe buffer and use it for spi_read() instead of a stack
memory. All SPI buffers must be DMA-safe.

Since we only need up to 3 bytes, we just use a u8[] instead of __be16
and __be32 and change the conversion functions appropriately.

Fixes: 4d671b71be ("iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 20:45:18 +00:00
David Lechner
24869650df iio: adc: ti-adc161s626: fix buffer read on big-endian
Rework ti_adc_trigger_handler() to properly handle data on big-endian
architectures. The scan data format is 16-bit CPU-endian, so we can't
cast it to a int * on big-endian and expect it to work. Instead, we
introduce a local int variable to read the data into, and then copy it
to the buffer.

Since the buffer isn't passed to any SPI functions, we don't need it to
be DMA-safe. So we can drop it from the driver data struct and just
use stack memory for the scan data.

Since there is only one data value (plus timestamp), we don't need an
array and can just declare a struct with the correct data type instead.

Also fix alignment of iio_get_time_ns() to ( while we are touching this.

Fixes: 4d671b71be ("iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 20:41:45 +00:00
Sanjay Chitroda
1ac30f58f0 iio: st_sensors: drop temporary kmalloc buffer and reuse buffer_data
Replace the per-call kmalloc() scratch buffer with the existing
buffer_data[] field present in struct st_sensor_data. The existing buffer
is DMA-aligned and sufficiently sized for all channel widths, so using it
avoids unnecessary dynamic memory allocation on each read.

This simplifies the code, removes redundant allocation and cleanup.
No functional change intended.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 20:09:55 +00:00
Chuang Zhu
733bcf18ea iio: adc: ina2xx: add INA236 support
The calibration divisor is not directly specified in the datasheet, but can be calculated:

I = Current_LSB * Current
Current = ShuntVoltage * CAL / calibration_divisor
CAL = 0.00512 / (Current_LSB * Rshunt)
ShuntVoltage = Vshunt / ShuntVoltage_LSB

=> I = (0.00512 / (calibration_divisor*ShuntVoltage_LSB)) * (Vshunt / Rshunt)

Ohm's law, I = Vshunt / Rshunt
=> 0.00512 / (calibration_divisor*ShuntVoltage_LSB) = 1

ShuntVoltage_LSB = 2.5 uV = 0.0000025 V
=> calibration_divisor = 2048

Signed-off-by: Chuang Zhu <git@chuang.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:44:15 +00:00
David Lechner
54dde4b1ed iio: light: as73211: remove duplicate zero init of scan.chan[3]
Remove setting scan.chan[3] to zero. Since commit 433b99e922 ("iio:
light: as73211: Ensure buffer holes are zeroed"), the entire scan struct
is zeroed before being filled with data, so this is redundant.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:35:56 +00:00
Shi Hao
88d699da8a iio: amplifiers: fix typo from Curren to Current
Fix incorrect spelling from Curren to Current.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:30:24 +00:00
Shi Hao
1011a6bd86 iio: cdc: fix spelling mistakes in comments
Fix spelling mistakes in comments.

- becaue -> because
- reenable -> re-enable
- irq's -> IRQs

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:29:49 +00:00
Shi Hao
1a18c847c8 iio: chemical: rephrase comment and fix a typo
Rephrase the comment and fix a spelling mistake.

- insuffient -> insufficient

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:29:08 +00:00
Shi Hao
96f4640521 iio: common: fix spelling mistakes in comments
Fix spelling mistakes in comments.

- exepects -> expects
- fuction -> function
- theoritical -> theoretical
- appopriate -> appropriate
- iio -> IIO

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:28:19 +00:00
Shi Hao
5088fc7448 iio: test: fix typo from neeeds to needs in comment
Fix incorrect spelling from neeeds to needs.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:27:32 +00:00
Shi Hao
abf88d037b iio: temp: fix spelling mistakes in comments
Fix spelling mistakes in comments.

- catched -> caught
- chanel -> channel

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:27:08 +00:00