[PATCH 1/2] dt-bindings: iio: dac: adding support for Microchip MCP47FEB02

Ariana Lazar posted 2 patches 1 week, 2 days ago
[PATCH 1/2] dt-bindings: iio: dac: adding support for Microchip MCP47FEB02
Posted by Ariana Lazar 1 week, 2 days ago
This is the device tree schema for iio driver for Microchip
MCP47F(E/V)B(0/1/2)1, MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and
MCP47F(E/V)B(0/1/2)8 series of buffered voltage output Digital-to-Analog
Converters with nonvolatile or volatile memory and an I2C Interface.

The families support up to 8 output channels.

The devices can be 8-bit, 10-bit and 12-bit.

Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
---
 .../bindings/iio/dac/microchip,mcp47feb02.yaml     | 305 +++++++++++++++++++++
 MAINTAINERS                                        |   6 +
 2 files changed, 311 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..d05ddafa37540bc1f6b6ce65a466b95913925c10
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
@@ -0,0 +1,305 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/microchip,mcp47feb02.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip MCP47F(E/V)B(0/1/2)(1/2/4/8) DAC with I2C Interface Families
+
+maintainers:
+  - Ariana Lazar <ariana.lazar@microchip.com>
+
+description: |
+  Datasheet for MCP47FEB01, MCP47FEB11, MCP47FEB21, MCP47FEB02, MCP47FEB12,
+  MCP47FEB22 can be found here:
+    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005375A.pdf
+  Datasheet for MCP47FVBXX can be found here:
+    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005405A.pdf
+  Datasheet for MCP47FEB04, MCP47FEB14, MCP47FEB24, MCP47FEB08, MCP47FEB18,
+  MCP47FEB28, MCP47FVB04, MCP47FVB14, MCP47FVB24, MCP47FVB08, MCP47FVB18,
+  MCP47FVB28 can be found here:
+    https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP47FXBX48-Data-Sheet-DS200006368A.pdf
+
+  +------------+--------------+-------------+-------------+------------+
+  | Device     |  Resolution  |   Channels  | Vref number | Memory     |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FEB01 |     8-bit    |      1      |      1      |   EEPROM   |
+  | MCP47FEB11 |    10-bit    |      1      |      1      |   EEPROM   |
+  | MCP47FEB21 |    12-bit    |      1      |      1      |   EEPROM   |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FEB02 |     8-bit    |      2      |      1      |   EEPROM   |
+  | MCP47FEB12 |    10-bit    |      2      |      1      |   EEPROM   |
+  | MCP47FEB22 |    12-bit    |      2      |      1      |   EEPROM   |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FVB01 |     8-bit    |      1      |      1      |      RAM   |
+  | MCP47FVB11 |    10-bit    |      1      |      1      |      RAM   |
+  | MCP47FVB21 |    12-bit    |      1      |      1      |      RAM   |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FVB02 |     8-bit    |      2      |      1      |      RAM   |
+  | MCP47FVB12 |    10-bit    |      2      |      1      |      RAM   |
+  | MCP47FVB22 |    12-bit    |      2      |      1      |      RAM   |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FVB04 |     8-bit    |      4      |      2      |      RAM   |
+  | MCP47FVB14 |    10-bit    |      4      |      2      |      RAM   |
+  | MCP47FVB24 |    12-bit    |      4      |      2      |      RAM   |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FVB08 |     8-bit    |      8      |      2      |      RAM   |
+  | MCP47FVB18 |    10-bit    |      8      |      2      |      RAM   |
+  | MCP47FVB28 |    12-bit    |      8      |      2      |      RAM   |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FEB04 |     8-bit    |      4      |      2      |   EEPROM   |
+  | MCP47FEB14 |    10-bit    |      4      |      2      |   EEPROM   |
+  | MCP47FEB24 |    12-bit    |      4      |      2      |   EEPROM   |
+  |------------|--------------|-------------|-------------|------------|
+  | MCP47FEB08 |     8-bit    |      8      |      2      |   EEPROM   |
+  | MCP47FEB18 |    10-bit    |      8      |      2      |   EEPROM   |
+  | MCP47FEB28 |    12-bit    |      8      |      2      |   EEPROM   |
+  +------------+--------------+-------------+-------------+------------+
+
+properties:
+  compatible:
+    enum:
+      - microchip,mcp47feb01
+      - microchip,mcp47feb11
+      - microchip,mcp47feb21
+      - microchip,mcp47feb02
+      - microchip,mcp47feb12
+      - microchip,mcp47feb22
+      - microchip,mcp47fvb01
+      - microchip,mcp47fvb11
+      - microchip,mcp47fvb21
+      - microchip,mcp47fvb02
+      - microchip,mcp47fvb12
+      - microchip,mcp47fvb22
+      - microchip,mcp47fvb04
+      - microchip,mcp47fvb14
+      - microchip,mcp47fvb24
+      - microchip,mcp47fvb08
+      - microchip,mcp47fvb18
+      - microchip,mcp47fvb28
+      - microchip,mcp47feb04
+      - microchip,mcp47feb14
+      - microchip,mcp47feb24
+      - microchip,mcp47feb08
+      - microchip,mcp47feb18
+      - microchip,mcp47feb28
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  vdd-supply:
+    description: |
+      Provides power and it will be used as the reference voltage if vref-supply
+      is not provided.
+
+  vref-supply:
+    description: |
+      Vref pin is used as a voltage reference when this supply is specified.
+      Into the datasheet it could be found as a Vref0.
+      If it does not exists the internal reference will be used.
+      This will be used as a reference voltage for the following outputs:
+        - for single-channel device: Vout0;
+        - for dual-channel device: Vout0, Vout1;
+        - for quad-channel device: Vout0, Vout2;
+        - for octal-channel device: Vout0, Vout2, Vout6, Vout8;
+
+  vref1-supply:
+    description: |
+      Vref1 pin is used as a voltage reference when this supply is specified.
+      If it does not exists the internal reference will be used.
+      This will be used as a reference voltage for the following outputs:
+        - for quad-channel device: Vout1, Vout3;
+        - for octal-channel device: Vout1, Vout3, Vout5, Vout7;
+
+  lat-gpios:
+    description: |
+      LAT pin to be used as a hardware trigger to synchronously update the DAC
+      channels and the pin is active Low. It could be also found as lat0 in
+      datasheet.
+    maxItems: 1
+
+  lat1-gpios:
+    description: |
+     LAT1 pin to be used as a hardware trigger to synchronously update the odd
+     DAC channels on devices with 4 and 8 channels. The pin is active Low.
+    maxItems: 1
+
+  microchip,vref-buffered:
+    type: boolean
+    description: |
+      Enable buffering of the external Vref/Vref0 pin in cases where the
+      external reference voltage does not have sufficient current capability in
+      order not to drop it’s voltage when connected to the internal resistor
+      ladder circuit.
+
+  microchip,vref1-buffered:
+    type: boolean
+    description: |
+      Enable buffering of the external Vref1 pin in cases where the external
+      reference voltage does not have sufficient current capability in order not
+      to drop it’s voltage when connected to the internal resistor ladder
+      circuit.
+
+  microchip,output-gain-2x:
+    type: boolean
+    description: |
+
+patternProperties:
+  "^channel@[0-7]$":
+    $ref: dac.yaml
+    type: object
+    description: Voltage output channel.
+
+    properties:
+      reg:
+        description: The channel number.
+        minimum: 1
+        maximum: 7
+
+      label:
+        description: Unique name to identify which channel this is.
+
+    required:
+      - reg
+
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - microchip,mcp47feb01
+              - microchip,mcp47feb11
+              - microchip,mcp47feb21
+              - microchip,mcp47fvb01
+              - microchip,mcp47fvb11
+              - microchip,mcp47fvb21
+    then:
+      properties:
+        lat-gpios: true
+        lat1-gpios: false
+        vref-supply: true
+        vref1-supply: false
+        microchip,vref-buffered: true
+        microchip,vref1-buffered: false
+      patternProperties:
+       "^channel@[1]$":
+        properties:
+         reg:
+          items:
+            maximum: 1
+        "^channel@[2-7]$": false
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - microchip,mcp47feb02
+              - microchip,mcp47feb12
+              - microchip,mcp47feb22
+              - microchip,mcp47fvb02
+              - microchip,mcp47fvb12
+              - microchip,mcp47fvb22
+    then:
+      properties:
+        lat-gpios: true
+        lat1-gpios: false
+        vref-supply: true
+        vref1-supply: false
+        microchip,vref-buffered: true
+        microchip,vref1-buffered: false
+      patternProperties:
+       "^channel@[1-2]$":
+        properties:
+         reg:
+          items:
+            maximum: 1
+        "^channel@[3-7]$": false
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - microchip,mcp47fvb04
+              - microchip,mcp47fvb14
+              - microchip,mcp47fvb24
+              - microchip,mcp47fvb08
+              - microchip,mcp47fvb18
+              - microchip,mcp47fvb28
+              - microchip,mcp47feb04
+              - microchip,mcp47feb14
+              - microchip,mcp47feb24
+              - microchip,mcp47feb08
+              - microchip,mcp47feb18
+              - microchip,mcp47feb28
+    then:
+      properties:
+        lat-gpios: true
+        lat1-gpios: true
+        vref-supply: true
+        vref1-supply: true
+        microchip,vref-buffered: true
+        microchip,vref1-buffered: true
+      patternProperties:
+       "^channel@[1-4]$":
+        properties:
+         reg:
+          items:
+            maximum: 1
+       "^channel@[5-7]$": false
+  - if:
+      not:
+        required:
+          - vref-supply
+    then:
+      properties:
+        microchip,vref-buffered: false
+  - if:
+      not:
+        required:
+          - vref1-supply
+    then:
+      properties:
+        microchip,vref1-buffered: false
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+          compatible = "microchip,mcp47feb02";
+          reg = <0>;
+          vdd-supply = <&vdac_vdd>;
+          vref-supply = <&vref_reg>;
+
+          #address-cells = <1>;
+          #size-cells = <0>;
+          channel@0 {
+            reg = <0>;
+            label = "DAC_OUTPUT_0";
+          };
+
+          channel@1 {
+            reg = <0x1>;
+            label = "DAC_OUTPUT_1";
+          };
+      };
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index a92290fffa163f9fe8fe3f04bf66426f9a894409..6f51890cfc3081bc49c08fddc8af526c1ecc8d72 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14938,6 +14938,12 @@ F:	Documentation/ABI/testing/sysfs-bus-iio-potentiometer-mcp4531
 F:	drivers/iio/potentiometer/mcp4018.c
 F:	drivers/iio/potentiometer/mcp4531.c
 
