xref: /freebsd-src/sys/contrib/device-tree/Bindings/display/panel/panel-mipi-dbi-spi.yaml (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
1aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c9ccf3a3SEmmanuel Vadot%YAML 1.2
3c9ccf3a3SEmmanuel Vadot---
4c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/display/panel/panel-mipi-dbi-spi.yaml#
5c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c9ccf3a3SEmmanuel Vadot
7c9ccf3a3SEmmanuel Vadottitle: MIPI DBI SPI Panel
8c9ccf3a3SEmmanuel Vadot
9c9ccf3a3SEmmanuel Vadotmaintainers:
10c9ccf3a3SEmmanuel Vadot  - Noralf Trønnes <noralf@tronnes.org>
11c9ccf3a3SEmmanuel Vadot
12c9ccf3a3SEmmanuel Vadotdescription: |
13c9ccf3a3SEmmanuel Vadot  This binding is for display panels using a MIPI DBI compatible controller
14c9ccf3a3SEmmanuel Vadot  in SPI mode.
15c9ccf3a3SEmmanuel Vadot
16c9ccf3a3SEmmanuel Vadot  The MIPI Alliance Standard for Display Bus Interface defines the electrical
17c9ccf3a3SEmmanuel Vadot  and logical interfaces for display controllers historically used in mobile
18c9ccf3a3SEmmanuel Vadot  phones. The standard defines 4 display architecture types and this binding is
19c9ccf3a3SEmmanuel Vadot  for type 1 which has full frame memory. There are 3 interface types in the
20c9ccf3a3SEmmanuel Vadot  standard and type C is the serial interface.
21c9ccf3a3SEmmanuel Vadot
22c9ccf3a3SEmmanuel Vadot  The standard defines the following interface signals for type C:
23c9ccf3a3SEmmanuel Vadot  - Power:
24c9ccf3a3SEmmanuel Vadot    - Vdd: Power supply for display module
25cb7aa33aSEmmanuel Vadot      Called power-supply in this binding.
26c9ccf3a3SEmmanuel Vadot    - Vddi: Logic level supply for interface signals
27cb7aa33aSEmmanuel Vadot      Called io-supply in this binding.
28c9ccf3a3SEmmanuel Vadot  - Interface:
29c9ccf3a3SEmmanuel Vadot    - CSx: Chip select
30c9ccf3a3SEmmanuel Vadot    - SCL: Serial clock
31c9ccf3a3SEmmanuel Vadot    - Dout: Serial out
32c9ccf3a3SEmmanuel Vadot    - Din: Serial in
33c9ccf3a3SEmmanuel Vadot    - SDA: Bidrectional in/out
34c9ccf3a3SEmmanuel Vadot    - D/CX: Data/command selection, high=data, low=command
35c9ccf3a3SEmmanuel Vadot      Called dc-gpios in this binding.
36c9ccf3a3SEmmanuel Vadot    - RESX: Reset when low
37c9ccf3a3SEmmanuel Vadot      Called reset-gpios in this binding.
38c9ccf3a3SEmmanuel Vadot
39c9ccf3a3SEmmanuel Vadot  The type C interface has 3 options:
40c9ccf3a3SEmmanuel Vadot
41c9ccf3a3SEmmanuel Vadot    - Option 1: 9-bit mode and D/CX as the 9th bit
42c9ccf3a3SEmmanuel Vadot      |              Command              |  the next command or following data  |
43c9ccf3a3SEmmanuel Vadot      |<0><D7><D6><D5><D4><D3><D2><D1><D0>|<D/CX><D7><D6><D5><D4><D3><D2><D1><D0>|
44c9ccf3a3SEmmanuel Vadot
45c9ccf3a3SEmmanuel Vadot    - Option 2: 16-bit mode and D/CX as a 9th bit
46c9ccf3a3SEmmanuel Vadot      |              Command or data                              |
47c9ccf3a3SEmmanuel Vadot      |<X><X><X><X><X><X><X><D/CX><D7><D6><D5><D4><D3><D2><D1><D0>|
48c9ccf3a3SEmmanuel Vadot
49c9ccf3a3SEmmanuel Vadot    - Option 3: 8-bit mode and D/CX as a separate interface line
50c9ccf3a3SEmmanuel Vadot      |        Command or data         |
51c9ccf3a3SEmmanuel Vadot      |<D7><D6><D5><D4><D3><D2><D1><D0>|
52c9ccf3a3SEmmanuel Vadot
53*0e8011faSEmmanuel Vadot  The standard defines one pixel format for type C: RGB111. The industry
54*0e8011faSEmmanuel Vadot  however has decided to provide the type A/B interface pixel formats also on
55*0e8011faSEmmanuel Vadot  the Type C interface and most common among these are RGB565 and RGB666.
56*0e8011faSEmmanuel Vadot  The MIPI DCS command set_address_mode (36h) has one bit that controls RGB/BGR
57*0e8011faSEmmanuel Vadot  order. This gives each supported RGB format a BGR variant.
58*0e8011faSEmmanuel Vadot
59c9ccf3a3SEmmanuel Vadot  The panel resolution is specified using the panel-timing node properties
60c9ccf3a3SEmmanuel Vadot  hactive (width) and vactive (height). The other mandatory panel-timing
61c9ccf3a3SEmmanuel Vadot  properties should be set to zero except clock-frequency which can be
62c9ccf3a3SEmmanuel Vadot  optionally set to inform about the actual pixel clock frequency.
63c9ccf3a3SEmmanuel Vadot
64c9ccf3a3SEmmanuel Vadot  If the panel is wired to the controller at an offset specify this using
65c9ccf3a3SEmmanuel Vadot  hback-porch (x-offset) and vback-porch (y-offset).
66c9ccf3a3SEmmanuel Vadot
67c9ccf3a3SEmmanuel VadotallOf:
68c9ccf3a3SEmmanuel Vadot  - $ref: panel-common.yaml#
69c9ccf3a3SEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
70c9ccf3a3SEmmanuel Vadot
71c9ccf3a3SEmmanuel Vadotproperties:
72c9ccf3a3SEmmanuel Vadot  compatible:
73c9ccf3a3SEmmanuel Vadot    items:
74c9ccf3a3SEmmanuel Vadot      - enum:
75aa1a8ff2SEmmanuel Vadot          - saef,sftc154b
76c9ccf3a3SEmmanuel Vadot          - sainsmart18
77f126890aSEmmanuel Vadot          - shineworld,lh133k
78c9ccf3a3SEmmanuel Vadot      - const: panel-mipi-dbi-spi
79c9ccf3a3SEmmanuel Vadot
807d0873ebSEmmanuel Vadot  reg:
817d0873ebSEmmanuel Vadot    maxItems: 1
827d0873ebSEmmanuel Vadot
83c9ccf3a3SEmmanuel Vadot  write-only:
84c9ccf3a3SEmmanuel Vadot    type: boolean
85c9ccf3a3SEmmanuel Vadot    description:
86c9ccf3a3SEmmanuel Vadot      Controller is not readable (ie. Din (MISO on the SPI interface) is not
87c9ccf3a3SEmmanuel Vadot      wired up).
88c9ccf3a3SEmmanuel Vadot
89c9ccf3a3SEmmanuel Vadot  dc-gpios:
90c9ccf3a3SEmmanuel Vadot    maxItems: 1
91c9ccf3a3SEmmanuel Vadot    description: |
92c9ccf3a3SEmmanuel Vadot      Controller data/command selection (D/CX) in 4-line SPI mode.
93c9ccf3a3SEmmanuel Vadot      If not set, the controller is in 3-line SPI mode.
94c9ccf3a3SEmmanuel Vadot
95cb7aa33aSEmmanuel Vadot  io-supply:
96cb7aa33aSEmmanuel Vadot    description: |
97cb7aa33aSEmmanuel Vadot      Logic level supply for interface signals (Vddi).
98cb7aa33aSEmmanuel Vadot      No need to set if this is the same as power-supply.
99cb7aa33aSEmmanuel Vadot
100f126890aSEmmanuel Vadot  spi-3wire: true
101f126890aSEmmanuel Vadot
102*0e8011faSEmmanuel Vadot  format:
103*0e8011faSEmmanuel Vadot    description: >
104*0e8011faSEmmanuel Vadot      Pixel format in bit order as going on the wire:
105*0e8011faSEmmanuel Vadot        * `x2r1g1b1r1g1b1` - RGB111, 2 pixels per byte
106*0e8011faSEmmanuel Vadot        * `x2b1g1r1b1g1r1` - BGR111, 2 pixels per byte
107*0e8011faSEmmanuel Vadot        * `x1r1g1b1x1r1g1b1` - RGB111, 2 pixels per byte
108*0e8011faSEmmanuel Vadot        * `x1b1g1r1x1b1g1r1` - BGR111, 2 pixels per byte
109*0e8011faSEmmanuel Vadot        * `r5g6b5` - RGB565, 2 bytes
110*0e8011faSEmmanuel Vadot        * `b5g6r5` - BGR565, 2 bytes
111*0e8011faSEmmanuel Vadot        * `r6x2g6x2b6x2` - RGB666, 3 bytes
112*0e8011faSEmmanuel Vadot        * `b6x2g6x2r6x2` - BGR666, 3 bytes
113*0e8011faSEmmanuel Vadot    enum:
114*0e8011faSEmmanuel Vadot      - x2r1g1b1r1g1b1
115*0e8011faSEmmanuel Vadot      - x2b1g1r1b1g1r1
116*0e8011faSEmmanuel Vadot      - x1r1g1b1x1r1g1b1
117*0e8011faSEmmanuel Vadot      - x1b1g1r1x1b1g1r1
118*0e8011faSEmmanuel Vadot      - r5g6b5
119*0e8011faSEmmanuel Vadot      - b5g6r5
120*0e8011faSEmmanuel Vadot      - r6x2g6x2b6x2
121*0e8011faSEmmanuel Vadot      - b6x2g6x2r6x2
122*0e8011faSEmmanuel Vadot    default: r5g6b5
123*0e8011faSEmmanuel Vadot
124c9ccf3a3SEmmanuel Vadotrequired:
125c9ccf3a3SEmmanuel Vadot  - compatible
126c9ccf3a3SEmmanuel Vadot  - reg
127c9ccf3a3SEmmanuel Vadot  - width-mm
128c9ccf3a3SEmmanuel Vadot  - height-mm
129c9ccf3a3SEmmanuel Vadot  - panel-timing
130c9ccf3a3SEmmanuel Vadot
131c9ccf3a3SEmmanuel VadotunevaluatedProperties: false
132c9ccf3a3SEmmanuel Vadot
133c9ccf3a3SEmmanuel Vadotexamples:
134c9ccf3a3SEmmanuel Vadot  - |
135c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
136c9ccf3a3SEmmanuel Vadot
137c9ccf3a3SEmmanuel Vadot    spi {
138c9ccf3a3SEmmanuel Vadot        #address-cells = <1>;
139c9ccf3a3SEmmanuel Vadot        #size-cells = <0>;
140c9ccf3a3SEmmanuel Vadot
141c9ccf3a3SEmmanuel Vadot        display@0{
142c9ccf3a3SEmmanuel Vadot            compatible = "sainsmart18", "panel-mipi-dbi-spi";
143c9ccf3a3SEmmanuel Vadot            reg = <0>;
144c9ccf3a3SEmmanuel Vadot            spi-max-frequency = <40000000>;
145c9ccf3a3SEmmanuel Vadot
146c9ccf3a3SEmmanuel Vadot            dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
147c9ccf3a3SEmmanuel Vadot            reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
148c9ccf3a3SEmmanuel Vadot            write-only;
149c9ccf3a3SEmmanuel Vadot
150*0e8011faSEmmanuel Vadot            format = "r5g6b5";
151*0e8011faSEmmanuel Vadot
152c9ccf3a3SEmmanuel Vadot            backlight = <&backlight>;
153c9ccf3a3SEmmanuel Vadot
154c9ccf3a3SEmmanuel Vadot            width-mm = <35>;
155c9ccf3a3SEmmanuel Vadot            height-mm = <28>;
156c9ccf3a3SEmmanuel Vadot
157c9ccf3a3SEmmanuel Vadot            panel-timing {
158c9ccf3a3SEmmanuel Vadot                hactive = <160>;
159c9ccf3a3SEmmanuel Vadot                vactive = <128>;
160c9ccf3a3SEmmanuel Vadot                hback-porch = <0>;
161c9ccf3a3SEmmanuel Vadot                vback-porch = <0>;
162c9ccf3a3SEmmanuel Vadot                clock-frequency = <0>;
163c9ccf3a3SEmmanuel Vadot                hfront-porch = <0>;
164c9ccf3a3SEmmanuel Vadot                hsync-len = <0>;
165c9ccf3a3SEmmanuel Vadot                vfront-porch = <0>;
166c9ccf3a3SEmmanuel Vadot                vsync-len = <0>;
167c9ccf3a3SEmmanuel Vadot            };
168c9ccf3a3SEmmanuel Vadot        };
169c9ccf3a3SEmmanuel Vadot    };
170c9ccf3a3SEmmanuel Vadot
171c9ccf3a3SEmmanuel Vadot...
172