From 228da4a6e96e18e68f992d3eb9f269383e96bc3e Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 8 Feb 2020 11:31:03 +0100 Subject: [PATCH 1/2] dt-bindings: display: add MIPI DBI bus Add binding for a GPIO based MIPI DBI bus. The binding describes Type A and Type B. Type C, that uses SPI, is not covered by the binding. Signed-off-by: Sam Ravnborg --- .../bindings/display/mipi-dbi-bus.yaml | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mipi-dbi-bus.yaml diff --git a/Documentation/devicetree/bindings/display/mipi-dbi-bus.yaml b/Documentation/devicetree/bindings/display/mipi-dbi-bus.yaml new file mode 100644 index 000000000000..43d7a5cb0bda --- /dev/null +++ b/Documentation/devicetree/bindings/display/mipi-dbi-bus.yaml @@ -0,0 +1,162 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/mipi-dbi-bus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MIPI DBI (Display Bus Interface) bus + +maintainers: + - Sam Ravnborg + +description: | + MIPI DBI describes a bus interface which is used for display panels. + MIPI DBI can be configured for different bus widths. + + This documents describes the bindings used to represent HW that + is compatible with MIPI DBI - using GPIOs for signalling. + + Only MIPI DBI Type 1 interfaces are supported by this binding. + There are three types of type 1 interfaces respectively: + - Type A: Motorola 6800 type parallel bus + Type A interface can either be "Fixed E" or "Clocked E". + Bus width is either 8, 9 or 16 bits. + Type A interfaces uses the same signal for read and write - R/WX + - Type B: Intel 8080 type parallel bus + Bus width is either 8, 9 or 16 bits. + Type B interfaces uses dedicated signals for read and write - RDX and WRX. + - C. SPI type with 3 options: + Option 1: 9-bit with the Data/Command signal as the ninth bit + Option 2: Same as above except it's sent as 16 bits + Option 3: 8-bit with the Data/Command signal as a separate D/CX pin + + The following ascii picture shows the signals between CPU and a display. + The picture uses 8080 mode + +-----+ +---------+ + | |---read---->| | + | CPU |---write--->| display | + | |---dc------>| | + | |---cs------>| | + | |<==data[]==>| | + | |---reset--->| | + +-----+ +---------+ + + The MIPI DBI bus can include several displays, each with their + individual chip selct - CSX. + All displays must use the same type of interface. + The displays are represented as child nodes of the mipi-dbi node, + each with a reg property that is an index to the chip selects + specified in the dbi node. + +properties: + # MIPI DBI Bus properties + $nodename: + pattern: "^dbi(@.*|-[0-9a-f])*$" + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + mipi-dbi-type: + enum: + - dbi-type-1-a + - dbi-type-1-b + - dbi-type-1-c + description: | + Define the type of MIPI DBI interface, either type a, b or c. + + rw-gpios: + description: | + GPIO for the read/write (R/WX) signal - used for 6800 (type-1-a). + Data is read when high, and written when low. + + read-gpios: + description: | + GPIO for the read (RDX) signal - used for 8080 (type-1-b) + The CPU read data at the rising edge. + + write-gpios: + description: | + GPIO for the write (WRX) signal - used for 8080 (type-1-b). + The CPU writes data at the rising edge. + + dc-gpios: + description: | + Data/command selection (D/CX). + Used for 6800 (type-1-a) and 8080 (type-1-b). + Data when high, and command when low. + + data-gpios: + minItems: 8 + maxItems: 16 + description: | + An array of either 4, 8 or 9 GPIO specifiers. + 8 - 8-bit mode D[7:0] + 9 - 9-bit mode D[8:0] + 16 - 19-bit mode D[15:0] + + e-clock-gpios: + description: | + In Clocked E mode the CPU writes data at falling edge + and reads data at rising edge + + te-gpios: + description: Tearing effect synchronization signal + + reset-gpios: + description: Reset signal + + cs-gpios: + minItems: 1 + maxItems: 8 + description: GPIOs to use for chipselect lines + +patternProperties: + "^panel@[0-7]$": + description: Display panels connected to the DBI bus + type: object + +required: + - mipi-dbi-type + +additionalProperties: false + +examples: + - | + dbi { + mipi-dbi-type = "dbi-type-1-b"; + #address-cells = <1>; + #size-cells = <0>; + read-gpios = <&pioA 7 0>; + write-gpios = <&pioA 8 0>; + dc-gpios = <&pioA 9 0>; + data-gpios = <&pioB 0 0>, + <&pioB 1 0>, + <&pioB 2 0>, + <&pioB 3 0>, + <&pioB 4 0>, + <&pioB 5 0>, + <&pioB 6 0>, + <&pioB 7 0>; + reset-gpios = <&pioA 2 0>; + + /* Two displays 0 and 1 */ + cs-gpios = <&pioC 0 0>, + <&pioC 1 0>; + + panel@0 { + compatible = "hit,hd44780-dbi"; + reg = <0>; + backlight = <&gpio_backlight>; + }; + + panel@1 { + compatible = "winstar,foo-dbi"; + reg = <1>; + backlight = <&bl_pwm>; + }; + }; + +... -- 2.25.1