Skip to content

Commit 14c4dc8

Browse files
committed
Merge tag 'iio-for-6.11b' 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.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 ...
2 parents dfd1986 + 529d2e1 commit 14c4dc8

File tree

119 files changed

+4447
-1494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+4447
-1494
lines changed

Documentation/devicetree/bindings/iio/adc/adc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ properties:
4646
differential channels). If this and diff-channels are not present reg
4747
shall be used instead.
4848

49+
common-mode-channel:
50+
$ref: /schemas/types.yaml#/definitions/uint32
51+
description:
52+
Some ADCs have differential input pins that can be used to measure
53+
single-ended or pseudo-differential inputs. This property can be used
54+
in addition to single-channel to signal software that this channel is
55+
not differential but still specify two inputs.
56+
57+
The input pair is specified by setting single-channel to the positive
58+
input pin and common-mode-channel to the negative pin.
59+
4960
settling-time-us:
5061
description:
5162
Time between enabling the channel and first stable readings.

Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml

Lines changed: 192 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@ description: |
1919
primarily for measurement of signals close to DC but also delivers
2020
outstanding performance with input bandwidths out to ~10kHz.
2121
22+
Analog Devices AD411x ADC's:
23+
The AD411X family encompasses a series of low power, low noise, 24-bit,
24+
sigma-delta analog-to-digital converters that offer a versatile range of
25+
specifications. They integrate an analog front end suitable for processing
26+
fully differential/single-ended and bipolar voltage inputs.
27+
2228
Datasheets for supported chips:
29+
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4111.pdf
30+
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4112.pdf
31+
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4114.pdf
32+
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4115.pdf
33+
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4116.pdf
2334
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-2.pdf
2435
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-4.pdf
2536
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7173-8.pdf
@@ -31,6 +42,11 @@ description: |
3142
properties:
3243
compatible:
3344
enum:
45+
- adi,ad4111
46+
- adi,ad4112
47+
- adi,ad4114
48+
- adi,ad4115
49+
- adi,ad4116
3450
- adi,ad7172-2
3551
- adi,ad7172-4
3652
- adi,ad7173-8
@@ -129,10 +145,56 @@ patternProperties:
129145
maximum: 15
130146

131147
diff-channels:
148+
description: |
149+
This property is used for defining the inputs of a differential
150+
voltage channel. The first value is the positive input and the second
151+
value is the negative input of the channel.
152+
153+
Family AD411x supports a dedicated VINCOM voltage input.
154+
To select it set the second channel to 16.
155+
(VIN2, VINCOM) -> diff-channels = <2 16>
156+
157+
There are special values that can be selected besides the voltage
158+
analog inputs:
159+
21: REF+
160+
22: REF−
161+
162+
Supported only by AD7172-2, AD7172-4, AD7175-2, AD7175-8, AD7177-2,
163+
must be paired together and can be used to monitor the power supply
164+
of the ADC:
165+
19: ((AVDD1 − AVSS)/5)+
166+
20: ((AVDD1 − AVSS)/5)−
167+
132168
items:
133169
minimum: 0
134170
maximum: 31
135171

172+
single-channel:
173+
description: |
174+
This property is used for defining a current channel or the positive
175+
input of a voltage channel (single-ended or pseudo-differential).
176+
177+
Models AD4111 and AD4112 support current channels.
178+
Example: (IIN2+, IIN2−) -> single-channel = <2>
179+
To correctly configure a current channel set the "adi,current-channel"
180+
property to true.
181+
182+
To configure a single-ended/pseudo-differential channel set the
183+
"common-mode-channel" property to the desired negative voltage input.
184+
185+
When used as a voltage channel, special inputs are valid as well.
186+
minimum: 0
187+
maximum: 31
188+
189+
common-mode-channel:
190+
description:
191+
This property is used for defining the negative input of a
192+
single-ended or pseudo-differential voltage channel.
193+
194+
Special inputs are valid as well.
195+
minimum: 0
196+
maximum: 31
197+
136198
adi,reference-select:
137199
description: |
138200
Select the reference source to use when converting on
@@ -154,9 +216,31 @@ patternProperties:
154216
- avdd
155217
default: refout-avss
156218

219+
adi,current-channel:
220+
$ref: /schemas/types.yaml#/definitions/flag
221+
description: |
222+
Signal that the selected inputs are current channels.
223+
Only available on AD4111 and AD4112.
224+
157225
required:
158226
- reg
159-
- diff-channels
227+
228+
allOf:
229+
- oneOf:
230+
- required: [single-channel]
231+
properties:
232+
diff-channels: false
233+
- required: [diff-channels]
234+
properties:
235+
single-channel: false
236+
adi,current-channel: false
237+
common-mode-channel: false
238+
239+
- if:
240+
required: [common-mode-channel]
241+
then:
242+
properties:
243+
adi,current-channel: false
160244

161245
required:
162246
- compatible
@@ -166,7 +250,6 @@ allOf:
166250
- $ref: /schemas/spi/spi-peripheral-props.yaml#
167251

