Skip to content

Commit

Permalink
Merge tag 'iio-for-6.11b' of ssh://gitolite.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/jic23/iio into char-misc-next

Jonathan writes:

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

The big one here is we finally have Paul Cercueil's (and others)
DMA buffer support for IIO devices enabling high speed zero
copy transfer of data to and from sensors supported by IIO (and for
example USB).  This should aid with upstream support of a range of
higher performance ADCs and DACs.

Two merges from other trees
- spi/spi_devm_optimize used for simplification in ad7944.
- dmaengine/topic_dma_vec to enable the DMABUF series.

One feature with impact outside IIO.
- Richer set of dev_err_probe() like helpers to cover ERR_PTR() cases.

New device support
==================
adi,ad7173
- Add support for AD4111, AD4112, AD4114, AD4115 and ADC4116 pseudo
  differential ADCs. Major driver rework was needed to enabled these.
adi,ad7944
- Use devm_spi_optimize_message() to avoid a local devm cleanup
  callback. This is the example case from the patch set, others will
  follow.
mediatek,mt6359-auxadc
- New driver for this ADC IP found in MT6357, MT6358 and MT6359 PMICs.
st,accel
- Add support for the LIS2DS12 accelerometer
ti,ads1119
- New driver for this 16 bit 2-differential or 4-single ended channel
  ADC.

Features
========
dt-bindings
- Introduce new common-mode-channel property to help handle pseudo
  differential ADCs where we have something that looks like one side
  of differential input, but which is only suited for use with a
  slow moving reference.
adi,adf4350
- Support use as a clock provider.
iio-hmwon
- Support reading of labels from IIO devices by their consumers and
  use this in the hwmon bridge.

Cleanup and minor fixes
=======================
Treewide
- Use regmap_clear_bits() / regmap_set_bits() to simplify open coded
  equivalents.
- Use devm_regulator_get_enable_read_voltage() to replace equivalent
  opencoded boilerplate. In some cases enabled complete conversion to
  devm handling and removal of explicit remove() callbacks.
- Introduce dev_err_ptr_probe() and other variants and make use of
  of them in a couple of examples driver cleanups. Will find use in
  many more drivers soon.
adi,ad7192
- Introduce local struct device *dev and use dev_err_probe() to give
  more readable code.
adi,adi-axi-adc/dac
- Improved consistency of messages using dev_err_probe()
adi,adis
- Split the trigger handling into cases that needed paging and those that
  don't resulting in more readable code.
- Use cleanup.h to simplify error paths via scoped cleanup.
- Add adis specific lock helpers and make use of them in a number of drivers.
adi,ad7192
- Update maintainer (Alisa-Dariana Roman)
adi,ad7606
- dt-binding cleanup.
avago,apds9306
- Add a maintainer entry (Subhajit Ghosh)
linear,ltc2309
- Fix a wrong endian type.
st,stm32-dfsdm
- Fix a missing port property in the dt-binding.
st,sensors
- Relax whoami match failure to a warning print rather than probe failure.
  This enables fallback compatibles to existing parts from those that don't
  necessarily even exit yet.

* tag 'iio-for-6.11b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (112 commits)
  iio: adc: ad7173: Fix uninitialized symbol is_current_chan
  iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC
  math.h: Add unsigned 8 bits fractional numbers type
  dt-bindings: iio: adc: Add MediaTek MT6359 PMIC AUXADC
  iio: common: scmi_iio: convert to dev_err_probe()
  iio: backend: make use of dev_err_cast_probe()
  iio: temperature: ltc2983: convert to dev_err_probe()
  dev_printk: add new dev_err_probe() helpers
  iio: xilinx-ams: Add labels
  iio: adc: ad7944: use devm_spi_optimize_message()
  Documentation: iio: Document high-speed DMABUF based API
  iio: buffer-dmaengine: Support new DMABUF based userspace API
  iio: buffer-dma: Enable support for DMABUFs
  iio: core: Add new DMABUF interface infrastructure
  MAINTAINERS: Update AD7192 driver maintainer
  iio: adc: ad7192: use devm_regulator_get_enable_read_voltage
  iio: st_sensors: relax WhoAmI check in st_sensors_verify_id()
  MAINTAINERS: Add AVAGO APDS9306
  dt-bindings: iio: adc: adi,ad7606: comment and sort the compatible names
  dt-bindings: iio: adc: adi,ad7606: add missing datasheet link
  ...
  • Loading branch information
