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

Merge tag 'iio-for-6.13b' of...

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

Jonathan writes:

IIO: 2nd set of new device support, features and cleanup for 6.13

Alongside new drivers and device support there are several large
cleanups going on across the IIO tree and we see part of some of those
in this pull request.

Merged char-misc-next at point of 6.12-rc6 merge to avoid a
conflict with a fix for the ad7380 merged earlier this cycle.
Note that I previously messed this merge up and had to reconstruct
it this morning so a coherent pull request was possible. The new
stuff is all the same as has been in linux-next for some time with
the exception of the kernel-doc related __private ordering fix
that went in yesterday.

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

adi,ad7380
- Support for adaq4370-4 and adaq4370 quad channel ADCs.
adi,ad7606
- Various cleanups preceeding support of AD7607, AD7608 and AD7609 ADCs.
adi,ad7779
- New driver supproting AD7770, AD7771 and AD7779 ADCs.
allegro,als31300
- New driver for this 3D Linear Hall Effect sensor.
bosch,bmi270
- Add support BMI260 which is similar but requires a different firmware image.
bosch,smi240
- New driver for this IMU.
ti,opt3001
- Add support opt3002 light sensor which has a wider spectral range than
  the opt3001.
vishay,veml3235
- New driver for this ambient light sensor.

Features
========

hid-sensors
- Add support Human Proximity Range and Attention detection (requiring
  a new classification style channel type)
adi,ad3552r
- Add backend support and related platform driver to support use
  with an FPGA IP to allow QSPI + DDR bus operation and much higher
  data aquisition rates.  (various rework preceeded this feature)
adi,ad7606
- Various cleanup prior to enabling use with an IIO Backend and PWM trigger
  enabling much higher speed data capture.
bosch,bme680
- Support control of preheat current
- Support triggered buffer capture
- Add SCALE and RAW channels (needed to enable the buffered capture).
bosch,bmp280
- Enable sleeping to save power.
- Add interrupt support for bmp3xx and bmp5xx devices. Also update bmp085
  to new approach.
- Enable data ready trigger.
bosch,bmi270
- Add triggered buffer support
- Add scale and sampling frequency control.
vishay,veml6070
- Support integration time via DT binding for an external resistor value.

Cleanup and minor fixes
=======================

core
- Fix a longstanding issue with event codes for differential channels.
  Note that not all drivers are yet fixed, but macros have been added
  to avoid potential repeats of this in future.
- Tidy up handling in iio_read_acpi_mount matrix.
- Mark iio_dev::priv with __private. Later move the marking before the
  field name to avoid a kernel-doc issue.
treewide
- Drop some pointless default n entries in Kconfig.
- Add an iio_get_acpi_device_name_and_data() handler to replace some
  commonly repeated code.
- simplify use of 'state' in write_event_config() callback  as it is
  effectively a boolean. Once done make it a boolean (lots of drivers
  were updated to enable this)
