summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/iio/dac/microchip,mcp4821.yaml
blob: 0dc577c339181da19b04b3e20af035467baaf1d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4821.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip MCP4821 and similar DACs

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

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

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

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

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

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

  reg:
    maxItems: 1

  vdd-supply: true

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

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

  spi-cpha: true
  spi-cpol: true

required:
  - compatible
  - reg
  - vdd-supply

additionalProperties: false

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

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

        dac@0 {
            compatible = "microchip,mcp4821";
            reg = <0>;
            vdd-supply = <&vdd_regulator>;
            ldac-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
            powerdown-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
            spi-cpha;
            spi-cpol;
        };
    };