1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/display/solomon,ssd1307fb.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Solomon SSD1307 OLED Controller Framebuffer
8
9maintainers:
10  - Maxime Ripard <mripard@kernel.org>
11  - Javier Martinez Canillas <javierm@redhat.com>
12
13properties:
14  compatible:
15    enum:
16      - sinowealth,sh1106-i2c
17      - solomon,ssd1305fb-i2c
18      - solomon,ssd1306fb-i2c
19      - solomon,ssd1307fb-i2c
20      - solomon,ssd1309fb-i2c
21
22  reg:
23    maxItems: 1
24
25  pwms:
26    maxItems: 1
27
28  reset-gpios:
29    maxItems: 1
30
31  vbat-supply:
32    description: The supply for VBAT
33
34  solomon,height:
35    $ref: /schemas/types.yaml#/definitions/uint32
36    default: 16
37    description:
38      Height in pixel of the screen driven by the controller
39
40  solomon,width:
41    $ref: /schemas/types.yaml#/definitions/uint32
42    default: 96
43    description:
44      Width in pixel of the screen driven by the controller
45
46  solomon,page-offset:
47    $ref: /schemas/types.yaml#/definitions/uint32
48    default: 1
49    description:
50      Offset of pages (band of 8 pixels) that the screen is mapped to
51
52  solomon,segment-no-remap:
53    type: boolean
54    description:
55      Display needs normal (non-inverted) data column to segment mapping
56
57  solomon,col-offset:
58    $ref: /schemas/types.yaml#/definitions/uint32
59    default: 0
60    description:
61      Offset of columns (COL/SEG) that the screen is mapped to
62
63  solomon,com-seq:
64    type: boolean
65    description:
66      Display uses sequential COM pin configuration
67
68  solomon,com-lrremap:
69    type: boolean
70    description:
71      Display uses left-right COM pin remap
72
73  solomon,com-invdir:
74    type: boolean
75    description:
76      Display uses inverted COM pin scan direction
77
78  solomon,com-offset:
79    $ref: /schemas/types.yaml#/definitions/uint32
80    default: 0
81    description:
82      Number of the COM pin wired to the first display line
83
84  solomon,prechargep1:
85    $ref: /schemas/types.yaml#/definitions/uint32
86    default: 2
87    description:
88      Length of deselect period (phase 1) in clock cycles
89
90  solomon,prechargep2:
91    $ref: /schemas/types.yaml#/definitions/uint32
92    default: 2
93    description:
94      Length of precharge period (phase 2) in clock cycles.  This needs to be
95      the higher, the higher the capacitance of the OLED's pixels is.
96
97  solomon,dclk-div:
98    $ref: /schemas/types.yaml#/definitions/uint32
99    minimum: 1
100    maximum: 16
101    description:
102      Clock divisor. The default value is controller-dependent.
103
104  solomon,dclk-frq:
105    $ref: /schemas/types.yaml#/definitions/uint32
106    minimum: 0
107    maximum: 15
108    description:
109      Clock frequency, higher value means higher frequency.
110      The default value is controller-dependent.
111
112  solomon,lookup-table:
113    $ref: /schemas/types.yaml#/definitions/uint8-array
114    maxItems: 4
115    description:
116      8 bit value array of current drive pulse widths for BANK0, and colors A,
117      B, and C. Each value in range of 31 to 63 for pulse widths of 32 to 64.
118      Color D is always width 64.
119
120  solomon,area-color-enable:
121    type: boolean
122    description:
123      Display uses color mode
124
125  solomon,low-power:
126    type: boolean
127    description:
128      Display runs in low power mode
129
130required:
131  - compatible
132  - reg
133
134allOf:
135  - if:
136      properties:
137        compatible:
138          contains:
139            const: sinowealth,sh1106-i2c
140    then:
141      properties:
142        solomon,dclk-div:
143          default: 1
144        solomon,dclk-frq:
145          default: 5
146
147  - if:
148      properties:
149        compatible:
150          contains:
151            const: solomon,ssd1305fb-i2c
152    then:
153      properties:
154        solomon,dclk-div:
155          default: 1
156        solomon,dclk-frq:
157          default: 7
158
159  - if:
160      properties:
161        compatible:
162          contains:
163            const: solomon,ssd1306fb-i2c
164    then:
165      properties:
166        solomon,dclk-div:
167          default: 1
168        solomon,dclk-frq:
169          default: 8
170
171  - if:
172      properties:
173        compatible:
174          contains:
175            const: solomon,ssd1307fb-i2c
176    then:
177      properties:
178        solomon,dclk-div:
179          default: 2
180        solomon,dclk-frq:
181          default: 12
182      required:
183        - pwms
184
185  - if:
186      properties:
187        compatible:
188          contains:
189            const: solomon,ssd1309fb-i2c
190    then:
191      properties:
192        solomon,dclk-div:
193          default: 1
194        solomon,dclk-frq:
195          default: 10
196
197additionalProperties: false
198
199examples:
200  - |
201    i2c1 {
202            #address-cells = <1>;
203            #size-cells = <0>;
204
205            ssd1307: oled@3c {
206                    compatible = "solomon,ssd1307fb-i2c";
207                    reg = <0x3c>;
208                    pwms = <&pwm 4 3000>;
209                    reset-gpios = <&gpio2 7>;
210            };
211
212            ssd1306: oled@3d {
213                    compatible = "solomon,ssd1306fb-i2c";
214                    reg = <0x3c>;
215                    pwms = <&pwm 4 3000>;
216                    reset-gpios = <&gpio2 7>;
217                    solomon,com-lrremap;
218                    solomon,com-invdir;
219                    solomon,com-offset = <32>;
220                    solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
221            };
222    };
223