Skip to contentSkip to conversation

dt-bindings: iio: dac: Add most missing binding documents.

PATCH In review Jonathan Cameron 6 participants 40 messages Jun 27, 2021 – Jul 27, 2021

Subsystems (4)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover dt-bindings: iio: dac: Add most missing binding documents.

From: Jonathan Cameron <[email protected]>

We have quite a few drivers in IIO that date back to the days of platform data. Many of them either worked out of the box with device tree due to the spi core using the spi_device_id to match against device tree compatibles, or were updated to use newer interfaces in the intervening years. As such, they mostly 'work' with device tree but can have some slightly odd quirks (particularly around naming of supplies). As we have no way of knowing what is out in the wild, we need to support these interesting bits of regulator naming.

I would ultimately like all such bindings to be documented both to facilitate automated check of device trees and to make things easier for people trying to write device tree files using these devices.

This series fills in the majority of the absent bindings for DACs. There are some outstanding
* max517 - some platform data configuration needs porting over to device tree.
* m62332 - this passes a consumer mapping in as platform data and will need careful porting over the dt way of doing that.

There is one 'fixlet' in here for the driver to deal with a case were the code was intended to allow the presence of a regulator to dictate whether an internal reference was used, but did not use the optional regulator get.

I've mostly nominated maintainers based on original authorship + where I was feeling guilty or couldn't find anyone still active I've listed myself.

I got bored half way through of producing brief descriptions of the devices so stopped doing so. If anyone wants to provide one for these parts I'm happy to add it!

Future series will cover the c. 40 bindings that I've identified as missing for other types of devices. I've also kept notes of easy cleanups in drivers spotted whilst working these out, so will probably follow up with those soon as well.

Note I haven't tested all of these so there may well be errors or elements I've missed.

Cc Lars-Peter Clausen <[email protected]>
Cc Ricardo Ribalda <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Gwenhael Goavec-Merou <[email protected]>
Cc Michael Welling <[email protected]>

Jonathan Cameron (15):
dt-bindings: iio: dac: adi,ad5421: Add missing binding document.
dt-bindings: iio: dac: adi,ad5064: Document bindings for many
different DACs
dt-bindings: iio: dac: adi,ad5360: Add missing binding document
dt-bindings: iio: dac: ad5380: Add missing binding document
dt-bindings: iio: dac: ad5446: Add missing binding document
dt-bindings: iio: dac: ad5449: Add missing binding document.
dt-bindings: iio: dac: ad5504: Add missing binding document
iio: dac: ad5624r: Fix incorrect handling of an optional regulator.
dt-bindings: iio: dac: ad5624r: Add missing binding document
dt-bindings: iio: dac: ad5686 and ad5696: Add missing binding
document.
dt-bindings: iio: dac: ad5761: Add missing binding doc.
dt-bindings: iio: dac: adi,ad5764: Add missing binding document
dt-bindings: iio: dac: adi,ad5791: Add missing bindings document
dt-bindings: iio: dac: adi,ad8801: Add missing binding document.
dt-bindings: iio: dac: microchip,mcp4922: Add missing binding document

 .../bindings/iio/dac/adi,ad5064.yaml          | 268 ++++++++++++++++++
 .../bindings/iio/dac/adi,ad5360.yaml          |  79 ++++++
 .../bindings/iio/dac/adi,ad5380.yaml          |  70 +++++
 .../bindings/iio/dac/adi,ad5421.yaml          |  51 ++++
 .../bindings/iio/dac/adi,ad5446.yaml          | 105 +++++++
 .../bindings/iio/dac/adi,ad5449.yaml          |  97 +++++++
 .../bindings/iio/dac/adi,ad5504.yaml          |  50 ++++
 .../bindings/iio/dac/adi,ad5624r.yaml         |  47 +++
 .../bindings/iio/dac/adi,ad5686.yaml          |  75 +++++
 .../bindings/iio/dac/adi,ad5761.yaml          |  60 ++++
 .../bindings/iio/dac/adi,ad5764.yaml          |  62 ++++
 .../bindings/iio/dac/adi,ad5791.yaml          |  52 ++++
 .../bindings/iio/dac/adi,ad8801.yaml          |  60 ++++
 .../bindings/iio/dac/microchip,mcp4922.yaml   |  46 +++
 drivers/iio/dac/ad5624r_spi.c                 |  18 +-
 15 files changed, 1139 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5064.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5360.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5421.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5449.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5624r.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5761.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5764.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad8801.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml
Signature · 1 line
2.32.0
author maintainer
#1 lore raw

PATCH 1/15 dt-bindings: iio: dac: adi,ad5421: Add missing binding document.

From: Jonathan Cameron <[email protected]>

This is documented what is currently the case. There are a number of things that could be added, but I don't feel the binding elements are obvious enough to document without a driver implementation to verify they are good choices.

These include
* Range
* Regulators, both input and potentially output (if the loop being driven is ever described).

I've listed Lars and myself as maintainers of the binding, but if anyone else wants to be added they would be most welcome!

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5421.yaml          | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5421.yaml new file +51 -0
new file mode 100644
index 000000000000..188f656617e3
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5421.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5421 DAC
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  AD5421 is designed for us in loop-powered, 4 mA to 20 mA smart transmitter
+  applications. It provides a 16-bit DAC, current amplifier, voltage regulator
+  to drive the loop and a voltage reference.
+
+properties:
+  compatible:
+    const: adi,ad5421
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description: Fault signal.
+
+  spi-max-frequency: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            compatible = "adi,ad5421";
+            reg = <0>;
+            spi-max-frequency = <30000000>;
+            interrupts = <55 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 1/15
#2 lore raw

Re: [PATCH 01/15] dt-bindings: iio: dac: adi,ad5421: Add missing binding document.

Quoted 12 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

This is documented what is currently the case. There are a number of things that could be added, but I don't feel the binding elements are obvious enough to document without a driver implementation to verify they are good choices.

These include
* Range
* Regulators, both input and potentially output (if the loop being driven is ever described).

Quoted 9 lines

I've listed Lars and myself as maintainers of the binding, but if anyone else wants to be added they would be most welcome!

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5421.yaml          | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
author maintainer
#3 lore raw

PATCH 2/15 dt-bindings: iio: dac: adi,ad5064: Document bindings for many different DACs

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Note this is documenting bindings that have effectively existing ever since this driver was merged. The naming conventions for the ADI parts are inconsistent on the data sheets which has lead to a mixture of -X and -reference voltage part naming. We could attempt to clean this up, but as we are stuck supporting the existing binding it is probably not worthwhile.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5064.yaml          | 268 ++++++++++++++++++
 1 file changed, 268 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5064.yaml new file +268 -0
