Commit 9991bbc6 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-7.0a' of...

Merge tag 'iio-for-7.0a' 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 the 6.20/7.0 cycle.

Slightly messier than normal unfortunately due to some conflicts
and build config bugs related to I3C drivers.

One last minute Kconfig fix right at the top after a linux-next report.
I've simplified the Kconfig and made it match other instances in the kernel
so that should be safe enough despite short soak time in front of build bots.

Merge of an immutable branch from I3C to get some stubs that were missing
and caused build issues with dual I2C / I3C drivers. This also brought in a
drop of some deprecated interfaces so there is also one patch to update a
new driver to not use those.

We are having another go at using cleanup.h magic with the IIO mode claim
functions after backing out last try at this. This time we have wrappers
around the new ACQUIRE() and ACQUIRE_ERR() macros.
Having been burnt once, we will be taking it a bit more slowly this time
wrt to wide adoption of these! Thanks in particular to Kurt for taking
on this core IIO work.

New Device Support
==================

adi,ad18113
- New driver to support the AD18113 amplifier - an interesting device due
  to the external bypass paths where we need to describe what gain those
  paths have in DT. Longer term it will be interesting to see if this
  simplistic description is enough for real deployments.
adi,ad4062
- New driver for the AD4060 and AD4052 SAR ADCs including trigger, event
  and GPIO controller support.  Follow up patch replaced use of some
  deprecated I3C interfaces prior to the I3C immutable branch merge as
  that includes dropping them.
adi,ad4134
- New driver for the AD4134 24bit 4 channel simultaneous sampling ADC.
adi,ad7768-1,
- Add support for the ADAQ767-1, ADAQ7768-1 and ADAQ7769-1 ADCs after some
  rework to enable the driver to support multiple device types.
adi,ad9467
- Add support for the similar ad9211 ADC to this existing driver.
- Make the selection of 2s comp mode explicit for normal operation and
  switch to offset binary when entering calibration mode.
honeywell,abp2
- New driver to support this huge family (100+) of board mount pressure and
  temperature sensors.
maxim,max22007
- New drier for this 4 channel DAC.
memsic,mmc5633
- New driver for this I2C/I3C magnetometer. Follow on patches fixed up
  issues related to single driver supporting both bus types.
microchip,mcp747feb02
- New driver for the Microchip MCP47F(E/V)B(0/1/2)1,
  MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and MCP47F(E/V)B(0/1/2)8
  buffered voltage output DACs.
nxp,sar-adc
- New driver support ADCs found on s32g2 and s32g3 platforms.
ti,ads1018
- New drier for the ADS1018 and ADS1118 SPI ADCs.
ti,ads131m02
- New driver supporting ADS131M(02/03/04/06/08)24-bit simultaneous sampling
  ADCs.

Features
========

iio-core
- New IIO_DEV_ACQUIRE_DIRECT_MODE() / IIO_DEV_ACQUIRE_FAILED() +
  equivalents for the much rarer case where the mode needs pinning
  whether or not it is in direct mode.  These use the ACQUIRE()
  / ACQUIRE_ERR() infrastructure underneath to provide both simple
  checks on whether we got the requested mode and to provide scope
  based release. Applied in a few initial drivers.
adi,ad9467
- Support calibbias control
adi,adf4377
- Add support to act as a clock provider.
adi,adxl380
- Support low power 1KHz sampling frequency mode. Required rework of
  how events and filters were configured, plus applying of constraints
  when in this mode.
rf-digital,rfd77402
- Add interrupt support as alternative to polling for completion.
st,lsm6dsx
- Tap event detection (after considerable driver rework)

Cleanup and Minor Fixes
=======================

More minor cleanup such as typos, white space etc not called out except
where they were applied to a lot of drivers.

Various drivers.
- Use of dev_err_probe() to cleanup error handling.
- Introduce local struct device and struct device_node variables to
  reduce duplication of getting them from containing structs.
- Ensure uses of iio_trigger_generic_data_rdy_poll() set IRQF_NO_THREAD
  as that function calls non threaded child interrupt handlers.
- Replace IRQF_ONESHOT in not thread interrupt handlers with
  IRQF_NO_THREAD to ensure they run as intended. Drop one unnecessary case.
iio-sw-device/trigger.
- Constify configs_group_operations structures.
iio-buffer-dma / buffer-dma-engine
- Use lockdep_assert_held() to replace WARN_ON() to check lock is
  correctly held.
- Make use of cleanup.h magic to simplify various code paths.
- Make iio_dma_buffer_init() return void rather than always success.

adi,ad7766
- Replace custom interrupt handler with iio_trigger_generic_data_rdy_poll()
adi,ad9832
- Drop legacy platform_data support.
adi,ade9000
- Add a maintainer entry.
adi,adt7316
- Move to EXPORT_GPL_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() so the compiler
  can cleanly drop unused pm structures and callbacks.
adi,adxl345
- Relax build constraint vs the driver that is in input so both may be
  built as modules and selection made at runtime.
adi,adxl380
- Make sure we don't read tail entries in the hardware fifo if a partial
  new scan has been written.
- Move to a single larger regmap_noinc_read() to read the hardware fifo.
aspeed,ast2600
- Add missing interrupts property to DT binding.
bosch,bmi270_i2c
- Add missing MODULE_DEVICE_TABLE() macros so auto probing of modules can
  work.
bosch,smi330
- Drop duplicate assignment of IIO_TYPE in smi330_read_avail()
- Use new common field_get() and field_prep() helpers to replace local
  version.
honeywell,mprls0025pa
  Fixes delayed to merge window as late in cycle and we didn't want to delay
  the rest of the series.
- Allow Kconfig selection of specific bus sub-drivers rather than tying that
  to the buses themselves being supported.
- Zero spi_transfer structure to avoid chance of unintentionally set fields
  effecting transfer.
- Fix a potential timing violation wrt to the chip select to first clock
  edge timing.
- As recent driver, take risk inherent in dropping interrupt direction from
  driver as that should be set by firmware.
- Fix wrong reported number of data bits for channel.
- Fix a pressure channel calculation bug.
- Rework to allow embedding the tx buffer in the iio_priv() structure rather
  than requiring separate allocation.
- Move the buffer clearing to the shared core bringing it into affect for
  SPI as well as I2C.
- Stricter checks for status byte.
- Greatly simplify the measurement sequence.
- Add a copyright entry to reflect Petre's continued work on this driver.
intersil,isl29018
- Switch from spritnf to sysfs_emit_at() to make it clear overflow can't
  occur.
invensense,icm42600
- Allow sysfs access to temperature when buffered capture in use as it
  does not impact other sensor data paths.
invensense,itg3200
- Check unused return value in read_raw() callback.
men,z188
- Drop now duplicated module alias.
rf-digital,rfd77402
- Add DT binding doc and explicit of_device_id table.
- Poll for timeout with times as on datasheet, then replace opencoded
  version with read_poll_timeout().
sensiron,scd4x
- Add missing timestamp channel. The code to push it to the buffer was there
  but there was no way to turn it on.
vti,sca3000
- Fix resource leak if iio_device_register() fails.

* tag 'iio-for-7.0a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (144 commits)
  iio: magn: mmc5633: Fix Kconfig for combination of I3C as module and driver builtin
  iio: sca3000: Fix a resource leak in sca3000_probe()
  iio: proximity: rfd77402: Add interrupt handling support
  iio: proximity: rfd77402: Document device private data structure
  iio: proximity: rfd77402: Use devm-managed mutex initialization
  iio: proximity: rfd77402: Use kernel helper for result polling
  iio: proximity: rfd77402: Align polling timeout with datasheet
  iio: cros_ec: Allow enabling/disabling calibration mode
  iio: frequency: ad9523: correct kernel-doc bad line warning
  iio: buffer: buffer_impl.h: fix kernel-doc warnings
  iio: gyro: itg3200: Fix unchecked return value in read_raw
  MAINTAINERS: add entry for ADE9000 driver
  iio: accel: sca3000: remove unused last_timestamp field
  iio: accel: adxl372: remove unused int2_bitmask field
  iio: adc: ad7766: Use iio_trigger_generic_data_rdy_poll()
  iio: magnetometer: Remove IRQF_ONESHOT
  iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD
  iio: Use IRQF_NO_THREAD
  iio: dac: Add MAX22007 DAC driver support
  dt-bindings: iio: dac: Add max22007
  ...
parents 96657eb5 0713b261
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -161,3 +161,14 @@ Contact: linux-i3c@vger.kernel.org
Description:
		These directories are just symbolic links to
		/sys/bus/i3c/devices/i3c-<bus-id>/<bus-id>-<device-pid>.

What:		/sys/bus/i3c/devices/i3c-<bus-id>/<bus-id>-<device-pid>/dev_nack_retry_count
KernelVersion:  6.18
Contact:	linux-i3c@vger.kernel.org
Description:
		Expose the dev_nak_retry_count which controls the number of
		automatic retries that will be performed by the controller when
		the target device returns a NACK response. A value of 0 disables
		the automatic retries. Exist only when I3C constroller supports
		this retry on nack feature.
+6 −3
Original line number Diff line number Diff line
@@ -3,8 +3,11 @@ Date: July 2015
KernelVersion:	4.7
Contact:	linux-iio@vger.kernel.org
Description:
		Writing '1' will perform a FOC (Fast Online Calibration). The
                corresponding calibration offsets can be read from `*_calibbias`
		Writing '1' either perform a FOC (Fast Online Calibration) or
		enter calibration mode.
		Writing '0` exits calibration mode. It is a NOP for FOC enabled
		sensors.
		The corresponding calibration offsets can be read from `*_calibbias`
		entries.

What:		/sys/bus/iio/devices/iio:deviceX/id
+120 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2025 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad4062.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD4062 ADC family device driver

maintainers:
  - Jorge Marques <jorge.marques@analog.com>

description: |
  Analog Devices AD4062 Single Channel Precision SAR ADC family

  https://www.analog.com/media/en/technical-documentation/data-sheets/ad4060.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad4062.pdf

properties:
  compatible:
    enum:
      - adi,ad4060
      - adi,ad4062

  reg:
    maxItems: 1

  interrupts:
    description:
      Two pins are available that can be configured as either a general purpose
      digital output, device enable signal (used to synchronise other parts of
      the signal chain with ADC sampling), device ready (GP1 only) or various
      interrupt signals. If intended for use as a GPIO or device enable, will not
      present here.
    minItems: 1
    items:
      - description:
          GP0 pin, cannot be configured as DEV_RDY.
      - description:
          GP1 pin, can be configured to any setting.

  interrupt-names:
    minItems: 1
    items:
      - const: gp0
      - const: gp1

  gpio-controller:
    description:
      Marks the device node as a GPIO controller. GPs not listed as interrupts
      are exposed as a GPO.

  '#gpio-cells':
    const: 2
    description:
      The first cell is the GPIO number and the second cell specifies
      GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.

  vdd-supply:
    description: Analog power supply.

  vio-supply:
    description: Digital interface logic power supply.

  ref-supply:
    description:
      Reference voltage to set the ADC full-scale range. If not present,
      vdd-supply is used as the reference voltage.

required:
  - compatible
  - reg
  - vdd-supply
  - vio-supply