+MCP47FEB02 MICROCHIP DAC DRIVER
+M:	Ariana Lazar <ariana.lazar@microchip.com>
+L:	linux-iio@vger.kernel.org
+S:	Supported
+F:	Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
+
 MCP4821 DAC DRIVER
 M:	Anshul Dalal <anshulusr@gmail.com>
 L:	linux-iio@vger.kernel.org

-- 
2.43.0

Re: [PATCH 1/2] dt-bindings: iio: dac: adding support for Microchip MCP47FEB02
Posted by Rob Herring 1 week, 2 days ago
On Mon, Sep 22, 2025 at 02:30:53PM +0300, Ariana Lazar wrote:
> This is the device tree schema for iio driver for Microchip
> MCP47F(E/V)B(0/1/2)1, MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and
> MCP47F(E/V)B(0/1/2)8 series of buffered voltage output Digital-to-Analog
> Converters with nonvolatile or volatile memory and an I2C Interface.
> 
> The families support up to 8 output channels.
> 
> The devices can be 8-bit, 10-bit and 12-bit.
> 
> Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
> ---
>  .../bindings/iio/dac/microchip,mcp47feb02.yaml     | 305 +++++++++++++++++++++
>  MAINTAINERS                                        |   6 +
>  2 files changed, 311 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..d05ddafa37540bc1f6b6ce65a466b95913925c10
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
> @@ -0,0 +1,305 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/microchip,mcp47feb02.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip MCP47F(E/V)B(0/1/2)(1/2/4/8) DAC with I2C Interface Families
> +
> +maintainers:
> +  - Ariana Lazar <ariana.lazar@microchip.com>
> +
> +description: |
> +  Datasheet for MCP47FEB01, MCP47FEB11, MCP47FEB21, MCP47FEB02, MCP47FEB12,
> +  MCP47FEB22 can be found here:
> +    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005375A.pdf
> +  Datasheet for MCP47FVBXX can be found here:
> +    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005405A.pdf
> +  Datasheet for MCP47FEB04, MCP47FEB14, MCP47FEB24, MCP47FEB08, MCP47FEB18,
> +  MCP47FEB28, MCP47FVB04, MCP47FVB14, MCP47FVB24, MCP47FVB08, MCP47FVB18,
> +  MCP47FVB28 can be found here:
> +    https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP47FXBX48-Data-Sheet-DS200006368A.pdf
> +
> +  +------------+--------------+-------------+-------------+------------+
> +  | Device     |  Resolution  |   Channels  | Vref number | Memory     |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB01 |     8-bit    |      1      |      1      |   EEPROM   |
> +  | MCP47FEB11 |    10-bit    |      1      |      1      |   EEPROM   |
> +  | MCP47FEB21 |    12-bit    |      1      |      1      |   EEPROM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB02 |     8-bit    |      2      |      1      |   EEPROM   |
> +  | MCP47FEB12 |    10-bit    |      2      |      1      |   EEPROM   |
> +  | MCP47FEB22 |    12-bit    |      2      |      1      |   EEPROM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB01 |     8-bit    |      1      |      1      |      RAM   |
> +  | MCP47FVB11 |    10-bit    |      1      |      1      |      RAM   |
> +  | MCP47FVB21 |    12-bit    |      1      |      1      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB02 |     8-bit    |      2      |      1      |      RAM   |
> +  | MCP47FVB12 |    10-bit    |      2      |      1      |      RAM   |
> +  | MCP47FVB22 |    12-bit    |      2      |      1      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB04 |     8-bit    |      4      |      2      |      RAM   |
> +  | MCP47FVB14 |    10-bit    |      4      |      2      |      RAM   |
> +  | MCP47FVB24 |    12-bit    |      4      |      2      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB08 |     8-bit    |      8      |      2      |      RAM   |
> +  | MCP47FVB18 |    10-bit    |      8      |      2      |      RAM   |
> +  | MCP47FVB28 |    12-bit    |      8      |      2      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB04 |     8-bit    |      4      |      2      |   EEPROM   |
> +  | MCP47FEB14 |    10-bit    |      4      |      2      |   EEPROM   |
> +  | MCP47FEB24 |    12-bit    |      4      |      2      |   EEPROM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB08 |     8-bit    |      8      |      2      |   EEPROM   |
> +  | MCP47FEB18 |    10-bit    |      8      |      2      |   EEPROM   |
> +  | MCP47FEB28 |    12-bit    |      8      |      2      |   EEPROM   |
> +  +------------+--------------+-------------+-------------+------------+
> +
> +properties:
> +  compatible:
> +    enum:
> +      - microchip,mcp47feb01
> +      - microchip,mcp47feb11
> +      - microchip,mcp47feb21
> +      - microchip,mcp47feb02
> +      - microchip,mcp47feb12
> +      - microchip,mcp47feb22
> +      - microchip,mcp47fvb01
> +      - microchip,mcp47fvb11
> +      - microchip,mcp47fvb21
> +      - microchip,mcp47fvb02
> +      - microchip,mcp47fvb12
> +      - microchip,mcp47fvb22
> +      - microchip,mcp47fvb04
> +      - microchip,mcp47fvb14
> +      - microchip,mcp47fvb24
> +      - microchip,mcp47fvb08
> +      - microchip,mcp47fvb18
> +      - microchip,mcp47fvb28
> +      - microchip,mcp47feb04
> +      - microchip,mcp47feb14
> +      - microchip,mcp47feb24
> +      - microchip,mcp47feb08
> +      - microchip,mcp47feb18
> +      - microchip,mcp47feb28
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +  vdd-supply:
> +    description: |