new file mode 100644
index 000000000000..05ed4e0ec364
@@ -0,0 +1,268 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5064.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5064 and similar DACs
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description: |
+   A range of similar DAC devices with between 1 and 12 channels. Some parts
+   have internal references, others require a single shared external reference
+   and the remainder have a separate reference pin for each DAC.
+
+properties:
+  compatible:
+    oneOf:
+      - description: I2C devics
+        enum:
+          - adi,ad5024
+          - adi,ad5025
+          - adi,ad5044
+          - adi,ad5045
+          - adi,ad5064
+          - adi,ad5064-1
+          - adi,ad5065
+          - adi,ad5628-1
+          - adi,ad5628-2
+          - adi,ad5648-1
+          - adi,ad5648-2
+          - adi,ad5666-1
+          - adi,ad5666-2
+          - adi,ad5668-1
+          - adi,ad5668-2
+          - adi,ad5668-3
+      - description: SPI devices
+        enum:
+          - adi,ad5625
+          - adi,ad5625r-1v25
+          - adi,ad5625r-2v5
+          - adi,ad5627
+          - adi,ad5627r-1v25
+          - adi,ad5627r-2v5
+          - adi,ad5629-1
+          - adi,ad5629-2
+          - adi,ad5629-3
+          - adi,ad5645r-1v25
+          - adi,ad5645r-2v5
+          - adi,ad5665
+          - adi,ad5665r-1v25
+          - adi,ad5665r-2v5
+          - adi,ad5667
+          - adi,ad5667r-1v25
+          - adi,ad5667r-2v5
+          - adi,ad5669-1
+          - adi,ad5669-2
+          - adi,ad5669-3
+          - lltc,ltc2606
+          - lltc,ltc2607
+          - lltc,ltc2609
+          - lltc,ltc2616
+          - lltc,ltc2617
+          - lltc,ltc2619
+          - lltc,ltc2626
+          - lltc,ltc2627
+          - lltc,ltc2629
+          - lltc,ltc2631-l12
+          - lltc,ltc2631-h12
+          - lltc,ltc2631-l10
+          - lltc,ltc2631-h10
+          - lltc,ltc2631-l8
+          - lltc,ltc2631-h8
+          - lltc,ltc2633-l12
+          - lltc,ltc2633-h12
+          - lltc,ltc2633-l10
+          - lltc,ltc2633-h10
+          - lltc,ltc2633-l8
+          - lltc,ltc2633-h8
+          - lltc,ltc2635-l12
+          - lltc,ltc2635-h12
+          - lltc,ltc2635-l10
+          - lltc,ltc2635-h10
+          - lltc,ltc2635-l8
+          - lltc,ltc2635-h8
+
+  reg:
+    maxItems: 1
+
+  vrefA-supply: true
+  vrefB-supply: true
+  vrefC-supply: true
+  vrefD-supply: true
+  vref-supply: true
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - # Shared external vref, no internal reference
+    if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5064-1
+              - adi,ad5625
+              - adi,ad5627
+              - adi,ad5665
+              - adi,ad5667
+              - lltc,ltc2606
+              - lltc,ltc2607
+              - lltc,ltc2616
+              - lltc,ltc2617
+              - lltc,ltc2626
+              - lltc,ltc2627
+    then:
+      properties:
+        vref-supply: true
+        vrefA-supply: false
+        vrefB-supply: false
+        vrefC-supply: false
+        vrefD-supply: false
+      required:
+        - vref-supply
+  - # Shared external vref, internal reference available
+    if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5625r-1v25
+              - adi,ad5625r-2v5
+              - adi,ad5627r-1v25
+              - adi,ad5627r-2v5
+              - adi,ad5628-1
+              - adi,ad5628-2
+              - adi,ad5629-1
+              - adi,ad5629-2
+              - adi,ad5629-3
+              - adi,ad5645r-1v25
+              - adi,ad5645r-2v5
+              - adi,ad5647r-1v25
+              - adi,ad5647r-2v5
+              - adi,ad5648-1
+              - adi,ad5648-2
+              - adi,ad5665r-1v25
+              - adi,ad5665r-2v5
+              - adi,ad5666-1
+              - adi,ad5666-2
+              - adi,ad5667r-1v25
+              - adi,ad5667r-2v5
+              - adi,ad5668-1
+              - adi,ad5668-2
+              - adi,ad5668-3
+              - adi,ad5669-1
+              - adi,ad5669-2
+              - adi,ad5669-3
+              - lltc,ltc2631-l12
+              - lltc,ltc2631-h12
+              - lltc,ltc2631-l10
+              - lltc,ltc2631-h10
+              - lltc,ltc2631-l8
+              - lltc,ltc2631-h8
+              - lltc,ltc2633-l12
+              - lltc,ltc2633-h12
+              - lltc,ltc2633-l10
+              - lltc,ltc2633-h10
+              - lltc,ltc2633-l8
+              - lltc,ltc2633-h8
+              - lltc,ltc2635-l12
+              - lltc,ltc2635-h12
+              - lltc,ltc2635-l10
+              - lltc,ltc2635-h10
+              - lltc,ltc2635-l8
+              - lltc,ltc2635-h8
+    then:
+      properties:
+        vref-supply: true
+        vrefA-supply: false
+        vrefB-supply: false
+        vrefC-supply: false
+        vrefD-supply: false
+  - # 4 input devices, separate vrefs, no internal reference
+    if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5024
+              - adi,ad5044
+              - adi,ad5064
+              - lltc,ltc2609
+              - lltc,ltc2619
+              - lltc,ltc2629
+    then:
+      properties:
+        vrefA-supply: true
+        vrefB-supply: true
+        vrefC-supply: true
+        vrefD-supply: true
+        vref-supply: false
+      required:
+        - vrefA-supply
+        - vrefB-supply
+        - vrefC-supply
+        - vrefD-supply
+  - # 2 input devices, separate vrefs, no internal reference
+    if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5025
+              - adi,ad5045
+              - adi,ad5065
+    then:
+      properties:
+        vrefA-supply: true
+        vrefB-supply: true
+        vrefC-supply: false
+        vrefD-supply: false
+        vref-supply: false
+      required:
+        - vrefA-supply
+        - vrefB-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5625";
+            vref-supply = <&dac_vref>;
+        };
+    };
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5625r-1v25";
+        };
+    };
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@42 {
+            reg = <0x42>;
+            compatible = "adi,ad5024";
+            vrefA-supply = <&dac_vref>;
+            vrefB-supply = <&dac_vref>;
+            vrefC-supply = <&dac_vref2>;
+            vrefD-supply = <&dac_vref2>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 2/15
#4 lore raw

Re: [PATCH 02/15] dt-bindings: iio: dac: adi,ad5064: Document bindings for many different DACs

Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Note this is documenting bindings that have effectively existing ever since this driver was merged. The naming conventions for the ADI parts are inconsistent on the data sheets which has lead to a mixture of -X and -reference voltage part naming. We could attempt to clean this up, but as we are stuck supporting the existing binding it is probably not worthwhile.

Quoted 6 lines
Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5064.yaml          | 268 ++++++++++++++++++
 1 file changed, 268 insertions(+)
author maintainer
#5 lore raw

PATCH 3/15 dt-bindings: iio: dac: adi,ad5360: Add missing binding document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Bindings for the family of many channel DACs. Fairly straight forward with just a differing number of voltage references (an extra one for the 40 channel ad4371)

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5360.yaml          | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5360.yaml new file +79 -0
new file mode 100644
index 000000000000..0d8fb56f4b09
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5360.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5360 and similar DACs
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5360
+      - adi,ad5361
+      - adi,ad5363
+      - adi,ad5370
+      - adi,ad5371
+      - adi,ad5372
+      - adi,ad5373
+
+  reg:
+    maxItems: 1
+
+  vref0-supply: true
+  vref1-supply: true
+  vref2-supply: true
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - vref0-supply
+  - vref1-supply
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5360
+              - adi,ad5361
+              - adi,ad5363
+              - adi,ad5370
+              - adi,ad5372
+              - adi,ad5373
+    then:
+      properties:
+        vref2-supply: false
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5371
+      then:
+        required:
+          - vref2-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5371";
+            vref0-supply = <&dac_vref0>;
+            vref1-supply = <&dac_vref1>;
+            vref2-supply = <&dac_vref2>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 3/15
#6 lore raw

Re: [PATCH 03/15] dt-bindings: iio: dac: adi,ad5360: Add missing binding document

Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Bindings for the family of many channel DACs. Fairly straight forward with just a differing number of voltage references (an extra one for the 40 channel ad4371)

Quoted 6 lines
Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5360.yaml          | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
author maintainer
#7 lore raw

PATCH 4/15 dt-bindings: iio: dac: ad5380: Add missing binding document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

A simple binding for this particular DAC familly.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5380.yaml          | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml new file +70 -0
new file mode 100644
index 000000000000..d599b418a020
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5380.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5380 and similar DACs
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  DAC devices supporting both SPI and I2C interfaces.
+properties:
+  compatible:
+    enum:
+      - adi,ad5380-3
+      - adi,ad5380-5
+      - adi,ad5381-3
+      - adi,ad5381-5
+      - adi,ad5382-3
+      - adi,ad5382-5
+      - adi,ad5383-3
+      - adi,ad5383-5
+      - adi,ad5384-3
+      - adi,ad5384-5
+      - adi,ad5390-3
+      - adi,ad5390-5
+      - adi,ad5391-3
+      - adi,ad5391-5
+      - adi,ad5392-3
+      - adi,ad5392-5
+
+  reg:
+    maxItems: 1
+
+  vref-supply:
+    description:
+      If not supplied devices will use internal regulators.
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+           reg = <0>;
+           compatible = "adi,ad5390-5";
+           vref-supply = <&dacvref>;
+        };
+    };
+  - |
+    i2c {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       dac@42 {
+          reg = <0x42>;
+          compatible = "adi,ad5380-3";
+       };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 4/15
#8 lore raw

Re: [PATCH 04/15] dt-bindings: iio: dac: ad5380: Add missing binding document

Quoted 39 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

A simple binding for this particular DAC familly.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5380.yaml          | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml new file +23 -0
new file mode 100644
index 000000000000..d599b418a020
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5380.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5380 and similar DACs
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  DAC devices supporting both SPI and I2C interfaces.
+properties:
+  compatible:
+    enum:
+      - adi,ad5380-3
+      - adi,ad5380-5
+      - adi,ad5381-3
+      - adi,ad5381-5
+      - adi,ad5382-3
+      - adi,ad5382-5

Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml new file +10 -0
+      - adi,ad5383-3
+      - adi,ad5383-5
+      - adi,ad5384-3
+      - adi,ad5384-5
+      - adi,ad5390-3
+      - adi,ad5390-5
+      - adi,ad5391-3
+      - adi,ad5391-5
+      - adi,ad5392-3
+      - adi,ad5392-5

You could do this:

pattern: '^adi,ad53(8[0-4]|9[0-2])-[35]$'

Either way,

author maintainer
#9 lore raw

Re: [PATCH 04/15] dt-bindings: iio: dac: ad5380: Add missing binding document

Quoted 53 lines · On Wed, 14 Jul 2021 09:54:21 -0600 Rob Herring <[email protected]> wrote:
Quoted 39 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

A simple binding for this particular DAC familly.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5380.yaml          | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml new file +23 -0
new file mode 100644
index 000000000000..d599b418a020
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5380.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5380 and similar DACs
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  DAC devices supporting both SPI and I2C interfaces.
+properties:
+  compatible:
+    enum:
+      - adi,ad5380-3
+      - adi,ad5380-5
+      - adi,ad5381-3
+      - adi,ad5381-5
+      - adi,ad5382-3
+      - adi,ad5382-5

Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/iio/dac/adi,ad5380.yaml new file +10 -0
+      - adi,ad5383-3
+      - adi,ad5383-5
+      - adi,ad5384-3
+      - adi,ad5384-5
+      - adi,ad5390-3
+      - adi,ad5390-5
+      - adi,ad5391-3
+      - adi,ad5391-5
+      - adi,ad5392-3
+      - adi,ad5392-5  

You could do this:

Quoted 1 line

pattern: '^adi,ad53(8[0-4]|9[0-2])-[35]$'

Feels fragile and not possible to grep, so I'll stick with the full listing.

Quoted 4 lines

Either way,

Thanks!

Jonathan

author maintainer
#10 lore raw

PATCH 5/15 dt-bindings: iio: dac: ad5446: Add missing binding document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Binding is a little stricter than the Linux driver.

It requires vcc-supply to be present for devices that don't have an internal reference, whereas the driver just prints a message and carries on. Given this means that it is impossible to establish a scaling of the output channel, let us make it required in the binding schema.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5446.yaml          | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml new file +105 -0
new file mode 100644
index 000000000000..e0a0def20c8c
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5446.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Single channel DACs similar to the AD5446
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - description: I2C devices
+        enum:
+          - adi,ad5602
+          - adi,ad5612
+          - adi,ad5622
+      - description: SPI devices
+        enum:
+          - adi,ad5300
+          - adi,ad5310
+          - adi,ad5320
+          - adi,ad5444
+          - adi,ad5446
+          - adi,ad5450
+          - adi,ad5451
+          - adi,ad5452
+          - adi,ad5453
+          - adi,ad5512a
+          - adi,ad5541a
+          - adi,ad5542a
+          - adi,ad5543
+          - adi,ad5553
+          - adi,ad5600
+          - adi,ad5601
+          - adi,ad5611
+          - adi,ad5621
+          - adi,ad5641
+          - adi,ad5620-2500
+          - adi,ad5620-1250
+          - adi,ad5640-2500
+          - adi,ad5640-1250
+          - adi,ad5660-2500
+          - adi,ad5660-1250
+          - adi,ad5662
+          - ti,dac081s101
+          - ti,dac101s101
+          - ti,dac121s101
+          - ti,dac7512
+
+  reg:
+    maxItems: 1
+
+  vcc-supply: true
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+# Ensure the scaling can be established for devices with no internal reference.
+allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - adi,ad5620-2500
+                - adi,ad5620-1250
+                - adi,ad5640-2500
+                - adi,ad5640-1250
+                - adi,ad5660-2500
+                - adi,ad5660-1250
+    then:
+      required:
+        - vcc-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5620-2500";
+        };
+    };
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@42 {
+            reg = <0x42>;
+            compatible = "adi,ad5602";
+            vcc-supply = <&vcc_dac>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer
#11 lore raw

Re: [PATCH 05/15] dt-bindings: iio: dac: ad5446: Add missing binding document

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Binding is a little stricter than the Linux driver.

It requires vcc-supply to be present for devices that don't have an internal reference, whereas the driver just prints a message and carries on. Given this means that it is impossible to establish a scaling of the output channel, let us make it required in the binding schema.

Quoted 6 lines
Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5446.yaml          | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/ti,dac7512.example.dt.yaml: dac@0: 'vcc-supply' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml
\ndoc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1497723

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

maintainer
#12 lore raw

Re: [PATCH 05/15] dt-bindings: iio: dac: ad5446: Add missing binding document

Quoted 18 lines · Rob Herring
Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Binding is a little stricter than the Linux driver.

It requires vcc-supply to be present for devices that don't have an internal reference, whereas the driver just prints a message and carries on. Given this means that it is impossible to establish a scaling of the output channel, let us make it required in the binding schema.

Quoted 6 lines
Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5446.yaml          | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)
Quoted 8 lines

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/ti,dac7512.example.dt.yaml: dac@0: 'vcc-supply' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/dac/adi,ad5446.yaml

