summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/serial/maxim,max310x.yaml
blob: e598dda4d13f514820ed8012f2fb2fc2aba3e669 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/maxim,max310x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim MAX310X Advanced Universal Asynchronous Receiver-Transmitter (UART)

maintainers:
  - Hugo Villeneuve <hvilleneuve@dimonoff.com>

description:
  The MAX310X is a family of SPI/I2C UARTs with one (max3107, max3108),
  two (max3109) or four (max14830) channels. Single-channel parts are
  described as a serial node with RS-485 properties on the chip node;
  multi-channel parts use one "serial@N" child node per channel, each
  carrying its own serial/RS-485 properties.

properties:
  compatible:
    enum:
      - maxim,max3107
      - maxim,max3108
      - maxim,max3109
      - maxim,max14830

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    enum:
      - xtal # External crystal
      - osc  # External clock source

  gpio-controller: true

  "#gpio-cells":
    const: 2

  gpio-line-names:
    minItems: 1
    maxItems: 16

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names

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

  - if:
      properties:
        compatible:
          contains:
            enum:
              - maxim,max3107
              - maxim,max3108
    then:
      allOf:
        - $ref: /schemas/serial/serial.yaml#
        - $ref: /schemas/serial/rs485.yaml#

  - if:
      properties:
        compatible:
          contains:
            enum:
              - maxim,max3109
              - maxim,max14830
    then:
      properties:
        "#address-cells":
          const: 1
        "#size-cells":
          const: 0
      patternProperties:
        "^serial@[0-3]$":
          type: object
          description: A single UART channel of the chip.
          allOf:
            - $ref: /schemas/serial/serial.yaml#
            - $ref: /schemas/serial/rs485.yaml#
          properties:
            reg:
              description: UART channel number on the chip.
              maximum: 3
          required:
            - reg
          unevaluatedProperties: false

  - if:
      properties:
        compatible:
          contains:
            const: maxim,max3109
    then:
      patternProperties:
        "^serial@[23]$": false

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        serial@2c {
            compatible = "maxim,max3107";
            reg = <0x2c>;
            clocks = <&xtal4m>;
            clock-names = "xtal";
            interrupt-parent = <&gpio3>;
            interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
            gpio-controller;
            #gpio-cells = <2>;
            rs485-rts-active-low;
            linux,rs485-enabled-at-boot-time;
        };
    };

  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        serial@0 {
            compatible = "maxim,max14830";
            reg = <0>;
            spi-max-frequency = <26000000>;
            clocks = <&xtal4m>;
            clock-names = "xtal";
            interrupt-parent = <&gpio3>;
            interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
            gpio-controller;
            #gpio-cells = <2>;
            #address-cells = <1>;
            #size-cells = <0>;

            serial@0 {
                reg = <0>;
                rs485-rts-active-low;
                linux,rs485-enabled-at-boot-time;
            };

            serial@2 {
                reg = <2>;
                rs485-rts-active-low;
            };
        };
    };