1440b075bSKrzysztof Kozlowski# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 22f3468b8SNoralf Trønnes%YAML 1.2 32f3468b8SNoralf Trønnes--- 42f3468b8SNoralf Trønnes$id: http://devicetree.org/schemas/display/panel/panel-mipi-dbi-spi.yaml# 52f3468b8SNoralf Trønnes$schema: http://devicetree.org/meta-schemas/core.yaml# 62f3468b8SNoralf Trønnes 72f3468b8SNoralf Trønnestitle: MIPI DBI SPI Panel 82f3468b8SNoralf Trønnes 92f3468b8SNoralf Trønnesmaintainers: 102f3468b8SNoralf Trønnes - Noralf Trønnes <noralf@tronnes.org> 112f3468b8SNoralf Trønnes 122f3468b8SNoralf Trønnesdescription: | 132f3468b8SNoralf Trønnes This binding is for display panels using a MIPI DBI compatible controller 142f3468b8SNoralf Trønnes in SPI mode. 152f3468b8SNoralf Trønnes 162f3468b8SNoralf Trønnes The MIPI Alliance Standard for Display Bus Interface defines the electrical 172f3468b8SNoralf Trønnes and logical interfaces for display controllers historically used in mobile 182f3468b8SNoralf Trønnes phones. The standard defines 4 display architecture types and this binding is 192f3468b8SNoralf Trønnes for type 1 which has full frame memory. There are 3 interface types in the 202f3468b8SNoralf Trønnes standard and type C is the serial interface. 212f3468b8SNoralf Trønnes 222f3468b8SNoralf Trønnes The standard defines the following interface signals for type C: 232f3468b8SNoralf Trønnes - Power: 242f3468b8SNoralf Trønnes - Vdd: Power supply for display module 2594914b85SOtto Pflüger Called power-supply in this binding. 262f3468b8SNoralf Trønnes - Vddi: Logic level supply for interface signals 2794914b85SOtto Pflüger Called io-supply in this binding. 282f3468b8SNoralf Trønnes - Interface: 292f3468b8SNoralf Trønnes - CSx: Chip select 302f3468b8SNoralf Trønnes - SCL: Serial clock 312f3468b8SNoralf Trønnes - Dout: Serial out 322f3468b8SNoralf Trønnes - Din: Serial in 332f3468b8SNoralf Trønnes - SDA: Bidrectional in/out 342f3468b8SNoralf Trønnes - D/CX: Data/command selection, high=data, low=command 352f3468b8SNoralf Trønnes Called dc-gpios in this binding. 362f3468b8SNoralf Trønnes - RESX: Reset when low 372f3468b8SNoralf Trønnes Called reset-gpios in this binding. 382f3468b8SNoralf Trønnes 392f3468b8SNoralf Trønnes The type C interface has 3 options: 402f3468b8SNoralf Trønnes 412f3468b8SNoralf Trønnes - Option 1: 9-bit mode and D/CX as the 9th bit 422f3468b8SNoralf Trønnes | Command | the next command or following data | 432f3468b8SNoralf Trønnes |<0><D7><D6><D5><D4><D3><D2><D1><D0>|<D/CX><D7><D6><D5><D4><D3><D2><D1><D0>| 442f3468b8SNoralf Trønnes 452f3468b8SNoralf Trønnes - Option 2: 16-bit mode and D/CX as a 9th bit 462f3468b8SNoralf Trønnes | Command or data | 472f3468b8SNoralf Trønnes |<X><X><X><X><X><X><X><D/CX><D7><D6><D5><D4><D3><D2><D1><D0>| 482f3468b8SNoralf Trønnes 492f3468b8SNoralf Trønnes - Option 3: 8-bit mode and D/CX as a separate interface line 502f3468b8SNoralf Trønnes | Command or data | 512f3468b8SNoralf Trønnes |<D7><D6><D5><D4><D3><D2><D1><D0>| 522f3468b8SNoralf Trønnes 53*fdb16466SNoralf Trønnes The standard defines one pixel format for type C: RGB111. The industry 54*fdb16466SNoralf Trønnes however has decided to provide the type A/B interface pixel formats also on 55*fdb16466SNoralf Trønnes the Type C interface and most common among these are RGB565 and RGB666. 56*fdb16466SNoralf Trønnes The MIPI DCS command set_address_mode (36h) has one bit that controls RGB/BGR 57*fdb16466SNoralf Trønnes order. This gives each supported RGB format a BGR variant. 58*fdb16466SNoralf Trønnes 592f3468b8SNoralf Trønnes The panel resolution is specified using the panel-timing node properties 602f3468b8SNoralf Trønnes hactive (width) and vactive (height). The other mandatory panel-timing 612f3468b8SNoralf Trønnes properties should be set to zero except clock-frequency which can be 622f3468b8SNoralf Trønnes optionally set to inform about the actual pixel clock frequency. 632f3468b8SNoralf Trønnes 642f3468b8SNoralf Trønnes If the panel is wired to the controller at an offset specify this using 652f3468b8SNoralf Trønnes hback-porch (x-offset) and vback-porch (y-offset). 662f3468b8SNoralf Trønnes 672f3468b8SNoralf TrønnesallOf: 682f3468b8SNoralf Trønnes - $ref: panel-common.yaml# 692f3468b8SNoralf Trønnes - $ref: /schemas/spi/spi-peripheral-props.yaml# 702f3468b8SNoralf Trønnes 712f3468b8SNoralf Trønnesproperties: 722f3468b8SNoralf Trønnes compatible: 732f3468b8SNoralf Trønnes items: 742f3468b8SNoralf Trønnes - enum: 7552810f62SChris Morgan - saef,sftc154b 762f3468b8SNoralf Trønnes - sainsmart18 7796b2b1a2SLeonard Göhrs - shineworld,lh133k 782f3468b8SNoralf Trønnes - const: panel-mipi-dbi-spi 792f3468b8SNoralf Trønnes 806b2358ffSKrzysztof Kozlowski reg: 816b2358ffSKrzysztof Kozlowski maxItems: 1 826b2358ffSKrzysztof Kozlowski 832f3468b8SNoralf Trønnes write-only: 842f3468b8SNoralf Trønnes type: boolean 852f3468b8SNoralf Trønnes description: 862f3468b8SNoralf Trønnes Controller is not readable (ie. Din (MISO on the SPI interface) is not 872f3468b8SNoralf Trønnes wired up). 882f3468b8SNoralf Trønnes 892f3468b8SNoralf Trønnes dc-gpios: 902f3468b8SNoralf Trønnes maxItems: 1 912f3468b8SNoralf Trønnes description: | 922f3468b8SNoralf Trønnes Controller data/command selection (D/CX) in 4-line SPI mode. 932f3468b8SNoralf Trønnes If not set, the controller is in 3-line SPI mode. 942f3468b8SNoralf Trønnes 9594914b85SOtto Pflüger io-supply: 9694914b85SOtto Pflüger description: | 9794914b85SOtto Pflüger Logic level supply for interface signals (Vddi). 9894914b85SOtto Pflüger No need to set if this is the same as power-supply. 9994914b85SOtto Pflüger 100222e0a8eSLeonard Göhrs spi-3wire: true 101222e0a8eSLeonard Göhrs 102*fdb16466SNoralf Trønnes format: 103*fdb16466SNoralf Trønnes description: > 104*fdb16466SNoralf Trønnes Pixel format in bit order as going on the wire: 105*fdb16466SNoralf Trønnes * `x2r1g1b1r1g1b1` - RGB111, 2 pixels per byte 106*fdb16466SNoralf Trønnes * `x2b1g1r1b1g1r1` - BGR111, 2 pixels per byte 107*fdb16466SNoralf Trønnes * `x1r1g1b1x1r1g1b1` - RGB111, 2 pixels per byte 108*fdb16466SNoralf Trønnes * `x1b1g1r1x1b1g1r1` - BGR111, 2 pixels per byte 109*fdb16466SNoralf Trønnes * `r5g6b5` - RGB565, 2 bytes 110*fdb16466SNoralf Trønnes * `b5g6r5` - BGR565, 2 bytes 111*fdb16466SNoralf Trønnes * `r6x2g6x2b6x2` - RGB666, 3 bytes 112*fdb16466SNoralf Trønnes * `b6x2g6x2r6x2` - BGR666, 3 bytes 113*fdb16466SNoralf Trønnes enum: 114*fdb16466SNoralf Trønnes - x2r1g1b1r1g1b1 115*fdb16466SNoralf Trønnes - x2b1g1r1b1g1r1 116*fdb16466SNoralf Trønnes - x1r1g1b1x1r1g1b1 117*fdb16466SNoralf Trønnes - x1b1g1r1x1b1g1r1 118*fdb16466SNoralf Trønnes - r5g6b5 119*fdb16466SNoralf Trønnes - b5g6r5 120*fdb16466SNoralf Trønnes - r6x2g6x2b6x2 121*fdb16466SNoralf Trønnes - b6x2g6x2r6x2 122*fdb16466SNoralf Trønnes default: r5g6b5 123*fdb16466SNoralf Trønnes 1242f3468b8SNoralf Trønnesrequired: 1252f3468b8SNoralf Trønnes - compatible 1262f3468b8SNoralf Trønnes - reg 1271ecc0c09SMarek Vasut - width-mm 1281ecc0c09SMarek Vasut - height-mm 1292f3468b8SNoralf Trønnes - panel-timing 1302f3468b8SNoralf Trønnes 1312f3468b8SNoralf TrønnesunevaluatedProperties: false 1322f3468b8SNoralf Trønnes 1332f3468b8SNoralf Trønnesexamples: 1342f3468b8SNoralf Trønnes - | 1352f3468b8SNoralf Trønnes #include <dt-bindings/gpio/gpio.h> 1362f3468b8SNoralf Trønnes 1372f3468b8SNoralf Trønnes spi { 1382f3468b8SNoralf Trønnes #address-cells = <1>; 1392f3468b8SNoralf Trønnes #size-cells = <0>; 1402f3468b8SNoralf Trønnes 1412f3468b8SNoralf Trønnes display@0{ 1422f3468b8SNoralf Trønnes compatible = "sainsmart18", "panel-mipi-dbi-spi"; 1432f3468b8SNoralf Trønnes reg = <0>; 1442f3468b8SNoralf Trønnes spi-max-frequency = <40000000>; 1452f3468b8SNoralf Trønnes 1462f3468b8SNoralf Trønnes dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; 1472f3468b8SNoralf Trønnes reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>; 1482f3468b8SNoralf Trønnes write-only; 1492f3468b8SNoralf Trønnes 150*fdb16466SNoralf Trønnes format = "r5g6b5"; 151*fdb16466SNoralf Trønnes 1522f3468b8SNoralf Trønnes backlight = <&backlight>; 1532f3468b8SNoralf Trønnes 1542f3468b8SNoralf Trønnes width-mm = <35>; 1552f3468b8SNoralf Trønnes height-mm = <28>; 1562f3468b8SNoralf Trønnes 1572f3468b8SNoralf Trønnes panel-timing { 1582f3468b8SNoralf Trønnes hactive = <160>; 1592f3468b8SNoralf Trønnes vactive = <128>; 1602f3468b8SNoralf Trønnes hback-porch = <0>; 1612f3468b8SNoralf Trønnes vback-porch = <0>; 1622f3468b8SNoralf Trønnes clock-frequency = <0>; 1632f3468b8SNoralf Trønnes hfront-porch = <0>; 1642f3468b8SNoralf Trønnes hsync-len = <0>; 1652f3468b8SNoralf Trønnes vfront-porch = <0>; 1662f3468b8SNoralf Trønnes vsync-len = <0>; 1672f3468b8SNoralf Trønnes }; 1682f3468b8SNoralf Trønnes }; 1692f3468b8SNoralf Trønnes }; 1702f3468b8SNoralf Trønnes 1712f3468b8SNoralf Trønnes... 172