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

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

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

Jonathan writes:

IIO: 1st set of new device support, features and cleanup for 6.13

Changes in take2:
- Additional patch to drop the accidentally added empty file.
- Tidy up of a duplicate include.

Two merges of other trees.

6.12-rc2:
To pull in the move of unaligned.h from include/asm to include/linux
This was to resolve issues in linux-next.

pwm/duty_offset-for6.13-rc1@
PWM infrastructure that is use di the AD7625 ADC driver.

New device support
==================

adi,ad7173
- Add support for the AD4113 8 channel ADC.
adi,ad7606
- Add support for the AD7606C-16 and AD7606C-18 which have higher precision
  and support bipolar and differential channels. A lot of driver
  rework was needed to add the additional flexibility needed to support
  these parts.
adi,ad7625
- New driver supporting AD7625, AD7626, AD7960 and AD7961 LVDS connected
  ADCs. Interface uses a combination of a PWM control and an IIO backend
  (currently a custom FPGA IP).
adi,ad8460
- New driver for the ad8460 Waveform DAC. This high speed device is
  driven by a custom IP via a DMAEngine buffer.
bosch,bmi270
- New driver for this 6-axis IMU. A later patch adds SPI support.
gehc,pmc-adc
- New driver for this GE Healthcare ADC 16-channel 16 bit ADC.
invensense,mpu6050
- Add support for IAM-20680HT and IAM-20680HP variants of the IAM-20680
  IMU that have better specifications in various ways including larger
  FIFO sizes.
vishay,vl6030
- Support the veml7700, a stripped down veml6030 ambient light sensor.
- Support the veml6035 ambient light sensor.

Features
========

liteon,ltr390
- Allow configuration of sampling frequency
- Support suspend and resume
- Add interrupt support including threshold events + control over
  event reporting persistence.
st,vl53l0x
- Add support for continuous mode via IIO buffer support and a dataready
  trigger.
ti,tmp0006
- Add triggered buffer support using data ready interrupt.
vishay,vl6030
- Add regulator control support.
vishay,vl6070
- Add regulator control support.
vishay,vl6180
- Allow configuration of waiting between continuous samples.
- Use the interrupt, if available, for single shot captures
- Support continuous mode via the IIO triggered buffer interfaces.

Cleanups and minor fixes
========================

tools/event monitor
- Free dev_dir_name.
treewide
- Introduce aligned_s64 type for timestamps to replace
  s64 __aligned(8). Initial use in a few drivers - many others to follow.
- Use dev_get_platform_data() instead of open-coding the access.
- InvenSense email address and maintainer updates to reflect
  move to the tdk domain after acquisition.
- Switch platform drivers from remove_new() back to remove() now all
  rework this was enabling is done.
- More use of device_for_each_child_node_scoped() to remove need for manual
  caling of fwnode_handle_put() in early exits from the loop.