Don't need '|' if no formatting to preserve.

> +      Provides power and it will be used as the reference voltage if vref-supply
> +      is not provided.
> +
> +  vref-supply:
> +    description: |
> +      Vref pin is used as a voltage reference when this supply is specified.
> +      Into the datasheet it could be found as a Vref0.
> +      If it does not exists the internal reference will be used.

blank line between paragraphs. But is every sentence a paragraph?

> +      This will be used as a reference voltage for the following outputs:
> +        - for single-channel device: Vout0;
> +        - for dual-channel device: Vout0, Vout1;
> +        - for quad-channel device: Vout0, Vout2;
> +        - for octal-channel device: Vout0, Vout2, Vout6, Vout8;
> +
> +  vref1-supply:
> +    description: |
> +      Vref1 pin is used as a voltage reference when this supply is specified.
> +      If it does not exists the internal reference will be used.
> +      This will be used as a reference voltage for the following outputs:
> +        - for quad-channel device: Vout1, Vout3;
> +        - for octal-channel device: Vout1, Vout3, Vout5, Vout7;
> +
> +  lat-gpios:
> +    description: |
> +      LAT pin to be used as a hardware trigger to synchronously update the DAC
> +      channels and the pin is active Low. It could be also found as lat0 in
> +      datasheet.
> +    maxItems: 1
> +
> +  lat1-gpios:
> +    description: |
> +     LAT1 pin to be used as a hardware trigger to synchronously update the odd
> +     DAC channels on devices with 4 and 8 channels. The pin is active Low.
> +    maxItems: 1
> +
> +  microchip,vref-buffered:
> +    type: boolean
> +    description: |
> +      Enable buffering of the external Vref/Vref0 pin in cases where the
> +      external reference voltage does not have sufficient current capability in
> +      order not to drop it’s voltage when connected to the internal resistor
> +      ladder circuit.
> +
> +  microchip,vref1-buffered:
> +    type: boolean
> +    description: |
> +      Enable buffering of the external Vref1 pin in cases where the external
> +      reference voltage does not have sufficient current capability in order not
> +      to drop it’s voltage when connected to the internal resistor ladder
> +      circuit.
> +
> +  microchip,output-gain-2x:
> +    type: boolean
> +    description: |