gregkh committed Jul 4, 2024
2 parents dfd1986 + 529d2e1 commit 14c4dc8
Show file tree
Hide file tree
Showing 119 changed files with 4,447 additions and 1,494 deletions.
11 changes: 11 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ properties:
differential channels). If this and diff-channels are not present reg
shall be used instead.

common-mode-channel:
$ref: /schemas/types.yaml#/definitions/uint32
description:
Some ADCs have differential input pins that can be used to measure
single-ended or pseudo-differential inputs. This property can be used
in addition to single-channel to signal software that this channel is
not differential but still specify two inputs.

The input pair is specified by setting single-channel to the positive
input pin and common-mode-channel to the negative pin.

settling-time-us:
description:
Time between enabling the channel and first stable readings.
Expand Down
194 changes: 192 additions & 2 deletions Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ description: |
primarily for measurement of signals close to DC but also delivers
outstanding performance with input bandwidths out to ~10kHz.
Analog Devices AD411x ADC's:
The AD411X family encompasses a series of low power, low noise, 24-bit,
sigma-delta analog-to-digital converters that offer a versatile range of
specifications. They integrate an analog front end suitable for processing
fully differential/single-ended and bipolar voltage inputs.
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
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
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-2.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-4.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7173-8.pdf
Expand All @@ -31,6 +42,11 @@ description: |
properties:
compatible:
enum:
- adi,ad4111
- adi,ad4112
- adi,ad4114
- adi,ad4115
- adi,ad4116
- adi,ad7172-2
- adi,ad7172-4
- adi,ad7173-8
Expand Down Expand Up @@ -129,10 +145,56 @@ patternProperties:
maximum: 15

diff-channels:
description: |
This property is used for defining the inputs of a differential
voltage channel. The first value is the positive input and the second
value is the negative input of the channel.
Family AD411x supports a dedicated VINCOM voltage input.
To select it set the second channel to 16.
(VIN2, VINCOM) -> diff-channels = <2 16>
There are special values that can be selected besides the voltage
analog inputs:
21: REF+
22: REF−
Supported only by AD7172-2, AD7172-4, AD7175-2, AD7175-8, AD7177-2,
must be paired together and can be used to monitor the power supply
of the ADC:
19: ((AVDD1 − AVSS)/5)+
20: ((AVDD1 − AVSS)/5)−
items:
minimum: 0
maximum: 31

single-channel:
description: |
This property is used for defining a current channel or the positive
input of a voltage channel (single-ended or pseudo-differential).
Models AD4111 and AD4112 support current channels.
Example: (IIN2+, IIN2−) -> single-channel = <2>
To correctly configure a current channel set the "adi,current-channel"
property to true.
To configure a single-ended/pseudo-differential channel set the
"common-mode-channel" property to the desired negative voltage input.
When used as a voltage channel, special inputs are valid as well.
minimum: 0
maximum: 31

common-mode-channel:
description:
This property is used for defining the negative input of a
single-ended or pseudo-differential voltage channel.

Special inputs are valid as well.
minimum: 0
maximum: 31

adi,reference-select:
description: |
Select the reference source to use when converting on
Expand All @@ -154,9 +216,31 @@ patternProperties:
- avdd
default: refout-avss

adi,current-channel:
$ref: /schemas/types.yaml#/definitions/flag
description: |
Signal that the selected inputs are current channels.
Only available on AD4111 and AD4112.
required:
- reg
- diff-channels

allOf:
- oneOf:
- required: [single-channel]
properties:
diff-channels: false
- required: [diff-channels]
properties:
single-channel: false
adi,current-channel: false
common-mode-channel: false

- if:
required: [common-mode-channel]
then:
properties:
adi,current-channel: false