allOf:
  - $ref: /schemas/i3c/i3c.yaml#

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    i3c {
        #address-cells = <3>;
        #size-cells = <0>;

        adc@0,2ee007c0000 {
            reg = <0x0 0x2ee 0x7c0000>;
            vdd-supply = <&vdd>;
            vio-supply = <&vio>;
            ref-supply = <&ref>;

            interrupt-parent = <&gpio>;
            interrupts = <0 0 IRQ_TYPE_EDGE_RISING>,
                         <0 1 IRQ_TYPE_EDGE_FALLING>;
            interrupt-names = "gp0", "gp1";
        };
    };

  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    i3c {
        #address-cells = <3>;
        #size-cells = <0>;

        adc@0,2ee007c0000 {
            reg = <0x0 0x2ee 0x7c0000>;
            vdd-supply = <&vdd>;
            vio-supply = <&vio>;
            ref-supply = <&ref>;

            gpio-controller;
            #gpio-cells = <2>;
        };
    };
+191 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad4134.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD4134 ADC

maintainers:
  - Marcelo Schmitt <marcelo.schmitt@analog.com>

description: |
  The AD4134 is a quad channel, low noise, simultaneous sampling, precision
  analog-to-digital converter (ADC).
  Specifications can be found at:
    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4134.pdf

$ref: /schemas/spi/spi-peripheral-props.yaml#

properties:
  compatible:
    enum:
      - adi,ad4134

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 50000000

  avdd5-supply:
    description: A 5V supply that powers the chip's analog circuitry.

  dvdd5-supply:
    description: A 5V supply that powers the chip's digital circuitry.

  iovdd-supply:
    description:
      A 1.8V supply that sets the logic levels for the digital interface pins.

  refin-supply:
    description:
      A 4.096V or 5V supply that serves as reference for ADC conversions.

  avdd1v8-supply:
    description: A 1.8V supply used by the analog circuitry.

  dvdd1v8-supply:
    description: A 1.8V supply used by the digital circuitry.

  clkvdd-supply:
    description: A 1.8V supply for the chip's clock management circuit.

  ldoin-supply:
    description:
      A 2.6V to 5.5V supply that generates 1.8V for AVDD1V8, DVDD1V8, and CLKVDD
      pins.

  clocks:
    maxItems: 1
    description:
      Required external clock source. Can specify either a crystal or CMOS clock
      source. If an external crystal is set, connect the CLKSEL pin to IOVDD.
      Otherwise, connect the CLKSEL pin to IOGND and the external CMOS clock
      signal to the XTAL2/CLKIN pin.

  clock-names:
    enum:
      - xtal
      - clkin
    default: clkin

  '#clock-cells':
    const: 0

  clock-output-names:
    maxItems: 1

  regulators:
    type: object
    description:
      list of regulators provided by this controller.

    properties:
      vcm-output:
        $ref: /schemas/regulator/regulator.yaml#
        type: object
        unevaluatedProperties: false

    additionalProperties: false

  reset-gpios:
    maxItems: 1

  powerdown-gpios:
    description:
      Active low GPIO connected to the /PDN pin. Forces the device into full
      power-down mode when brought low. Pull this input to IOVDD for normal
      operation.
    maxItems: 1

  odr-gpios:
    description:
      GPIO connected to ODR pin. Used to sample ADC data in minimum I/O mode.
    maxItems: 1

  adi,asrc-mode:
    $ref: /schemas/types.yaml#/definitions/string
    description:
      Asynchronous Sample Rate Converter (ASRC) operation mode control input.
      Describes whether the MODE pin is set to a high level (for master mode
      operation) or to a low level (for slave mode operation).
    enum: [ high, low ]
    default: low

  adi,dclkio:
    description:
      DCLK pin I/O direction control for when the device operates in Pin Control
      Slave Mode or in SPI Control Mode. Describes if DEC0/DCLKIO pin is at a
      high level (which configures DCLK as an output) or to set to a low level
      (configuring DCLK for input).
    enum: [ out, in ]
    default: in

  adi,dclkmode:
    description:
      DCLK mode control for when the device operates in Pin Control Slave Mode
      or in SPI Control Mode. Describes whether the DEC1/DCLKMODE pin is set to
      a high level (configuring the DCLK to operate in free running mode) or
      to a low level (to configure DCLK to operate in gated mode).
    enum: [ free-running, gated ]
    default: gated