?

> +
> +patternProperties:
> +  "^channel@[0-7]$":
> +    $ref: dac.yaml
> +    type: object
> +    description: Voltage output channel.
> +
> +    properties:
> +      reg:
> +        description: The channel number.
> +        minimum: 1
> +        maximum: 7
> +
> +      label:
> +        description: Unique name to identify which channel this is.
> +
> +    required:
> +      - reg
> +
> +    unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - vdd-supply
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,mcp47feb01
> +              - microchip,mcp47feb11
> +              - microchip,mcp47feb21
> +              - microchip,mcp47fvb01
> +              - microchip,mcp47fvb11
> +              - microchip,mcp47fvb21
> +    then:
> +      properties:
> +        lat-gpios: true

true has no effect as the property is already allowed. Drop all the true 
cases.

> +        lat1-gpios: false
> +        vref-supply: true
> +        vref1-supply: false
> +        microchip,vref-buffered: true
> +        microchip,vref1-buffered: false
> +      patternProperties:
> +       "^channel@[1]$":

Did you mean "[01]"? If not, that's not a pattern, but a fixed string.


> +        properties:
> +         reg:
> +          items:
> +            maximum: 1
> +        "^channel@[2-7]$": false
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,mcp47feb02
> +              - microchip,mcp47feb12
> +              - microchip,mcp47feb22
> +              - microchip,mcp47fvb02
> +              - microchip,mcp47fvb12
> +              - microchip,mcp47fvb22
> +    then:
> +      properties:
> +        lat-gpios: true
> +        lat1-gpios: false
> +        vref-supply: true
> +        vref1-supply: false
> +        microchip,vref-buffered: true
> +        microchip,vref1-buffered: false
> +      patternProperties:
> +       "^channel@[1-2]$":
> +        properties:
> +         reg:
> +          items:
> +            maximum: 1

Based on the unit-address, the minimum is 1 and the maximum is 2. 
"enum: [ 1, 2 ]" is a bit more concise.

> +        "^channel@[3-7]$": false
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,mcp47fvb04
> +              - microchip,mcp47fvb14
> +              - microchip,mcp47fvb24
> +              - microchip,mcp47fvb08
> +              - microchip,mcp47fvb18
> +              - microchip,mcp47fvb28
> +              - microchip,mcp47feb04
> +              - microchip,mcp47feb14
> +              - microchip,mcp47feb24
> +              - microchip,mcp47feb08
> +              - microchip,mcp47feb18
> +              - microchip,mcp47feb28
> +    then:
> +      properties:
> +        lat-gpios: true
> +        lat1-gpios: true
> +        vref-supply: true
> +        vref1-supply: true
> +        microchip,vref-buffered: true
> +        microchip,vref1-buffered: true
> +      patternProperties:
> +       "^channel@[1-4]$":
> +        properties:
> +         reg:
> +          items:
> +            maximum: 1

?

> +       "^channel@[5-7]$": false
> +  - if:
> +      not:
> +        required:
> +          - vref-supply
> +    then:
> +      properties:
> +        microchip,vref-buffered: false
> +  - if:
> +      not:
> +        required:
> +          - vref1-supply
> +    then:
> +      properties:
> +        microchip,vref1-buffered: false
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        dac@0 {
> +          compatible = "microchip,mcp47feb02";
> +          reg = <0>;
> +          vdd-supply = <&vdac_vdd>;
> +          vref-supply = <&vref_reg>;
> +
> +          #address-cells = <1>;
> +          #size-cells = <0>;
> +          channel@0 {
> +            reg = <0>;
> +            label = "DAC_OUTPUT_0";
> +          };
> +
> +          channel@1 {
> +            reg = <0x1>;
> +            label = "DAC_OUTPUT_1";
> +          };
> +      };
> +    };
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a92290fffa163f9fe8fe3f04bf66426f9a894409..6f51890cfc3081bc49c08fddc8af526c1ecc8d72 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14938,6 +14938,12 @@ F:	Documentation/ABI/testing/sysfs-bus-iio-potentiometer-mcp4531
>  F:	drivers/iio/potentiometer/mcp4018.c
>  F:	drivers/iio/potentiometer/mcp4531.c
>  
> +MCP47FEB02 MICROCHIP DAC DRIVER
> +M:	Ariana Lazar <ariana.lazar@microchip.com>
> +L:	linux-iio@vger.kernel.org
> +S:	Supported
> +F:	Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
> +
>  MCP4821 DAC DRIVER
>  M:	Anshul Dalal <anshulusr@gmail.com>
>  L:	linux-iio@vger.kernel.org
> 
> -- 
> 2.43.0
> 
Re: [PATCH 1/2] dt-bindings: iio: dac: adding support for Microchip MCP47FEB02
Posted by David Lechner 1 week, 2 days ago
On 9/22/25 6:30 AM, Ariana Lazar wrote:
> This is the device tree schema for iio driver for Microchip
> MCP47F(E/V)B(0/1/2)1, MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and
> MCP47F(E/V)B(0/1/2)8 series of buffered voltage output Digital-to-Analog
> Converters with nonvolatile or volatile memory and an I2C Interface.
> 
> The families support up to 8 output channels.
> 
> The devices can be 8-bit, 10-bit and 12-bit.
> 
> Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
> ---
>  .../bindings/iio/dac/microchip,mcp47feb02.yaml     | 305 +++++++++++++++++++++
>  MAINTAINERS                                        |   6 +
>  2 files changed, 311 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..d05ddafa37540bc1f6b6ce65a466b95913925c10
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
> @@ -0,0 +1,305 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/microchip,mcp47feb02.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip MCP47F(E/V)B(0/1/2)(1/2/4/8) DAC with I2C Interface Families
> +
> +maintainers:
> +  - Ariana Lazar <ariana.lazar@microchip.com>
> +
> +description: |
> +  Datasheet for MCP47FEB01, MCP47FEB11, MCP47FEB21, MCP47FEB02, MCP47FEB12,
> +  MCP47FEB22 can be found here:
> +    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005375A.pdf
> +  Datasheet for MCP47FVBXX can be found here:
> +    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005405A.pdf
> +  Datasheet for MCP47FEB04, MCP47FEB14, MCP47FEB24, MCP47FEB08, MCP47FEB18,
> +  MCP47FEB28, MCP47FVB04, MCP47FVB14, MCP47FVB24, MCP47FVB08, MCP47FVB18,
> +  MCP47FVB28 can be found here:
> +    https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP47FXBX48-Data-Sheet-DS200006368A.pdf
> +
> +  +------------+--------------+-------------+-------------+------------+
> +  | Device     |  Resolution  |   Channels  | Vref number | Memory     |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB01 |     8-bit    |      1      |      1      |   EEPROM   |
> +  | MCP47FEB11 |    10-bit    |      1      |      1      |   EEPROM   |
> +  | MCP47FEB21 |    12-bit    |      1      |      1      |   EEPROM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB02 |     8-bit    |      2      |      1      |   EEPROM   |
> +  | MCP47FEB12 |    10-bit    |      2      |      1      |   EEPROM   |
> +  | MCP47FEB22 |    12-bit    |      2      |      1      |   EEPROM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB01 |     8-bit    |      1      |      1      |      RAM   |
> +  | MCP47FVB11 |    10-bit    |      1      |      1      |      RAM   |
> +  | MCP47FVB21 |    12-bit    |      1      |      1      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB02 |     8-bit    |      2      |      1      |      RAM   |
> +  | MCP47FVB12 |    10-bit    |      2      |      1      |      RAM   |
> +  | MCP47FVB22 |    12-bit    |      2      |      1      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB04 |     8-bit    |      4      |      2      |      RAM   |
> +  | MCP47FVB14 |    10-bit    |      4      |      2      |      RAM   |
> +  | MCP47FVB24 |    12-bit    |      4      |      2      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FVB08 |     8-bit    |      8      |      2      |      RAM   |
> +  | MCP47FVB18 |    10-bit    |      8      |      2      |      RAM   |
> +  | MCP47FVB28 |    12-bit    |      8      |      2      |      RAM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB04 |     8-bit    |      4      |      2      |   EEPROM   |
> +  | MCP47FEB14 |    10-bit    |      4      |      2      |   EEPROM   |
> +  | MCP47FEB24 |    12-bit    |      4      |      2      |   EEPROM   |
> +  |------------|--------------|-------------|-------------|------------|
> +  | MCP47FEB08 |     8-bit    |      8      |      2      |   EEPROM   |
> +  | MCP47FEB18 |    10-bit    |      8      |      2      |   EEPROM   |
> +  | MCP47FEB28 |    12-bit    |      8      |      2      |   EEPROM   |
> +  +------------+--------------+-------------+-------------+------------+
> +
> +properties:
> +  compatible:
> +    enum:
> +      - microchip,mcp47feb01
> +      - microchip,mcp47feb11
> +      - microchip,mcp47feb21
> +      - microchip,mcp47feb02
> +      - microchip,mcp47feb12
> +      - microchip,mcp47feb22
> +      - microchip,mcp47fvb01
> +      - microchip,mcp47fvb11
> +      - microchip,mcp47fvb21
> +      - microchip,mcp47fvb02
> +      - microchip,mcp47fvb12
> +      - microchip,mcp47fvb22
> +      - microchip,mcp47fvb04
> +      - microchip,mcp47fvb14
> +      - microchip,mcp47fvb24
> +      - microchip,mcp47fvb08
> +      - microchip,mcp47fvb18
> +      - microchip,mcp47fvb28
> +      - microchip,mcp47feb04
> +      - microchip,mcp47feb14
> +      - microchip,mcp47feb24
> +      - microchip,mcp47feb08
> +      - microchip,mcp47feb18
> +      - microchip,mcp47feb28
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +  vdd-supply:
> +    description: |

Don't need `|` unless formatting needs to be preserved, like for the table in
the description above or the bullet lists below.

> +      Provides power and it will be used as the reference voltage if vref-supply
> +      is not provided.
> +
> +  vref-supply:
> +    description: |
> +      Vref pin is used as a voltage reference when this supply is specified.
> +      Into the datasheet it could be found as a Vref0.
> +      If it does not exists the internal reference will be used.

It looks like there is also the possibility to use V_DD as the reference
voltage. Not sure the best way to handle that though.

> +      This will be used as a reference voltage for the following outputs:
> +        - for single-channel device: Vout0;
> +        - for dual-channel device: Vout0, Vout1;
> +        - for quad-channel device: Vout0, Vout2;
> +        - for octal-channel device: Vout0, Vout2, Vout6, Vout8;
> +
> +  vref1-supply:
> +    description: |
> +      Vref1 pin is used as a voltage reference when this supply is specified.
> +      If it does not exists the internal reference will be used.
> +      This will be used as a reference voltage for the following outputs:
> +        - for quad-channel device: Vout1, Vout3;
> +        - for octal-channel device: Vout1, Vout3, Vout5, Vout7;
> +
> +  lat-gpios:
> +    description: |
> +      LAT pin to be used as a hardware trigger to synchronously update the DAC
> +      channels and the pin is active Low. It could be also found as lat0 in
> +      datasheet.
> +    maxItems: 1
> +
> +  lat1-gpios:
> +    description: |
> +     LAT1 pin to be used as a hardware trigger to synchronously update the odd
> +     DAC channels on devices with 4 and 8 channels. The pin is active Low.
> +    maxItems: 1
> +
> +  microchip,vref-buffered:
> +    type: boolean
> +    description: |
> +      Enable buffering of the external Vref/Vref0 pin in cases where the
> +      external reference voltage does not have sufficient current capability in
> +      order not to drop it’s voltage when connected to the internal resistor
> +      ladder circuit.
> +
> +  microchip,vref1-buffered:
> +    type: boolean
> +    description: |
> +      Enable buffering of the external Vref1 pin in cases where the external
> +      reference voltage does not have sufficient current capability in order not
> +      to drop it’s voltage when connected to the internal resistor ladder
> +      circuit.
> +
> +  microchip,output-gain-2x:
> +    type: boolean
> +    description: |
> +
> +patternProperties:
> +  "^channel@[0-7]$":
> +    $ref: dac.yaml
> +    type: object
> +    description: Voltage output channel.
> +
> +    properties:
> +      reg:
> +        description: The channel number.
> +        minimum: 1
> +        maximum: 7
> +
> +      label:
> +        description: Unique name to identify which channel this is.
> +
> +    required:
> +      - reg
> +
> +    unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - vdd-supply
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,mcp47feb01
> +              - microchip,mcp47feb11
> +              - microchip,mcp47feb21
> +              - microchip,mcp47fvb01
> +              - microchip,mcp47fvb11
> +              - microchip,mcp47fvb21
> +    then:
> +      properties:
> +        lat-gpios: true
> +        lat1-gpios: false
> +        vref-supply: true
> +        vref1-supply: false
> +        microchip,vref-buffered: true

