[PATCH 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Solomon SSD130x OLED displays can either have an I2C or SPI interface,
add to the schema the compatible strings, properties and examples for SPI.

Signed-off-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>
---

 .../bindings/display/solomon,ssd1307fb.yaml   | 89 +++++++++++++++----
 1 file changed, 71 insertions(+), 18 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
index 46207f2c12b8..05e7975296a7 100644
--- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
+++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
@@ -31,6 +31,15 @@ properties:
               - solomon,ssd1307-i2c
               - solomon,ssd1309-i2c
 
+      # SSD130x SPI controllers
+      - items:
+          - enum:
+              - sinowealth,sh1106-spi
+              - solomon,ssd1305-spi
+              - solomon,ssd1306-spi
+              - solomon,ssd1307-spi
+              - solomon,ssd1309-spi
+
   reg:
     maxItems: 1
 
@@ -40,9 +49,14 @@ properties:
   reset-gpios:
     maxItems: 1
 
+  dc-gpios:
+    maxItems: 1
+
   vbat-supply:
     description: The supply for VBAT
 
+  spi-max-frequency: true
+
   solomon,height:
     $ref: /schemas/types.yaml#/definitions/uint32
     default: 16
@@ -148,19 +162,10 @@ allOf:
       properties:
         compatible:
           contains:
-            const: sinowealth,sh1106-i2c
-    then:
-      properties:
-        solomon,dclk-div:
-          default: 1
-        solomon,dclk-frq:
-          default: 5
-
-  - if:
-      properties:
-        compatible:
-          contains:
-            const: solomon,ssd1305-i2c
+            enum:
+              - sinowealth,sh1106-i2c
+              - solomon,ssd1305-i2c
+              - solomon,ssd1305-spi
     then:
       properties:
         solomon,dclk-div:
@@ -172,7 +177,9 @@ allOf:
       properties:
         compatible:
           contains:
-            const: solomon,ssd1306-i2c
+            enum:
+              - solomon,ssd1306-i2c
+              - solomon,ssd1306-spi
     then:
       properties:
         solomon,dclk-div:
@@ -184,7 +191,9 @@ allOf:
       properties:
         compatible:
           contains:
-            const: solomon,ssd1307-i2c
+            enum:
+              - solomon,ssd1307-i2c
+              - solomon,ssd1307-spi
     then:
       properties:
         solomon,dclk-div:
@@ -198,7 +207,9 @@ allOf:
       properties:
         compatible:
           contains:
-            const: solomon,ssd1309-i2c
+            enum:
+              - solomon,ssd1309-i2c
+              - solomon,ssd1309-spi
     then:
       properties:
         solomon,dclk-div:
@@ -206,6 +217,21 @@ allOf:
         solomon,dclk-frq:
           default: 10
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - sinowealth,sh1106-spi
+              - solomon,ssd1305-spi
+              - solomon,ssd1306-spi
+              - solomon,ssd1307-spi
+              - solomon,ssd1309-spi
+    then:
+      required:
+        - spi-max-frequency
+        - dc-gpios
+
 additionalProperties: false
 
 examples:
@@ -214,14 +240,14 @@ examples:
             #address-cells = <1>;
             #size-cells = <0>;
 
-            ssd1307: oled@3c {
+            ssd1307_i2c: oled@3c {
                     compatible = "solomon,ssd1307-i2c";
                     reg = <0x3c>;
                     pwms = <&pwm 4 3000>;
                     reset-gpios = <&gpio2 7>;
             };
 
-            ssd1306: oled@3d {
+            ssd1306_i2c: oled@3d {
                     compatible = "solomon,ssd1306-i2c";
                     reg = <0x3c>;
                     pwms = <&pwm 4 3000>;
@@ -232,3 +258,30 @@ examples:
                     solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
             };
     };
+  - |
+    spi {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            ssd1307_spi: oled@0 {
+                    compatible = "solomon,ssd1307-spi";
+                    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-spi";
+                    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>;
+            };
+    };
-- 
2.35.1




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux