Commit 56d784d1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-6.2a-take2' of...

Merge tag 'iio-for-6.2a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

1st set of IIO new device support, feature and cleanup for 6.2 (take2)

We have finally managed to take the mlock mutex entirely private so as
to avoid it being used for multiple purposes.  Now it is just used to
protect device mode transitions (typically to and from buffered capture).

Includes merge of an immutable i2c branch to get the new
i2c_client_get_device_id() (thanks to Wolfram for providing the branch).

Based on rc3 to pick up some precursor fixes from early in the cycle and
avoid an unnecessarily messy history.

New device support
* adi,ad4310
  - New driver to support this very flexible measurement device including
    a 24 bit ADC. Later fix for documentation build issue.
* adi,adxl355
  - Add support of the ADXL359 accelerometer.
* adi,ltc2983
  - Support additional variants of the temperatures sensor:
    LTC2984 with an EEPROM
    LTC2985, LTC2986 with only 10 channels.
* invensense,icm42600
  - Add support for icm42631 (needed only ID and WHOAMI)
* kionix,kx022a
  - New driver for this 3 axis accelerometer.
* maxim,max11401
  - New driver to support this 24-bit 10 channel ADC.
    Includes some new ABI to support configuration of notch filters.
* mediatek,mt6370
  - Add new driver to support the ADC part of the mt6370.
* st,lsm6dsx
  - Add support for LSM6DSV accelerometer and gyroscope. Simple additional
    of chip specific data and IDs.
  - Add support for LSM6DSV16X accelerometer and gyroscope.  Compatible with
    features currently implemented for the LSM6DSV.
* st,stm32-adc
  - Add support for stm32pm13x SoCs.

core / subsystem wide:
 - Add new IIO_STATIC_CONST_DEVICE_ATTR() which is a dance necessary to
   allow for the wrapping of attributes in the code that duplicates them
   for multiple buffers.
 - Harden against future issues with expectation that all buffer attributes
   are iio_dev_attrs by changing the code to take an array of pointers
   of the correct type.
 - Last transitions of drivers to local locks rather than missuses of mlock.
 - Add an iio_device_claim_buffer_mode() callback to avoid a race in the
   max30100 driver without directly using mlock.
 - Move mlock to the opaque IIO device structure to prevent misuse.
 - Add missing spi_device_id tables to support auto loading of modules.
 - Update some ADI maintainers in DT bindings.
 - A few more moves of bus drivers and core module sets to export
   name spaces.
 - Extensive use of new devm_regulator_get_enable() and friends.
 - Switch a bunch of i2c drivers to probe_new() including the bmp280
   which makes use of the new i2c_client_get_device_id() helper to
   simplify this change.

dt-bindings:
 - More use of spi-peripheral-props.yaml.

Features
* freescale,mpl115
  - Use runtime PM to implement shutdown GPIO support.
* melexis,mlx90632
  - More sophisticated runtime power management
  - Provide access to sampling frequency.
  - Trivial follow up fixes.
* microchip,mcp3911
  - Support control of PGA.
* st,lsm6dsx
  - Add support for software triggers for cases where the IRQ lines
    are not wired up.
* vishay,vcnl4000
  - Add control of integration time.

Minor cleanups and fixes
* adi,ad4130
  - Improve ABI documentation formatting.
  - Kconfig dependency fixup.
* adi,ad5758
  - Minor dt binding fix.
* adi,ad9834
  - Tidy up line breaks.
* adi,ade7854
  - Minor improvement in code clarity by replacing a ternary.
* adi,admv8818
  - Harden code against hardware returning wrong values.
* adi,adxl355
  - Warn only if unknown device ID detected to allow for fall back
    device tree compatibles on future devices.
* adi,ltc2983
  - dt-bindings clarifications and general improvements.
  - Ensure DMA safe buffer for bulk writes without relying on current
    regmap implementation choices.
* avago,adps9960
  - Fix up a disconnect between event enable attributes and what was
    enabled.
* bosch,bma400
  - Switch to dev_err_probe() from open coded EPROBE_DEFER handling.
* cosmic,cc10001
  - Fully devm managed probe() and related tidying up.
* meas,ms5611
  - Add an example of spi-max-frequency.
* meleixs,mlx90632
  - Tidy up confusing error return value.
  - Style improvements.
* multiplexer
  - Switch to dev_err_probe() from open coded EPROBE_DEFER handling.
* qcom,spmi-vadc
  - Minor dt binding improvements.
* rockchip,saradc
  - Add ID for rv1126.
* semtech,sx9360
  - Add SAMM0208 ACPI ID. Doesn't appear to be a valid vendor prefix
    but is in the wild.
* st,lsm6dsx
  - Factor out common code as _device_set_enable().
  - Fix up wrong docs after LSM6DSV addition.
* st,stm32-adc
  - Manage the min sampling time on all internal channels.
* trig,sysfs
  - Improve error labels.

* tag 'iio-for-6.2a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (146 commits)
  iio: pressure: bmp280: convert to i2c's .probe_new()
  iio: imu: st_lsm6dsx: fix LSM6DSV sensor description
  iio: adc: ad4130: depend on GPIOLIB
  staging: iio: meter: replace ternary operator by if condition
  iio: light: apds9960: Fix iio_event_spec structures
  dt-bindings: iio: imu: Add inv_icm42600 documentation
  iio: imu: inv_icm42600: Add support for icm42631
  dt-bindings: iio: adc: rockchip-saradc: Add saradc for rv1126
  dt-bindings: iio: dac: adi,ad5758: Drop 'contains' from 'adi,dc-dc-mode'
  dt-bindings: iio: imu: st_lsm6dsx: add lsm6dsv16x
  iio: imu: st_lsm6dsx: add support to LSM6DSV16X
  iio: proximity: sx9360: Add a new ACPI hardware ID
  iio: temperature: mlx90632: Add missing static marking on devm_pm_ops
  iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
  iio: temperature: ltc2983: support more parts
  dt-bindings: iio: temperature: ltc2983: support more parts
  dt-bindings: iio: temperature: ltc2983: use generic node name in example
  dt-bindings: iio: temperature: ltc2983: describe broken mux delay property
  dt-bindings: iio: temperature: ltc2983: refine descriptions
  dt-bindings: iio: temperature: ltc2983: change default excitation for custom thermistors
  ...
parents 02cd3032 12491d35
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
What:		/sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
KernelVersion:  6.2
Contact:	linux-iio@vger.kernel.org
Description:
		Reading returns a list with the possible filter modes.

		  * "sinc4"       - Sinc 4. Excellent noise performance. Long
                    1st conversion time. No natural 50/60Hz rejection.

		  * "sinc4+sinc1" - Sinc4 + averaging by 8. Low 1st conversion
		    time.

		  * "sinc3"	      - Sinc3. Moderate 1st conversion time.
		    Good noise performance.

		  * "sinc3+rej60" - Sinc3 + 60Hz rejection. At a sampling
		    frequency of 50Hz, achieves simultaneous 50Hz and 60Hz
		    rejection.

		  * "sinc3+sinc1" - Sinc3 + averaging by 8. Low 1st conversion
		    time. Best used with a sampling frequency of at least
		    216.19Hz.

		  * "sinc3+pf1"   - Sinc3 + Post Filter 1. 53dB rejection @
		    50Hz, 58dB rejection @ 60Hz.

		  * "sinc3+pf2"   - Sinc3 + Post Filter 2. 70dB rejection @
		    50Hz, 70dB rejection @ 60Hz.

		  * "sinc3+pf3"   - Sinc3 + Post Filter 3. 99dB rejection @
		    50Hz, 103dB rejection @ 60Hz.

		  * "sinc3+pf4"   - Sinc3 + Post Filter 4. 103dB rejection @
		    50Hz, 109dB rejection @ 60Hz.