- some more use of devm_regulator_get_enable_read_voltage( to replace
  open coded versions.  Where this enables it convert all of remove
  handling to devm based and drop the remove callback.
- check returns from devm_mutex_init()
accel drivers
- Use aligned_s64 instead of s64 __aligned(8)
adi,ad5791
- Add some missing GPIOs and power supplies that presumably were always
  hard wired on previous boards.
- Refactor to use chip_info in device id tables.
- Convert probe entirely to devm based simplify code and allowing remove()
  callback to be dropped.
adi,ad7192
- Check return from spi_get_device_match_data()
adi,ad74413r
- Don't keep an unnecessary copy of the gpio after probe.
- Use devm_regulator_get_enable_read_voltage() instead of open coding.
- Apply cleanup.h approach to reduce complexity.
adi,dac8460
- Fix a wrong compaitble ID due to a stray space.
- Add an spi_device_id table.
bosch,bmc150
- Drop some likely false ACPI IDs.
- Drop left over unused ACPI specific code.
bosch,bme680
- Add mising regmap.h include.
- Reduce excessive sleep on startup.
- Drop some cammelcase usage.
- Use fsleep
- Generalize read functions to allow for reuse.
- Use s16 variable to avoid some incorrect casting
bosch,bmg150
- Drop some likely false ACPI IDs.
bosch,bmi270
- Drop unused FREQUENCY and SCALE attributes that always returned an
  error (they wil be back impelmented correctly).
- Factor out the chip specific data into a structure to enable simple
  support for additional devices.
isil,isl29018
- Drop ACPI_PTR() and CONFIG_ACPI guards as not worth the trouble for very
  minor saving.
invensense,mpu6050
- Use much simpler test for ACPI firmware.
kionix,kxcjk-1013
- Drop unnecessary ACPI entry in the i2c_device_id table.
- Drop support KX022-1020 to fix a bug that was introduced with that change.
  Hopefully a fixed version will replace it soon.
- Drop CONFIG guards for PM in favor of pm_ptr() and the compiler removing
  dead code.
- Switch from enum to chip_info structure and add ODR times to that structure.
- Deduplicate one of those ODR structures
- Drop ACPI_PTR() and move ID table out of config guards.
- Minor additional cleanup.
liteon,ltr401
- Drop some likely false ACPI Ids and add LTER0303 which is know to be in use.
microchip,pac1934
- Use much simpler test for ACPI firmware.
vishay,veml6070
- Use unsigned int instead of just unsigned.
- Use FIELD_PREP to make setting of field value explicit.

Various other minor fixes to documentation

* tag 'iio-for-6.13b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (153 commits)
  iio: Move __private marking before struct element priv in struct iio_dev
  docs: iio: ad7380: add adaq4370-4 and adaq4380-4
  iio: adc: ad7380: add support for adaq4370-4 and adaq4380-4
  iio: adc: ad7380: use local dev variable to shorten long lines
  iio: adc: ad7380: fix oversampling formula
  dt-bindings: iio: adc: ad7380: add adaq4370-4 and adaq4380-4 compatible parts
  iio: chemical: bme680: Add support for preheat current
  iio: chemical: bme680: Add triggered buffer support
  iio: chemical: bme680: Add SCALE and RAW channels
  iio: chemical: bme680: refactorize set_mode() mode
  iio: events: make IIO_EVENT_CODE macro private
  iio: accel: mma9553: use specialized event code macros
  iio: dummy: use specialized event code macros
  iio: adc: ad7280a: use IIO_DIFF_EVENT_CODE macro helper
  iio: events.h: add event identifier macros for differential channel
  iio: magnetometer: add Allegro MicroSystems ALS31300 3-D Linear Hall Effect driver
  dt-bindings: iio: magnetometer: document the Allegro MicroSystems ALS31300 3-D Linear Hall Effect Sensor
  dt-bindings: vendor-prefixes: Add Allegro MicroSystems, Inc
  iio: light: apds9960: remove useless return
  iio: light: apds9960: convert als_int and pxs_int to bool
  ...
parents 7215ff51 20fd1383
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -2268,6 +2268,30 @@ Description:
		An example format is 16-bytes, 2-digits-per-byte, HEX-string
		representing the sensor unique ID number.

What:		/sys/bus/iio/devices/iio:deviceX/filter_type_available
What:		/sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
KernelVersion:	6.1
Contact:	linux-iio@vger.kernel.org
Description:
		Reading returns a list with the possible filter modes. Options
		for the attribute:

		* "sinc3" - The digital sinc3 filter. Moderate 1st
		  conversion time. Good noise performance.
		* "sinc4" - Sinc 4. Excellent noise performance. Long
		  1st conversion time.
		* "sinc5" - The digital sinc5 filter. Excellent noise
		  performance
		* "sinc4+sinc1" - Sinc4 + averaging by 8. Low 1st conversion
		  time.
		* "sinc3+rej60" - Sinc3 + 60Hz rejection.
		* "sinc3+sinc1" - Sinc3 + averaging by 8. Low 1st conversion
		  time.
		* "sinc3+pf1" - Sinc3 + device specific Post Filter 1.
		* "sinc3+pf2" - Sinc3 + device specific Post Filter 2.
		* "sinc3+pf3" - Sinc3 + device specific Post Filter 3.
		* "sinc3+pf4" - Sinc3 + device specific Post Filter 4.

What:		/sys/.../events/in_proximity_thresh_either_runningperiod
KernelVersion:	6.6
Contact:	linux-iio@vger.kernel.org
@@ -2339,3 +2363,11 @@ KernelVersion: 6.10
Contact:	linux-iio@vger.kernel.org
Description:
		The value of current sense resistor in Ohms.

What:		/sys/.../iio:deviceX/in_attention_input
KernelVersion:	6.13
Contact:	linux-iio@vger.kernel.org
Description:
		Value representing the user's attention to the system expressed
		in units as percentage. This usually means if the user is
		looking at the screen or not.
+0 −46
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.
+120 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ description: |
  * https://www.analog.com/en/products/ad7386-4.html
  * https://www.analog.com/en/products/ad7387-4.html
  * https://www.analog.com/en/products/ad7388-4.html
  * https://www.analog.com/en/products/adaq4370-4.html
  * https://www.analog.com/en/products/adaq4380-4.html


$ref: /schemas/spi/spi-peripheral-props.yaml#
@@ -46,6 +48,8 @@ properties:
      - adi,ad7386-4
      - adi,ad7387-4
      - adi,ad7388-4
      - adi,adaq4370-4
      - adi,adaq4380-4

  reg:
    maxItems: 1
@@ -70,6 +74,20 @@ properties:
  refin-supply:
    description:
      A 2.5V to 3.3V supply for external reference voltage, for ad7380-4 only.
      For adaq devices, a 5V supply voltage. A 3.3V internal reference is
      derived from it. Connect to vs-p-supply for normal operation.

  vs-p-supply:
    description:
      Amplifiers positive supply.

  vs-n-supply:
    description:
      Amplifiers negative supply.

  ldo-supply:
    description:
      LDO supply. Connect to vs-p-supply or a 3.6 to 5.5 V supply.

  aina-supply:
    description:
@@ -97,12 +115,45 @@ properties:
      specify the ALERT interrupt.
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

required:
  - compatible
  - reg
  - vcc-supply
  - vlogic-supply

patternProperties:
  "^channel@[0-3]$":
    $ref: adc.yaml
    type: object

    properties:
      reg:
        description:
          The channel number. From 0 to 3 corresponding to channels A,B,C,D
        minimum: 0
        maximum: 3

      adi,gain-milli:
        description:
          The hardware gain applied to the ADC input (in milli units).
          If not present, default to 1000 (no actual gain applied).
          Refer to the typical connection diagrams section of the datasheet for
          pin wiring.
        $ref: /schemas/types.yaml#/definitions/uint16
        enum: [300, 600, 1000, 1600]
        default: 1000

    required:
      - reg

    additionalProperties: false

unevaluatedProperties: false

allOf:
@@ -140,6 +191,7 @@ allOf:
        aind-supply: false

  # ad7380-4 uses refin-supply as external reference.
  # adaq devices use internal reference only, derived from refin-supply
  # All other chips from ad738x family use refio as optional external reference.
  # When refio-supply is omitted, internal reference is used.
  - if:
@@ -147,6 +199,8 @@ allOf:
        compatible:
          enum:
            - adi,ad7380-4
            - adi,adaq4370-4
            - adi,adaq4380-4
    then:
      properties:
        refio-supply: false
@@ -156,6 +210,27 @@ allOf:
      properties:
        refin-supply: false

  # adaq devices need more supplies and using channel to declare gain property
  # only applies to adaq devices
  - if:
      properties:
        compatible:
          enum:
            - adi,adaq4370-4
            - adi,adaq4380-4
    then:
      required:
        - vs-p-supply
        - vs-n-supply
        - ldo-supply
    else:
      properties:
        vs-p-supply: false
        vs-n-supply: false
        ldo-supply: false
      patternProperties:
        "^channel@[0-3]$": false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
@@ -180,3 +255,48 @@ examples:
            refio-supply = <&supply_2_5V>;
        };
    };

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

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

        adc@0 {
            compatible = "adi,adaq4380-4";
            reg = <0>;

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

            interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
            interrupt-parent = <&gpio0>;

            vcc-supply = <&supply_3_3V>;
            vlogic-supply = <&supply_3_3V>;
            refin-supply = <&supply_5V>;
            vs-p-supply = <&supply_5V>;
            vs-n-supply = <&supply_0V>;
            ldo-supply = <&supply_5V>;

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

            channel@0 {
                reg = <0>;
                adi,gain-milli = /bits/ 16 <300>;
            };

            channel@2 {
                reg = <2>;
                adi,gain-milli = /bits/ 16 <600>;
            };

            channel@3 {
                reg = <3>;
                adi,gain-milli = /bits/ 16 <1000>;
            };
        };
    };