required:
- compatible
Expand All @@ -166,7 +250,6 @@ allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#

# Only ad7172-4, ad7173-8 and ad7175-8 support vref2
# Other models have [0-3] channel registers
- if:
properties:
compatible:
Expand All @@ -187,6 +270,37 @@ allOf:
- vref
- refout-avss
- avdd

- if:
properties:
compatible:
contains:
enum:
- adi,ad4114
- adi,ad4115
- adi,ad4116
- adi,ad7173-8
- adi,ad7175-8
then:
patternProperties:
"^channel@[0-9a-f]$":
properties:
reg:
maximum: 15

- if:
properties:
compatible:
contains:
enum:
- adi,ad7172-2
- adi,ad7175-2
- adi,ad7176-2
- adi,ad7177-2
then:
patternProperties:
"^channel@[0-9a-f]$":
properties:
reg:
maximum: 3

Expand All @@ -210,6 +324,34 @@ allOf:
required:
- adi,reference-select

- if:
properties:
compatible:
contains:
enum:
- adi,ad4111
- adi,ad4112
- adi,ad4114
- adi,ad4115
- adi,ad4116
then:
properties:
avdd2-supply: false

- if:
properties:
compatible:
not:
contains:
enum:
- adi,ad4111
- adi,ad4112
then:
patternProperties:
"^channel@[0-9a-f]$":
properties:
adi,current-channel: false

- if:
anyOf:
- required: [clock-names]
Expand All @@ -221,6 +363,7 @@ allOf:
unevaluatedProperties: false

examples:
# Example AD7173-8 with external reference connected to REF+/REF-:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
Expand Down Expand Up @@ -277,3 +420,50 @@ examples:
};
};
};
# Example AD4111 with current channel and single-ended channel:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
adc@0 {
compatible = "adi,ad4111";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
interrupt-names = "rdy";
interrupt-parent = <&gpio>;
spi-max-frequency = <5000000>;
gpio-controller;
#gpio-cells = <2>;
#clock-cells = <0>;
channel@0 {
reg = <0>;
bipolar;
diff-channels = <4 5>;
};
// Single ended channel VIN2/VINCOM
channel@1 {
reg = <1>;
bipolar;
single-channel = <2>;
common-mode-channel = <16>;
};
// Current channel IN2+/IN2-
channel@2 {
reg = <2>;
single-channel = <2>;
adi,current-channel;
};
};
};
5 changes: 3 additions & 2 deletions Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ maintainers:

description: |
Analog Devices AD7606 Simultaneous Sampling ADC
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/AD7616.pdf
Expand All @@ -19,9 +20,9 @@ properties:
compatible:
enum:
- adi,ad7605-4
- adi,ad7606-8
- adi,ad7606-6
- adi,ad7606-4
- adi,ad7606-6
- adi,ad7606-8 # Referred to as AD7606 (without -8) in the datasheet
- adi,ad7606b
- adi,ad7616

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/mediatek,mt6359-auxadc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT6350 series PMIC AUXADC

maintainers:
- AngeloGioacchino Del Regno <[email protected]>

description:
The Auxiliary Analog/Digital Converter (AUXADC) is an ADC found
in some MediaTek PMICs, performing various PMIC related measurements
such as battery and PMIC internal voltage regulators temperatures,
accessory detection resistance (usually, for a 3.5mm audio jack)
other than voltages for various PMIC internal components.

properties:
compatible:
enum:
- mediatek,mt6357-auxadc
- mediatek,mt6358-auxadc
- mediatek,mt6359-auxadc

"#io-channel-cells":
const: 1

required:
- compatible
- "#io-channel-cells"

additionalProperties: false
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ patternProperties:
From common IIO binding. Used to pipe external sigma delta
modulator or internal ADC output to DFSDM channel.

port:
$ref: /schemas/sound/audio-graph-port.yaml#
unevaluatedProperties: false

required:
- compatible
- "#sound-dai-cells"
Expand Down
Loading

0 comments on commit 14c4dc8

Please sign in to comment.