From patchwork Fri Jun 28 05:10:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hironori KIKUCHI X-Patchwork-Id: 13715436 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 7E464C2BBCA for ; Fri, 28 Jun 2024 05:11:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0619210EBAD; Fri, 28 Jun 2024 05:11:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Nxp0jfD4"; dkim-atps=neutral Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70D4810E1CF for ; Fri, 28 Jun 2024 05:11:03 +0000 (UTC) Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3d561d685e7so158742b6e.1 for ; Thu, 27 Jun 2024 22:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719551462; x=1720156262; 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=JpenRVGjM2ZSkUQ2dBUpd49BSbf2cRRpi0pJzb2v/wA=; b=Nxp0jfD4Rr13s2cEbVdVrhEgvH7mXFyMhMy2KJskJR+q8dUA9Z2kvcK9uT33g9JhPx pcwSE/wao/37dYI6KnA7HlehYOiIm0X0NZ8hxPgxtrsvoBtaooAdHv8zQuF/QKQecYzo OTlKWX1uYnfWkXc/04Q8vyrtaFsMNrxKE8O+8pLxARL7vsmrkWGk56weFSVLy8MHsMjK 2Ne/2YyAqwj96gVb5PX8zDGDzmaTu0+4WruGJTOmdxqm5z9VRN7MWil2TqnwZPtUGDEi 4N53D/hzAaYceaYYre7M6PgUE4Ro0EWQe+bXElCKJ7zP2n6xpbljVDYqmvSOCwalqXBE y8BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719551462; x=1720156262; 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=JpenRVGjM2ZSkUQ2dBUpd49BSbf2cRRpi0pJzb2v/wA=; b=OVl9fBq8uYS2I6DRL3e/YxU/h+P9mxD3a/irozMF1xZ7h78xU2y+ZpBIZKti/z/Bug U5Jk7SVQSd1reAaEdCcJpONI2Jmp+ZvZv9ymvWbxy31UWmypD3A1BW9WFoUk0jqhhQjk xWIdfW8q1M7eNxBr9yPDsV/30zkFcb3pKNau7/ZVQgusB6lCEiYaQqGg46qlMFHq+kwa Hkx692vzPCKjuTzhz3fpADQdggytPOYcfhLuHgqWKBtfmNXXodZd/IqP9RDG5IV8uhPE gCmrqYDDhqXysdrCjjXE7lBgOkKb1nYZYabDP8Ueqh+iflUGTwyhkM5ZypFCTLk+XdTn CLlw== X-Forwarded-Encrypted: i=1; AJvYcCXkP8JHFK0u38aWesgwNDWDbkPlY6+qY5XUx/5CRth3ILQcAqVEVxcUW5nnQ9eRynOBdftWerTQ0w9AWt3Yo8UvAt3fR/RmYCDzF51uHRDG X-Gm-Message-State: AOJu0YxkOQc5mkNPuBpbzftwe5fB4s+Ek16+VngPJ5AjdXmT78AJ2gCK 0JEuN8nrJPRFrkRcaNCCIJ2ILSi5Z8fYGKJjFRNuV3XqMKttGjNL X-Google-Smtp-Source: AGHT+IEx8bqjf6+huD46hE7EYOhNRkSCa7gQ7/NJzyrFgBjzYsCqxdHOWw/F7oJT2+64neV07mk8Tg== X-Received: by 2002:a05:6808:1b26:b0:3d2:1759:7db1 with SMTP id 5614622812f47-3d54594bcbamr18842835b6e.10.1719551462153; Thu, 27 Jun 2024 22:11:02 -0700 (PDT) Received: from noel.flets-west.jp ([2405:6586:4480:a10:167:9818:d778:5c14]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70804893e4bsm624716b3a.184.2024.06.27.22.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 22:11:01 -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 v2 1/3] dt-bindings: display: st7701: Add Anbernic RG28XX panel Date: Fri, 28 Jun 2024 14:10:15 +0900 Message-ID: <20240628051019.975172-2-kikuchan98@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240628051019.975172-1-kikuchan98@gmail.com> References: <20240628051019.975172-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 display panel of the Anbernic RG28XX, a handheld gaming device from Anbernic. It is 2.8 inches in size (diagonally) with a resolution of 480x640. This panel is driven by a variant of the ST7701 driver IC internally, confirmed by dumping and analyzing its BSP initialization sequence by using a logic analyzer. It is very similar to the existing densitron,dmt028vghmcmi-1a panel, but differs in some unknown register values, so add a new entry for the panel to distinguish them. Additionally, the panel is connected via SPI instead of MIPI DSI. So add and modify for SPI as well. Signed-off-by: Hironori KIKUCHI --- .../display/panel/sitronix,st7701.yaml | 69 +++++++++++++++++-- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml b/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml index b348f5bf0a9..835ea436531 100644 --- a/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml +++ b/Documentation/devicetree/bindings/display/panel/sitronix,st7701.yaml @@ -20,21 +20,19 @@ description: | Densitron DMT028VGHMCMI-1A is 480x640, 2-lane MIPI DSI LCD panel which has built-in ST7701 chip. -allOf: - - $ref: panel-common.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 +41,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. + Disallowed for DSI. + port: true reset-gpios: true rotation: true @@ -57,7 +62,38 @@ required: - port - reset-gpios -additionalProperties: false +allOf: + - $ref: panel-common.yaml# + - if: + properties: + compatible: + contains: + # SPI connected panels + enum: + - anbernic,rg28xx-panel + then: + $ref: /schemas/spi/spi-peripheral-props.yaml + + - if: + properties: + compatible: + not: + contains: + # DSI or SPI without D/CX pin + enum: + - anbernic,rg-arc-panel + - anbernic,rg28xx-panel + - densitron,dmt028vghmcmi-1a + - elida,kd50t048a + - techstar,ts8550b + then: + required: + - dc-gpios + else: + properties: + dc-gpios: false + +unevaluatedProperties: false examples: - | @@ -82,3 +118,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 Fri Jun 28 05:10:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hironori KIKUCHI X-Patchwork-Id: 13715438 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 8166BC30659 for ; Fri, 28 Jun 2024 05:11:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B96110EBAF; Fri, 28 Jun 2024 05:11:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fx9Sb7Hp"; dkim-atps=neutral Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id A5FB910E1CF for ; Fri, 28 Jun 2024 05:11:07 +0000 (UTC) Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3c9b94951cfso130473b6e.3 for ; Thu, 27 Jun 2024 22:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719551467; x=1720156267; 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=rZ+bU2UDYgJ51ntk3R6TV2myBGVBSFhrOCUZiKRxthM=; b=fx9Sb7Hput6EF4jvsjZdJ/dRRQI/oX+OY7CkO9cBG5X4oZ5YXU3OGE9knLAhoFgK9Q EvrsRxbMWVKgxHZK1DE7M15NpaDgZYnXDozdWArqCvUoEW712+Yp0x2ayLDmzJxhnaA4 GlGZBugUmqziwgbL0kzHZi+AcRAVZmEcap9R/727payeb43ts4x08AN7jyt/ytWh2h98 HyFTC8hSKRvNogyduUzlizeb6x/F7OlqzPY1T82IuHGXpad/glaeen8mhAfeedgpt52D IMOl0hRR2UV2x4zPia954qe30ljOixgHoxNNab3d3FJXlDztOJ8tECnf6WOGF+ksOq+3 1kQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719551467; x=1720156267; 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=rZ+bU2UDYgJ51ntk3R6TV2myBGVBSFhrOCUZiKRxthM=; b=dehS8T5ua6tRdwOCQWKCJHcylMyhXvdgfpk91kAbUv6citTv47Wt3dLk5hZe9Dk5dr 4hGIyr7yZQEUF0A8HysXF3G7DUrpzvdMKkOLfNwqUlYB6irmQnLSemueWKYhKr/WJlB3 y5eNTHjxoJZEj+pkfUD0oYUA0xyUaw6ShSZctLeHKhjsDep2zc6PTy/l3qj/gIV6gEX7 4WDTFThtCo/198Ouajv2yx18N2iE0z6/lefmYdtddDHOSuECmKJsewNo3aTZBkWSyJ9G pHBRhsNbyuKhEXdyonT3htHww/Cr0htfi9HvZ9PhexFneqo1piwU7B1/GazBfTE3E2/A assg== X-Forwarded-Encrypted: i=1; AJvYcCW4sr9NEDtebmasHE1dJJWsyogKNgvfu/uNMun5kdiPWf5Jr/I312LeoWvM+vpzgvS6v96GoK6Eq9oFSa3huQlFn1xxl9ybgYqaqu+bGxlQ X-Gm-Message-State: AOJu0YyYoldsbPrLd5glLVT8UOObm/W1YdM77i8cSp5fus+xfAdbETlX CP+Wp1P8NHDAb5NUds4FGV7ObqAG82OTAYC6gPzOOVhVKrSOqrbQ X-Google-Smtp-Source: AGHT+IH7KlcPQVtZgfMTp6xRpAKYjQRztijvVFpnYAmnq1YuNqBZjg54ppPtBDFjGzxgnEnU9sYUHg== X-Received: by 2002:a05:6808:23cb:b0:3d5:5cd4:5a20 with SMTP id 5614622812f47-3d55cd45b2bmr10816253b6e.19.1719551466349; Thu, 27 Jun 2024 22:11:06 -0700 (PDT) Received: from noel.flets-west.jp ([2405:6586:4480:a10:167:9818:d778:5c14]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70804893e4bsm624716b3a.184.2024.06.27.22.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 22:11:05 -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 v2 2/3] drm/panel: st7701: Add support for SPI for configuration Date: Fri, 28 Jun 2024 14:10:16 +0900 Message-ID: <20240628051019.975172-3-kikuchan98@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240628051019.975172-1-kikuchan98@gmail.com> References: <20240628051019.975172-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 SPI with an 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 | 923 ++++++++++-------- 2 files changed, 517 insertions(+), 408 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..07980f010bb 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,79 +15,80 @@ #include #include #include +#include #include