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

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

Merge tag 'iio-for-6.8b' of https://git.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.8

A late/optimistic second pull request. The bots have been poking them
since Wednesday without any issues. There are a few fixes in the
ad7091r5 driver as part of rework to enable the ad7091r8 parts that
are included at start of that series.

Includes pre-work for major changes to the DMA buffers that should
land in 6.9 and will greatly improve performance and flexibility for
high performance devices by enabling DMABUF based zero copy transfers
when we don't need to bounce the data via user space.

New device support
------------------
adi,ad7091r8
 - Major refactor of existing adi,ad7091r5 driver to separate out useful
   shared library code that can be used by I2C and SPI parts.
 - Use that library from a new driver supporting the AD7091R-2, AD7091R-4
   and AD7091R-8 12-Bit SPI ADCs.
 - Series includes some late breaking fixes for the ad7091r5.

microchip,mcp4821
 - New driver for MCP4801, MCP4802, MCP4811, MCP4812, MCP4821 and MCP4822
   I2C single / dual channel DACs.

Cleanup
-------
buffers:
 - Use IIO_SEPARATE in place of some hard-coded 0 values.
dma-buffers:
 - Simplify things to not use an outgoing queue given it only ever has
   up to two elements and we only need to track which is first.
 - Split the iio_dma_buffer_fileio_free() function up to make it easier
   to read and enable reuse in a series lining up for 6.9
iio.h
 - Drop some stale documentation of struct fields that don't exist.

* tag 'iio-for-6.8b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: linux/iio.h: fix Excess kernel-doc description warning
  MAINTAINERS: Add MAINTAINERS entry for AD7091R
  iio: adc: Add support for AD7091R-8
  dt-bindings: iio: Add AD7091R-8
  iio: adc: Split AD7091R-5 config symbol
  iio: adc: ad7091r: Add chip_info callback to get conversion result channel
  iio: adc: ad7091r: Set device mode through chip_info callback
  iio: adc: ad7091r: Remove unneeded probe parameters
  iio: adc: ad7091r: Move chip init data to container struct
  iio: adc: ad7091r: Move generic AD7091R code to base driver and header file
  iio: adc: ad7091r: Enable internal vref if external vref is not supplied
  iio: adc: ad7091r: Allow users to configure device events
  iio: dac: driver for MCP4821
  dt-bindings: iio: dac: add MCP4821
  iio: buffer-dma: split iio_dma_buffer_fileio_free() function
  iio: buffer-dma: Get rid of outgoing queue
  iio: buffer: Use IIO_SEPARATE instead of a hard-coded 0
parents c9d98a56 8645e659
Loading
Loading
Loading
Loading
+78 −4
Original line number Diff line number Diff line
@@ -4,36 +4,92 @@
$id: http://devicetree.org/schemas/iio/adc/adi,ad7091r5.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD7091R5 4-Channel 12-Bit ADC
title: Analog Devices AD7091R-2/-4/-5/-8 Multi-Channel 12-Bit ADCs

maintainers:
  - Michael Hennerich <michael.hennerich@analog.com>
  - Marcelo Schmitt <marcelo.schmitt@analog.com>

description: |
  Analog Devices AD7091R5 4-Channel 12-Bit ADC
  Analog Devices AD7091R5 4-Channel 12-Bit ADC supporting I2C interface
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7091r-5.pdf
  Analog Devices AD7091R-2/AD7091R-4/AD7091R-8 2-/4-/8-Channel 12-Bit ADCs
  supporting SPI interface
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7091R-2_7091R-4_7091R-8.pdf

properties:
  compatible:
    enum:
      - adi,ad7091r2
      - adi,ad7091r4
      - adi,ad7091r5
      - adi,ad7091r8

  reg:
    maxItems: 1

  vdd-supply:
    description:
      Provide VDD power to the sensor (VDD range is from 2.7V to 5.25V).

  vdrive-supply:
    description:
      Determines the voltage level at which the interface logic will operate.
      The V_drive voltage range is from 1.8V to 5.25V and must not exceed VDD by
      more than 0.3V.

  vref-supply:
    description:
      Phandle to the vref power supply

  interrupts:
  convst-gpios:
    description:
      GPIO connected to the CONVST pin.
      This logic input is used to initiate conversions on the analog
      input channels.
    maxItems: 1

  reset-gpios:
    maxItems: 1

  interrupts:
    description:
      Interrupt for signaling when conversion results exceed the high limit for
      ADC readings or fall below the low limit for them. Interrupt source must
      be attached to ALERT/BUSY/GPO0 pin.
    maxItems: 1

required:
  - compatible
  - reg

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

  # AD7091R-2 does not have ALERT/BUSY/GPO pin
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad7091r2
    then:
      properties:
        interrupts: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad7091r2
              - adi,ad7091r4
              - adi,ad7091r8
    then:
      required:
        - convst-gpios

unevaluatedProperties: false

examples:
  - |
@@ -51,4 +107,22 @@ examples:
            interrupt-parent = <&gpio>;
        };
    };
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        adc@0 {
            compatible = "adi,ad7091r8";
            reg = <0x0>;
            spi-max-frequency = <1000000>;
            vref-supply = <&adc_vref>;
            convst-gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
            reset-gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
            interrupts = <22 IRQ_TYPE_EDGE_FALLING>;
            interrupt-parent = <&gpio>;
        };
    };