Humm, seems it's not missing?

Rob

author maintainer
#13 lore raw

PATCH 6/15 dt-bindings: iio: dac: ad5449: Add missing binding document.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Documenting existing binding, so little flexibility available. 2 channel devices that require separate reference voltages.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5449.yaml          | 97 +++++++++++++++++++
 1 file changed, 97 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5449.yaml new file +97 -0
new file mode 100644
index 000000000000..044332c97743
@@ -0,0 +1,97 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5449.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5449 and similar DACs
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description:
+  Family of multiplying DACs from Analog Devices
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5415
+      - adi,ad5426
+      - adi,ad5429
+      - adi,ad5432
+      - adi,ad5439
+      - adi,ad5443
+      - adi,ad5449
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  VREF-supply: true
+  VREFA-supply: true
+  VREFB-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5415
+              - adi,ad5426
+              - adi,ad5432
+    then:
+      properties:
+        VREF-supply: true
+        VREFA-supply: false
+        VREFB-supply: false
+      required:
+        - VREF-supply
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5429
+              - adi,ad5439
+              - adi,ad5449
+    then:
+      properties:
+        VREF-supply: false
+        VREFA-supply: true
+        VREFB-supply: true
+      required:
+        - VREFA-supply
+        - VREFB-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5415";
+            VREF-supply = <&dac_ref>;
+        };
+    };
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5429";
+            VREFA-supply = <&dac_refA>;
+            VREFB-supply = <&dac_refB>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 6/15
#14 lore raw

Re: [PATCH 06/15] dt-bindings: iio: dac: ad5449: Add missing binding document.

Quoted 11 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Documenting existing binding, so little flexibility available. 2 channel devices that require separate reference voltages.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5449.yaml          | 97 +++++++++++++++++++
 1 file changed, 97 insertions(+)
author maintainer
#15 lore raw

PATCH 7/15 dt-bindings: iio: dac: ad5504: Add missing binding document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Binding for this high voltage DAC with temperature event signal.

---
 .../bindings/iio/dac/adi,ad5504.yaml          | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5504.yaml new file +50 -0
new file mode 100644
index 000000000000..9c2c038683b4
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5504.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5501 and AD5504 DACs
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description:
+  High voltage (up to 60V) DACs with temperature sensor alarm function
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5501
+      - adi,ad5504
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description: Used for temperature alarm.
+    maxItems: 1
+
+  vcc-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5504";
+            vcc-supply = <&dac_vcc>;
+            interrupts = <55 IRQ_TYPE_EDGE_FALLING>;
+        };
+    };
+...
Signature · 1 line
2.32.0
author maintainer
#17 lore raw

PATCH 8/15 iio: dac: ad5624r: Fix incorrect handling of an optional regulator.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The naming of the regulator is problematic. VCC is usually a supply voltage whereas these devices have a separate VREF pin.

Secondly, the regulator core might have provided a stub regulator if a real regulator wasn't provided. That would in turn have failed to provide a voltage when queried. So reality was that there was no way to use the internal reference.

In order to avoid breaking any dts out in the wild, make sure to fallback to the original vcc naming if vref is not available.

---
 drivers/iio/dac/ad5624r_spi.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5624r_spi.c +17 -1
index 9bde86982912..b4888c8c14a2 100644
@@ -229,7 +229,7 @@ static int ad5624r_probe(struct spi_device *spi)
 	if (!indio_dev)
 		return -ENOMEM;
 	st = iio_priv(indio_dev);
-	st->reg = devm_regulator_get(&spi->dev, "vcc");
+	st->reg = devm_regulator_get_optional(&spi->dev, "vref");
 	if (!IS_ERR(st->reg)) {
 		ret = regulator_enable(st->reg);
 		if (ret)
@@ -240,6 +240,22 @@ static int ad5624r_probe(struct spi_device *spi)
 			goto error_disable_reg;
 
 		voltage_uv = ret;
+	} else {
+		if (PTR_ERR(st->reg) != -ENODEV) {
+			return PTR_ERR(st->reg);
+		/* Backwards compatibility. This naming is not correct */
+		st->reg = devm_regulator_get_optional(&spi->dev, "vcc");
+		if (!IS_ERR(st->reg)) {
+			ret = regulator_enable(st->reg);
+			if (ret)
+				return ret;
+
+			ret = regulator_get_voltage(st->reg);
+			if (ret < 0)
+				goto error_disable_reg;
+
+			voltage_uv = ret;
+		}
 	}
 
 	spi_set_drvdata(spi, indio_dev);
Signature · 1 line
2.32.0
#18 lore raw

Re: [PATCH 08/15] iio: dac: ad5624r: Fix incorrect handling of an optional regulator.

I love your patch! Yet something to improve:

Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on iio/togreg]
[also build test ERROR on robh/for-next v5.13-rc7 next-20210625] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/dt-bindings-iio-dac-Add-most-missing-binding-documents/20210628-003216
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: nios2-randconfig-r001-20210627 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/4f70da9b9819945461961ccdfbd87438ac8a9f89
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jonathan-Cameron/dt-bindings-iio-dac-Add-most-missing-binding-documents/20210628-003216 git checkout 4f70da9b9819945461961ccdfbd87438ac8a9f89
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/iio/dac/

If you fix the issue, kindly add following tag as appropriate

All error/warnings (new ones prefixed by >>):

drivers/iio/dac/ad5624r_spi.c: In function 'ad5624r_probe':

>> drivers/iio/dac/ad5624r_spi.c:296:12: error: invalid storage class for function 'ad5624r_remove'
     296 | static int ad5624r_remove(struct spi_device *spi)
         |            ^~~~~~~~~~~~~~
>> drivers/iio/dac/ad5624r_spi.c:296:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     296 | static int ad5624r_remove(struct spi_device *spi)
         | ^~~~~~
>> drivers/iio/dac/ad5624r_spi.c:324:12: error: initializer element is not constant
     324 |  .remove = ad5624r_remove,
         |            ^~~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:324:12: note: (near initialization for 'ad5624r_driver.remove')
   drivers/iio/dac/ad5624r_spi.c:319:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     319 | static struct spi_driver ad5624r_driver = {
         | ^~~~~~
   In file included from include/linux/device.h:32,
                    from drivers/iio/dac/ad5624r_spi.c:10:
>> drivers/iio/dac/ad5624r_spi.c:327:19: error: invalid storage class for function 'ad5624r_driver_init'
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/device/driver.h:259:19: note: in definition of macro 'module_driver'
     259 | static int __init __driver##_init(void) \
         |                   ^~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:6,
                    from include/linux/kernel.h:17,
                    from include/linux/interrupt.h:6,
                    from drivers/iio/dac/ad5624r_spi.c:8:
   drivers/iio/dac/ad5624r_spi.c:327:19: error: initializer element is not constant
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/init.h:250:41: note: in definition of macro '____define_initcall'
     250 |   __attribute__((__section__(__sec))) = fn;
         |                                         ^~
   include/linux/init.h:260:2: note: in expansion of macro '__unique_initcall'
     260 |  __unique_initcall(fn, id, __sec, __initcall_id(fn))
         |  ^~~~~~~~~~~~~~~~~
   include/linux/init.h:262:35: note: in expansion of macro '___define_initcall'
     262 | #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)
         |                                   ^~~~~~~~~~~~~~~~~~
   include/linux/init.h:291:30: note: in expansion of macro '__define_initcall'
     291 | #define device_initcall(fn)  __define_initcall(fn, 6)
         |                              ^~~~~~~~~~~~~~~~~
   include/linux/init.h:296:24: note: in expansion of macro 'device_initcall'
     296 | #define __initcall(fn) device_initcall(fn)
         |                        ^~~~~~~~~~~~~~~
   include/linux/module.h:87:24: note: in expansion of macro '__initcall'
      87 | #define module_init(x) __initcall(x);
         |                        ^~~~~~~~~~
   include/linux/device/driver.h:263:1: note: in expansion of macro 'module_init'
     263 | module_init(__driver##_init); \
         | ^~~~~~~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/device.h:32,
                    from drivers/iio/dac/ad5624r_spi.c:10:
>> drivers/iio/dac/ad5624r_spi.c:327:19: error: invalid storage class for function 'ad5624r_driver_exit'
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/device/driver.h:264:20: note: in definition of macro 'module_driver'
     264 | static void __exit __driver##_exit(void) \
         |                    ^~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
>> include/linux/device/driver.h:264:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     264 | static void __exit __driver##_exit(void) \
         | ^~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:6,
                    from include/linux/kernel.h:17,
                    from include/linux/interrupt.h:6,
                    from drivers/iio/dac/ad5624r_spi.c:8:
   drivers/iio/dac/ad5624r_spi.c:327:19: error: initializer element is not constant
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/init.h:299:50: note: in definition of macro '__exitcall'
     299 |  static exitcall_t __exitcall_##fn __exit_call = fn
         |                                                  ^~
   include/linux/device/driver.h:268:1: note: in expansion of macro 'module_exit'
     268 | module_exit(__driver##_exit);
         | ^~~~~~~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/module.h:21,
                    from include/linux/bpf.h:19,
                    from include/linux/bpf-cgroup.h:5,
                    from include/linux/cgroup-defs.h:22,
                    from include/linux/cgroup.h:28,
                    from include/linux/memcontrol.h:13,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from include/linux/regulator/consumer.h:35,
                    from drivers/iio/dac/ad5624r_spi.c:15:
   include/linux/moduleparam.h:24:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      24 |  static const char __UNIQUE_ID(name)[]      \
         |  ^~~~~~
   include/linux/module.h:165:32: note: in expansion of macro '__MODULE_INFO'
     165 | #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
         |                                ^~~~~~~~~~~~~
   include/linux/module.h:235:32: note: in expansion of macro 'MODULE_INFO'
     235 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
         |                                ^~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:329:1: note: in expansion of macro 'MODULE_AUTHOR'
     329 | MODULE_AUTHOR("Barry Song <[email protected]>");
         | ^~~~~~~~~~~~~
>> drivers/iio/dac/ad5624r_spi.c:331:1: error: expected declaration or statement at end of input
     331 | MODULE_LICENSE("GPL v2");
         | ^~~~~~~~~~~~~~

At top level:
drivers/iio/dac/ad5624r_spi.c:222:12: warning: 'ad5624r_probe' defined but not used [-Wunused-function]
222 | static int ad5624r_probe(struct spi_device *spi)
| ^~~~~~~~~~~~~

vim +/ad5624r_remove +296 drivers/iio/dac/ad5624r_spi.c

6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song 2010-10-27 295

fc52692c49969e drivers/iio/dac/ad5624r_spi.c         Greg Kroah-Hartman 2012-12-21 @296  static int ad5624r_remove(struct spi_device *spi)
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  297  {
3ff242055b7b46 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-06-27  298  	struct iio_dev *indio_dev = spi_get_drvdata(spi);
3ff242055b7b46 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-06-27  299  	struct ad5624r_state *st = iio_priv(indio_dev);
3ff242055b7b46 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-06-27  300  
d2fffd6c2fd60f drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-10-14  301  	iio_device_unregister(indio_dev);
75238230cce22b drivers/iio/dac/ad5624r_spi.c         Sachin Kamat       2013-08-19  302  	if (!IS_ERR(st->reg))
26a54797c1b094 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-08-30  303  		regulator_disable(st->reg);
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  304  
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  305  	return 0;
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  306  }
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  307  
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  308  static const struct spi_device_id ad5624r_id[] = {
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  309  	{"ad5624r3", ID_AD5624R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  310  	{"ad5644r3", ID_AD5644R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  311  	{"ad5664r3", ID_AD5664R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  312  	{"ad5624r5", ID_AD5624R5},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  313  	{"ad5644r5", ID_AD5644R5},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  314  	{"ad5664r5", ID_AD5664R5},
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  315  	{}
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  316  };
55e4390cb04e8b drivers/staging/iio/dac/ad5624r_spi.c Lars-Peter Clausen 2011-11-16  317  MODULE_DEVICE_TABLE(spi, ad5624r_id);
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  318  
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  319  static struct spi_driver ad5624r_driver = {
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  320  	.driver = {
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  321  		   .name = "ad5624r",
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  322  		   },
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  323  	.probe = ad5624r_probe,
fc52692c49969e drivers/iio/dac/ad5624r_spi.c         Greg Kroah-Hartman 2012-12-21 @324  	.remove = ad5624r_remove,
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  325  	.id_table = ad5624r_id,
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  326  };
ae6ae6fec3f7d6 drivers/staging/iio/dac/ad5624r_spi.c Lars-Peter Clausen 2011-11-16 @327  module_spi_driver(ad5624r_driver);
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  328  
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  329  MODULE_AUTHOR("Barry Song <[email protected]>");
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  330  MODULE_DESCRIPTION("Analog Devices AD5624/44/64R DAC spi driver");
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27 @331  MODULE_LICENSE("GPL v2");

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

author maintainer
#19 lore raw

Re: [PATCH 08/15] iio: dac: ad5624r: Fix incorrect handling of an optional regulator.

Quoted 25 lines · On Mon, 28 Jun 2021 01:29:53 +0800 kernel test robot <[email protected]> wrote:

Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on iio/togreg]
[also build test ERROR on robh/for-next v5.13-rc7 next-20210625] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/dt-bindings-iio-dac-Add-most-missing-binding-documents/20210628-003216
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: nios2-randconfig-r001-20210627 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/4f70da9b9819945461961ccdfbd87438ac8a9f89
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jonathan-Cameron/dt-bindings-iio-dac-Add-most-missing-binding-documents/20210628-003216 git checkout 4f70da9b9819945461961ccdfbd87438ac8a9f89
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/iio/dac/

Quoted 2 lines

If you fix the issue, kindly add following tag as appropriate

Stray bracket. Oops and now fixed in the patch I've applied.

Thanks!
Jonathan

Quoted 175 lines

All error/warnings (new ones prefixed by >>):

   drivers/iio/dac/ad5624r_spi.c: In function 'ad5624r_probe':
Quoted 1 line
Quoted 1 line

drivers/iio/dac/ad5624r_spi.c:296:12: error: invalid storage class for function 'ad5624r_remove'

296 | static int ad5624r_remove(struct spi_device *spi)
| ^~~~~~~~~~~~~~

Quoted 1 line
Quoted 1 line

drivers/iio/dac/ad5624r_spi.c:296:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

296 | static int ad5624r_remove(struct spi_device *spi)
| ^~~~~~

Quoted 1 line
Quoted 1 line

drivers/iio/dac/ad5624r_spi.c:324:12: error: initializer element is not constant

     324 |  .remove = ad5624r_remove,
         |            ^~~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:324:12: note: (near initialization for 'ad5624r_driver.remove')
   drivers/iio/dac/ad5624r_spi.c:319:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     319 | static struct spi_driver ad5624r_driver = {
         | ^~~~~~
   In file included from include/linux/device.h:32,
                    from drivers/iio/dac/ad5624r_spi.c:10:
Quoted 1 line
Quoted 1 line

drivers/iio/dac/ad5624r_spi.c:327:19: error: invalid storage class for function 'ad5624r_driver_init'

     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/device/driver.h:259:19: note: in definition of macro 'module_driver'
     259 | static int __init __driver##_init(void) \
         |                   ^~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:6,
                    from include/linux/kernel.h:17,
                    from include/linux/interrupt.h:6,
                    from drivers/iio/dac/ad5624r_spi.c:8:
   drivers/iio/dac/ad5624r_spi.c:327:19: error: initializer element is not constant
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/init.h:250:41: note: in definition of macro '____define_initcall'
     250 |   __attribute__((__section__(__sec))) = fn;
         |                                         ^~
   include/linux/init.h:260:2: note: in expansion of macro '__unique_initcall'
     260 |  __unique_initcall(fn, id, __sec, __initcall_id(fn))
         |  ^~~~~~~~~~~~~~~~~
   include/linux/init.h:262:35: note: in expansion of macro '___define_initcall'
     262 | #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)
         |                                   ^~~~~~~~~~~~~~~~~~
   include/linux/init.h:291:30: note: in expansion of macro '__define_initcall'
     291 | #define device_initcall(fn)  __define_initcall(fn, 6)
         |                              ^~~~~~~~~~~~~~~~~
   include/linux/init.h:296:24: note: in expansion of macro 'device_initcall'
     296 | #define __initcall(fn) device_initcall(fn)
         |                        ^~~~~~~~~~~~~~~
   include/linux/module.h:87:24: note: in expansion of macro '__initcall'
      87 | #define module_init(x) __initcall(x);
         |                        ^~~~~~~~~~
   include/linux/device/driver.h:263:1: note: in expansion of macro 'module_init'
     263 | module_init(__driver##_init); \
         | ^~~~~~~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/device.h:32,
                    from drivers/iio/dac/ad5624r_spi.c:10:
Quoted 1 line
Quoted 1 line

drivers/iio/dac/ad5624r_spi.c:327:19: error: invalid storage class for function 'ad5624r_driver_exit'

     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/device/driver.h:264:20: note: in definition of macro 'module_driver'
     264 | static void __exit __driver##_exit(void) \
         |                    ^~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
Quoted 1 line
Quoted 1 line

include/linux/device/driver.h:264:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

     264 | static void __exit __driver##_exit(void) \
         | ^~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:6,
                    from include/linux/kernel.h:17,
                    from include/linux/interrupt.h:6,
                    from drivers/iio/dac/ad5624r_spi.c:8:
   drivers/iio/dac/ad5624r_spi.c:327:19: error: initializer element is not constant
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/init.h:299:50: note: in definition of macro '__exitcall'
     299 |  static exitcall_t __exitcall_##fn __exit_call = fn
         |                                                  ^~
   include/linux/device/driver.h:268:1: note: in expansion of macro 'module_exit'
     268 | module_exit(__driver##_exit);
         | ^~~~~~~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/module.h:21,
                    from include/linux/bpf.h:19,
                    from include/linux/bpf-cgroup.h:5,
                    from include/linux/cgroup-defs.h:22,
                    from include/linux/cgroup.h:28,
                    from include/linux/memcontrol.h:13,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from include/linux/regulator/consumer.h:35,
                    from drivers/iio/dac/ad5624r_spi.c:15:
   include/linux/moduleparam.h:24:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      24 |  static const char __UNIQUE_ID(name)[]      \
         |  ^~~~~~
   include/linux/module.h:165:32: note: in expansion of macro '__MODULE_INFO'
     165 | #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
         |                                ^~~~~~~~~~~~~
   include/linux/module.h:235:32: note: in expansion of macro 'MODULE_INFO'
     235 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
         |                                ^~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:329:1: note: in expansion of macro 'MODULE_AUTHOR'
     329 | MODULE_AUTHOR("Barry Song <[email protected]>");
         | ^~~~~~~~~~~~~
Quoted 1 line
Quoted 1 line

drivers/iio/dac/ad5624r_spi.c:331:1: error: expected declaration or statement at end of input

     331 | MODULE_LICENSE("GPL v2");
         | ^~~~~~~~~~~~~~

At top level:
drivers/iio/dac/ad5624r_spi.c:222:12: warning: 'ad5624r_probe' defined but not used [-Wunused-function]
222 | static int ad5624r_probe(struct spi_device *spi)
| ^~~~~~~~~~~~~

vim +/ad5624r_remove +296 drivers/iio/dac/ad5624r_spi.c

6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song 2010-10-27 295

fc52692c49969e drivers/iio/dac/ad5624r_spi.c         Greg Kroah-Hartman 2012-12-21 @296  static int ad5624r_remove(struct spi_device *spi)
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  297  {
3ff242055b7b46 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-06-27  298  	struct iio_dev *indio_dev = spi_get_drvdata(spi);
3ff242055b7b46 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-06-27  299  	struct ad5624r_state *st = iio_priv(indio_dev);
3ff242055b7b46 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-06-27  300  
d2fffd6c2fd60f drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-10-14  301  	iio_device_unregister(indio_dev);
75238230cce22b drivers/iio/dac/ad5624r_spi.c         Sachin Kamat       2013-08-19  302  	if (!IS_ERR(st->reg))
26a54797c1b094 drivers/staging/iio/dac/ad5624r_spi.c Jonathan Cameron   2011-08-30  303  		regulator_disable(st->reg);
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  304  
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  305  	return 0;
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  306  }
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  307  
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  308  static const struct spi_device_id ad5624r_id[] = {
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  309  	{"ad5624r3", ID_AD5624R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  310  	{"ad5644r3", ID_AD5644R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  311  	{"ad5664r3", ID_AD5664R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  312  	{"ad5624r5", ID_AD5624R5},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  313  	{"ad5644r5", ID_AD5644R5},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  314  	{"ad5664r5", ID_AD5664R5},
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  315  	{}
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  316  };
55e4390cb04e8b drivers/staging/iio/dac/ad5624r_spi.c Lars-Peter Clausen 2011-11-16  317  MODULE_DEVICE_TABLE(spi, ad5624r_id);
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  318  
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  319  static struct spi_driver ad5624r_driver = {
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  320  	.driver = {
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  321  		   .name = "ad5624r",
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  322  		   },
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  323  	.probe = ad5624r_probe,
fc52692c49969e drivers/iio/dac/ad5624r_spi.c         Greg Kroah-Hartman 2012-12-21 @324  	.remove = ad5624r_remove,
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  325  	.id_table = ad5624r_id,
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  326  };
ae6ae6fec3f7d6 drivers/staging/iio/dac/ad5624r_spi.c Lars-Peter Clausen 2011-11-16 @327  module_spi_driver(ad5624r_driver);
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  328  
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  329  MODULE_AUTHOR("Barry Song <[email protected]>");
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  330  MODULE_DESCRIPTION("Analog Devices AD5624/44/64R DAC spi driver");
6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27 @331  MODULE_LICENSE("GPL v2");

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

#20 lore raw

Re: [PATCH 08/15] iio: dac: ad5624r: Fix incorrect handling of an optional regulator.

In reply to Jonathan Cameron
I love your patch! Perhaps something to improve:

Hi Jonathan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on robh/for-next v5.13-rc7 next-20210625] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/dt-bindings-iio-dac-Add-most-missing-binding-documents/20210628-003216
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: powerpc-allmodconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/4f70da9b9819945461961ccdfbd87438ac8a9f89
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jonathan-Cameron/dt-bindings-iio-dac-Add-most-missing-binding-documents/20210628-003216 git checkout 4f70da9b9819945461961ccdfbd87438ac8a9f89
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

drivers/iio/dac/ad5624r_spi.c: In function 'ad5624r_probe':
drivers/iio/dac/ad5624r_spi.c:296:12: error: invalid storage class for function 'ad5624r_remove'
296 | static int ad5624r_remove(struct spi_device *spi)
| ^~~~~~~~~~~~~~
drivers/iio/dac/ad5624r_spi.c:296:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
296 | static int ad5624r_remove(struct spi_device *spi)
| ^~~~~~

>> drivers/iio/dac/ad5624r_spi.c:317:1: warning: 'alias' attribute ignored [-Wattributes]
     317 | MODULE_DEVICE_TABLE(spi, ad5624r_id);
         | ^~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:324:12: error: initializer element is not constant
     324 |  .remove = ad5624r_remove,
         |            ^~~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:324:12: note: (near initialization for 'ad5624r_driver.remove')
   In file included from include/linux/device.h:32,
                    from arch/powerpc/include/asm/io.h:27,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from arch/powerpc/include/asm/hardirq.h:6,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from drivers/iio/dac/ad5624r_spi.c:8:
   drivers/iio/dac/ad5624r_spi.c:327:19: error: invalid storage class for function 'ad5624r_driver_init'
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/device/driver.h:259:19: note: in definition of macro 'module_driver'
     259 | static int __init __driver##_init(void) \
         |                   ^~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/bpf.h:19,
                    from include/linux/bpf-cgroup.h:5,
                    from include/linux/cgroup-defs.h:22,
                    from include/linux/cgroup.h:28,
                    from include/linux/memcontrol.h:13,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from include/linux/regulator/consumer.h:35,
                    from drivers/iio/dac/ad5624r_spi.c:15:
   include/linux/module.h:130:42: error: invalid storage class for function '__inittest'
     130 |  static inline initcall_t __maybe_unused __inittest(void)  \
         |                                          ^~~~~~~~~~
   include/linux/device/driver.h:263:1: note: in expansion of macro 'module_init'
     263 | module_init(__driver##_init); \
         | ^~~~~~~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: warning: 'alias' attribute ignored [-Wattributes]
   In file included from include/linux/device.h:32,
                    from arch/powerpc/include/asm/io.h:27,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from arch/powerpc/include/asm/hardirq.h:6,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from drivers/iio/dac/ad5624r_spi.c:8:
   drivers/iio/dac/ad5624r_spi.c:327:19: error: invalid storage class for function 'ad5624r_driver_exit'
     327 | module_spi_driver(ad5624r_driver);
         |                   ^~~~~~~~~~~~~~
   include/linux/device/driver.h:264:20: note: in definition of macro 'module_driver'
     264 | static void __exit __driver##_exit(void) \
         |                    ^~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   include/linux/device/driver.h:264:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     264 | static void __exit __driver##_exit(void) \
         | ^~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~
   In file included from include/linux/bpf.h:19,
                    from include/linux/bpf-cgroup.h:5,
                    from include/linux/cgroup-defs.h:22,
                    from include/linux/cgroup.h:28,
                    from include/linux/memcontrol.h:13,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from include/linux/regulator/consumer.h:35,
                    from drivers/iio/dac/ad5624r_spi.c:15:
   include/linux/module.h:138:42: error: invalid storage class for function '__exittest'
     138 |  static inline exitcall_t __maybe_unused __exittest(void)  \
         |                                          ^~~~~~~~~~
   include/linux/device/driver.h:268:1: note: in expansion of macro 'module_exit'
     268 | module_exit(__driver##_exit);
         | ^~~~~~~~~~~
   include/linux/spi/spi.h:315:2: note: in expansion of macro 'module_driver'
     315 |  module_driver(__spi_driver, spi_register_driver, \
         |  ^~~~~~~~~~~~~
   drivers/iio/dac/ad5624r_spi.c:327:1: note: in expansion of macro 'module_spi_driver'
     327 | module_spi_driver(ad5624r_driver);
         | ^~~~~~~~~~~~~~~~~

drivers/iio/dac/ad5624r_spi.c:327:1: warning: 'alias' attribute ignored [-Wattributes] In file included from include/linux/module.h:21,
from include/linux/bpf.h:19,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,

vim +/alias +317 drivers/iio/dac/ad5624r_spi.c

6790e29fef61b2 drivers/staging/iio/dac/ad5624r_spi.c Barry Song         2010-10-27  307  
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  308  static const struct spi_device_id ad5624r_id[] = {
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  309  	{"ad5624r3", ID_AD5624R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  310  	{"ad5644r3", ID_AD5644R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  311  	{"ad5664r3", ID_AD5664R3},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  312  	{"ad5624r5", ID_AD5624R5},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  313  	{"ad5644r5", ID_AD5644R5},
14f88f1b07e03b drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2011-03-09  314  	{"ad5664r5", ID_AD5664R5},
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  315  	{}
ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich  2010-11-19  316  };

55e4390cb04e8b drivers/staging/iio/dac/ad5624r_spi.c Lars-Peter Clausen 2011-11-16 @317 MODULE_DEVICE_TABLE(spi, ad5624r_id); ece30c15921f94 drivers/staging/iio/dac/ad5624r_spi.c Michael Hennerich 2010-11-19 318

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

author maintainer
#21 lore raw

PATCH 9/15 dt-bindings: iio: dac: ad5624r: Add missing binding document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding, with optional vref.
Note that the Linux driver does support vcc-supply for historical reasons, but lets not let that get into any bindings that are checked going forwards. Hence I have deliberately not documented it.

---
 .../bindings/iio/dac/adi,ad5624r.yaml         | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5624r.yaml new file +47 -0
new file mode 100644
index 000000000000..330383b85eeb
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5624r.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5624r and similar DACs
+
+maintainers:
+  - Jonathan Cameron <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5624r3
+      - adi,ad5644r3
+      - adi,ad5664r3
+      - adi,ad5624r5
+      - adi,ad5644r5
+      - adi,ad5664r5
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vref-supply:
+    description: If not present, internal reference will be used.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5624r3";
+            vref-supply = <&vref>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 9/15
#22 lore raw

Re: [PATCH 09/15] dt-bindings: iio: dac: ad5624r: Add missing binding document

Quoted 7 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding, with optional vref.
Note that the Linux driver does support vcc-supply for historical reasons, but lets not let that get into any bindings that are checked going forwards. Hence I have deliberately not documented it.

Quoted 5 lines
---
 .../bindings/iio/dac/adi,ad5624r.yaml         | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
author maintainer
#23 lore raw

PATCH 10/15 dt-bindings: iio: dac: ad5686 and ad5696: Add missing binding document.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The use of vcc-supply for the reference voltage is unsual and should probably be deprecated as there is an explicit VREF pin on at least some of these parts.

---
 .../bindings/iio/dac/adi,ad5686.yaml          | 75 +++++++++++++++++++
 1 file changed, 75 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml new file +75 -0
new file mode 100644
index 000000000000..5c26441eae9f
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5686.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5360 and similar DACs
+
+maintainers:
+  - Michael Hennerich <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - description: SPI devices
+        enum:
+          - adi,ad5310r
+          - adi,ad5672r
+          - adi,ad5674r
+          - adi,ad5676
+          - adi,ad5676r
+          - adi,ad5679r
+          - adi,ad5681r
+          - adi,ad5682r
+          - adi,ad5683
+          - adi,ad5683r
+          - adi,ad5684
+          - adi,ad5684r
+          - adi,ad5685r
+          - adi,ad5686
+          - adi,ad5686r
+      - description: I2C devices
+        enum:
+          - adi,ad5311r
+          - adi,ad5338r
+          - adi,ad5671r
+          - adi,ad5675r
+          - adi,ad5691r
+          - adi,ad5692r
+          - adi,ad5693
+          - adi,ad5693r
+          - adi,ad5694
+          - adi,ad5694r
+          - adi,ad5695r
+          - adi,ad5696
+          - adi,ad5696r
+
+
+  reg:
+    maxItems: 1
+
+  vcc-supply:
+    description: If not supplied the internal reference is used.
+
+  spi-max-frequency: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            reg = <0>;
+            compatible = "adi,ad5310r";
+            vcc-supply = <&dac_vref0>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 10/15
#24 lore raw

Re: [PATCH 10/15] dt-bindings: iio: dac: ad5686 and ad5696: Add missing binding document.

Quoted 3 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The use of vcc-supply for the reference voltage is unsual and should

unusual

Quoted 7 lines

probably be deprecated as there is an explicit VREF pin on at least some of these parts.

---
 .../bindings/iio/dac/adi,ad5686.yaml          | 75 +++++++++++++++++++
 1 file changed, 75 insertions(+)

Otherwise,

author maintainer
#25 lore raw

PATCH 11/15 dt-bindings: iio: dac: ad5761: Add missing binding doc.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward binding with vref optional for those part with internal regulators, but required for those without.

---
 .../bindings/iio/dac/adi,ad5761.yaml          | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5761.yaml new file +60 -0
new file mode 100644
index 000000000000..7f95a9ed55fe
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5761.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5761 and similar DACs
+
+maintainers:
+  - Ricardo Ribalda <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+properties:
+
+  compatible:
+    enum:
+      - adi,ad5721
+      - adi,ad5721r
+      - adi,ad5761
+      - adi,ad5761r
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vref-supply:
+    description: If not supplied, internal reference will be used.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5721
+              - adi,ad5761
+    then:
+      required:
+        - vref-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            compatible = "adi,ad5721";
+            reg = <0>;
+            vref-supply = <&dac_vref>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 11/15
#26 lore raw

Re: [PATCH 11/15] dt-bindings: iio: dac: ad5761: Add missing binding doc.

Quoted 11 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward binding with vref optional for those part with internal regulators, but required for those without.

---
 .../bindings/iio/dac/adi,ad5761.yaml          | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
#27 lore raw

Re: [PATCH 11/15] dt-bindings: iio: dac: ad5761: Add missing binding doc.

Sorry for the late reply, holiday season :). Thanks for the patch

Quoted 15 lines · Rob Herring
Quoted 11 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward binding with vref optional for those part with internal regulators, but required for those without.

---
 .../bindings/iio/dac/adi,ad5761.yaml          | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
author maintainer
#28 lore raw

PATCH 12/15 dt-bindings: iio: dac: adi,ad5764: Add missing binding document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

This binding covers the ad5744, ad5744r, ad5764 and ad5764r DACs. Note that the driver currently assumes the internal reference is used for the r parts. The binding as defined relaxes this constraint.

There is no support in the binding or driver for the two digital IO signals. I do not propose to add that until we have a means to test any such binding.

Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5764.yaml          | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5764.yaml new file +62 -0
new file mode 100644
index 000000000000..8e893d52bfb1
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5764.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5744 and AD5764 DAC families
+
+maintainers:
+  - Lars-Peter Clausen <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+properties:
+
+  compatible:
+    enum:
+      - adi,ad5744
+      - adi,ad5744r
+      - adi,ad5764
+      - adi,ad5764r
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vrefAB-supply: true
+  vrefCD-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,ad5744
+              - adi,ad5764
+    then:
+      required:
+        - vrefAB-supply
+        - vrefCD-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            compatible = "adi,ad5744";
+            reg = <0>;
+            vrefAB-supply = <&dac_vref>;
+            vrefCD-supply = <&dac_vref>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 12/15
#29 lore raw

Re: [PATCH 12/15] dt-bindings: iio: dac: adi,ad5764: Add missing binding document

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

This binding covers the ad5744, ad5744r, ad5764 and ad5764r DACs. Note that the driver currently assumes the internal reference is used for the r parts. The binding as defined relaxes this constraint.

There is no support in the binding or driver for the two digital IO signals. I do not propose to add that until we have a means to test any such binding.

Quoted 6 lines
Cc Lars-Peter Clausen <[email protected]>
---
 .../bindings/iio/dac/adi,ad5764.yaml          | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
author maintainer
#30 lore raw

PATCH 13/15 dt-bindings: iio: dac: adi,ad5791: Add missing bindings document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Documenting existing bindings for this device.

The Linux driver in theory 'works' without the two supplies that I have listed as required, but without a valid scale. As such I've documented it as required.

Cc Michael Hennerich <[email protected]>
---
 .../bindings/iio/dac/adi,ad5791.yaml          | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml new file +52 -0
new file mode 100644
index 000000000000..650d1ebdcec3
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5791.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5791 and similar DACs
+
+maintainers:
+  - Michael Hennerich <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+properties:
+
+  compatible:
+    enum:
+      - adi,ad5760
+      - adi,ad5780
+      - adi,ad5781
+      - adi,ad5790
+      - adi,ad5791
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vdd-supply: true
+  vss-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+  - vss-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            compatible = "adi,ad5791";
+            reg = <0>;
+            vss-supply = <&dac_vss>;
+            vdd-supply = <&dac_vdd>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 13/15
#31 lore raw

Re: [PATCH 13/15] dt-bindings: iio: dac: adi,ad5791: Add missing bindings document

Quoted 8 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Documenting existing bindings for this device.

The Linux driver in theory 'works' without the two supplies that I have listed as required, but without a valid scale. As such I've documented it as required.

Quoted 6 lines
Cc Michael Hennerich <[email protected]>
---
 .../bindings/iio/dac/adi,ad5791.yaml          | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
author maintainer
#32 lore raw

PATCH 14/15 dt-bindings: iio: dac: adi,ad8801: Add missing binding document.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

This device was missing a binding document. Simple binding with the ad8803 requiring two both low and high references whilst the 8801 only has a high reference.

Cc Gwenhael Goavec-Merou <[email protected]>
---
 .../bindings/iio/dac/adi,ad8801.yaml          | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
Documentation/devicetree/bindings/iio/dac/adi,ad8801.yaml new file +60 -0
new file mode 100644
index 000000000000..6a3990a8d0ad
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad8801.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD8801 and AD8803 DACs
+
+maintainers:
+  - Jonathan Cameron <[email protected]>
+
+properties:
+
+  compatible:
+    enum:
+      - adi,ad8801
+      - adi,ad8803
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vrefh-supply: true
+  vrefl-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - vrefh-supply
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: adi,ad8803
+    then:
+      required:
+        - vrefl-supply
+    else:
+      properties:
+        vrefl-supply: false
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            compatible = "adi,ad8803";
+            reg = <0>;
+            vrefl-supply = <&dac_vrefl>;
+            vrefh-supply = <&dac_vrefh>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 14/15
#33 lore raw

Re: [PATCH 14/15] dt-bindings: iio: dac: adi,ad8801: Add missing binding document.

Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

This device was missing a binding document. Simple binding with the ad8803 requiring two both low and high references whilst the 8801 only has a high reference.

Quoted 6 lines
Cc Gwenhael Goavec-Merou <[email protected]>
---
 .../bindings/iio/dac/adi,ad8801.yaml          | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
author maintainer
#34 lore raw

PATCH 15/15 dt-bindings: iio: dac: microchip,mcp4922: Add missing binding document

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding for this family of microchip DACs.

---
 .../bindings/iio/dac/microchip,mcp4922.yaml   | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml new file +46 -0
new file mode 100644
index 000000000000..12a14b3f36cb
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4922.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip MCP4902, MCP4912 and MPC4922 dual output SPI DACs
+
+maintainers:
+  - Jonathan Cameron <[email protected]>
+  - Michael Welling <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - microchip,mcp4902
+      - microchip,mcp4912
+      - microchip,mcp4922
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vref-supply: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - vref-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            compatible = "microchip,mcp4912";
+            reg = <0>;
+            vref-supply = <&dac_vref>;
+        };
+    };
+...
Signature · 1 line
2.32.0
maintainer Reviewed-by on v1 15/15
#35 lore raw

Re: [PATCH 15/15] dt-bindings: iio: dac: microchip,mcp4922: Add missing binding document

Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple binding for this family of microchip DACs.

---
 .../bindings/iio/dac/microchip,mcp4922.yaml   | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
maintainer Acked-by on the v1 series
#36 lore raw
In reply to Jonathan Cameron

Hi Jonathan,

Quoted 63 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Sunday, June 27, 2021 6:32 PM
To: [email protected]; Rob Herring <[email protected]>; [email protected]
Cc: Jonathan Cameron <[email protected]>; Lars-Peter Clausen <[email protected]>; Ricardo Ribalda <[email protected]>; Hennerich, Michael <[email protected]>; Gwenhael Goavec-Merou <[email protected]>; Michael Welling <[email protected]>
Subject: [PATCH 00/15] dt-bindings: iio: dac: Add most missing binding documents.

From: Jonathan Cameron <[email protected]>

We have quite a few drivers in IIO that date back to the days of platform
data. Many of them either worked out of the box with device tree due to the spi core using the spi_device_id to match against device tree compatibles, or were updated to use newer interfaces in the
intervening years. As such, they mostly 'work' with device tree but can have some slightly odd quirks (particularly around naming of supplies).
As we have no way of knowing what is out in the wild, we need to support
these interesting bits of regulator naming.

I would ultimately like all such bindings to be documented both to facilitate
automated check of device trees and to make things easier for people trying
to write device tree files using these devices.

This series fills in the majority of the absent bindings for DACs. There are some outstanding
* max517 - some platform data configuration needs porting over to device tree.
* m62332 - this passes a consumer mapping in as platform data and will need
careful porting over the dt way of doing that.

There is one 'fixlet' in here for the driver to deal with a case were the code was intended to allow the presence of a regulator to dictate whether
an internal reference was used, but did not use the optional regulator get.

I've mostly nominated maintainers based on original authorship + where
I was feeling guilty or couldn't find anyone still active I've listed myself.

I got bored half way through of producing brief descriptions of the devices so stopped doing so. If anyone wants to provide one for these
parts I'm happy to add it!

Future series will cover the c. 40 bindings that I've identified as missing for other types of devices. I've also kept notes of easy cleanups in drivers spotted whilst working these out, so will probably follow up with
those soon as well.

Quoted 4 lines

Note I haven't tested all of these so there may well be errors or elements
I've missed.

LGTM... Just wondering if we could not add the adi,ad5421 directly into the trivial-devices yaml as it looks to be the only one without any odd regulator name?

Anyways, feel free to add:

#37 lore raw
Quoted 65 lines · Nuno

Hi Jonathan,

Quoted 63 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Sunday, June 27, 2021 6:32 PM
To: [email protected]; Rob Herring <[email protected]>; [email protected]
Cc: Jonathan Cameron <[email protected]>; Lars-Peter Clausen <[email protected]>; Ricardo Ribalda <[email protected]>; Hennerich, Michael <[email protected]>; Gwenhael Goavec-Merou <[email protected]>; Michael Welling <[email protected]>
Subject: [PATCH 00/15] dt-bindings: iio: dac: Add most missing binding documents.

From: Jonathan Cameron <[email protected]>

We have quite a few drivers in IIO that date back to the days of platform
data. Many of them either worked out of the box with device tree due to the spi core using the spi_device_id to match against device tree compatibles, or were updated to use newer interfaces in the
intervening years. As such, they mostly 'work' with device tree but can have some slightly odd quirks (particularly around naming of supplies).
As we have no way of knowing what is out in the wild, we need to support
these interesting bits of regulator naming.

I would ultimately like all such bindings to be documented both to facilitate
automated check of device trees and to make things easier for people trying
to write device tree files using these devices.

This series fills in the majority of the absent bindings for DACs. There are some outstanding
* max517 - some platform data configuration needs porting over to device tree.
* m62332 - this passes a consumer mapping in as platform data and will need
careful porting over the dt way of doing that.

There is one 'fixlet' in here for the driver to deal with a case were the code was intended to allow the presence of a regulator to dictate whether
an internal reference was used, but did not use the optional regulator get.

I've mostly nominated maintainers based on original authorship + where
I was feeling guilty or couldn't find anyone still active I've listed myself.

I got bored half way through of producing brief descriptions of the devices so stopped doing so. If anyone wants to provide one for these
parts I'm happy to add it!

Future series will cover the c. 40 bindings that I've identified as missing for other types of devices. I've also kept notes of easy cleanups in drivers spotted whilst working these out, so will probably follow up with
those soon as well.

Quoted 8 lines
Quoted 4 lines

Note I haven't tested all of these so there may well be errors or elements
I've missed.

LGTM... Just wondering if we could not add the adi,ad5421 directly into the trivial-devices yaml as it looks to be the only one without any odd regulator name?

We could, but would probably end up pulling it out again. As noted in that patch description there is a bunch of stuff the binding doesn't currently support that would make sense to add if anyone actually needs it.

Hmm. I guess it's a question of whether we think anyone will ever care :)

Jonathan

Quoted 4 lines

Anyways, feel free to add:

maintainer
#38 lore raw
Quoted 102 lines

From: Jonathan Cameron <[email protected]>
Sent: Monday, June 28, 2021 3:44 PM
To: Sa, Nuno <[email protected]>
Cc: Jonathan Cameron <[email protected]>; [email protected]; Rob Herring <[email protected]>; [email protected]; Lars-Peter Clausen <[email protected]>; Ricardo Ribalda <[email protected]>; Hennerich, Michael <[email protected]>; Gwenhael Goavec-Merou <[email protected]>; Michael Welling <[email protected]>
Subject: Re: [PATCH 00/15] dt-bindings: iio: dac: Add most missing binding documents.

[External]

Quoted 8 lines · Nuno

Hi Jonathan,

Quoted 6 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Sunday, June 27, 2021 6:32 PM
To: [email protected]; Rob Herring <[email protected]>; [email protected]
Cc: Jonathan Cameron <[email protected]>; Lars-

Peter

Quoted 1 line
Quoted 1 line

Clausen <[email protected]>; Ricardo Ribalda

<[email protected]>;

Quoted 2 lines
Quoted 2 lines

Hennerich, Michael <[email protected]>; Gwenhael Goavec-Merou <[email protected]>;

Michael

Quoted 2 lines
Quoted 2 lines

Welling <[email protected]>
Subject: [PATCH 00/15] dt-bindings: iio: dac: Add most missing

binding

Quoted 9 lines
Quoted 9 lines

documents.

From: Jonathan Cameron <[email protected]>

We have quite a few drivers in IIO that date back to the days of platform
data. Many of them either worked out of the box with device tree due to the spi core using the spi_device_id to match against device tree compatibles, or were updated to use newer interfaces

in

Quoted 11 lines
Quoted 11 lines

the
intervening years. As such, they mostly 'work' with device tree but can have some slightly odd quirks (particularly around naming of supplies).
As we have no way of knowing what is out in the wild, we need to support
these interesting bits of regulator naming.

I would ultimately like all such bindings to be documented both to facilitate
automated check of device trees and to make things easier for

people

Quoted 8 lines
Quoted 8 lines

trying
to write device tree files using these devices.

This series fills in the majority of the absent bindings for DACs. There are some outstanding
* max517 - some platform data configuration needs porting over to device tree.
* m62332 - this passes a consumer mapping in as platform data and

will

Quoted 4 lines
Quoted 4 lines

need
careful porting over the dt way of doing that.

There is one 'fixlet' in here for the driver to deal with a case were

the

Quoted 3 lines
Quoted 3 lines

code was intended to allow the presence of a regulator to dictate whether
an internal reference was used, but did not use the optional

regulator

Quoted 5 lines
Quoted 5 lines

get.

I've mostly nominated maintainers based on original authorship + where
I was feeling guilty or couldn't find anyone still active I've listed

myself.

Quoted 3 lines
Quoted 3 lines

I got bored half way through of producing brief descriptions of the devices so stopped doing so. If anyone wants to provide one

for

Quoted 4 lines
Quoted 4 lines

these
parts I'm happy to add it!

Future series will cover the c. 40 bindings that I've identified as

missing

Quoted 11 lines
Quoted 9 lines

for other types of devices. I've also kept notes of easy cleanups in drivers spotted whilst working these out, so will probably follow up with
those soon as well.

Note I haven't tested all of these so there may well be errors or elements
I've missed.

LGTM... Just wondering if we could not add the adi,ad5421 directly

Quoted 8 lines

into

Quoted 2 lines

the trivial-devices yaml as it looks to be the only one without any odd regulator name?

We could, but would probably end up pulling it out again. As noted in that patch description there is a bunch of stuff the binding doesn't currently
support that would make sense to add if anyone actually needs it.

Fair enough :)

- Nuno Sá

author maintainer
#39 lore raw
Quoted 105 lines · Nuno
Quoted 105 lines

From: Jonathan Cameron <[email protected]>
Sent: Monday, June 28, 2021 3:44 PM
To: Sa, Nuno <[email protected]>
Cc: Jonathan Cameron <[email protected]>; [email protected]; Rob Herring <[email protected]>; [email protected]; Lars-Peter Clausen <[email protected]>; Ricardo Ribalda <[email protected]>; Hennerich, Michael <[email protected]>; Gwenhael Goavec-Merou <[email protected]>; Michael Welling <[email protected]>
Subject: Re: [PATCH 00/15] dt-bindings: iio: dac: Add most missing binding documents.

[External]

Quoted 8 lines · Nuno

Hi Jonathan,

Quoted 6 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Sunday, June 27, 2021 6:32 PM
To: [email protected]; Rob Herring <[email protected]>; [email protected]
Cc: Jonathan Cameron <[email protected]>; Lars-

Peter

Quoted 1 line
Quoted 1 line

Clausen <[email protected]>; Ricardo Ribalda

<[email protected]>;

Quoted 2 lines
Quoted 2 lines

Hennerich, Michael <[email protected]>; Gwenhael Goavec-Merou <[email protected]>;

Michael

Quoted 2 lines
Quoted 2 lines

Welling <[email protected]>
Subject: [PATCH 00/15] dt-bindings: iio: dac: Add most missing

binding

Quoted 9 lines
Quoted 9 lines

documents.

From: Jonathan Cameron <[email protected]>

We have quite a few drivers in IIO that date back to the days of platform
data. Many of them either worked out of the box with device tree due to the spi core using the spi_device_id to match against device tree compatibles, or were updated to use newer interfaces

in

Quoted 11 lines
Quoted 11 lines

the
intervening years. As such, they mostly 'work' with device tree but can have some slightly odd quirks (particularly around naming of supplies).
As we have no way of knowing what is out in the wild, we need to support
these interesting bits of regulator naming.

I would ultimately like all such bindings to be documented both to facilitate
automated check of device trees and to make things easier for

people

Quoted 8 lines
Quoted 8 lines

trying
to write device tree files using these devices.

This series fills in the majority of the absent bindings for DACs. There are some outstanding
* max517 - some platform data configuration needs porting over to device tree.
* m62332 - this passes a consumer mapping in as platform data and

will

Quoted 4 lines
Quoted 4 lines

need
careful porting over the dt way of doing that.

There is one 'fixlet' in here for the driver to deal with a case were

the

Quoted 3 lines
Quoted 3 lines

code was intended to allow the presence of a regulator to dictate whether
an internal reference was used, but did not use the optional

regulator

Quoted 5 lines
Quoted 5 lines

get.

I've mostly nominated maintainers based on original authorship + where
I was feeling guilty or couldn't find anyone still active I've listed

myself.

Quoted 3 lines
Quoted 3 lines

I got bored half way through of producing brief descriptions of the devices so stopped doing so. If anyone wants to provide one

for

Quoted 4 lines
Quoted 4 lines

these
parts I'm happy to add it!

Future series will cover the c. 40 bindings that I've identified as

missing

Quoted 11 lines
Quoted 9 lines

for other types of devices. I've also kept notes of easy cleanups in drivers spotted whilst working these out, so will probably follow up with
those soon as well.

Note I haven't tested all of these so there may well be errors or elements
I've missed.

LGTM... Just wondering if we could not add the adi,ad5421 directly

into

Quoted 2 lines

the trivial-devices yaml as it looks to be the only one without any odd regulator name?

Quoted 9 lines
Quoted 4 lines

We could, but would probably end up pulling it out again. As noted in that patch description there is a bunch of stuff the binding doesn't currently
support that would make sense to add if anyone actually needs it.

Fair enough :)

- Nuno Sá

Applied all except patch 5 where something odd happened with the test scripts that needs another look.

Thanks,

Jonathan