+76 −5
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@ description: |
  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/ad7607.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7608.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7609.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7616.pdf

properties:
@@ -28,6 +31,9 @@ properties:
      - adi,ad7606b
      - adi,ad7606c-16
      - adi,ad7606c-18
      - adi,ad7607
      - adi,ad7608
      - adi,ad7609
      - adi,ad7616

  reg:
@@ -39,6 +45,11 @@ properties:
  "#size-cells":
    const: 0

  # According to the datasheet, "Data is clocked in from SDI on the falling
  # edge of SCLK, while data is clocked out on DOUTA on the rising edge of
  # SCLK".  Also, even if not stated textually in the datasheet, it is made
  # clear on the diagrams that sclk idles at high.  Subsequently, in case SPI
  # interface is used, the correct way is to only set spi-cpol.
  spi-cpha: true

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

  pwms:
    description:
      In case the conversion is triggered by a PWM instead of a GPIO plugged to
      the CONVST pin, the PWM must be referenced.
      The first is the PWM connected to CONVST or CONVST1 for the chips with the
      2nd PWM connected to CONVST2, if CONVST2 is available and not shorted to
      CONVST1.
    minItems: 1
    maxItems: 2

  pwm-names:
    items:
      - const: convst1
      - const: convst2

  io-backends:
    description:
      A reference to the iio-backend, which is responsible handling the BUSY
      pin's falling edge and communication.
      An example of backend can be found at
      http://analogdevicesinc.github.io/hdl/library/axi_ad7606x/index.html