...
+86 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4821.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip MCP4821 and similar DACs

description: |
  Supports MCP48x1 (single channel) and MCP48x2 (dual channel) series of DACs.
  Device supports simplex communication over SPI in Mode 0 and Mode 3.

  +---------+--------------+-------------+
  | Device  |  Resolution  |   Channels  |
  |---------|--------------|-------------|
  | MCP4801 |     8-bit    |      1      |
  | MCP4802 |     8-bit    |      2      |
  | MCP4811 |    10-bit    |      1      |
  | MCP4812 |    10-bit    |      2      |
  | MCP4821 |    12-bit    |      1      |
  | MCP4822 |    12-bit    |      2      |
  +---------+--------------+-------------+

  Datasheet:
    MCP48x1: https://ww1.microchip.com/downloads/en/DeviceDoc/22244B.pdf
    MCP48x2: https://ww1.microchip.com/downloads/en/DeviceDoc/20002249B.pdf

maintainers:
  - Anshul Dalal <anshulusr@gmail.com>

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

properties:
  compatible:
    enum:
      - microchip,mcp4801
      - microchip,mcp4802
      - microchip,mcp4811
      - microchip,mcp4812
      - microchip,mcp4821
      - microchip,mcp4822

  reg:
    maxItems: 1

  vdd-supply: true

  ldac-gpios:
    description: |
      Active Low LDAC (Latch DAC Input) pin used to update the DAC output.
    maxItems: 1

  powerdown-gpios:
    description: |
      Active Low SHDN pin used to enter the shutdown mode.
    maxItems: 1

  spi-cpha: true
  spi-cpol: true

required:
  - compatible
  - reg
  - vdd-supply

additionalProperties: false

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

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

        dac@0 {
            compatible = "microchip,mcp4821";
            reg = <0>;
            vdd-supply = <&vdd_regulator>;
            ldac-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
            powerdown-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
            spi-cpha;
            spi-cpol;
        };
    };
+15 −0
Original line number Diff line number Diff line
@@ -1122,6 +1122,14 @@ F: Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
F:	Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
F:	drivers/iio/adc/ad4130.c
ANALOG DEVICES INC AD7091R DRIVER
M:	Marcelo Schmitt <marcelo.schmitt@analog.com>
L:	linux-iio@vger.kernel.org
S:	Supported
W:	http://ez.analog.com/community/linux-device-drivers
F:	Documentation/devicetree/bindings/iio/adc/adi,ad7091r*
F:	drivers/iio/adc/drivers/iio/adc/ad7091r*
ANALOG DEVICES INC AD7192 DRIVER
M:	Alexandru Tachici <alexandru.tachici@analog.com>
L:	linux-iio@vger.kernel.org
@@ -13180,6 +13188,13 @@ F: Documentation/ABI/testing/sysfs-bus-iio-potentiometer-mcp4531
F:	drivers/iio/potentiometer/mcp4018.c
F:	drivers/iio/potentiometer/mcp4531.c
MCP4821 DAC DRIVER
M:	Anshul Dalal <anshulusr@gmail.com>
L:	linux-iio@vger.kernel.org
S:	Maintained
F:	Documentation/devicetree/bindings/iio/dac/microchip,mcp4821.yaml
F:	drivers/iio/dac/mcp4821.c
MCR20A IEEE-802.15.4 RADIO DRIVER
M:	Stefan Schmidt <stefan@datenfreihafen.org>
L:	linux-wpan@vger.kernel.org
+16 −0
Original line number Diff line number Diff line
@@ -36,13 +36,29 @@ config AD4130
	  To compile this driver as a module, choose M here: the module will be
	  called ad4130.

config AD7091R
	tristate

config AD7091R5
	tristate "Analog Devices AD7091R5 ADC Driver"
	depends on I2C
	select AD7091R
	select REGMAP_I2C
	help
	  Say yes here to build support for Analog Devices AD7091R-5 ADC.

config AD7091R8
	tristate "Analog Devices AD7091R8 ADC Driver"
	depends on SPI
	select AD7091R
	select REGMAP_SPI
	help
	  Say yes here to build support for Analog Devices AD7091R-2, AD7091R-4,
	  and AD7091R-8 ADC.

	  To compile this driver as a module, choose M here: the module will be
	  called ad7091r8.

config AD7124
	tristate "Analog Devices AD7124 and similar sigma-delta ADCs driver"
	depends on SPI_MASTER
+3 −1
Original line number Diff line number Diff line
@@ -7,7 +7,9 @@
obj-$(CONFIG_AB8500_GPADC) += ab8500-gpadc.o
obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o
obj-$(CONFIG_AD4130) += ad4130.o
obj-$(CONFIG_AD7091R5) += ad7091r5.o ad7091r-base.o
obj-$(CONFIG_AD7091R) += ad7091r-base.o
obj-$(CONFIG_AD7091R5) += ad7091r5.o
obj-$(CONFIG_AD7091R8) += ad7091r8.o
obj-$(CONFIG_AD7124) += ad7124.o
obj-$(CONFIG_AD7192) += ad7192.o
obj-$(CONFIG_AD7266) += ad7266.o
Loading