0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/display/solomon,ssd1307fb.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Solomon SSD1307 OLED Controller Framebuffer
0008
0009 maintainers:
0010 - Maxime Ripard <mripard@kernel.org>
0011 - Javier Martinez Canillas <javierm@redhat.com>
0012
0013 properties:
0014 compatible:
0015 oneOf:
0016 # Deprecated compatible strings
0017 - items:
0018 - enum:
0019 - solomon,ssd1305fb-i2c
0020 - solomon,ssd1306fb-i2c
0021 - solomon,ssd1307fb-i2c
0022 - solomon,ssd1309fb-i2c
0023 deprecated: true
0024 - items:
0025 - enum:
0026 - sinowealth,sh1106
0027 - solomon,ssd1305
0028 - solomon,ssd1306
0029 - solomon,ssd1307
0030 - solomon,ssd1309
0031
0032 reg:
0033 maxItems: 1
0034
0035 pwms:
0036 maxItems: 1
0037
0038 reset-gpios:
0039 maxItems: 1
0040
0041 # Only required for SPI
0042 dc-gpios:
0043 description:
0044 GPIO connected to the controller's D/C# (Data/Command) pin,
0045 that is needed for 4-wire SPI to tell the controller if the
0046 data sent is for a command register or the display data RAM
0047 maxItems: 1
0048
0049 vbat-supply:
0050 description: The supply for VBAT
0051
0052 solomon,height:
0053 $ref: /schemas/types.yaml#/definitions/uint32
0054 default: 16
0055 description:
0056 Height in pixel of the screen driven by the controller
0057
0058 solomon,width:
0059 $ref: /schemas/types.yaml#/definitions/uint32
0060 default: 96
0061 description:
0062 Width in pixel of the screen driven by the controller
0063
0064 solomon,page-offset:
0065 $ref: /schemas/types.yaml#/definitions/uint32
0066 default: 1
0067 description:
0068 Offset of pages (band of 8 pixels) that the screen is mapped to
0069
0070 solomon,segment-no-remap:
0071 type: boolean
0072 description:
0073 Display needs normal (non-inverted) data column to segment mapping
0074
0075 solomon,col-offset:
0076 $ref: /schemas/types.yaml#/definitions/uint32
0077 default: 0
0078 description:
0079 Offset of columns (COL/SEG) that the screen is mapped to
0080
0081 solomon,com-seq:
0082 type: boolean
0083 description:
0084 Display uses sequential COM pin configuration
0085
0086 solomon,com-lrremap:
0087 type: boolean
0088 description:
0089 Display uses left-right COM pin remap
0090
0091 solomon,com-invdir:
0092 type: boolean
0093 description:
0094 Display uses inverted COM pin scan direction
0095
0096 solomon,com-offset:
0097 $ref: /schemas/types.yaml#/definitions/uint32
0098 default: 0
0099 description:
0100 Number of the COM pin wired to the first display line
0101
0102 solomon,prechargep1:
0103 $ref: /schemas/types.yaml#/definitions/uint32
0104 default: 2
0105 description:
0106 Length of deselect period (phase 1) in clock cycles
0107
0108 solomon,prechargep2:
0109 $ref: /schemas/types.yaml#/definitions/uint32
0110 default: 2
0111 description:
0112 Length of precharge period (phase 2) in clock cycles. This needs to be
0113 the higher, the higher the capacitance of the OLED's pixels is.
0114
0115 solomon,dclk-div:
0116 $ref: /schemas/types.yaml#/definitions/uint32
0117 minimum: 1
0118 maximum: 16
0119 description:
0120 Clock divisor. The default value is controller-dependent.
0121
0122 solomon,dclk-frq:
0123 $ref: /schemas/types.yaml#/definitions/uint32
0124 minimum: 0
0125 maximum: 15
0126 description:
0127 Clock frequency, higher value means higher frequency.
0128 The default value is controller-dependent.
0129
0130 solomon,lookup-table:
0131 $ref: /schemas/types.yaml#/definitions/uint8-array
0132 maxItems: 4
0133 description:
0134 8 bit value array of current drive pulse widths for BANK0, and colors A,
0135 B, and C. Each value in range of 31 to 63 for pulse widths of 32 to 64.
0136 Color D is always width 64.
0137
0138 solomon,area-color-enable:
0139 type: boolean
0140 description:
0141 Display uses color mode
0142
0143 solomon,low-power:
0144 type: boolean
0145 description:
0146 Display runs in low power mode
0147
0148 required:
0149 - compatible
0150 - reg
0151
0152 allOf:
0153 - $ref: /schemas/spi/spi-peripheral-props.yaml#
0154
0155 - if:
0156 properties:
0157 compatible:
0158 contains:
0159 const: sinowealth,sh1106
0160 then:
0161 properties:
0162 solomon,dclk-div:
0163 default: 1
0164 solomon,dclk-frq:
0165 default: 5
0166
0167 - if:
0168 properties:
0169 compatible:
0170 contains:
0171 enum:
0172 - solomon,ssd1305-i2c
0173 - solomon,ssd1305
0174 then:
0175 properties:
0176 solomon,dclk-div:
0177 default: 1
0178 solomon,dclk-frq:
0179 default: 7
0180
0181 - if:
0182 properties:
0183 compatible:
0184 contains:
0185 enum:
0186 - solomon,ssd1306-i2c
0187 - solomon,ssd1306
0188 then:
0189 properties:
0190 solomon,dclk-div:
0191 default: 1
0192 solomon,dclk-frq:
0193 default: 8
0194
0195 - if:
0196 properties:
0197 compatible:
0198 contains:
0199 enum:
0200 - solomon,ssd1307-i2c
0201 - solomon,ssd1307
0202 then:
0203 properties:
0204 solomon,dclk-div:
0205 default: 2
0206 solomon,dclk-frq:
0207 default: 12
0208 required:
0209 - pwms
0210
0211 - if:
0212 properties:
0213 compatible:
0214 contains:
0215 enum:
0216 - solomon,ssd1309-i2c
0217 - solomon,ssd1309
0218 then:
0219 properties:
0220 solomon,dclk-div:
0221 default: 1
0222 solomon,dclk-frq:
0223 default: 10
0224
0225 unevaluatedProperties: false
0226
0227 examples:
0228 - |
0229 i2c1 {
0230 #address-cells = <1>;
0231 #size-cells = <0>;
0232
0233 ssd1307_i2c: oled@3c {
0234 compatible = "solomon,ssd1307";
0235 reg = <0x3c>;
0236 pwms = <&pwm 4 3000>;
0237 reset-gpios = <&gpio2 7>;
0238 };
0239
0240 ssd1306_i2c: oled@3d {
0241 compatible = "solomon,ssd1306";
0242 reg = <0x3c>;
0243 pwms = <&pwm 4 3000>;
0244 reset-gpios = <&gpio2 7>;
0245 solomon,com-lrremap;
0246 solomon,com-invdir;
0247 solomon,com-offset = <32>;
0248 solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
0249 };
0250 };
0251 - |
0252 spi {
0253 #address-cells = <1>;
0254 #size-cells = <0>;
0255
0256 ssd1307_spi: oled@0 {
0257 compatible = "solomon,ssd1307";
0258 reg = <0x0>;
0259 pwms = <&pwm 4 3000>;
0260 reset-gpios = <&gpio2 7>;
0261 dc-gpios = <&gpio2 8>;
0262 spi-max-frequency = <10000000>;
0263 };
0264
0265 ssd1306_spi: oled@1 {
0266 compatible = "solomon,ssd1306";
0267 reg = <0x1>;
0268 pwms = <&pwm 4 3000>;
0269 reset-gpios = <&gpio2 7>;
0270 dc-gpios = <&gpio2 8>;
0271 spi-max-frequency = <10000000>;
0272 solomon,com-lrremap;
0273 solomon,com-invdir;
0274 solomon,com-offset = <32>;
0275 solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
0276 };
0277 };