summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-21 17:25:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-21 17:25:20 +0300
commite354cc78f7285ae656f745813873b3fcfba20221 (patch)
tree5aab1935045f35c32202a1ce09d707a27c5c8f56 /include/linux
parent623db9a1dd91317a05a7aca272a0dc19fa88b4b8 (diff)
parentf9e05791642810a0cf6237d39fafd6fec5e0b4bb (diff)
downloadlinux-e354cc78f7285ae656f745813873b3fcfba20221.tar.xz
Merge tag 'iio-for-6.19a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes: IIO: New device support, features and cleanup for 6.19 The usual bunch of new device support, but also quite a bit of cleanup of the core and older drivers which is always good to see. New device support ------------------ adi,ad4080 - Add support for AD4081, AD4083, AD4084, AD4086 and AD4087 ADCs with slightly different features to existing supported parts (max CNV clock count, resolution etc) adi,adxl380 - Add support for ADXL318 and ADXL319 which have reduced functionality compared to other supported parts, particularly around event detection. aosong,adp810 - New driver for this differential pressure and temperature sensor. aspeed,adc - Add support for the AST2700 SoC ADCs which differ in small ways from already supported parts. bosch,sm330 - New driver for this IMU (accelerometer + gyroscop) with I2C and SPI bus support. invensense,icm45600 - New driver for this family of IMUs with sub drivers for accelerometer and gyroscope elements. I2C, I3C and SPI busses all supported. * Supports ICM45605, ICM45606, ICM45608, ICM45634, ICM45686, ICM45687, ICM45688P, ICM45689. * Support basic features and FIFO. maxim,max14001 - New driver for the MAX14001 and MAX14002 ADCs. renesas,rzt2h - New driver supporting the RZ/T2H and RZ/N2H ADCs found in various SoCs. renesas,rznl - New driver supporting the RZ/NL ADC found in various SoCs. Features -------- adi,ad5446 - Add a DT binding doc for the 29 variants currently covered by the driver. - Add adi,ad5542 which is compatiable with the adi,ad5542a which was already supported. bosch,bma220 - I2C support including an I2C bus watchdog. - Power supply control - Data ready trigger. - Low pass filter control. - Debugfs register access. - Add Petre Rodan as a maintainer of this driver (thanks!) bosch,bmi270 - Add support for motion events. fsl,mpl3115 - Add a dataready trigger and related sampling frequency control. - Add threshold events. infineon,dps310 - Add a specific device tree binding. maxim,max30100 - Allow control of LED pulse-width in dt-binding. Optimum value depends on physical characteristics of the device which contains this sensor. mediatek,mt2701 - Add dt compatible for the mt8189. rockchip,saradc - Add rk3506 compatible which is functionally the same as the already supported rk3528 (which is therefore the fallback) st,lsm6dsx - Make sampling more flexible when both fifo and events are of interest by decoupling the FIFO fill rate from actual sampling. Cleanup and minor fixes ----------------------- core - Document and add might_sleep() to iio_push_to_buffers_with_ts_unaligned() as it allocates a buffer, typically just on 1st call. - Add documentation for iio_push_to_buffers_with_ts() which is being used to replace iio_push_to_buffers_with_timestamp() in new code as it validates the buffer size. Make the deprecation of the old function clear. - Document that the store_to() callback in struct iio_buffer_access_funcs may be called from contexts that cannot sleep. - Document that the cb() provided to a callback buffer may be called from contexts that cannot sleep. - Cleanup up industrialio-backend.c comments. - Call mutex_destroy() in cleanup of buffers. - Call device_initialize() later to avoid having to call device_put() before configuration is otherwise complete. - Use mutex_init_with_key() to replace opencoded version. - Use dma_buf_unmap_attachment_unlocked() to replace opencoded version. - Reorder Makefile for pressure sensors. various - Uses sysfs_emit() to replace sprintf() in read_label() and other callbacks that typically are used to write data to sysfs buffers. - Switch to REGCACHE_MAPLE in various drivers. adi,docs - Fix up formatting of cross references and other kernel-doc issues. adi,ad4080 - Fix wrong masking of product IDs. adi,ad5446 - Use DMA safe buffers as needed for SPI. - Drop a duplicate device chip specific data structure where two parts are functionally identical. - Fail probe if reference is not available. - Split up the massive array of chip type specific structures into separate structures as this tends to be easier to read and maintain. - Add explicit of_device_id entries for all supported parts. - Split I2C and SPI parts away from core to avoid ifdef complexity. - Switch to devm_mutex_init(). - Make use of guard() to simplify code. - Applying IWYU principles and reorder headers. - Various other minor cleanup. adi,ad7124 - Add debugfs to support single cycle mode, typically only used for cases such as validate performance of the ADC. - Various other minor cleanup including removing some layers of indirection that weren't necessary. - Add extended attributes to the temperature channel which follows the same signal path as other channels. - Replace the setup register allocation strategy with a simpler more predictable one (a fix for OOB from this code follows later in this pull request). adi,adxl345 - Ensure dt-binding allows for both interrupt wired at the same time. arm,scmi - Replace const_ilog2() with the resulting value which ends up simpler to read. bosch,bma220 - Add correct SPI mode specification to the device tree binding. - Fix up interrupt type in dt binding example to match that the driver expects. - Relax hard constraint on matching chip ID with a message only so as to enable fallback DT compatibles to work. - Use local struct device *dev to replaces lots of indirect look ups. - Improve includes on approximate IWYU basis. - Explicit of_match_table. - Reset some registers during probe. - Move to regmap. - Ensure a timestamp is available when filling the buffer by using a locally acquired one rather than relying on trigger top half running. - Add a utility function to search value pair tables for a match. - Various other minor improvements. - Move code to avoid a false dependency of the core code on the I2C module. bosch,bma400 - Improve register and field naming + organization. Use with FIELD_GET() and FIELD_PREP() to allow dropping of shift defines. - Use macros to define event related fields. - Switch to an address lookup based on an index variable to replace lots of very similar register macros. - Rename activity_event_en() to generic_event_en() to better reflect what it does. - Improve comments around interrupt register handling. fsl,mpl3115 - Factor out code for triggered buffer data collection. - Use more consistent register field naming style. - Use get_unaligned_be24() to get the pressure. invensense,mpu6050 - Drop false requirement in DT binding for the interrupt. The driver will be able to do less if one is not provided, but some features are still available. invensense,icm45600_i3c - Fix missing return on failure to match part. linear,ltc2688 - Use devm_mutex_init() so mutex_destroy() is called in tear down path. - Use guard() to simplify lock handling in error return paths. qcom,vadc - Fix up some kernel-doc related warnings. rohm,bd79112 and bd79124 - Use regmap_reg_range() helper to set the ranges. st,lsm6dsx - Fix units of ODR in structure documentation. ti,am335x - Add range checks to avoid a compiler warning. ti,pac1934 - Switch to system_percpu_wq. Various other minor typo fixes etc. * tag 'iio-for-6.19a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (150 commits) staging: iio: adt7316: replace sprintf() with sysfs_emit() iio: pressure: Arrange Makefile alphabetically iio: ABI: document pressure event attributes iio: mpl3115: add threshold events support iio: mpl3115: use get_unaligned_be24() to retrieve pressure data iio: buffer: use dma_buf_unmap_attachment_unlocked() helper iio: core: Replace lockdep_set_class() + mutex_init() by combined call iio: core: Clean up device correctly on iio_device_alloc() failure iio: core: add missing mutex_destroy in iio_dev_release() iio: accel: adxl380: add support for ADXL318 and ADXL319 dt-bindings: iio: accel: adxl380: add new supported parts iio: imu: inv_icm45600: Initializes inv_icm45600_buffer_postdisable() sleep iio: adc: pac1934: replace use of system_wq with system_percpu_wq iio: dac: ad5446: Add AD5542 to the spi id table iio: dac: ad5446: Fix coding style issues iio: dac: ad5446: Refactor header inclusion iio: dac: ad5446: Make use of the cleanup helpers iio: dac: ad5446: Make use of devm_mutex_init() iio: dac: ad5446: Separate I2C/SPI into different drivers iio: dac: ad5456: Add missing DT compatibles ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iio/adc/qcom-vadc-common.h27
-rw-r--r--include/linux/iio/buffer.h22
-rw-r--r--include/linux/iio/buffer_impl.h3
-rw-r--r--include/linux/iio/consumer.h3
-rw-r--r--include/linux/iio/imu/adis.h45
5 files changed, 71 insertions, 29 deletions
diff --git a/include/linux/iio/adc/qcom-vadc-common.h b/include/linux/iio/adc/qcom-vadc-common.h
index aa21b032e861..3bf4c49726a7 100644
--- a/include/linux/iio/adc/qcom-vadc-common.h
+++ b/include/linux/iio/adc/qcom-vadc-common.h
@@ -83,27 +83,27 @@ struct vadc_linear_graph {
/**
* enum vadc_scale_fn_type - Scaling function to convert ADC code to
* physical scaled units for the channel.
- * SCALE_DEFAULT: Default scaling to convert raw adc code to voltage (uV).
- * SCALE_THERM_100K_PULLUP: Returns temperature in millidegC.
+ * @SCALE_DEFAULT: Default scaling to convert raw adc code to voltage (uV).
+ * @SCALE_THERM_100K_PULLUP: Returns temperature in millidegC.
* Uses a mapping table with 100K pullup.
- * SCALE_PMIC_THERM: Returns result in milli degree's Centigrade.
- * SCALE_XOTHERM: Returns XO thermistor voltage in millidegC.
- * SCALE_PMI_CHG_TEMP: Conversion for PMI CHG temp
- * SCALE_HW_CALIB_DEFAULT: Default scaling to convert raw adc code to
+ * @SCALE_PMIC_THERM: Returns result in milli degree's Centigrade.
+ * @SCALE_XOTHERM: Returns XO thermistor voltage in millidegC.
+ * @SCALE_PMI_CHG_TEMP: Conversion for PMI CHG temp
+ * @SCALE_HW_CALIB_DEFAULT: Default scaling to convert raw adc code to
* voltage (uV) with hardware applied offset/slope values to adc code.
- * SCALE_HW_CALIB_THERM_100K_PULLUP: Returns temperature in millidegC using
+ * @SCALE_HW_CALIB_THERM_100K_PULLUP: Returns temperature in millidegC using
* lookup table. The hardware applies offset/slope to adc code.
- * SCALE_HW_CALIB_XOTHERM: Returns XO thermistor voltage in millidegC using
+ * @SCALE_HW_CALIB_XOTHERM: Returns XO thermistor voltage in millidegC using
* 100k pullup. The hardware applies offset/slope to adc code.
- * SCALE_HW_CALIB_THERM_100K_PU_PM7: Returns temperature in millidegC using
+ * @SCALE_HW_CALIB_THERM_100K_PU_PM7: Returns temperature in millidegC using
* lookup table for PMIC7. The hardware applies offset/slope to adc code.
- * SCALE_HW_CALIB_PMIC_THERM: Returns result in milli degree's Centigrade.
+ * @SCALE_HW_CALIB_PMIC_THERM: Returns result in milli degree's Centigrade.
* The hardware applies offset/slope to adc code.
- * SCALE_HW_CALIB_PMIC_THERM: Returns result in milli degree's Centigrade.
+ * @SCALE_HW_CALIB_PMIC_THERM: Returns result in milli degree's Centigrade.
* The hardware applies offset/slope to adc code. This is for PMIC7.
- * SCALE_HW_CALIB_PM5_CHG_TEMP: Returns result in millidegrees for PMIC5
+ * @SCALE_HW_CALIB_PM5_CHG_TEMP: Returns result in millidegrees for PMIC5
* charger temperature.
- * SCALE_HW_CALIB_PM5_SMB_TEMP: Returns result in millidegrees for PMIC5
+ * @SCALE_HW_CALIB_PM5_SMB_TEMP: Returns result in millidegrees for PMIC5
* SMB1390 temperature.
*/
enum vadc_scale_fn_type {
@@ -120,6 +120,7 @@ enum vadc_scale_fn_type {
SCALE_HW_CALIB_PMIC_THERM_PM7,
SCALE_HW_CALIB_PM5_CHG_TEMP,
SCALE_HW_CALIB_PM5_SMB_TEMP,
+ /* private: */
SCALE_HW_CALIB_INVALID,
};
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index 5c84ec4a9810..d37f82678f71 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -26,11 +26,7 @@ int iio_pop_from_buffer(struct iio_buffer *buffer, void *data);
* @data: sample data
* @timestamp: timestamp for the sample data
*
- * Pushes data to the IIO device's buffers. If timestamps are enabled for the
- * device the function will store the supplied timestamp as the last element in
- * the sample data buffer before pushing it to the device buffers. The sample
- * data buffer needs to be large enough to hold the additional timestamp
- * (usually the buffer should be indio->scan_bytes bytes large).
+ * DEPRECATED: Use iio_push_to_buffers_with_ts() instead.
*
* Returns 0 on success, a negative error code otherwise.
*/
@@ -45,6 +41,22 @@ static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev,
return iio_push_to_buffers(indio_dev, data);
}
+/**
+ * iio_push_to_buffers_with_ts() - push data and timestamp to buffers
+ * @indio_dev: iio_dev structure for device.
+ * @data: Pointer to sample data buffer.
+ * @data_total_len: The size of @data in bytes.
+ * @timestamp: Timestamp for the sample data.
+ *
+ * Pushes data to the IIO device's buffers. If timestamps are enabled for the
+ * device the function will store the supplied timestamp as the last element in
+ * the sample data buffer before pushing it to the device buffers. The sample
+ * data buffer needs to be large enough to hold the additional timestamp
+ * (usually the buffer should be at least indio->scan_bytes bytes large).
+ *
+ * Context: Any context.
+ * Return: 0 on success, a negative error code otherwise.
+ */
static inline int iio_push_to_buffers_with_ts(struct iio_dev *indio_dev,
void *data, size_t data_total_len,
s64 timestamp)
diff --git a/include/linux/iio/buffer_impl.h b/include/linux/iio/buffer_impl.h
index e72552e026f3..0daff9ff20ce 100644
--- a/include/linux/iio/buffer_impl.h
+++ b/include/linux/iio/buffer_impl.h
@@ -24,7 +24,8 @@ struct sg_table;
/**
* struct iio_buffer_access_funcs - access functions for buffers.
- * @store_to: actually store stuff to the buffer
+ * @store_to: actually store stuff to the buffer - must be safe to
+ * call from any context (e.g. must not sleep).
* @read: try to get a specified number of bytes (must exist)
* @data_available: indicates how much data is available for reading from
* the buffer.
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index a38b277c2c02..5039558267e4 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -131,7 +131,8 @@ struct iio_cb_buffer;
/**
* iio_channel_get_all_cb() - register callback for triggered capture
* @dev: Pointer to client device.
- * @cb: Callback function.
+ * @cb: Callback function. Must be safe to call from any context
+ * (e.g. must not sleep).
* @private: Private data passed to callback.
*
* NB right now we have no ability to mux data from multiple devices.
diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h
index aa160511e265..bfb6df68e6c9 100644
--- a/include/linux/iio/imu/adis.h
+++ b/include/linux/iio/imu/adis.h
@@ -57,6 +57,7 @@ struct adis_timeout {
* @enable_irq: Hook for ADIS devices that have a special IRQ enable/disable
* @unmasked_drdy: True for devices that cannot mask/unmask the data ready pin
* @has_paging: True if ADIS device has paged registers
+ * @has_fifo: True if ADIS device has a hardware FIFO
* @burst_reg_cmd: Register command that triggers burst
* @burst_len: Burst size in the SPI RX buffer. If @burst_max_len is defined,
* this should be the minimum size supported by the device.
@@ -136,7 +137,7 @@ struct adis {
const struct adis_data *data;
unsigned int burst_extra_len;
const struct adis_ops *ops;
- /**
+ /*
* The state_lock is meant to be used during operations that require
* a sequence of SPI R/W in order to protect the SPI transfer
* information (fields 'xfer', 'msg' & 'current_page') between
@@ -166,7 +167,7 @@ int __adis_reset(struct adis *adis);
* adis_reset() - Reset the device
* @adis: The adis device
*
- * Returns 0 on success, a negative error code otherwise
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_reset(struct adis *adis)
{
@@ -183,7 +184,9 @@ int __adis_read_reg(struct adis *adis, unsigned int reg,
* __adis_write_reg_8() - Write single byte to a register (unlocked)
* @adis: The adis device
* @reg: The address of the register to be written
- * @value: The value to write
+ * @val: The value to write
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int __adis_write_reg_8(struct adis *adis, unsigned int reg,
u8 val)
@@ -195,7 +198,9 @@ static inline int __adis_write_reg_8(struct adis *adis, unsigned int reg,
* __adis_write_reg_16() - Write 2 bytes to a pair of registers (unlocked)
* @adis: The adis device
* @reg: The address of the lower of the two registers
- * @value: Value to be written
+ * @val: Value to be written
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int __adis_write_reg_16(struct adis *adis, unsigned int reg,
u16 val)
@@ -207,7 +212,9 @@ static inline int __adis_write_reg_16(struct adis *adis, unsigned int reg,
* __adis_write_reg_32() - write 4 bytes to four registers (unlocked)
* @adis: The adis device
* @reg: The address of the lower of the four register
- * @value: Value to be written
+ * @val: Value to be written
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int __adis_write_reg_32(struct adis *adis, unsigned int reg,
u32 val)
@@ -220,6 +227,8 @@ static inline int __adis_write_reg_32(struct adis *adis, unsigned int reg,
* @adis: The adis device
* @reg: The address of the lower of the two registers
* @val: The value read back from the device
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int __adis_read_reg_16(struct adis *adis, unsigned int reg,
u16 *val)
@@ -239,6 +248,8 @@ static inline int __adis_read_reg_16(struct adis *adis, unsigned int reg,
* @adis: The adis device
* @reg: The address of the lower of the two registers
* @val: The value read back from the device
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int __adis_read_reg_32(struct adis *adis, unsigned int reg,
u32 *val)
@@ -257,8 +268,10 @@ static inline int __adis_read_reg_32(struct adis *adis, unsigned int reg,
* adis_write_reg() - write N bytes to register
* @adis: The adis device
* @reg: The address of the lower of the two registers
- * @value: The value to write to device (up to 4 bytes)
+ * @val: The value to write to device (up to 4 bytes)
* @size: The size of the @value (in bytes)
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_write_reg(struct adis *adis, unsigned int reg,
unsigned int val, unsigned int size)
@@ -273,6 +286,8 @@ static inline int adis_write_reg(struct adis *adis, unsigned int reg,
* @reg: The address of the lower of the two registers
* @val: The value read back from the device
* @size: The size of the @val buffer
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static int adis_read_reg(struct adis *adis, unsigned int reg,
unsigned int *val, unsigned int size)
@@ -285,7 +300,9 @@ static int adis_read_reg(struct adis *adis, unsigned int reg,
* adis_write_reg_8() - Write single byte to a register
* @adis: The adis device
* @reg: The address of the register to be written
- * @value: The value to write
+ * @val: The value to write
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_write_reg_8(struct adis *adis, unsigned int reg,
u8 val)
@@ -297,7 +314,9 @@ static inline int adis_write_reg_8(struct adis *adis, unsigned int reg,
* adis_write_reg_16() - Write 2 bytes to a pair of registers
* @adis: The adis device
* @reg: The address of the lower of the two registers
- * @value: Value to be written
+ * @val: Value to be written
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_write_reg_16(struct adis *adis, unsigned int reg,
u16 val)
@@ -309,7 +328,9 @@ static inline int adis_write_reg_16(struct adis *adis, unsigned int reg,
* adis_write_reg_32() - write 4 bytes to four registers
* @adis: The adis device
* @reg: The address of the lower of the four register
- * @value: Value to be written
+ * @val: Value to be written
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_write_reg_32(struct adis *adis, unsigned int reg,
u32 val)
@@ -322,6 +343,8 @@ static inline int adis_write_reg_32(struct adis *adis, unsigned int reg,
* @adis: The adis device
* @reg: The address of the lower of the two registers
* @val: The value read back from the device
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_read_reg_16(struct adis *adis, unsigned int reg,
u16 *val)
@@ -341,6 +364,8 @@ static inline int adis_read_reg_16(struct adis *adis, unsigned int reg,
* @adis: The adis device
* @reg: The address of the lower of the two registers
* @val: The value read back from the device
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_read_reg_32(struct adis *adis, unsigned int reg,
u32 *val)
@@ -366,6 +391,8 @@ int __adis_update_bits_base(struct adis *adis, unsigned int reg, const u32 mask,
* @size: Size of the register to update
*
* Updates the desired bits of @reg in accordance with @mask and @val.
+ *
+ * Returns: %0 on success, a negative error code otherwise
*/
static inline int adis_update_bits_base(struct adis *adis, unsigned int reg,
const u32 mask, const u32 val, u8 size)