- Use IIO_MAP() macro to replace some open-coded versions.
- Constify struct iio_map arrays.
- Use irq_get_trigger_type(irq) rather than
  irqd_get_trigger_type(irq_get_irq_data(irq);
core
- unsigned to unsigned int.
adi,ad3552r
- Fix to low a limit on max SPI clock speed. No rush to upstream this
  one as the binding that uses the higher speed will merge via this
  tree once ready.
adi,ad5770r
- Use get_unaligned_le16() instead of open-coding. Note this caused
  a merge issue in linux-next as unaligned.h has moved.
adi,ad7606
- Use read_avail() callback to handle the various _available attributes.
- Wrap up all data related to channel scaling into a single structure as
  the use of this gets more complex for the -16 and -18 parts.
adi,adf4371
- Use chip_info structures and spi_get_device_match_data()
- Drop spi_set_drvdata() as unused.
- Reduce scope of struct clock as only touched in probe().
- Use dev_err_probe() where appropriate.
adi,axi-dac
- Improve register naming to make field and register association clearer.
- Fix a wrong register bit.
amlogic,meson8-saradc
- Allow the meson8-saradc to have the amlogic,hhi-sysctrl property.
bosch,bmp280
- Use u8 for the DMA buffer to avoid implication of other types given it
  can contain be24 data.
- Use unsigned types to store raw values to make it clear they cannot be
  negative.
- Drop unnecessary check for errors after IIR filter update.
- Support soft reset to get device to know state on driver load.
- Use bulk reads to retrieve the humidity calibration data.
dynaimage,al3010
- Make sure to powerdown device in error paths.
invensense,icm42600
- Add missing i2c_device-id tables.
kionix,kmx61
- Drop ACPI IDs that are not associated with valid ACPI vendor IDs
  and for which there is no evidence they are in use in real devices.
liteon,ltrf261a
- Document a bad compatible that we are supporting because it is in
  the wild in the Valve Steam Deck via ACPI PRP0001.
maxim,max1363
- Use get_unaligned_be16() instead of open-coding. Note this caused
  a merge issue in linux-next as unaligned.h has moved.
mediatek,mt6360
- Use get_unaligned_be16() instead of open-coding. Note this caused
  a merge issue in linux-next as unaligned.h has moved.
microchip,pac1921
- Drop various unnecessary type casts that were suggested by
  Wconversion compiler warnings which we do not use in IIO.
  Remove them because they hurt readability in cases where it is clear
  not overflow can occur.
rohm,rpr0521
- Use iio_poll_func_store_time() rather than open-coding a similar solution.
semtech,sx9324
- Make sx_common_get_raw_register() local to the only code that uses it.
- Drop unnecessary acpi.h include.
st,vl53l0x
- Check the part ID register and print an info message if it is not what
  is expected.
vishay,veml6030
- Fix DT binding file name to include vishay
- Use regmap_set_bits() for case where all bits are set.
- Use dev_err_probe() where appropriate.
- Add missing delay after powering up in resume path.
- Drop a processed accessor for the white channel as there is no public
  information to allow a specific scale to be established.
- Use read_avail() to replace explicit custom _available attributes.
vishay,veml6070
- Use guard() to allow early returns.
- Add a devm callback to unregister the i2c device.
- Use devm_iio_device_register() to simplify removal code.

Various other minor improvements not called out explicitly.

* tag 'iio-for-6.13a-take2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (161 commits)
  iio: imu: bmi270: Remove duplicated include in bmi270_i2c.c
  iio: adc: ad7606: Drop spurious empty file.
  iio: light: rpr0521: Use generic iio_pollfunc_store_time()
  iio: light: vl6180: Add support for Continuous Mode
  iio: light: vl6180: Added Interrupt support for single shot access
  iio: light: vl6180: Add configurable inter-measurement period support
  MAINTAINERS: add entry for VEML6030 ambient light sensor driver
  iio: light: veml6030: add support for veml7700
  dt-bindings: iio: light: veml6030: add veml7700
  iio: light: veml6035: fix read_avail in no_irq case for veml6035
  iio: dac: adi-axi-dac: update register names
  iio: dac: adi-axi-dac: fix wrong register bitfield
  docs: iio: new docs for ad7625 driver
  iio: adc: ad7625: add driver
  dt-bindings: iio: adc: add AD762x/AD796x ADCs
  iio: Convert unsigned to unsigned int
  iio: pressure: bmp280: Fix uninitialized variable
  iio: Switch back to struct platform_driver::remove()
  iio: imu: bmi323: remove redundant register definition
  iio: frequency: adf4371: make use of dev_err_probe()
  ...
parents 78fe6636 57573ace
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ properties:
      to both the positive and negative inputs of a differential ADC.
      The first value specifies the positive input pin, the second
      specifies the negative input pin.
      There are also some ADCs, where the differential channel has dedicated
      positive and negative inputs which can be used to measure differential
      voltage levels. For those setups, this property can be configured with
      the 'reg' property for both inputs (i.e. diff-channels = <reg reg>).

  single-channel:
    $ref: /schemas/types.yaml#/definitions/uint32
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ description: |
  Datasheets for supported chips:
    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4111.pdf
    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4112.pdf
    <AD4113: not released yet>
    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4114.pdf
    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4115.pdf
    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4116.pdf
@@ -44,6 +45,7 @@ properties:
    enum:
      - adi,ad4111
      - adi,ad4112
      - adi,ad4113
      - adi,ad4114
      - adi,ad4115
      - adi,ad4116
@@ -331,6 +333,7 @@ allOf:
            enum:
              - adi,ad4111
              - adi,ad4112
              - adi,ad4113
              - adi,ad4114
              - adi,ad4115
              - adi,ad4116
+120 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ description: |
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7605-4.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606_7606-6_7606-4.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7606B.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-16.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-18.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7616.pdf

properties:
@@ -24,11 +26,19 @@ properties:
      - adi,ad7606-6
      - adi,ad7606-8  # Referred to as AD7606 (without -8) in the datasheet
      - adi,ad7606b
      - adi,ad7606c-16
      - adi,ad7606c-18
      - adi,ad7616

  reg:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  spi-cpha: true

  spi-cpol: true
@@ -114,6 +124,47 @@ properties:
      assumed that the pins are hardwired to VDD.
    type: boolean

patternProperties:
  "^channel@[1-8]$":
    type: object
    $ref: adc.yaml
    unevaluatedProperties: false

    properties:
      reg:
        description:
          The channel number, as specified in the datasheet (from 1 to 8).
        minimum: 1
        maximum: 8

      diff-channels:
        description:
          Each channel can be configured as a bipolar differential channel.
          The ADC uses the same positive and negative inputs for this.
          This property must be specified as 'reg' (or the channel number) for
          both positive and negative inputs (i.e. diff-channels = <reg reg>).
          Since the configuration is bipolar differential, the 'bipolar'
          property is required.
        items:
          minimum: 1
          maximum: 8

      bipolar:
        description:
          The ADC channels can be configured as
             * Bipolar single-ended
             * Unipolar single-ended
             * Bipolar differential
          Therefore in the DT, if no channel node is specified, it is considered
          'unipolar single-ended'. So for the other configurations the 'bipolar'
          property must be specified. If 'diff-channels' is specified, it is
          considered a bipolar differential channel. Otherwise it is bipolar
          single-ended.

    required:
      - reg
      - bipolar

required:
  - compatible
  - reg
@@ -170,6 +221,25 @@ allOf:
        adi,conversion-start-gpios:
          maxItems: 1

  - if:
      not:
        required:
          - adi,sw-mode
    then:
      patternProperties:
        "^channel@[1-8]$": false

  - if:
      not:
        properties:
          compatible:
            enum:
              - adi,ad7606c-16
              - adi,ad7606c-18
    then:
      patternProperties:
        "^channel@[1-8]$": false

unevaluatedProperties: false

examples:
@@ -202,4 +272,54 @@ examples:
            standby-gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
        };
    };
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        adc@0 {
            compatible = "adi,ad7606c-18";
            reg = <0>;

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

            spi-max-frequency = <1000000>;
            spi-cpol;
            spi-cpha;

            avcc-supply = <&adc_vref>;
            vdrive-supply = <&vdd_supply>;

            interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
            interrupt-parent = <&gpio>;

            adi,conversion-start-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
            reset-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
            adi,first-data-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
            standby-gpios = <&gpio 24 GPIO_ACTIVE_LOW>;

            adi,sw-mode;

            channel@1 {
                reg = <1>;
                diff-channels = <1 1>;
                bipolar;
            };

            channel@3 {
                reg = <3>;
                bipolar;
            };

            channel@8 {
                reg = <8>;
                diff-channels = <8 8>;
                bipolar;
            };

        };
    };