required:
  - compatible
  - reg
  - avdd5-supply
  - dvdd5-supply
  - iovdd-supply
  - refin-supply
  - clocks
  - clock-names

oneOf:
  - required:
      - ldoin-supply
  - required:
      - avdd1v8-supply
      - dvdd1v8-supply
      - clkvdd-supply

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        adc@0 {
            compatible = "adi,ad4134";
            reg = <0>;

            spi-max-frequency = <1000000>;

            reset-gpios = <&gpio0 86 GPIO_ACTIVE_LOW>;
            odr-gpios = <&gpio0 87 GPIO_ACTIVE_HIGH>;
            powerdown-gpios = <&gpio0 88 GPIO_ACTIVE_LOW>;

            clocks = <&sys_clk>;
            clock-names = "clkin";

            avdd5-supply = <&avdd5>;
            dvdd5-supply = <&dvdd5>;
            iovdd-supply = <&iovdd>;
            refin-supply = <&refin>;
            avdd1v8-supply = <&avdd1v8>;
            dvdd1v8-supply = <&dvdd1v8>;
            clkvdd-supply = <&clkvdd>;

            regulators {
                vcm_reg: vcm-output {
                    regulator-name = "ad4134-vcm";
                };
            };

        };
    };
...
+60 −4
Original line number Diff line number Diff line
@@ -4,18 +4,26 @@
$id: http://devicetree.org/schemas/iio/adc/adi,ad7768-1.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD7768-1 ADC device driver
title: Analog Devices AD7768-1 ADC family

maintainers:
  - Michael Hennerich <michael.hennerich@analog.com>

description: |
  Datasheet at:
  Analog Devices AD7768-1 24-Bit Single Channel Low Power sigma-delta ADC family

  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7768-1.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/adaq7767-1.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/adaq7768-1.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/adaq7769-1.pdf

properties:
  compatible:
    const: adi,ad7768-1
    enum:
      - adi,ad7768-1
      - adi,adaq7767-1
      - adi,adaq7768-1
      - adi,adaq7769-1

  reg:
    maxItems: 1
@@ -58,6 +66,25 @@ properties:
    description:
      ADC reference voltage supply

  adi,aaf-gain-bp:
    description: |
       Specifies the gain applied by the Analog Anti-Aliasing Filter (AAF)
       to the ADC input in basis points (one hundredth of a percent).
       The hardware gain is determined by which input pin(s) the signal goes
       through into the AAF. The possible connections are:
       * For the ADAQ7767-1: Input connected to IN1±, IN2± or IN3±.
       * For the ADAQ7769-1: OUT_PGA pin connected to IN1_AAF+, IN2_AAF+,
         or IN3_AAF+.
    enum: [1430, 3640, 10000]
    default: 10000

  pga-gpios:
    description:
      GAIN 0, GAIN1 and GAIN2 pins for gain selection. For devices that have
      PGA configuration input pins, pga-gpios must be defined.
    minItems: 3
    maxItems: 3

  adi,sync-in-gpios:
    maxItems: 1
    description:
@@ -147,6 +174,35 @@ patternProperties:
allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

  # AAF Gain property only applies to ADAQ7767-1 and ADAQ7769-1 devices
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,adaq7767-1
              - adi,adaq7769-1
    then:
      required:
        - adi,aaf-gain-bp
    else:
      properties:
        adi,aaf-gain-bp: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,adaq7768-1
              - adi,adaq7769-1
    then:
      required:
        - pga-gpios
    else:
      properties:
        pga-gpios: false

unevaluatedProperties: false

examples:
Loading