patternProperties:
  "^channel@[1-8]$":
    type: object
@@ -168,15 +202,24 @@ patternProperties:
required:
  - compatible
  - reg
  - spi-cpha
  - avcc-supply
  - vdrive-supply
  - interrupts
  - adi,conversion-start-gpios

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

  - oneOf:
      - required:
          - adi,conversion-start-gpios
      - required:
          - pwms

  - oneOf:
      - required:
          - interrupts
      - required:
          - io-backends

  - if:
      properties:
        compatible:
@@ -213,11 +256,18 @@ allOf:
              - adi,ad7606-4
              - adi,ad7606-6
              - adi,ad7606-8
              - adi,ad7607
              - adi,ad7608
              - adi,ad7609
    then:
      properties:
        adi,sw-mode: false
    else:
      properties:
        pwms:
          maxItems: 1
        pwm-names:
          maxItems: 1
        adi,conversion-start-gpios:
          maxItems: 1

@@ -243,6 +293,29 @@ allOf:
unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    iio-backend {
        #address-cells = <1>;
        #size-cells = <0>;
        adi_adc@0 {
            compatible = "adi,ad7606b";
            reg = <0>;
            pwms = <&axi_pwm_gen 0 0>;

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

            reset-gpios = <&gpio0 91 GPIO_ACTIVE_HIGH>;
            standby-gpios = <&gpio0 90 GPIO_ACTIVE_LOW>;
            adi,range-gpios = <&gpio0 89 GPIO_ACTIVE_HIGH>;
            adi,oversampling-ratio-gpios = <&gpio0 88 GPIO_ACTIVE_HIGH
                                            &gpio0 87 GPIO_ACTIVE_HIGH
                                            &gpio0 86 GPIO_ACTIVE_HIGH>;
            io-backends = <&iio_backend>;
        };
    };

  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
@@ -255,7 +328,6 @@ examples:
            reg = <0>;
            spi-max-frequency = <1000000>;
            spi-cpol;
            spi-cpha;

            avcc-supply = <&adc_vref>;
            vdrive-supply = <&vdd_supply>;
@@ -288,7 +360,6 @@ examples:

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

            avcc-supply = <&adc_vref>;
            vdrive-supply = <&vdd_supply>;
+110 −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,ad7779.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD777X family 8-Channel, 24-Bit, Simultaneous Sampling ADCs

maintainers:
  - Ramona Nechita <ramona.nechita@analog.com>

description: |
  The AD777X family consist of 8-channel, simultaneous sampling analog-to-
  digital converter (ADC). Eight full Σ-Δ ADCs are on-chip. The
  AD7771 provides an ultralow input current to allow direct sensor
  connection. Each input channel has a programmable gain stage
  allowing gains of 1, 2, 4, and 8 to map lower amplitude sensor
  outputs into the full-scale ADC input range, maximizing the
  dynamic range of the signal chain.

  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7770.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7771.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7779.pdf

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

properties:
  compatible:
    enum:
      - adi,ad7770
      - adi,ad7771
      - adi,ad7779

  reg:
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  clocks:
    maxItems: 1

  avdd1-supply:
    description: Front-End analog supply AVDD1. Can be used as conversion ref.

  avdd2-supply:
    description: AVDD2 Analog Supply from 2.2 V to 3.6 V.

  avdd4-supply:
    description: AVDD4 SAR Analog Supply and Reference Source.

  interrupts:
    minItems: 1
    items:
      - description: |
          adc_rdy: Interrupt line for DRDY signal which indicates the end of
          conversion independently of the interface selected to read back the
          Σ-∆ conversion.
      - description: |
          Alert: The chip includes self diagnostic features to guarantee the
          correct operation. If an error is detected, the ALERT pin is pulled
          high to generate an external interruption to the controller.

  interrupt-names:
    minItems: 1
    maxItems: 2
    items:
      enum:
        - adc_rdy
        - alert

  start-gpios:
    description:
      Pin that controls start synchronization pulse.
    maxItems: 1

  reset-gpios:
    maxItems: 1

required:
  - compatible
  - reg
  - clocks
  - interrupts

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        adc@0 {
          compatible = "adi,ad7779";
          reg = <0>;
          start-gpios = <&gpio0 87 GPIO_ACTIVE_LOW>;
          reset-gpios = <&gpio0 93 GPIO_ACTIVE_LOW>;
          interrupt-parent = <&intc>;
          interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
          interrupt-names = "adc_rdy";
          clocks = <&adc_clk>;
        };
    };
...
Loading