Commit Graph

3060 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
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
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
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
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
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
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
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
Shi Hao
a27bace4d5 iio: adc: add an article and use digitize instead of digitalize
Use digitize instead of digitalize, which is the correct technical term,
and add an article for clarity.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:13:12 +00:00
Billy Tsai
58b98c66e6 iio: adc: aspeed: Reserve battery sensing channel for on-demand use
For controllers with battery sensing capability (AST2600/AST2700), the
last channel uses a different circuit design optimized for battery
voltage measurement. This channel should not be enabled by default
along with other channels to avoid potential interference and power
efficiency issues.
This ensures optimal power efficiency for normal ADC operations while
maintaining full functionality when battery sensing is needed.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 15:52:22 +00:00
Billy Tsai
66ab53c286 iio: adc: aspeed: Replace mdelay() with fsleep() for ADC stabilization delay
The ADC stabilization delays in compensation mode and battery sensing
mode do not require atomic context. Using mdelay() here results in
unnecessary busy waiting.

Replace mdelay(1) with fsleep(1000) to allow the scheduler to run other
tasks while waiting for the ADC to stabilize.

Also fix a minor typo in the comment ("adc" -> "ADC").

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 15:49:16 +00:00
Billy Tsai
9ee1c3be16 iio: adc: Enable multiple consecutive channels based on model data
Add helpers to generate channel masks and enable multiple ADC channels
according to the device model's channel count.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 15:48:53 +00:00
Billy Tsai
a28069be7d iio: adc: Add battery channel definition for ADC
Defines a constant for the battery sensing channel, typically the last
channel of the ADC. Clarifies channel usage and improves code
readability.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 15:48:37 +00:00
Giorgi Tchankvetadze
8c7440c686 iio: adc: mt6359-auxadc: Fix comma spacing
Fix incorrect whitespace around comma on line 325 to comply with
kernel coding style. This silences checkpatch errors "ERROR: space
prohibited before that ','" and "ERROR: space required after that ','".
No functional change.

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-15 12:29:43 +00:00
David Lechner
ff0843ceb1 iio: adc: ti-ads7950: remove chip_info[]
Remove the chip_info[] array and related enum used for looking up chip-
specific information. Instead, use individual structs directly in the
module device tables.

Also update to use spi_get_device_match_data() in case the devicetree
table is ever used instead of the SPI device ID table.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-14 12:10:22 +00:00
Giorgi Tchankvetadze
c48012d519 iio: adc: palmas_gpadc: Replace leading space indentation with tabs
Fix lines starting with spaces instead of tabs to comply with the
kernel coding style.

No functional change.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-14 12:10:22 +00:00
Rosen Penev
d6f2eac644 iio: adc: meson: no devm for nvmem_cell_get
There is no reason to extend the lifetime of this post removal of the
driver when it's only needed in one spot.

Moved tsc_regmap assignment to avoid two nvmem_cell_put calls.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-14 12:10:21 +00:00
Rosen Penev
8d86130364 iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
There is absolutely no reason to pospone cleanup of this post driver
removal. Just do it immediately.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-14 12:10:21 +00:00
Giorgi Tchankvetadze
af2f069b78 iio: adc: max1363: Reformat enum and array initializers
Reformat the device enum so each entry is on its own line and add a
trailing comma to the final enumerator. Also reformat the nearby monitor
speeds array for consistency.

No functional change.

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-14 12:10:03 +00:00
Billy Tsai
7cf2f6ed8e iio: adc: aspeed: clear reference voltage bits before configuring vref
Ensures the reference voltage bits are cleared in the ADC engine
control register before configuring the voltage reference. This
avoids potential misconfigurations caused by residual bits.

Fixes: 1b5ceb55fe ("iio: adc: aspeed: Support ast2600 adc.")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-07 13:27:38 +00:00
Felix Gu
2f16809417 iio: adc: ti-ads1119: Reinit completion before wait_for_completion_timeout()
The completion is not reinit before wait_for_completion_timeout(),
so wait_for_completion_timeout() will return immediately after
the first successful completion.