168252
# Only ad7172-4, ad7173-8 and ad7175-8 support vref2
169-
# Other models have [0-3] channel registers
170253
- if:
171254
properties:
172255
compatible:
@@ -187,6 +270,37 @@ allOf:
187270
- vref
188271
- refout-avss
189272
- avdd
273+
274+
- if:
275+
properties:
276+
compatible:
277+
contains:
278+
enum:
279+
- adi,ad4114
280+
- adi,ad4115
281+
- adi,ad4116
282+
- adi,ad7173-8
283+
- adi,ad7175-8
284+
then:
285+
patternProperties:
286+
"^channel@[0-9a-f]$":
287+
properties:
288+
reg:
289+
maximum: 15
290+
291+
- if:
292+
properties:
293+
compatible:
294+
contains:
295+
enum:
296+
- adi,ad7172-2
297+
- adi,ad7175-2
298+
- adi,ad7176-2
299+
- adi,ad7177-2
300+
then:
301+
patternProperties:
302+
"^channel@[0-9a-f]$":
303+
properties:
190304
reg:
191305
maximum: 3
192306

@@ -210,6 +324,34 @@ allOf:
210324
required:
211325
- adi,reference-select
212326

327+
- if:
328+
properties:
329+
compatible:
330+
contains:
331+
enum:
332+
- adi,ad4111
333+
- adi,ad4112
334+
- adi,ad4114
335+
- adi,ad4115
336+
- adi,ad4116
337+
then:
338+
properties:
339+
avdd2-supply: false
340+
341+
- if:
342+
properties:
343+
compatible:
344+
not:
345+
contains:
346+
enum:
347+
- adi,ad4111
348+
- adi,ad4112
349+
then:
350+
patternProperties:
351+
"^channel@[0-9a-f]$":
352+
properties:
353+
adi,current-channel: false
354+
213355
- if:
214356
anyOf:
215357
- required: [clock-names]
@@ -221,6 +363,7 @@ allOf:
221363
unevaluatedProperties: false
222364

223365
examples:
366+
# Example AD7173-8 with external reference connected to REF+/REF-:
224367
- |
225368
#include <dt-bindings/gpio/gpio.h>
226369
#include <dt-bindings/interrupt-controller/irq.h>
@@ -277,3 +420,50 @@ examples:
277420
};
278421
};
279422
};
423+
424+
# Example AD4111 with current channel and single-ended channel:
425+
- |
426+
#include <dt-bindings/gpio/gpio.h>
427+
#include <dt-bindings/interrupt-controller/irq.h>
428+
429+
spi {
430+
#address-cells = <1>;
431+
#size-cells = <0>;
432+
433+
adc@0 {
434+
compatible = "adi,ad4111";
435+
reg = <0>;
436+
437+
#address-cells = <1>;
438+
#size-cells = <0>;
439+
440+
interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
441+
interrupt-names = "rdy";
442+
interrupt-parent = <&gpio>;
443+
spi-max-frequency = <5000000>;
444+
gpio-controller;
445+
#gpio-cells = <2>;
446+
#clock-cells = <0>;
447+
448+
channel@0 {
449+
reg = <0>;
450+
bipolar;
451+
diff-channels = <4 5>;
452+
};
453+
454+
// Single ended channel VIN2/VINCOM
455+
channel@1 {
456+
reg = <1>;
457+
bipolar;
458+
single-channel = <2>;
459+
common-mode-channel = <16>;
460+
};
461+
462+
// Current channel IN2+/IN2-
463+
channel@2 {
464+
reg = <2>;
465+
single-channel = <2>;
466+
adi,current-channel;
467+
};
468+
};
469+
};

Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ maintainers:
1111

1212
description: |
1313
Analog Devices AD7606 Simultaneous Sampling ADC
14+
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7605-4.pdf
1415
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606_7606-6_7606-4.pdf
1516
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7606B.pdf
1617
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7616.pdf
@@ -19,9 +20,9 @@ properties:
1920
compatible:
2021
enum:
2122
- adi,ad7605-4
22-
- adi,ad7606-8
23-
- adi,ad7606-6
2423
- adi,ad7606-4
24+
- adi,ad7606-6
25+
- adi,ad7606-8 # Referred to as AD7606 (without -8) in the datasheet
2526
- adi,ad7606b
2627
- adi,ad7616
2728

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/iio/adc/mediatek,mt6359-auxadc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek MT6350 series PMIC AUXADC
8+
9+
maintainers:
10+
- AngeloGioacchino Del Regno <[email protected]>
11+
12+
description:
13+
The Auxiliary Analog/Digital Converter (AUXADC) is an ADC found
14+
in some MediaTek PMICs, performing various PMIC related measurements
15+
such as battery and PMIC internal voltage regulators temperatures,
16+
accessory detection resistance (usually, for a 3.5mm audio jack)
17+
other than voltages for various PMIC internal components.
18+
19+
properties:
20+
compatible:
21+
enum:
22+
- mediatek,mt6357-auxadc
23+
- mediatek,mt6358-auxadc
24+
- mediatek,mt6359-auxadc
25+
26+
"#io-channel-cells":
27+
const: 1
28+
29+
required:
30+
- compatible
31+
- "#io-channel-cells"
32+
33+
additionalProperties: false

Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ patternProperties:
246246
From common IIO binding. Used to pipe external sigma delta
247247
modulator or internal ADC output to DFSDM channel.
248248

249+
port:
250+
$ref: /schemas/sound/audio-graph-port.yaml#
251+
unevaluatedProperties: false
252+
249253
required:
250254
- compatible
251255
- "#sound-dai-cells"

0 commit comments

Comments
 (0)