What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY-voltageZ_filter_mode
KernelVersion:  6.2
Contact:	linux-iio@vger.kernel.org
Description:
		Set the filter mode of the differential channel. When the filter
		mode changes, the in_voltageY-voltageZ_sampling_frequency and
		in_voltageY-voltageZ_sampling_frequency_available attributes
		might also change to accommodate the new filter mode.
		If the current sampling frequency is out of range for the new
		filter mode, the sampling frequency will be changed to the
		closest valid one.
+13 −0
Original line number Diff line number Diff line
What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_filterY_notch_en
Date:		September 2022
KernelVersion:  6.0
Contact:	linux-iio@vger.kernel.org
Description:
		Enable or disable a notch filter.

What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_filterY_notch_center
Date:		September 2022
KernelVersion:  6.0
Contact:	linux-iio@vger.kernel.org
Description:
		Center frequency of the notch filter in Hz.
+5 −3
Original line number Diff line number Diff line
@@ -4,20 +4,22 @@
$id: http://devicetree.org/schemas/iio/accel/adi,adxl355.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices ADXL355 3-Axis, Low noise MEMS Accelerometer
title: Analog Devices ADXL355 and ADXL359 3-Axis, Low noise MEMS Accelerometers

maintainers:
  - Puranjay Mohan <puranjay12@gmail.com>

description: |
  Analog Devices ADXL355 3-Axis, Low noise MEMS Accelerometer that supports
  both I2C & SPI interfaces
  Analog Devices ADXL355 and ADXL359 3-Axis, Low noise MEMS Accelerometers that
  support both I2C & SPI interfaces
    https://www.analog.com/en/products/adxl355.html
    https://www.analog.com/en/products/adxl359.html

properties:
  compatible:
    enum:
      - adi,adxl355
      - adi,adxl359

  reg:
    maxItems: 1
+65 −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/accel/kionix,kx022a.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ROHM/Kionix KX022A Accelerometer

maintainers:
  - Matti Vaittinen <mazziesaccount@gmail.com>

description: |
  KX022A is a 3-axis accelerometer supporting +/- 2G, 4G, 8G and 16G ranges,
  output data-rates from 0.78Hz to 1600Hz and a hardware-fifo buffering.
  KX022A can be accessed either via I2C or SPI.

properties:
  compatible:
    const: kionix,kx022a

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    maxItems: 2

  interrupt-names:
    minItems: 1
    items:
      - enum: [INT1, INT2]
      - const: INT2

  vdd-supply: true
  io-vdd-supply: true

  mount-matrix:
    description: |
      an optional 3x3 mounting rotation matrix.

required:
  - compatible
  - reg
  - interrupts

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        accel@1f {
            compatible = "kionix,kx022a";
            reg = <0x1f>;

            interrupt-parent = <&gpio1>;
            interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
            interrupt-names = "INT1";

            io-vdd-supply = <&iovdd>;
            vdd-supply = <&vdd>;
        };
    };
+259 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2022 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad4130.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD4130 ADC device driver

maintainers:
  - Cosmin Tanislav <cosmin.tanislav@analog.com>

description: |
  Bindings for the Analog Devices AD4130 ADC. Datasheet can be found here:
    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4130-8.pdf

properties:
  compatible:
    enum:
      - adi,ad4130

  reg:
    maxItems: 1

  clocks:
    maxItems: 1
    description: phandle to the master clock (mclk)

  clock-names:
    items:
      - const: mclk

  interrupts:
    maxItems: 1

  interrupt-names:
    description: |
      Specify which interrupt pin should be configured as Data Ready / FIFO
      interrupt.
      Default if not supplied is int.
    enum:
      - int
      - clk
      - p2
      - dout

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  '#clock-cells':
    const: 0

  clock-output-names:
    maxItems: 1

  refin1-supply:
    description: refin1 supply. Can be used as reference for conversion.

  refin2-supply:
    description: refin2 supply. Can be used as reference for conversion.

  avdd-supply:
    description: AVDD voltage supply. Can be used as reference for conversion.

  iovdd-supply:
    description: IOVDD voltage supply. Used for the chip interface.

  spi-max-frequency:
    maximum: 5000000

  adi,ext-clk-freq-hz:
    description: Specify the frequency of the external clock.
    enum: [76800, 153600]
    default: 76800

  adi,bipolar:
    description: Specify if the device should be used in bipolar mode.
    type: boolean

  adi,vbias-pins:
    description: Analog inputs to apply a voltage bias of (AVDD − AVSS) / 2 to.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 16
    items:
      minimum: 0
      maximum: 15