Fixes: a9306887eb ("iio: adc: ti-ads1119: Add driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-07 13:18:09 +00:00
Chunyang Chen
6f658d19a5 iio: adc: ti-ads1018: fix type overflow for data rate
The variable 'drate' is currently defined as u8. However, the data rate
values in ads1018 can reach up to 3300 Hz, which exceeds the maximum
value of 255 that a u8 can hold.

Change the type of 'drate' to u32 to match the data_rate_mode_to_hz
array definition and ensure the data rate is handled correctly.

Fixes: bf0bba486b ("iio: adc: Add ti-ads1018 driver")
Signed-off-by: Chunyang Chen <chenchunyang0908@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-07 13:17:59 +00:00
Dmitry Torokhov
d20bbae6e5 iio: adc: ti-ads7950: do not clobber gpio state in ti_ads7950_get()
GPIO state was inadvertently overwritten by the result of spi_sync(),
resulting in ti_ads7950_get() only returning 0 as GPIO state (or error).

Fix this by introducing a separate variable to hold the state.

Fixes: c97dce792d ("iio: adc: ti-ads7950: add GPIO support")
Reported-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-07 11:40:37 +00:00
Dmitry Torokhov
e2fa075d5c iio: adc: ti-ads7950: normalize return value of gpio_get
The GPIO get callback is expected to return 0 or 1 (or a negative error
code). Ensure that the value returned by ti_ads7950_get() for output
pins is normalized to the [0, 1] range.

Fixes: 86ef402d80 ("gpiolib: sanitize the return value of gpio_chip::get()")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-07 11:40:17 +00:00
Svyatoslav Ryhel
18a1ae3e73 iio: adc: cpcap-adc: add support for Mot ADC
Add support for ADC found in Motorola Mot board, used as a base for
Atrix 4G and Droid X2 smartphones.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-03 21:20:03 +00:00
Antoniu Miclaus
0555e56f4c iio: adc: ti-ads1015: remove unused enabled field
Remove unused enabled field from ads1015_channel_data
struct. The field is declared but never accessed in the
driver.

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-03 21:20:02 +00:00
Antoniu Miclaus
726c1035ba iio: adc: nau7802: remove unused min_conversions field
Remove unused min_conversions field from nau7802_state
struct. The field is declared but never accessed in the
driver.

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-03 21:20:02 +00:00
Antoniu Miclaus
d41114a74e iio: adc: max1363: remove unused requestedmask field
Remove unused requestedmask field from max1363_state struct.
The field is declared but never accessed in the driver.

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-03 21:20:02 +00:00
Antoniu Miclaus
8c0af74e25 iio: adc: ad9467: remove unused output_mode field
Remove unused output_mode field from ad9467_state struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-03 21:20:02 +00:00
Antoniu Miclaus
1062f21ce1 iio: adc: ad7793: remove unused int_vref_mv field
Remove unused int_vref_mv field from ad7793_state struct.
The field is declared but never accessed in the driver.

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-03 21:20:02 +00:00
Antoniu Miclaus
1a993d5686 iio: adc: ad7768-1: remove unused mclk_div field
Remove unused mclk_div field from ad7768_state struct.
The field is declared but never accessed in the driver.

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-03 21:20:02 +00:00
Antoniu Miclaus
c1de86dab6 iio: adc: ad4080: remove unused dec_rate field
Remove unused dec_rate field from ad4080_state struct.
The driver reads/writes decimation rate directly from
hardware registers via ad4080_get_dec_rate() and
ad4080_set_dec_rate() functions.

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-03 21:20:01 +00:00
Giorgi Tchankvetadze
5c3cf14b82 iio: adc: ade9000: remove unused ADE9000_ST_ERROR macro
The ADE9000_ST_ERROR macro references ADE9000_ST1_ERROR0
through ADE9000_ST1_ERROR3, but the actual defined symbols
use the BIT suffix. Since this macro is currently unused
in the driver, remove it entirely rather than fixing the names.
It can be reintroduced in a future patch when it is actually needed.

The individual error bit definitions (bits 28-31 of the STATUS1
register at 0x403) are retained as they follow the convention of
defining all register fields.

Reference: ADE9000 datasheet (Rev. B, Page 61), STATUS1 register
(0x403), bits 28-31 define ERROR0 through ERROR3 status flags.

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-02 20:03:43 +00:00
Felix Gu
36f6d4db3c iio: adc: ti-ads1119: Replace IRQF_ONESHOT with IRQF_NO_THREAD
As there is no threaded handler, replace devm_request_threaded_irq()
with devm_request_irq(), and as the handler calls iio_trigger_poll()
which may not be called from a threaded handler replace IRQF_ONESHOT
with IRQF_NO_THREAD.

Since commit aef30c8d56 ("genirq: Warn about using IRQF_ONESHOT
without a threaded handler"), the IRQ core checks IRQF_ONESHOT flag
in IRQ request and gives a warning if there is no threaded handler.

Fixes: a9306887eb ("iio: adc: ti-ads1119: Add driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-02 19:58:23 +00:00
Felix Gu
dad46509b6 iio: adc: ti-ads1119: Drop redundant error message
devm_request_threaded_irq already prints an error message when failure,
so the error message is redundant, drop it.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-02 19:49:47 +00:00
Jonathan Santos
6ea592a31b iio: adc: ad7768-1: add support for SPI offload
The AD7768-1 family supports sampling rates up to 1 MSPS, which exceeds
the capabilities of conventional triggered buffer operations due to SPI
transaction overhead and interrupt latency.

Add SPI offload support to enable hardware-accelerated data acquisition
that bypasses software SPI transactions using continuous data streaming.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 12:10:23 +00:00
Jonathan Santos
68fe7c28fa iio: adc: ad7768-1: disable IRQ autoenable
The device continuously converts data while powered up, generating
interrupts in the background. Configure the IRQ to be enabled and
disabled manually as needed to avoid unnecessary CPU load.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 12:07:11 +00:00
Jonathan Santos
81fdc3127d iio: adc: ad7768-1: remove switch to one-shot mode
wideband low ripple FIR Filter is not available in one-shot mode. In
order to make direct reads work for all filter options, remove the
switch for one-shot mode and guarantee device is always in continuous
conversion mode.

Fixes: fb1d3b24eb ("iio: adc: ad7768-1: add filter type and oversampling ratio attributes")
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 12:07:05 +00:00
Jonathan Santos
8be19e2337 iio: adc: ad7768-1: fix one-shot mode data acquisition
According to the datasheet, one-shot mode requires a SYNC_IN pulse to
trigger a new sample conversion. In the current implementation, No sync
pulse was sent after switching to one-shot mode and reinit_completion()
was called before mode switching, creating a race condition where spurious
interrupts during mode change could trigger completion prematurely.

Fix by sending a sync pulse after configuring one-shot mode and
reinit_completion() to ensure it only waits for the actual conversion
completion.

Fixes: a5f8c7da3d ("iio: adc: Add AD7768-1 ADC basic support")
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 12:06:57 +00:00
Marcelo Schmitt
185f7b6cee iio: adc: ad4030: Add support for ADAQ4216 and ADAQ4224
ADAQ4216 and ADAQ4224 are similar to AD4030, but feature a PGA circuitry
that scales the analog input signal prior to it reaching the ADC. The PGA
is controlled through a pair of pins (A0 and A1) whose state define the
gain that is applied to the input signal.

Add support for ADAQ4216 and ADAQ4224. Provide a list of PGA options
through the IIO device channel scale available interface and enable control
of the PGA through the channel scale interface.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 12:04:44 +00:00
Marcelo Schmitt
a98edf7de5 iio: adc: ad4030: Add SPI offload support
AD4030 and similar ADCs can capture data at sample rates up to 2 mega
samples per second (MSPS). Not all SPI controllers are able to achieve such
high throughputs and even when the controller is fast enough to run
transfers at the required speed, it may be costly to the CPU to handle
transfer data at such high sample rates. Add SPI offload support for AD4030
and similar ADCs to enable data capture at maximum sample rates.

Note that a pair of PWM devices are used for the supported setup. One of
the PWM goes to the ADC CNV pin to initiate conversions while the other PWM
is connected to the SPI offload trigger to signal when to fetch data from
the peripheral. Note also that the PWMs must be somewhat synchronized such
to make the controller run transfers only when ADC sample data is
available. See Documentation/iio/ad4030.rst for details.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Co-developed-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 12:04:44 +00:00
Giorgi Tchankvetadze
1037352197 iio: adc: fix typos found by codespell
Fix various spelling mistakes in comments and error messages
across drivers/iio/adc/, found by running codespell.

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-01 12:04:44 +00:00
Felix Gu
20c2a46da4 iio: adc: ad4062: Replace IRQF_ONESHOT with IRQF_NO_THREAD
In ad4062_request_irq(), when request irq for "gp1", the code uses
IRQF_ONESHOT flag, which is not appropriate for a primary handler
that does not have a secondary threaded handler.

And since commit aef30c8d56 ("genirq: Warn about using IRQF_ONESHOT
without a threaded handler"), the IRQ core checks IRQF_ONESHOT flag
in IRQ request and gives a warning if there is no threaded handler.

Since there is no threaded handler, replace devm_request_threaded_irq
with devm_request_irq, and replace IRQF_ONESHOT with IRQF_NO_THREAD.

Also remove an extraneous semicolon at the end of
ad4062_write_raw_dispatch().

Found by code review, compile pass.

Fixes: d5284402d2 ("iio: adc: Add support for ad4062")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 11:20:11 +00:00