...
+176 −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,ad7625.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices Fast PulSAR Analog to Digital Converters

maintainers:
  - Michael Hennerich <Michael.Hennerich@analog.com>
  - Nuno Sá <nuno.sa@analog.com>

description: |
  A family of single channel differential analog to digital converters.

  * https://www.analog.com/en/products/ad7625.html
  * https://www.analog.com/en/products/ad7626.html
  * https://www.analog.com/en/products/ad7960.html
  * https://www.analog.com/en/products/ad7961.html

properties:
  compatible:
    enum:
      - adi,ad7625
      - adi,ad7626
      - adi,ad7960
      - adi,ad7961

  vdd1-supply: true
  vdd2-supply: true
  vio-supply: true

  ref-supply:
    description:
      Voltage regulator for the external reference voltage (REF).

  refin-supply:
    description:
      Voltage regulator for the reference buffer input (REFIN).

  clocks:
    description:
      The clock connected to the CLK pins, gated by the clk_gate PWM.
    maxItems: 1

  pwms:
    items:
      - description: PWM connected to the CNV input on the ADC.
      - description: PWM that gates the clock connected to the ADC's CLK input.

  pwm-names:
    items:
      - const: cnv
      - const: clk_gate

  io-backends:
    description:
      The AXI ADC IP block connected to the D+/- and DCO+/- lines of the
      ADC. An example backend can be found at
      http://analogdevicesinc.github.io/hdl/projects/pulsar_lvds/index.html.
    maxItems: 1

  adi,no-dco:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Indicates the wiring of the DCO+/- lines. If true, then they are
      grounded and the device is in self-clocked mode. If this is not
      present, then the device is in echoed clock mode.

  adi,en0-always-on:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Indicates if EN0 is hard-wired to the high state. If neither this
      nor en0-gpios are present, then EN0 is hard-wired low.

  adi,en1-always-on:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Indicates if EN1 is hard-wired to the high state. If neither this
      nor en1-gpios are present, then EN1 is hard-wired low.

  adi,en2-always-on:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Indicates if EN2 is hard-wired to the high state. If neither this
      nor en2-gpios are present, then EN2 is hard-wired low.

  adi,en3-always-on:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Indicates if EN3 is hard-wired to the high state. If neither this
      nor en3-gpios are present, then EN3 is hard-wired low.

  en0-gpios:
    description:
      Configurable EN0 pin.

  en1-gpios:
    description:
      Configurable EN1 pin.

  en2-gpios:
    description:
      Configurable EN2 pin.

  en3-gpios:
    description:
      Configurable EN3 pin.