required:
  - compatible
  - reg
  - interrupts

patternProperties:
  "^channel@([0-9a-f])$":
    type: object
    $ref: adc.yaml
    unevaluatedProperties: false

    properties:
      reg:
        description: The channel number.
        minimum: 0
        maximum: 15

      diff-channels:
        description: |
          Besides the analog inputs available, internal inputs can be used.
          16: Internal temperature sensor.
          17: AVSS
          18: Internal reference
          19: DGND
          20: (AVDD − AVSS)/6+
          21: (AVDD − AVSS)/6-
          22: (IOVDD − DGND)/6+
          23: (IOVDD − DGND)/6-
          24: (ALDO − AVSS)/6+
          25: (ALDO − AVSS)/6-
          26: (DLDO − DGND)/6+
          27: (DLDO − DGND)/6-
          28: V_MV_P
          29: V_MV_M
        items:
          minimum: 0
          maximum: 29

      adi,reference-select:
        description: |
          Select the reference source to use when converting on the
          specific channel. Valid values are:
          0: REFIN1(+)/REFIN1(−)
          1: REFIN2(+)/REFIN2(−)
          2: REFOUT/AVSS (Internal reference)
          3: AVDD/AVSS
          If not specified, REFIN1 is used.
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        default: 0

      adi,excitation-pin-0:
        description: |
          Analog input to apply excitation current to while the channel
          is active.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 15
        default: 0

      adi,excitation-pin-1:
        description: |
          Analog input to apply excitation current to while this channel
          is active.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 15
        default: 0

      adi,excitation-current-0-nanoamp:
        description: |
          Excitation current in nanoamps to be applied to pin specified in
          adi,excitation-pin-0 while this channel is active.
        enum: [0, 100, 10000, 20000, 50000, 100000, 150000, 200000]
        default: 0

      adi,excitation-current-1-nanoamp:
        description: |
          Excitation current in nanoamps to be applied to pin specified in
          adi,excitation-pin-1 while this channel is active.
        enum: [0, 100, 10000, 20000, 50000, 100000, 150000, 200000]
        default: 0

      adi,burnout-current-nanoamp:
        description: |
          Burnout current in nanoamps to be applied for this channel.
        enum: [0, 500, 2000, 4000]
        default: 0

      adi,buffered-positive:
        description: Enable buffered mode for positive input.
        type: boolean

      adi,buffered-negative:
        description: Enable buffered mode for negative input.
        type: boolean

    required:
      - reg
      - diff-channels

additionalProperties: false

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

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

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

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

        spi-max-frequency = <5000000>;
        interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
        interrupt-parent = <&gpio>;

        channel@0 {
          reg = <0>;

          adi,reference-select = <2>;

          /* AIN8, AIN9 */
          diff-channels = <8 9>;
        };

        channel@1 {
          reg = <1>;

          adi,reference-select = <2>;

          /* AIN10, AIN11 */
          diff-channels = <10 11>;
        };

        channel@2 {
          reg = <2>;

          adi,reference-select = <2>;

          /* Temperature Sensor, DGND */
          diff-channels = <16 19>;
        };

        channel@3 {
          reg = <3>;

          adi,reference-select = <2>;

          /* Internal reference, DGND */
          diff-channels = <18 19>;
        };

        channel@4 {
          reg = <4>;

          adi,reference-select = <2>;

          /* DGND, DGND */
          diff-channels = <19 19>;
        };
      };
    };
Loading