From patchwork Tue Sep 25 14:35:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 147463 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp807536lji; Tue, 25 Sep 2018 07:36:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV61eeFlJ/f7lgRXnCyjHodue+uZKZARo9Vvshpv9OpXP75UeC7d0sl2RmATSJDP3vBq+rsv/ X-Received: by 2002:a63:24c4:: with SMTP id k187-v6mr1426557pgk.162.1537886172102; Tue, 25 Sep 2018 07:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537886172; cv=none; d=google.com; s=arc-20160816; b=m+MRRTYCudyNgJkBlEhkHgly5nwU011tA8PxnuQ5Pyw1x0q4UeFswdSckIKnj8a6Df F2rU10IeQ6zLWkAmv+5SnnB9GqFC1BKVNYO47GuO0NitVTiCUZ9AkigXiQJ+P41CQkQ1 ijjAAFl1JZAd7Inp0C0EFqBzTsVmTSLkeE191eEQSQlHSY0Tui2O2Gvx660pkonFYJ8K IGjsur/QdaYEqVXsDO4n23VhRKFXObjZC4BWUQJ5QzZO9/2ER/ch/A//sdUHzTtbtmxE A0Tc7djdBpLTmOrLLLc+Hu8EMlwmL68+BmT4jPJT7YFtoUdAgWiKQk8f7qs9/qW2UUTV C3WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=di5eixf9Z2Y2mN5/dyZsA2b9UvgkByN1eB45QMXPWN0=; b=HD9PHNNhWLhl6C2ThJniJjX40LfzI951y8dCachrr3Sk5j8h8EHEzRuBEdL5SwCTCA +eMW/8T1HL3xSS9IcodcHhDFFlAqvhfZX6mDdGwXPw4XaNWCexiuncCsViMnzpodKdsH R47XSfnBPyiyBF7fR8iWCmP7KRpPVi3z9GZgCyG3dHe0Nh+52S4wfd4UUdi/umYHuGuz 16MVHjMhldWuPG36YPs3jyIVI10L7l+bi3X7BPFjNLV6dgv8IBL3wQqDQHoPvoE/Fy7y dy6hvQyZGhcfuiVe0oUD9au6Wz4JfpeVBqYgHEFYXpXChL/TbjR9C2LXUGg5iDR4hE6a +48Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M7S6WRxh; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c37-v6si2440394pgl.689.2018.09.25.07.36.11; Tue, 25 Sep 2018 07:36:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M7S6WRxh; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729199AbeIYUn6 (ORCPT + 6 others); Tue, 25 Sep 2018 16:43:58 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38929 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729170AbeIYUn6 (ORCPT ); Tue, 25 Sep 2018 16:43:58 -0400 Received: by mail-lf1-f66.google.com with SMTP id w21-v6so6212151lff.6 for ; Tue, 25 Sep 2018 07:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=di5eixf9Z2Y2mN5/dyZsA2b9UvgkByN1eB45QMXPWN0=; b=M7S6WRxh51InpPL/jvDJ1iR6RsVu4QjN3cHFnRyRxorDGOVlc9eCG5xLcwCZhq3wxr fK2rOAXG6WoNiOMzHLgGMzmeIqwBx8cbZ0UWQpLOOPvD7L/g90KFM6hTrMhjusnicR43 +aHZCyb1Wi8sNc9M80Y3hRJoo16zB4sLCRZvQ= 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; bh=di5eixf9Z2Y2mN5/dyZsA2b9UvgkByN1eB45QMXPWN0=; b=OoG/xTWGbp7DsFrZ2sfl0tYcGuEYR5ZSv8BUUglNe2E6ekhsQk1fH3BuGsxOs2pZ5k BpeziCIhcnA0FtERARQWijSLHMpQiBgNOVzFQIxbuSey6gbvnWgJlEgkMjoeadxyQEaS B6E2nZbq9xLZ2QP03EUtGt/J56nFYe0JcUlOwpzycAs+D3fkE/1QLOqC2YBArc+3op76 Bxin0n7nR2eym7DqIA97Aqw46leulO0PcHhDnEabrn9nuTgK+gF96bOdODGPG3VmSw9d DAzcNWO/9R3npzoHeUzQbmMneSsrL9KBzDXkZnmXzlxK8nGolTYzM1zhryi9ARxvkDIL Xw/A== X-Gm-Message-State: ABuFfojuk89y9S31AgjZl10QbeE0PiH4A+K/uboLtqOFbGS5bcsYseWh pFDCnDOV90RRDJJpRFcRiPohng== X-Received: by 2002:a19:8c1a:: with SMTP id o26-v6mr1098022lfd.90.1537886168054; Tue, 25 Sep 2018 07:36:08 -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 n67-v6sm457691ljb.15.2018.09.25.07.36.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Sep 2018 07:36:06 -0700 (PDT) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Cc: Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 1/2 v3] drm/panel: Augment the TPO TPG110 bindings Date: Tue, 25 Sep 2018 16:35:58 +0200 Message-Id: <20180925143559.19934-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 Signed-off-by: Linus Walleij --- 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 | 83 ++++++++++++------- 1 file changed, 54 insertions(+), 29 deletions(-) -- 2.17.1 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt b/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt index f5e3c6f2095a..4b90a0929a46 100644 --- a/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt +++ b/Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt @@ -1,47 +1,72 @@ 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-3wire-high-impedance-turnaround +- 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; + spi-3wire-high-impedance-turnaround; + /* 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>; - }; };