Commit Graph

1428625 Commits

Author SHA1 Message Date
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
Siratul Islam
2c9225e8d2 dt-bindings: iio: proximity: add ST VL53L1X ToF sensor
Add device tree binding documentation for the STMicroelectronics
VL53L1X Time-of-Flight ranging sensor connected via I2C.

vdd-supply is not made globally required to maintain backwards
compatibility with existing st,vl53l0x devicetrees that do not specify it.

Signed-off-by: Siratul Islam <email@sirat.me>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-26 08:20: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
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
Kyle Hsieh
732df35bbb dt-bindings: adc: ltc2497: add support for ltc2305
Add documentation for the 2-channel LTC2305 ADC in the
existing ltc2497 binding.
This enables automatic device tree matching for LTC2305
while using the LTC2309 driver (drivers/iio/adc/ltc2309.c),
since both ADCs share the same I2C interface and 12-bit SAR architecture.
The main difference is the number of channels (LTC2305: 2, LTC2309: 8).

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
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
f789b8cc39 dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
The Maxim DS4422/DS4424 and DS4402/DS4404 current DACs determine their
full-scale output current via external resistors (Rfs) connected to the
FSx pins. Without knowing these values, the full-scale range of the
hardware is undefined.

Add the 'maxim,rfs-ohms' property to describe these physical components.
This property is required to provide a complete description of the
hardware configuration.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Conor Dooley <conor.dooley@microchip.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
a7622a651d dt-bindings: iio: dac: maxim,ds4424: add ds4402/ds4404
Add compatible strings for Maxim DS4402 and DS4404 current DACs.
These devices are 5-bit variants of the DS4422/DS4424 family.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Conor Dooley <conor.dooley@microchip.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 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
Randy Dunlap
e8b83499b4 iio: st_sensors: correct kernel-doc issues
Use the proper kernel-doc format and struct member names to avoid
kernel-doc warnings:

Warning: include/linux/iio/common/st_sensors.h:184 struct member 'int1'
 not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:184 struct member 'int2'
 not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:184 struct member
 'stat_drdy' not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:184 struct member 'ig1'
 not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:219 struct member
 'num_ch' not described in 'st_sensor_settings'
Warning: ../include/linux/iio/common/st_sensors.h:263 struct member
 'num_data_channels' not described in 'st_sensor_data'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-22 11:53:19 +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
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
Shi Hao
761451473f iio: resolver: fix typo from degredation to degradation
Fix incorrect spelling from degredation to degradation and fixed
up some missing spaces prior to */

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:21:25 +00:00
Shi Hao
22dd6499c1 iio: proximity: fix typo from currenly to currently
Fix incorrect spelling from currenly to currently.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:18:01 +00:00
Shi Hao
896b6508ac iio: pressure: fix spelling mistakes in comments
Fix several spelling mistakes in comments.

- opertion -> operations
- transfered -> transferred
- usng -> using
- externaly -> externally

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:16:08 +00:00
Shi Hao
2354338cc8 iio: magnetometer: fix various spelling mistakes
Fix spelling mistakes in comments.

- follwing -> following
- atleast -> at least
- occured -> occurred
- measurment -> measurement
- rougly -> roughly

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:15:32 +00:00
Shi Hao
d5036cd38a iio: imu: fix typo from adjustement to adjustment
Fix incorrect spelling in a comment.

- adjustement -> adjustment

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:13:51 +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
Shi Hao
0dcaf3db24 iio: light: fix several incorrect spellings
Fix spelling mistakes reported by codespell.

- sesnor -> sensor
- substraction -> subtraction
- simulataneous -> simultaneous
- proccessed -> processed
- coefficents -> coefficients

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:12:14 +00:00
Shi Hao
db0da4b7f6 iio: accel: fix typo celcius to Celsius
Fix incorrect spelling in comments
- celcius -> Celsius

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-21 19:09:41 +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