Everything is already true, so we can leave out all of those
lines. It make it hard to see what is actually being modified.

> +        microchip,vref1-buffered: false
> +      patternProperties:
> +       "^channel@[1]$":
> +        properties:
> +         reg:
> +          items:

No items: here.

> +            maximum: 1
> +        "^channel@[2-7]$": false
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,mcp47feb02
> +              - microchip,mcp47feb12
> +              - microchip,mcp47feb22
> +              - microchip,mcp47fvb02
> +              - microchip,mcp47fvb12
> +              - microchip,mcp47fvb22
> +    then:
> +      properties:
> +        lat-gpios: true
> +        lat1-gpios: false
> +        vref-supply: true
> +        vref1-supply: false
> +        microchip,vref-buffered: true
> +        microchip,vref1-buffered: false
> +      patternProperties:
> +       "^channel@[1-2]$":
> +        properties:
> +         reg:
> +          items:
> +            maximum: 1

Isn't maximum 2 in this case?

> +        "^channel@[3-7]$": false
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,mcp47fvb04
> +              - microchip,mcp47fvb14
> +              - microchip,mcp47fvb24
> +              - microchip,mcp47fvb08
> +              - microchip,mcp47fvb18
> +              - microchip,mcp47fvb28
> +              - microchip,mcp47feb04
> +              - microchip,mcp47feb14
> +              - microchip,mcp47feb24
> +              - microchip,mcp47feb08
> +              - microchip,mcp47feb18
> +              - microchip,mcp47feb28

