summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-10-01 13:34:38 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-10-01 13:34:38 +0200
commit267032931120f21f2cd419ce173bd9ffb247825a (patch)
treebc284c987f97fef668bafad03f5b25cf86d1a367 /include
parentbc5a1c6d4a405bf5ecaec12296a06691a88ea80b (diff)
parenta3b3580713f3ac5a32dc2874ee546828977a1d68 (diff)
Merge tag 'iio-for-7.4a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes: IIO: 1st set of device support, features and cleanup for 7.4 2 merges - v7.3-rc4 to get a x86 build fix needed by the ad9910 driver. - devm_notifier_chain_register to pick up the IIO specific users of this new infrastructure. New device support ------------------ Major refactors or new drivers needed: adi,ad3530r - Support for the AD5710R and AD5711R 8 channel IDAC / VDAC parts. Needed substantial driver rework to support channel type controls. adi,ad5529r - New driver for this 16 channel DAC with 12 and 16 bit variants. adi,ad7768 - New driver for the 8 (AD7768) and 4 (AD7768-4) channel variants of this 24-bit simultaneous sampling ADC family. They are very different from the 1 channel variant that has as separate driver. adi,ad9910 - New driver for this DDS (Direct Digital Synthesizer). This was a large undertaking is it is a complex chip requiring quite a lot of new IIO ABI. Delayed from last cycle by an x86 bug that was fixed in rc4. adi,ade9000 - Add support for the ADE9078 polyphase energy metering device. Required significant changes to introduce multiple part support into this driver. adi,adis16201 - Add support for the ADIS16203 device, replacing the driver in staging. axiado,saradc - New driver for the SARADC found on the AX3000 and ADX3005 SoCs. liteon,ltr501 - Add support for the LTR-329ALS-01 ambient light sensor. Included various bits of driver modernization. microchip,mcp48fev02 - Split previously I2C specific mcp47feb02 into core and I2C specific parts. - Add an SPI specific part for the many parts in the MCP48FxBy1/2/4/8 series of SPI DACS 24 different part numbers covering: - 8, 10 and 12 bit resolutions - 1, 2, 4, and 8 channels - EEPROM and no non volatile storage variants. - Substantial driver modification and cleanup was needed prior to the new support. maxim,max40080 - New driver for this current-sense amplifier with integrated ADC. renesas,rzg2l_adc - Support the RZ/G3L ADC 1 that is dedicate to the on-chip thermal sensor unit. The thermal parts of this support will be going through that tree. sensortek,stk3310 - Add support for the STK36C61 Ambient Light, proximity and RGB color sensor. Handling had to be added for RGB elements and the driver in general had to be made ready for support multiple parts. ti,ads1100 - Add support for the ADS1110 with faster data rate and 2.048V reference. ti,ads112c04 - New driver to support this 16bit sigma-delta ADC. vishay,veml6031x00 - New driver for this ambient light sensor that was built in in stages. - Add triggered buffer data capture. - Add support for events and triggers. - Enable mysterious 'internal calibration' setting. Minor additions such as IDs, compatibles or device specific data. adi,ad3530r - Support the AD3536R which is low resolution equivalent of the already supported AD3532R. adi,ad4080 - Support the AD4885 - only needed chip specific data. aosong,am2315 - Add support for the AM2320, fully compatible wth the AM2315. invensense,icm42600 - Minor tweaks + addition of compatible for the ICM42630 IMU. mediatek,mt2701-adc - Compatible for the MT6572 rockchip,saradc - Support the RV1106. Features -------- IIO Core - Add a helper to discover if timestamps are enabled. In a few cases (typically when there is batching involved) we may have to refuse to start the buffer if timestamps are enabled. Provided a helper to allow that to be queried. IIO backend - CRC support. infineon,dps310 - Add triggered buffer support. linear,ltc2497 - Add 2x conversion speed mode. - Add the internal temperature channel. renesas,r9a09g077 - Add missing DMA properties to DT and enable use of DMA - Expose the sampling frequency as per channel attributes. ti,ad1015 - Add per channel labels from DT support. ti,ads112c14 - Add dataready trigger using continuous mode if only one channel is enabled. - Add burnout current control including new IIO ABI. - Add filter control. - Add new ABI for settling time. Cleanup and minor or late breaking fixes ---------------------------------------- Only calling out the more significant changes or ones that were carried on out on several drivers. multiple drivers - Add sanity check for spi_device_get_match_data() returning NULL due to use of driver_override. - Add some useful __counted_by_ptr markings. - Add some missing MODULE_DEVICE_TABLE() calls. - Use dmaenginge_get_dma_device() instead of chan->device->dev - A few precursor cleanups for planed devm_ object allocators. - Disable autosuspend on exit. Note there is work ongoing to make this unnecessary. - Header reorders and IWYU being applied to what was included. - Use devm_blocking_notifier_chain_register() to replace open coded equivalent. - Ensure some clk related structures are always fully initialized. - Use the size checked iio_push_to_buffers_with_ts() replacement for iio_push_to_buffers_with_timestamp(). - Avoid shadowing various error codes from store() callbacks. adi,axi-adc - Fix missing mutex_init() adi,ad4080 - Ensure autoincrement is set for multi register reads. adi,ad5758 - Fix wrong offset calculation - Reject out of range values rather than truncating values. - Make sure buffer used for bulk acceses is DMA safe. adi,ad7816 - Local lock to protect state by serializing accesses. A few extra locations were added much later in the cycle. - Stop using non DMA safe buffers by using spi_write_then_read() to ensure the data was bounce buffered. adi,adxl367 - Ensure interrupt mapping is resolved before device setup reducing work done before potential deferral. - Support INT2 pin. asahi-kasei,ak8975 - Use BIT() and GENMASK() to improve readability of defines. - Add an enum for scan mask elements. - Switch to devm_ for all resources. avago,apds9306 - Fix the default sampling frequency. awinc,aw96103 - Fix an early return that stopped all channels being checked. broadcom,iproc-adc - General modernization and conversion to devm managed cleanup. - Use dev_err_probe(), local dev pointer and drop some duplicate error messages. capella,cm32181 - Add device specific dt-binding as trivial-devices doesn't provide vdd-supply or interrupt properties. freescale,mma8452 - Modernize driver via guard(), IIO specific cleanup helpers and bulk regulator handling. infineon,dps310 - Add context analysis lock markings. - Single local acquire / release per raw read. - Replace opencoded get_unaligned_be24(). - Fix incorrect CFG_REG bit definitions. invensense,icm42600 - Ensure ODR is updated when switching power mode to paper over a hardware bug. - Fix detecting ODR change in invalid data packets. - Optimize high frequency data readback by not bothering to read the FIFO count when the watermark is known to have been passed. - Various other minor fixes. isil,isl29028 - Fix a runtime pm reference leak. liteon,ltr501 - Make the dt-binding property proximit-near-level only available on parts that support it. kionix,kx022a - Use as structure to make the channel layout explicit and use that for all cases (previously there were two similar buffers). pulsed-light,lidar-lite-v2 - Move binding from trivial-devices to it's own file as there are power enable and mode control pins that needs describing. renesas,r9a09g077 - Drop some interrupt descriptions for interrupts that aren't connected to the interrupt controller. - Avoid direct reads when buffer enabled. - Store the device PA and IRQ in state ready for the DMA support. st,hts221 - Fix a potential division by zero if calibration data corrupted. - Allow an unknown Who Am I value to support fallback dt-compatibles. - Replace opencoded oversampling_ration_available handling with read_avail callback. st,stm32-adc - Fix up some wrong minimum sample times. ti,ads1100 - Fix readings after datarate change by ensuring a long enough wait for a new sample. ti,tmp117 - Fix case where cached state was updated before we know if the write to the device succeeds. vishay,veml3328 - Reshape the scale array to improve readability as it is made up of value pairs. * tag 'iio-for-7.4a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (270 commits) iio: dac: ad5758: Fix the offset calculation iio: dac: ad5758: Reject out-of-range raw values iio: dac: ad5758: Fix alignment for DMA safety iio: pressure: dps310: check the lock markings with context analysis iio: core: add an accessor for scan_timestamp iio: pressure: dps310: add triggered buffer support iio: pressure: dps310: take the lock once per raw read iio: pressure: dps310: use get_unaligned_be24() for the 24-bit results iio: pressure: dps310: use a local device pointer in probe iio: pressure: dps310: fix CFG_REG bit definitions staging: iio: adc: ad7816: Protect sysfs attributes with mutex dt-bindings: iio: Add dedicated CM32181 schema iio: adc: stm32: fix minimum sampling time values iio: light: veml6031x00: Enable internal calibration iio: dac: add support for Microchip MCP48FEB02 dt-bindings: iio: dac: add support for MCP48FEB02 SPI iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules iio: dac: mcp47feb02: protect EEPROM store sequence with mutex iio: dac: mcp47feb02: Avoid unjustified probe error on missing label iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/iio/adc/qcom-adc5-gen3-common.h2
-rw-r--r--include/linux/iio/backend.h6
-rw-r--r--include/linux/iio/iio-gts-helper.h11
-rw-r--r--include/linux/iio/iio-opaque.h2
-rw-r--r--include/linux/iio/iio.h25
-rw-r--r--include/linux/notifier.h7
-rw-r--r--include/uapi/linux/iio/types.h1
7 files changed, 45 insertions, 9 deletions
diff --git a/include/linux/iio/adc/qcom-adc5-gen3-common.h b/include/linux/iio/adc/qcom-adc5-gen3-common.h
index 39cbfcbdb101..b3e2c2f50e8f 100644
--- a/include/linux/iio/adc/qcom-adc5-gen3-common.h
+++ b/include/linux/iio/adc/qcom-adc5-gen3-common.h
@@ -137,7 +137,7 @@ struct adc5_sdam_data {
*/
struct adc5_device_data {
struct regmap *regmap;
- struct adc5_sdam_data *base;
+ struct adc5_sdam_data *base __counted_by_ptr(num_sdams);
int num_sdams;
};
diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h
index 3f95ed1fdf9e..9c16b695a602 100644
--- a/include/linux/iio/backend.h
+++ b/include/linux/iio/backend.h
@@ -133,6 +133,8 @@ enum iio_backend_capabilities {
* @filter_type_set: Set filter type.
* @interface_data_align: Perform the data alignment process.
* @num_lanes_set: Set the number of lanes enabled.
+ * @crc_enable: Enable direction-specific CRC handling.
+ * @crc_disable: Disable direction-specific CRC handling.
* @ddr_enable: Enable interface DDR (Double Data Rate) mode.
* @ddr_disable: Disable interface DDR (Double Data Rate) mode.
* @data_stream_enable: Enable data stream.
@@ -189,6 +191,8 @@ struct iio_backend_ops {
enum iio_backend_filter_type type);
int (*interface_data_align)(struct iio_backend *back, u32 timeout_us);
int (*num_lanes_set)(struct iio_backend *back, unsigned int num_lanes);
+ int (*crc_enable)(struct iio_backend *back);
+ int (*crc_disable)(struct iio_backend *back);
int (*ddr_enable)(struct iio_backend *back);
int (*ddr_disable)(struct iio_backend *back);
int (*data_stream_enable)(struct iio_backend *back);
@@ -237,6 +241,8 @@ int iio_backend_filter_type_set(struct iio_backend *back,
enum iio_backend_filter_type type);
int iio_backend_interface_data_align(struct iio_backend *back, u32 timeout_us);
int iio_backend_num_lanes_set(struct iio_backend *back, unsigned int num_lanes);
+int iio_backend_crc_enable(struct iio_backend *back);
+int iio_backend_crc_disable(struct iio_backend *back);
int iio_backend_ddr_enable(struct iio_backend *back);
int iio_backend_ddr_disable(struct iio_backend *back);
int iio_backend_data_stream_enable(struct iio_backend *back);
diff --git a/include/linux/iio/iio-gts-helper.h b/include/linux/iio/iio-gts-helper.h
index 66f830ab9b49..0c4b2e9fbe1e 100644
--- a/include/linux/iio/iio-gts-helper.h
+++ b/include/linux/iio/iio-gts-helper.h
@@ -7,6 +7,7 @@
#ifndef __IIO_GTS_HELPER__
#define __IIO_GTS_HELPER__
+#include <linux/errno.h>
#include <linux/types.h>
struct device;
@@ -58,14 +59,14 @@ struct iio_itime_sel_mul {
struct iio_gts {
u64 max_scale;
- const struct iio_gain_sel_pair *hwgain_table;
+ const struct iio_gain_sel_pair *hwgain_table __counted_by_ptr(num_hwgain);
int num_hwgain;
- const struct iio_itime_sel_mul *itime_table;
+ const struct iio_itime_sel_mul *itime_table __counted_by_ptr(num_itime);
int num_itime;
- int **per_time_avail_scale_tables;
- int *avail_all_scales_table;
+ int **per_time_avail_scale_tables __counted_by_ptr(num_itime);
+ int *avail_all_scales_table __counted_by_ptr(num_avail_all_scales);
int num_avail_all_scales;
- int *avail_time_tables;
+ int *avail_time_tables __counted_by_ptr(num_avail_time_tables);
int num_avail_time_tables;
};
diff --git a/include/linux/iio/iio-opaque.h b/include/linux/iio/iio-opaque.h
index b87841a355f8..98330385e08d 100644
--- a/include/linux/iio/iio-opaque.h
+++ b/include/linux/iio/iio-opaque.h
@@ -73,7 +73,7 @@ struct iio_dev_opaque {
#if defined(CONFIG_DEBUG_FS)
struct dentry *debugfs_dentry;
unsigned int cached_reg_addr;
- char read_buf[20];
+ char read_buf[24];
unsigned int read_buf_len;
#endif
};
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 711c00f67371..9b63785d5aec 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -264,6 +264,10 @@ struct iio_scan_type {
* @ext_info: Array of extended info attributes for this channel.
* The array is NULL terminated, the last element should
* have its name field set to NULL.
+ * @parent: Optional pointer to the parent channel spec for
+ * hierarchical channel relationships. When set, a read-only
+ * "parent" sysfs attribute is created containing the
+ * parent channel's sysfs name prefix (e.g. "in_voltage0").
* @extend_name: Allows labeling of channel attributes with an
* informative name. Note this has no effect codes etc,
* unlike modifiers.
@@ -309,6 +313,7 @@ struct iio_chan_spec {
const struct iio_event_spec *event_spec;
unsigned int num_event_specs;
const struct iio_chan_spec_ext_info *ext_info;
+ const struct iio_chan_spec *parent;
const char *extend_name;
const char *datasheet_name;
unsigned int modified:1;
@@ -484,6 +489,10 @@ struct iio_trigger; /* forward declaration */
* @update_scan_mode: function to configure device and scan buffer when
* channels have changed
* @debugfs_reg_access: function to read or write register value of device
+ * @debugfs_reg64_access: function to read or write 64-bit register value of
+ * device. debugfs_reg_access() and debugfs_reg64_access()
+ * are mutually exclusive, but the 64-bit variant has
+ * precedence in case both are implemented.
* @fwnode_xlate: fwnode based function pointer to obtain channel specifier index.
* @hwfifo_set_watermark: function pointer to set the current hardware
* fifo watermark level; see hwfifo_* entries in
@@ -572,6 +581,9 @@ struct iio_info {
int (*debugfs_reg_access)(struct iio_dev *indio_dev,
unsigned int reg, unsigned int writeval,
unsigned int *readval);
+ int (*debugfs_reg64_access)(struct iio_dev *indio_dev,
+ unsigned int reg, u64 writeval,
+ u64 *readval);
int (*fwnode_xlate)(struct iio_dev *indio_dev,
const struct fwnode_reference_args *iiospec);
int (*hwfifo_set_watermark)(struct iio_dev *indio_dev, unsigned int val);
@@ -648,7 +660,7 @@ struct iio_dev {
struct iio_poll_func *pollfunc;
struct iio_poll_func *pollfunc_event;
- struct iio_chan_spec const *channels;
+ struct iio_chan_spec const *channels __counted_by_ptr(num_channels);
int num_channels;
const char *name;
@@ -789,7 +801,7 @@ DEFINE_GUARD_COND(__priv__iio_dev_mode_lock, _try_direct,
*
* Tries to acquire the direct mode lock with cleanup ACQUIRE() semantics and
* automatically releases it at the end of the scope. It most be always paired
- * with IIO_DEV_ACQUIRE_ERR(), for example (notice the scope braces)::
+ * with IIO_DEV_ACQUIRE_FAILED(), for example (notice the scope braces)::
*
* switch() {
* case IIO_CHAN_INFO_RAW: {
@@ -1083,6 +1095,15 @@ static inline unsigned int iio_get_masklength(const struct iio_dev *indio_dev)
return ACCESS_PRIVATE(indio_dev, masklength);
}
+/**
+ * iio_scan_timestamp_enabled - Is the timestamp channel in the current scan
+ * @indio_dev: the IIO device to check
+ */
+static inline bool iio_scan_timestamp_enabled(const struct iio_dev *indio_dev)
+{
+ return ACCESS_PRIVATE(indio_dev, scan_timestamp);
+}
+
int iio_active_scan_mask_index(struct iio_dev *indio_dev);
/**
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 01b6c9d9956f..4eeae9741a6e 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -46,6 +46,7 @@
* often but notifier_blocks will seldom be removed.
*/
+struct device;
struct notifier_block;
typedef int (*notifier_fn_t)(struct notifier_block *nb,
@@ -145,8 +146,14 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
struct notifier_block *nb);
+int devm_atomic_notifier_chain_register(struct device *dev,
+ struct atomic_notifier_head *nh,
+ struct notifier_block *nb);
extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
struct notifier_block *nb);
+int devm_blocking_notifier_chain_register(struct device *dev,
+ struct blocking_notifier_head *nh,
+ struct notifier_block *nb);
extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
struct notifier_block *nb);
extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
index d0fb714ca0fd..d602b40f14d0 100644
--- a/include/uapi/linux/iio/types.h
+++ b/include/uapi/linux/iio/types.h
@@ -55,6 +55,7 @@ enum iio_chan_type {
IIO_ALTCURRENT,
IIO_COVERAGE,
IIO_VOLUMEFLOW,
+ IIO_FREQUENCY,
};
enum iio_modifier {