From patchwork Thu Nov 1 21:32:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 149984 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1296779ljp; Thu, 1 Nov 2018 14:33:05 -0700 (PDT) X-Google-Smtp-Source: AJdET5cu6pZES5PPN2uBeWroc/T6ZPn43hoSpiOs+SzvNotxvyMeOsKEcvVM8dzXKPBuJ3xg3P2i X-Received: by 2002:a63:7506:: with SMTP id q6-v6mr8489959pgc.137.1541107985088; Thu, 01 Nov 2018 14:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541107985; cv=none; d=google.com; s=arc-20160816; b=zaKSFSkIcP6OOTVMFSbKP2WjsEKRUT9kLFV2sdCN/W6Otyds6Gt5AUH+faWiTlrSXE QRrZiRbC8hhlZV6ykEtJHcMINH2jXYDDF0ayhFvC1aOObiZLSAi4nxJx4T7PV3TfXeqj jkPDmEX0bsuSIx3K3d+lopzSVCGKhS6OKYc7Vt0nSKeQw4OUHvFvArHOmNCT4AbKoMUH 8RCYGyY1RO1XDitx27K3CC4EmRn1xy1UejSZKKxGrABqxvrtkNq1M7usR/G8g+zG9Dvx 5BqOCKr1FENjZvrM4bNJ42dGiwAcsbkpAP42XvX01KrT+t60E3QkU5bbjRfyKnaVNknd DZfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=H6EK0A0JbBBXmz2dJzf9FcWIjfeEKodg5X4RdR1K76w=; b=u8NItvjBiuQ1uHIOJlSJgFxHb/Jn9/oHpHtPlvXm1M1KcxrxQKAZ8DoJPaW8vBYv2B c0qs5iMY12aiuw/T/pUTFdaTpm6WG/TlpKxyfhr1rm49krAcF//oi75XVyF0dO6TAhRx 1SrYDi/EFLyafh8m+nEiDTlQ31Lcl+lNW1jGZGvC2W2iL0I4lP28tnbEYINmkzNl8WEo 1WnRROnvOLJrkxAAW2/fVUYsZ/TBjFNk0BBygEDk54iKDEo0Hdk0Sq2cuvXabVUtCuyc XD4QzXysMDZU3GT76ThfrKHIeaT94fuP9cgBNwPTzrL2mx4CYMAiPF6VNdSqMJuw7dcJ B9CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id i66-v6si32610098pfc.173.2018.11.01.14.33.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 14:33:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFC296E4B0; Thu, 1 Nov 2018 21:33:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 470486E4B0 for ; Thu, 1 Nov 2018 21:33:02 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id x85-v6so15201567ljb.2 for ; Thu, 01 Nov 2018 14:33:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XZKXs55JR9f63vzd+xv0Hih9KjcZbP4m2f8GI7vOQ6o=; b=G5shnmyMkAKB6atarPW+GNboylcahn8H67H2ORj8fdaXTrjgb8Y/crX8mPc6ZYaBtI 4fI0Ir1cR9VuGbuFuLLMHnKG6PHq2v38PGlukDNMDcXHLwsYngQ2/Hc25bEGYtBdMMrb C9KkNklO7DdNEuVKxPSNE8qzUrQf5sS2BcX+vKpqG5/TtNVv92osQZ/o8m7QJppXbPTp 9PkiXU7QhdjkOUy6dL1umRO6jn8t1Kb6IXDFNKS//a4YzXlS5E90EmSZkgQrZoZkakqK bYr+dilbTLvVvMCFTdhDOnJtyW39Gr4gUeu1jI5SRFPJ5FeG+bY2aVwunIQPhV9X0uBe TTEA== X-Gm-Message-State: AGRZ1gJiAa+Ei2QeMpSyKUGz347x0DbPptqW0FBfJd4BeZyP3porxaH3 +cgqnvZy/UzdXNha9RXe8TchyQ== X-Received: by 2002:a2e:9c08:: with SMTP id s8-v6mr5095205lji.149.1541107980448; Thu, 01 Nov 2018 14:33:00 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id c20sm568982lfj.67.2018.11.01.14.32.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 14:32:59 -0700 (PDT) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 1/2 v4] drm/panel: Augment the TPO TPG110 bindings Date: Thu, 1 Nov 2018 22:32:55 +0100 Message-Id: <20181101213256.12097-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The TPO TPG110 bindings were using the DPI bindings (popular in the fbdev subsystem) but this misses the finer points learned in the DRM subsystem. We need to augment the bindings for proper DRM integration: the timings are expressed by the hardware, not put into the device tree. I.e. this hardware is self-describing and can report the resolutions and timings needed. It should not be described in the device tree. Further the device was incorrectly modeled with GPIO lines instead of an SPI child, even though the device was using SPI. No known deployments of the device using device tree exist, so it should be fine to augment the bindings. Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Drop the high-impedance turn-around flag: this should be a characteristic of the device driver not a DT property. - Collect Rob's review tag. (Presumably OK since I just dropped a property and added nothing.) ChangeLog v2->v3: - Rewrite to reflect the fact that the display should be an SPI child device using 3WIRE SPI. ChangeLog v1->v2: - Expand some sections to make it clear what kind of device this is and that the serial protocol it uses is not I2C. --- .../bindings/display/panel/tpo,tpg110.txt | 81 ++++++++++++------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt b/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt index f5e3c6f2095a..40f3d7c713bb 100644 --- a/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt +++ b/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt @@ -1,47 +1,70 @@ TPO TPG110 Panel ================ -This binding builds on the DPI bindings, adding a few properties -as a superset of a DPI. See panel-dpi.txt for the required DPI -bindings. +This panel driver is a component that acts as an intermediary +between an RGB output and a variety of panels. The panel +driver is strapped up in electronics to the desired resolution +and other properties, and has a control interface over 3WIRE +SPI. By talking to the TPG110 over SPI, the strapped properties +can be discovered and the hardware is therefore mostly +self-describing. + + +--------+ +SPI -> | TPO | -> physical display +RGB -> | TPG110 | + +--------+ + +If some electrical strap or alternate resolution is desired, +this can be set up by taking software control of the display +over the SPI interface. The interface can also adjust +for properties of the display such as gamma correction and +certain electrical driving levels. + +The TPG110 does not know the physical dimensions of the panel +connected, so this needs to be specified in the device tree. + +It requires a GPIO line for control of its reset line. + +The serial protocol has line names that resemble I2C but the +protocol is not I2C but 3WIRE SPI. Required properties: -- compatible : "tpo,tpg110" +- compatible : one of: + "ste,nomadik-nhk15-display", "tpo,tpg110" + "tpo,tpg110" - grestb-gpios : panel reset GPIO -- scen-gpios : serial control enable GPIO -- scl-gpios : serial control clock line GPIO -- sda-gpios : serial control data line GPIO +- width-mm : see display/panel/panel-common.txt +- height-mm : see display/panel/panel-common.txt + +The device needs to be a child of an SPI bus, see +spi/spi-bus.txt. The SPI child must set the following +properties: +- spi-3wire +- spi-max-frequency = <3000000>; +as these are characteristics of this device. -Required nodes: -- Video port for DPI input, see panel-dpi.txt -- Panel timing for DPI setup, see panel-dpi.txt +The device node can contain one 'port' child node with one child +'endpoint' node, according to the bindings defined in +media/video-interfaces.txt. This node should describe panel's video bus. Example ------- -panel { - compatible = "tpo,tpg110", "panel-dpi"; - grestb-gpios = <&stmpe_gpio44 5 GPIO_ACTIVE_LOW>; - scen-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; - scl-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; - sda-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; +panel: display@0 { + compatible = "tpo,tpg110"; + reg = <0>; + spi-3wire; + /* 320 ns min period ~= 3 MHz */ + spi-max-frequency = <3000000>; + /* Width and height from data sheet */ + width-mm = <116>; + height-mm = <87>; + grestb-gpios = <&foo_gpio 5 GPIO_ACTIVE_LOW>; backlight = <&bl>; port { nomadik_clcd_panel: endpoint { - remote-endpoint = <&nomadik_clcd_pads>; + remote-endpoint = <&foo>; }; }; - - panel-timing { - clock-frequency = <33200000>; - hactive = <800>; - hback-porch = <216>; - hfront-porch = <40>; - hsync-len = <1>; - vactive = <480>; - vback-porch = <35>; - vfront-porch = <10>; - vsync-len = <1>; - }; };