Should the 8-channel chips be include here? This
limits the channel@ to 1-4, so that doesn't jive
with having 8 channels.

> +    then:
> +      properties:
> +        lat-gpios: true
> +        lat1-gpios: true
> +        vref-supply: true
> +        vref1-supply: true
> +        microchip,vref-buffered: true
> +        microchip,vref1-buffered: true
> +      patternProperties:
> +       "^channel@[1-4]$":
> +        properties:
> +         reg:
> +          items:
> +            maximum: 1

And 4 here?

> +       "^channel@[5-7]$": false
> +  - if:
> +      not:
> +        required:
> +          - vref-supply
> +    then:
> +      properties:
> +        microchip,vref-buffered: false
> +  - if:
> +      not:
> +        required:
> +          - vref1-supply
> +    then:
> +      properties:
> +        microchip,vref1-buffered: false
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        dac@0 {
> +          compatible = "microchip,mcp47feb02";
> +          reg = <0>;
> +          vdd-supply = <&vdac_vdd>;
> +          vref-supply = <&vref_reg>;
> +
> +          #address-cells = <1>;
> +          #size-cells = <0>;
> +          channel@0 {
> +            reg = <0>;
> +            label = "DAC_OUTPUT_0";

These aren't particularly useful labels. It gives
the same info as the register number.

> +          };
> +
> +          channel@1 {
> +            reg = <0x1>;
> +            label = "DAC_OUTPUT_1";
> +          };
> +      };
> +    };
> +...

Re: [PATCH 1/2] dt-bindings: iio: dac: adding support for Microchip MCP47FEB02
Posted by Jonathan Cameron 4 days, 12 hours ago
> > +  vref-supply:
> > +    description: |
> > +      Vref pin is used as a voltage reference when this supply is specified.
> > +      Into the datasheet it could be found as a Vref0.
> > +      If it does not exists the internal reference will be used.  
> 
> It looks like there is also the possibility to use V_DD as the reference
> voltage. Not sure the best way to handle that though.

Indeed that's awkward.  I suppose a custom property as choice of VDD or internal
reference is unusual and it might be critical to how what is downstream of the DAC
so we can't even do it via userspace _scale control.

I'm lazy so haven't checked the values. If the internal reference is near VDD
it is probably safe enough to just make this a userspace problem if anyone
ever needs it.
Re: [PATCH 1/2] dt-bindings: iio: dac: adding support for Microchip MCP47FEB02
Posted by Rob Herring (Arm) 1 week, 2 days ago
On Mon, 22 Sep 2025 14:30:53 +0300, Ariana Lazar wrote:
> This is the device tree schema for iio driver for Microchip
> MCP47F(E/V)B(0/1/2)1, MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and
> MCP47F(E/V)B(0/1/2)8 series of buffered voltage output Digital-to-Analog
> Converters with nonvolatile or volatile memory and an I2C Interface.
> 
> The families support up to 8 output channels.
> 
> The devices can be 8-bit, 10-bit and 12-bit.
> 
> Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
> ---
>  .../bindings/iio/dac/microchip,mcp47feb02.yaml     | 305 +++++++++++++++++++++
>  MAINTAINERS                                        |   6 +
>  2 files changed, 311 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:199:8: [warning] wrong indentation: expected 8 but found 7 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:200:9: [warning] wrong indentation: expected 9 but found 8 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:201:10: [warning] wrong indentation: expected 10 but found 9 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:202:11: [warning] wrong indentation: expected 11 but found 10 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:225:8: [warning] wrong indentation: expected 8 but found 7 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:226:9: [warning] wrong indentation: expected 9 but found 8 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:227:10: [warning] wrong indentation: expected 10 but found 9 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:228:11: [warning] wrong indentation: expected 11 but found 10 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:257:8: [warning] wrong indentation: expected 8 but found 7 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:258:9: [warning] wrong indentation: expected 9 but found 8 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:259:10: [warning] wrong indentation: expected 10 but found 9 (indentation)
./Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml:260:11: [warning] wrong indentation: expected 11 but found 10 (indentation)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml: allOf:0:then:patternProperties:^channel@[1]$: 'anyOf' conditional failed, one must be fixed:
	'^channel@[2-7]$' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
	'type' was expected
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml: allOf:1:then:patternProperties:^channel@[1-2]$: 'anyOf' conditional failed, one must be fixed:
	'^channel@[3-7]$' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
	'type' was expected
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.example.dtb: dac@0 (microchip,mcp47feb02): channel@0:reg:0:0: 0 is less than the minimum of 1
	from schema $id: http://devicetree.org/schemas/iio/dac/microchip,mcp47feb02.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250922-mcp47feb02-v1-1-06cb4acaa347@microchip.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.