From patchwork Tue Jun 18 08:15:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hironori KIKUCHI X-Patchwork-Id: 13701946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A4BEC27C4F for ; Tue, 18 Jun 2024 08:15:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3521A10E5C9; Tue, 18 Jun 2024 08:15:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HQQxEEzz"; dkim-atps=neutral Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1530910E5CA for ; Tue, 18 Jun 2024 08:15:50 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-652fd0bb5e6so4094523a12.0 for ; Tue, 18 Jun 2024 01:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718698549; x=1719303349; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J1NVDaPXa6D4F2sbo9R4akJ/9kWJg22tXMUc7cYS2HM=; b=HQQxEEzzHfcC47IC+H3vgXjThOX6BzTnDGhv0mupTajY0qvce0oCrk1XJhSJBqv8wx k4zaTf4rruofjclJPOjnXqkRfbBzOr/loMcStOmp/k5yFPMNjU5wMHrU2b+aSmDHg2YI 6P3BldBd9IaxVj/AzVBHUBydjn6i30Q0QCLrxWmta2bhNA2BD5v7kAvzD9y7N3egbN9Z FDs0MwPoIklmz/Y1OhjYoptoAQDDJc1UwjKKEmi6YObKNpQE88KqNRZvOUiqtpizzqIC gPeEnXTv43Ybj5r5XEjnF1CpVbh0Ubl7n+wG8JPNRAERQJao9JJ453B2hplCto7DgbXX E8AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718698549; x=1719303349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J1NVDaPXa6D4F2sbo9R4akJ/9kWJg22tXMUc7cYS2HM=; b=nBBCBuCxm2i7XUVUJFuWCBbCHxodDyj6JTpQvXXzkRTLCkso1MrPtNwJ/Y4v3Q1+QR OANyH3B0Yo2AYsKarW/400JkaNu1lxm4hL5AvS+V26xQEtXl2sCOAOAW+8LP1xFAC52l 7FP1UXYm67ZPcsHs9Yn8CBtBJmJBY0tK0ETkpIXZn8UNvtsB46NHz5aBldSKdcd+PXIK puikDJ/SEZ4c3E8dC5Q+AsWWubAxsvOQU4AqW/jbkId+EJdbm1cGLkMSXX1dUbGGmYi9 XmQqqX2FRl3cyJrfwJH7xbDR9fhvG6f9ckJwGoa+gUjBSf8+W9YZTOg18+vHMVpeR9tY 52Tw== X-Forwarded-Encrypted: i=1; AJvYcCVbGjJlwAkoV4uf4uAEijjtvCewoLdKNX9+V+WKYrs1acTmX9w8sz7C33JY3v0L/1MxLoh3lcnrdxfsT7YI1Toqr/LlpRtwENeHJ7hwE9Vg X-Gm-Message-State: AOJu0YxZC90pLXsobXst8XFI3ur6Vd8YR8JGW7nyw5in0eMMb7ZCX6FN 3MQY6saFQC4i22qHzPA62OT+LXvns7dhvWHch2cAVb5/sUd9q7Xs X-Google-Smtp-Source: AGHT+IGzYUM3GnISel4DD57OKPNCWzNF0T1Fd0b4gLUiKppMSD2hu6qFDU9hmvCWOlG2Ky/D3Xd3lw== X-Received: by 2002:a05:6a20:2447:b0:1b8:5c3c:794f with SMTP id adf61e73a8af0-1bae7e1133emr13429201637.10.1718698549371; Tue, 18 Jun 2024 01:15:49 -0700 (PDT) Received: from noel.flets-west.jp ([2405:6586:4480:a10:167:9818:d778:5c14]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855f1a1ebsm91883575ad.238.2024.06.18.01.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 01:15:49 -0700 (PDT) From: Hironori KIKUCHI To: linux-kernel@vger.kernel.org Cc: Hironori KIKUCHI , Jagan Teki , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v1 1/3] dt-bindings: display: st7701: Add Anbernic RG28XX panel Date: Tue, 18 Jun 2024 17:15:12 +0900 Message-ID: <20240618081515.1215552-2-kikuchan98@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618081515.1215552-1-kikuchan98@gmail.com> References: <20240618081515.1215552-1-kikuchan98@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The RG28XX panel is a panel specific to the Anbernic RG28XX. It is 2.8 inches in size (diagonally) with a resolution of 480x640. Signed-off-by: Hironori KIKUCHI --- .../display/panel/sitronix,st7701.yaml | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml b/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml index b348f5bf0a9..04f6751ccca 100644 --- a/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml +++ b/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml @@ -22,19 +22,21 @@ description: | allOf: - $ref: panel-common.yaml# + - $ref: /schemas/spi/spi-peripheral-props.yaml# properties: compatible: items: - enum: - anbernic,rg-arc-panel + - anbernic,rg28xx-panel - densitron,dmt028vghmcmi-1a - elida,kd50t048a - techstar,ts8550b - const: sitronix,st7701 reg: - description: DSI virtual channel used by that screen + description: DSI / SPI channel used by that screen maxItems: 1 VCC-supply: @@ -43,6 +45,13 @@ properties: IOVCC-supply: description: I/O system regulator + dc-gpios: + maxItems: 1 + description: | + Controller data/command selection (D/CX) in 4-line SPI mode. + If not set, the controller is in 3-line SPI mode. + No effect for DSI. + port: true reset-gpios: true rotation: true @@ -57,7 +66,7 @@ required: - port - reset-gpios -additionalProperties: false +unevaluatedProperties: false examples: - | @@ -82,3 +91,26 @@ examples: }; }; }; + - | + #include + + spi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "anbernic,rg28xx-panel", "sitronix,st7701"; + reg = <0>; + spi-max-frequency = <3125000>; + VCC-supply = <®_lcd>; + IOVCC-supply = <®_lcd>; + reset-gpios = <&pio 8 14 GPIO_ACTIVE_HIGH>; /* LCD-RST: PI14 */ + backlight = <&backlight>; + + port { + panel_in_rgb: endpoint { + remote-endpoint = <&tcon_lcd0_out_lcd>; + }; + }; + }; + }; From patchwork Tue Jun 18 08:15:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hironori KIKUCHI X-Patchwork-Id: 13701947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A60C7C2BA15 for ; Tue, 18 Jun 2024 08:15:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EDCF610E5CD; Tue, 18 Jun 2024 08:15:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YprzLNYD"; dkim-atps=neutral Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by gabe.freedesktop.org (Postfix) with ESMTPS id C71FA10E5CA for ; Tue, 18 Jun 2024 08:15:53 +0000 (UTC) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1f44b45d6abso39048015ad.0 for ; Tue, 18 Jun 2024 01:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718698553; x=1719303353; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QD1GfKw9SNR3aCxw2m1Eb7xqb4LCyjQ9URCxOhH2S+4=; b=YprzLNYDYExJxnOIAbl74YUxqkBQQVNdXZCSiKUn/KSR9fQ5W6DvtP7iOZvnA4WIyg maNfvw9NTgPL0sHevEYBWpo622fzRKEgDCq5W2gP3dR7mGXIByS+MjXpYbSRIdwguYF2 kYSjFFBoWo+5r2tCRGLFSVVo7eBPmFhUFR0L8BIfpWpZ/YPnA6IzWz4Wp84hulOinWaV VNeSLcCjpya3XCxKeAqwliqoaWXlmKVIf9KPdeYZx4ntxqbhlr6/n12D8vBKV+qcZV+I J4C3lLusk4RwOmek9zpTFL4hhF6IK+Dwvvg7Xn8bVEvYLOSMVH+iE6NoCHigmupyj/Zs ERkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718698553; x=1719303353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QD1GfKw9SNR3aCxw2m1Eb7xqb4LCyjQ9URCxOhH2S+4=; b=MozACK34AE/J/DIV0E52z3i/lmZT66xWEaHVbMgMGJyqV9jMZcW7pFzEgjjbGYufJr ZHGho3RhWUVb2m8UJVtVG2I1p87vdYqJkKBXt7OGH+jVyg+QZWGAQ+fibALP8gZxIM02 NnrXTotYDaiu1VFY4HQ6/r2V2t3t1SayG+VDAlXOsyBOT/0Bc7gU0UkfJv0TTYmkx/80 ww/uUhBQFNL3xRDWFibk42Xb+zz+Bv9ocEZpj3QrLWcJUjegBYE31+t8O3uNeIrlRK8l APuM7XytmoM5tPm3lbrrciBoOzUg/jErSaaBRAEiUKdgk8wS9CP2wYWjZQkVkI3sPWUf nvfQ== X-Forwarded-Encrypted: i=1; AJvYcCXYJpO4ITNDFqG8Ps5DjIaublQOpRjSyE3jFHZCqg+3fPxrm2ykjuFWIVOSNQeoQmiEoCqvHYOwZqXBoGoOgVH8ydVLw1mHIkR2ZMchLsrM X-Gm-Message-State: AOJu0Yx0o3gEkoM55ATy7a02wLsW4+c3QbkB+4C2ZQirmNhTv1j8H2sn xufjI2qwO2ghlU5sJ4Suh3H7KbT11hutBlRWx8d4sGiYEi53sTJm X-Google-Smtp-Source: AGHT+IG9TC/KD0e6xD+FYGIcjwjENiHg6TgflND45V342WU/3qkJFD75wF7dTxbpmYomMIt7s9egqA== X-Received: by 2002:a17:902:ce87:b0:1f7:3d0d:4cd with SMTP id d9443c01a7336-1f8625cf213mr128231965ad.24.1718698553108; Tue, 18 Jun 2024 01:15:53 -0700 (PDT) Received: from noel.flets-west.jp ([2405:6586:4480:a10:167:9818:d778:5c14]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855f1a1ebsm91883575ad.238.2024.06.18.01.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 01:15:52 -0700 (PDT) From: Hironori KIKUCHI To: linux-kernel@vger.kernel.org Cc: Hironori KIKUCHI , Jagan Teki , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v1 2/3] drm/panel: st7701: Add support for SPI for configuration Date: Tue, 18 Jun 2024 17:15:13 +0900 Message-ID: <20240618081515.1215552-3-kikuchan98@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618081515.1215552-1-kikuchan98@gmail.com> References: <20240618081515.1215552-1-kikuchan98@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The ST7701 supports not only MIPI DSI, but also SPI as an interface for configuration. To support a panel connected via RGB parallel interface, add support for SPI using MIPI DBI helpers. Signed-off-by: Hironori KIKUCHI --- drivers/gpu/drm/panel/Kconfig | 2 + drivers/gpu/drm/panel/panel-sitronix-st7701.c | 211 ++++++++++++++---- 2 files changed, 172 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 2ae0eb0638f..1831544400d 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -755,7 +755,9 @@ config DRM_PANEL_SHARP_LS060T1SX01 config DRM_PANEL_SITRONIX_ST7701 tristate "Sitronix ST7701 panel driver" depends on OF + depends on SPI depends on DRM_MIPI_DSI + select DRM_MIPI_DBI depends on BACKLIGHT_CLASS_DEVICE help Say Y here if you want to enable support for the Sitronix diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index 421eb4592b6..3c4a66f2fc7 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -4,6 +4,7 @@ * Author: Jagan Teki */ +#include #include #include #include @@ -14,6 +15,7 @@ #include #include #include +#include #include