summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
blob: 153ff86fb40590dd926483b299896b39744dee5d (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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/solomon,ssd1307fb.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Solomon SSD1307 OLED Controller Framebuffer

maintainers:
  - Maxime Ripard <mripard@kernel.org>
  - Javier Martinez Canillas <javierm@redhat.com>

properties:
  compatible:
    oneOf:
      # Deprecated compatible strings
      - enum:
          - solomon,ssd1305fb-i2c
          - solomon,ssd1306fb-i2c
          - solomon,ssd1307fb-i2c
          - solomon,ssd1309fb-i2c
        deprecated: true
      - enum:
          - sinowealth,sh1106
          - solomon,ssd1305
          - solomon,ssd1306
          - solomon,ssd1307
          - solomon,ssd1309

  pwms:
    maxItems: 1

  vbat-supply:
    description: The supply for VBAT

  solomon,page-offset:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 1
    description:
      Offset of pages (band of 8 pixels) that the screen is mapped to

  solomon,segment-no-remap:
    type: boolean
    description:
      Display needs normal (non-inverted) data column to segment mapping

  solomon,col-offset:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0
    description:
      Offset of columns (COL/SEG) that the screen is mapped to

  solomon,com-seq:
    type: boolean
    description:
      Display uses sequential COM pin configuration

  solomon,com-lrremap:
    type: boolean
    description:
      Display uses left-right COM pin remap

  solomon,com-invdir:
    type: boolean
    description:
      Display uses inverted COM pin scan direction

  solomon,com-offset:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0
    description:
      Number of the COM pin wired to the first display line

  solomon,prechargep1:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 2
    description:
      Length of deselect period (phase 1) in clock cycles

  solomon,prechargep2:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 2
    description:
      Length of precharge period (phase 2) in clock cycles.  This needs to be
      the higher, the higher the capacitance of the OLED's pixels is.

  solomon,dclk-div:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    maximum: 16
    description:
      Clock divisor. The default value is controller-dependent.

  solomon,dclk-frq:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15
    description:
      Clock frequency, higher value means higher frequency.
      The default value is controller-dependent.

  solomon,lookup-table:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    maxItems: 4
    description:
      8 bit value array of current drive pulse widths for BANK0, and colors A,
      B, and C. Each value in range of 31 to 63 for pulse widths of 32 to 64.
      Color D is always width 64.

  solomon,area-color-enable:
    type: boolean
    description:
      Display uses color mode

  solomon,low-power:
    type: boolean
    description:
      Display runs in low power mode

required:
  - compatible
  - reg

allOf:
  - $ref: solomon,ssd-common.yaml#

  - if:
      properties:
        compatible:
          contains:
            const: sinowealth,sh1106
    then:
      properties:
        solomon,width:
          default: 132
        solomon,height:
          default: 64
        solomon,dclk-div:
          default: 1
        solomon,dclk-frq:
          default: 5

  - if:
      properties:
        compatible:
          contains:
            enum:
              - solomon,ssd1305-i2c
              - solomon,ssd1305
    then:
      properties:
        solomon,width:
          default: 132
        solomon,height:
          default: 64
        solomon,dclk-div:
          default: 1
        solomon,dclk-frq:
          default: 7

  - if:
      properties:
        compatible:
          contains:
            enum:
              - solomon,ssd1306-i2c
              - solomon,ssd1306
    then:
      properties:
        solomon,width:
          default: 128
        solomon,height:
          default: 64
        solomon,dclk-div:
          default: 1
        solomon,dclk-frq:
          default: 8

  - if:
      properties:
        compatible:
          contains:
            enum:
              - solomon,ssd1307-i2c
              - solomon,ssd1307
    then:
      properties:
        solomon,width:
          default: 128
        solomon,height:
          default: 39
        solomon,dclk-div:
          default: 2
        solomon,dclk-frq:
          default: 12
      required:
        - pwms

  - if:
      properties:
        compatible:
          contains:
            enum:
              - solomon,ssd1309-i2c
              - solomon,ssd1309
    then:
      properties:
        solomon,width:
          default: 128
        solomon,height:
          default: 64
        solomon,dclk-div:
          default: 1
        solomon,dclk-frq:
          default: 10

unevaluatedProperties: false

examples:
  - |
    i2c {
            #address-cells = <1>;
            #size-cells = <0>;

            ssd1307_i2c: oled@3c {
                    compatible = "solomon,ssd1307";
                    reg = <0x3c>;
                    pwms = <&pwm 4 3000>;
                    reset-gpios = <&gpio2 7>;
            };

            ssd1306_i2c: oled@3d {
                    compatible = "solomon,ssd1306";
                    reg = <0x3d>;
                    pwms = <&pwm 4 3000>;
                    reset-gpios = <&gpio2 7>;
                    solomon,com-lrremap;
                    solomon,com-invdir;
                    solomon,com-offset = <32>;
                    solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
            };
    };
  - |
    spi {
            #address-cells = <1>;
            #size-cells = <0>;

            ssd1307_spi: oled@0 {
                    compatible = "solomon,ssd1307";
                    reg = <0x0>;
                    pwms = <&pwm 4 3000>;
                    reset-gpios = <&gpio2 7>;
                    dc-gpios = <&gpio2 8>;
                    spi-max-frequency = <10000000>;
            };

            ssd1306_spi: oled@1 {
                    compatible = "solomon,ssd1306";
                    reg = <0x1>;
                    pwms = <&pwm 4 3000>;
                    reset-gpios = <&gpio2 7>;
                    dc-gpios = <&gpio2 8>;
                    spi-max-frequency = <10000000>;
                    solomon,com-lrremap;
                    solomon,com-invdir;
                    solomon,com-offset = <32>;
                    solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
            };
    };