required:
  - compatible
  - vdd1-supply
  - vdd2-supply
  - vio-supply
  - clocks
  - pwms
  - pwm-names
  - io-backends

allOf:
  - if:
      required:
        - ref-supply
    then:
      properties:
        refin-supply: false
  - if:
      required:
        - refin-supply
    then:
      properties:
        ref-supply: false
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad7625
              - adi,ad7626
    then:
      properties:
        en2-gpios: false
        en3-gpios: false
        adi,en2-always-on: false
        adi,en3-always-on: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad7960
              - adi,ad7961
    then:
      # ad796x parts must have one of the two supplies
      oneOf:
        - required: [ref-supply]
        - required: [refin-supply]

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    adc {
        compatible = "adi,ad7625";
        vdd1-supply = <&supply_5V>;
        vdd2-supply = <&supply_2_5V>;
        vio-supply = <&supply_2_5V>;
        io-backends = <&axi_adc>;
        clocks = <&ref_clk>;
        pwms = <&axi_pwm_gen 0 0>, <&axi_pwm_gen 1 0>;
        pwm-names = "cnv", "clk_gate";
        en0-gpios = <&gpio0 86 GPIO_ACTIVE_HIGH>;
        en1-gpios = <&gpio0 87 GPIO_ACTIVE_HIGH>;
    };
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ allOf:
        compatible:
          contains:
            enum:
              - amlogic,meson8-saradc
              - amlogic,meson8b-saradc
              - amlogic,meson8m2-saradc
    then:
Loading