From patchwork Wed Apr 26 14:32:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13224648 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 DD1EAC7618E for ; Wed, 26 Apr 2023 14:32:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5575010E96C; Wed, 26 Apr 2023 14:32:37 +0000 (UTC) Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83D8E10E101 for ; Wed, 26 Apr 2023 14:32:26 +0000 (UTC) Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6a5f9c1200eso2825746a34.1 for ; Wed, 26 Apr 2023 07:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682519545; x=1685111545; 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=UKt31LkUOMOVzbhHQr750NfPuXf5xSa7bbIP5o6iHnY=; b=HqJRPRxTaW7AIr+dZKH+gDLLKfN2N9CoFu7K5eZrpfM1aGoJzlA/2DYCSQM/km7PkR yK1ReMSJY7nVFRSGqSR+MH6j/Zx0fN2qdugNq8x05U/f/OAncgSAPTmdt7U/Tcxlb7eU s2j2IEHpXXsq9WqwWoO2BSnBuf+Ek6aTadkC4UL96LBbL7NwtHTjvN1HRo4umLNlK4f0 5Kf5vdbwd4/QRsTU84As9Eyn3DnYbpup00XIr+6udt9wZFnM/qGtj9m7HuM7mGzAdkE2 W3p/a0IFA8jzTiwsbHSS5cxmN9zXmXYp53t1+4CydhzAPU2OlzDeT7rlbSBh0xoi7Hhr WVLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682519545; x=1685111545; 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=UKt31LkUOMOVzbhHQr750NfPuXf5xSa7bbIP5o6iHnY=; b=fepoEE3ypYtIbyTrDCN8uXb+uV2RcEw4KNUGRXhja0kantGRJgjuY3zrCGwGiJ7eiL vCFBt79ws1Kswc1vEzNZRJl2vjkZRsFJT7l+kHti5XVx8ZyyMT2gmcKPg24CWQ+ITqcu vvgdltvlduFzqfp83JW6WiaZaMMuo6R7HyLnyNb4XX+bAkM6SNZctwjTikmz5VY7+LdT nsDdpXMjV5bqKMZy+D4CBzDu9wHEmiivOXjs+OHOxNmSNmCHB4np/665Q/4/fyikhM7K wxBvF+WF62xE3iQIz+MxInhPBC7EMQe5wtUxqVBQAXUN/ZZvgKd6UZvdLqYW5OCRgHYF aTYw== X-Gm-Message-State: AC+VfDyTcrBoG2c9U1JnRmieVONnEOypHdCmMwmUPoDdzkLNeX4qcD9v AhLtYBhosbT5DkllCvmJU3Qwu+MHXBQ= X-Google-Smtp-Source: AKy350blnrnSkBv4NNaSiw762d0pt+rrX5Fu/nYbFtPQ5+qO+0qlRQCWKLLEAATPvhgA/go9W6wTaA== X-Received: by 2002:a05:6870:3310:b0:18e:b155:c418 with SMTP id x16-20020a056870331000b0018eb155c418mr5554086oae.55.1682519545314; Wed, 26 Apr 2023 07:32:25 -0700 (PDT) Received: from localhost.localdomain ([76.244.6.13]) by smtp.gmail.com with ESMTPSA id z18-20020a05683010d200b006a32ba92994sm2613502oto.23.2023.04.26.07.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 07:32:25 -0700 (PDT) From: Chris Morgan To: dri-devel@lists.freedesktop.org Subject: [PATCH V3 1/3] dt-bindings: panel: Add Anbernic RG353V-V2 panel compatible Date: Wed, 26 Apr 2023 09:32:11 -0500 Message-Id: <20230426143213.4178586-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426143213.4178586-1-macroalpha82@gmail.com> References: <20230426143213.4178586-1-macroalpha82@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: , Cc: megous@megous.com, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, agx@sigxcpu.org, Chris Morgan , Krzysztof Kozlowski , robh+dt@kernel.org, sam@ravnborg.org, kernel@puri.sm Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chris Morgan The Anbernic RG353V-V2 panel is a 3.5 inch 640x480 MIPI-DSI LCD panel. It's based on the ST7703 LCD controller just like rocktech,jh057n00900. It's used in a 2nd revision of the Anbernic RG353V handheld gaming device. Like the first revision of the RG353V the control chip is known but the panel itself is unknown, so name it for the device. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Acked-by: Guido Günther --- .../devicetree/bindings/display/panel/rocktech,jh057n00900.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml index 09b5eb7542f8..150e81090af2 100644 --- a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml +++ b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml @@ -20,6 +20,8 @@ allOf: properties: compatible: enum: + # Anberic RG353V-V2 5.0" 640x480 TFT LCD panel + - anbernic,rg353v-panel-v2 # Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel - rocktech,jh057n00900 # Xingbangda XBD599 5.99" 720x1440 TFT LCD panel From patchwork Wed Apr 26 14:32:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13224646 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 0FE31C77B60 for ; Wed, 26 Apr 2023 14:32:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F5B510E4BD; Wed, 26 Apr 2023 14:32:32 +0000 (UTC) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8558210E101 for ; Wed, 26 Apr 2023 14:32:27 +0000 (UTC) Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6a64b5bc7aaso4424275a34.1 for ; Wed, 26 Apr 2023 07:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682519546; x=1685111546; 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=340VE8yyciE0VVNXRcAMeTlRfiO46LMQpmeQ1hUKh7g=; b=UJrS7ew6Y5c+2wzJDLja6RehbZbiME1vU2/NLKU5WkoLvX6WRcRycGBOfeDt3CSQdn Iq4XxcehcrfdoDJSALuQ0esDZ70xwkJge67LXUIuXtan1eipJ1XhbLso+Dkx61SwlCYk +CG105rYwicn9YAGSyH+GqhY3tcy1uMFB7jCtFkLORF9Yur/jLfaD9GEKXhOW3Ts3EZd sG3qPHTWUfktSOkVlzSaNzlfsrX6OdX6A/K8ZvvP7WHbvaGTnrsds126gaKmlOrt1BSX fqhgAtOsGWPMF18QIn9bfrYNEPTnFsLv68eXfc1RB1rEPMjGeQLbatcN7jNgJZ9JoxbQ Ckbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682519546; x=1685111546; 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=340VE8yyciE0VVNXRcAMeTlRfiO46LMQpmeQ1hUKh7g=; b=ipwisdfDkoDFuf9kfKUB8CMbdNTUe2qcE/8IEMQTqRuw2WYzAeJ1oMo52SCFGBGXzE QUcr//2Tla4df4h/fFd2ap57fvPwjHavucIADyIb9JhOsxXVgsCgsISr2/AUkkDfvd3q Gb0DFot27eMeZUxu3xpsrLavFFwzKeHl4C00CONvErDD+gamFVF0TBI7F9WuxvlDGb3O 4+FWPQdvBd31BzSM2fccB6rZxIdhqEJQFrl/fp1B3s0GuKA3Pb9oEfK/2l6bsoOsUuxq q7ay2+wSYl1L3m1igWrRyZAMxGYaW4OtV0Z1zt0i4hLwStCU1AybVHYTazYNpvfLSFvd bJUg== X-Gm-Message-State: AAQBX9dKjF8PI1HasqcvGu1g0TJXHM2Qnwm4fl8+OdfkClfKBOVYeKeW 75vdZUwnY+QQ8tXC2u4JN/Zj5618x1k= X-Google-Smtp-Source: AKy350Z1kM6FryOxsjjecboR7nQFlr53tk49FDbyoz6TRIZdc7AgHCX6l/VN3HYhWClMsv1CORwxWQ== X-Received: by 2002:a9d:7cca:0:b0:6a6:52a4:5e49 with SMTP id r10-20020a9d7cca000000b006a652a45e49mr6231046otn.12.1682519546144; Wed, 26 Apr 2023 07:32:26 -0700 (PDT) Received: from localhost.localdomain ([76.244.6.13]) by smtp.gmail.com with ESMTPSA id z18-20020a05683010d200b006a32ba92994sm2613502oto.23.2023.04.26.07.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 07:32:25 -0700 (PDT) From: Chris Morgan To: dri-devel@lists.freedesktop.org Subject: [PATCH V3 2/3] drm/panel: st7703: Rename CMD_UNKNOWN_C6 to CMD_SETECO Date: Wed, 26 Apr 2023 09:32:12 -0500 Message-Id: <20230426143213.4178586-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426143213.4178586-1-macroalpha82@gmail.com> References: <20230426143213.4178586-1-macroalpha82@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: , Cc: megous@megous.com, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, agx@sigxcpu.org, Chris Morgan , robh+dt@kernel.org, sam@ravnborg.org, kernel@puri.sm Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chris Morgan A later revision of the datasheet for the ST7703 refers to this command as "SETECO". Signed-off-by: Chris Morgan Reviewed-by: Guido Günther --- drivers/gpu/drm/panel/panel-sitronix-st7703.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c index 6747ca237ced..fc55b5fbb67f 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -41,8 +41,8 @@ #define ST7703_CMD_UNKNOWN_BF 0xBF #define ST7703_CMD_SETSCR 0xC0 #define ST7703_CMD_SETPOWER 0xC1 +#define ST7703_CMD_SETECO 0xC6 #define ST7703_CMD_SETPANEL 0xCC -#define ST7703_CMD_UNKNOWN_C6 0xC6 #define ST7703_CMD_SETGAMMA 0xE0 #define ST7703_CMD_SETEQ 0xE3 #define ST7703_CMD_SETGIP1 0xE9 @@ -249,8 +249,7 @@ static int xbd599_init_sequence(struct st7703 *ctx) * ESD_DET_TIME_SEL = 0 frames */); - /* Undocumented command. */ - mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_C6, 0x01, 0x00, 0xFF, 0xFF, 0x00); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETECO, 0x01, 0x00, 0xFF, 0xFF, 0x00); mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER, 0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */ From patchwork Wed Apr 26 14:32:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13224647 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 1A4F7C7618E for ; Wed, 26 Apr 2023 14:32:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2683D10E4D8; Wed, 26 Apr 2023 14:32:33 +0000 (UTC) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 668B510E4BD for ; Wed, 26 Apr 2023 14:32:28 +0000 (UTC) Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6a5ebf9f432so5460551a34.3 for ; Wed, 26 Apr 2023 07:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682519547; x=1685111547; 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=X7dKTPslkvbl866yacFnONC6ojn4tHVdQfSmUuNN064=; b=F28ElpvA3YlFibOSpSjJ9TBv7Jk0qAzep5kNk0L+2/h8pnW4HlkwvjR0p4VQEm/dki Qd0wnycEgJAMl3rz7o57L/lkyvPJ4TwqkEhgt6HQMkUEjn0r+k65AMKgv6lrV1rlLCAy SD03GPu6lLs1Da56HHterPmooA1f1K88jBMopNVNJEOxef0JbsfwkDlDkrcDQOLFnshm mNZSRKlY6IN0pOnayD8SYZzrGUiShDf5Z/NI5AIVVrDaGEZT6pl4/MWGyPTGE54hbNrZ R/9Wb/Q9N1zBihpZ2CjJ3z4Hki+7x0CW1wOTSOPsso/5cvNp2y7x++L1imyxsUAs8XV+ shuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682519547; x=1685111547; 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=X7dKTPslkvbl866yacFnONC6ojn4tHVdQfSmUuNN064=; b=HFqJsediNTZ/iSjSy0FwVQ+tycA8trOmTmzeSX1ix5F4pZp1P47gShO1qmlqZL1xu1 p10G67wWF+QTkMQeJUTRmvfy37zbZJUOVOsHwy0hm1l8MpKgH+wVSIi0LP9MIcCFyp32 uWKLy4z9Ng1UJn6syrw5xmLV7qexIvYKDXAYqUUzG3seYUjZqf4r0K5TX9e1T31KZNLA vAEoMb4wPS7ZNG0iopfVjskQHCKp7WqRjXfU3KquI6bf6GY6Cppo4XdvX8jPWPaIN1u5 BzCd+C4wjOGfblPkDrJ9iQSUuWkZkGnA2b2YFSjighZeYXFfrmTuwjkuPIIQPS48wSdq /sbw== X-Gm-Message-State: AAQBX9fjs6F2UvvV+5GXcaXrvZcsR7sJ6bQGJ8GydGssel2azHClj5wu 5MOro0gLI0VhpetNLqx8B3eJLlZu7LM= X-Google-Smtp-Source: AKy350aaiQaxCUglw1O/q7pw5yp/5p/sPIhFie8GpiXhAaKPO6H2xp7/yOEBT8TAY7AfQfa8Y6FVHg== X-Received: by 2002:a05:6830:1d49:b0:6a6:3e09:4ddd with SMTP id p9-20020a0568301d4900b006a63e094dddmr8867523oth.2.1682519546826; Wed, 26 Apr 2023 07:32:26 -0700 (PDT) Received: from localhost.localdomain ([76.244.6.13]) by smtp.gmail.com with ESMTPSA id z18-20020a05683010d200b006a32ba92994sm2613502oto.23.2023.04.26.07.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 07:32:26 -0700 (PDT) From: Chris Morgan To: dri-devel@lists.freedesktop.org Subject: [PATCH V3 3/3] drm/panel: st7703: Add Anbernic RG353V-V2 Panel Support Date: Wed, 26 Apr 2023 09:32:13 -0500 Message-Id: <20230426143213.4178586-4-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426143213.4178586-1-macroalpha82@gmail.com> References: <20230426143213.4178586-1-macroalpha82@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: , Cc: megous@megous.com, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, agx@sigxcpu.org, Chris Morgan , robh+dt@kernel.org, sam@ravnborg.org, kernel@puri.sm Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chris Morgan The Anbernic RG353V-V2 is a 5 inch panel used in a new revision of the Anbernic RG353V handheld gaming device. Add support for it. Unfortunately it appears this controller is not able to support 120hz or 100hz mode like the first revision panel. Signed-off-by: Chris Morgan Reviewed-by: Guido Günther --- drivers/gpu/drm/panel/panel-sitronix-st7703.c | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c index fc55b5fbb67f..3aa31f3d6157 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -28,6 +28,7 @@ /* Manufacturer specific Commands send via DSI */ #define ST7703_CMD_ALL_PIXEL_OFF 0x22 #define ST7703_CMD_ALL_PIXEL_ON 0x23 +#define ST7703_CMD_SETAPID 0xB1 #define ST7703_CMD_SETDISP 0xB2 #define ST7703_CMD_SETRGBIF 0xB3 #define ST7703_CMD_SETCYC 0xB4 @@ -42,11 +43,14 @@ #define ST7703_CMD_SETSCR 0xC0 #define ST7703_CMD_SETPOWER 0xC1 #define ST7703_CMD_SETECO 0xC6 +#define ST7703_CMD_SETIO 0xC7 +#define ST7703_CMD_SETCABC 0xC8 #define ST7703_CMD_SETPANEL 0xCC #define ST7703_CMD_SETGAMMA 0xE0 #define ST7703_CMD_SETEQ 0xE3 #define ST7703_CMD_SETGIP1 0xE9 #define ST7703_CMD_SETGIP2 0xEA +#define ST7703_CMD_UNKNOWN_EF 0xEF struct st7703 { struct device *dev; @@ -337,6 +341,98 @@ static const struct st7703_panel_desc xbd599_desc = { .init_sequence = xbd599_init_sequence, }; +static int rg353v2_init_sequence(struct st7703 *ctx) +{ + struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); + + /* + * Init sequence was supplied by the panel vendor. + */ + + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC, 0xf1, 0x12, 0x83); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETAPID, 0x00, 0x00, 0x00, + 0xda, 0x80); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0x00, 0x13, 0x70); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF, 0x10, 0x10, 0x28, + 0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22, + 0xf0, 0x63); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05, + 0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x25, 0x00, 0x90, 0x0a, + 0x00, 0x00, 0x01, 0x4f, 0x01, 0x00, 0x00, 0x37); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x47); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_BF, 0x02, 0x11, 0x00); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR, 0x73, 0x73, 0x50, 0x50, + 0x00, 0x00, 0x12, 0x50, 0x00); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER, 0x53, 0xc0, 0x32, + 0x32, 0x77, 0xe1, 0xdd, 0xdd, 0x77, 0x77, 0x33, + 0x33); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETECO, 0x82, 0x00, 0xbf, 0xff, + 0x00, 0xff); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETIO, 0xb8, 0x00, 0x0a, 0x00, + 0x00, 0x00); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCABC, 0x10, 0x40, 0x1e, + 0x02); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0b); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA, 0x00, 0x07, 0x0d, + 0x37, 0x35, 0x3f, 0x41, 0x44, 0x06, 0x0c, 0x0d, + 0x0f, 0x11, 0x10, 0x12, 0x14, 0x1a, 0x00, 0x07, + 0x0d, 0x37, 0x35, 0x3f, 0x41, 0x44, 0x06, 0x0c, + 0x0d, 0x0f, 0x11, 0x10, 0x12, 0x14, 0x1a); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ, 0x07, 0x07, 0x0b, 0x0b, + 0x0b, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, + 0xc0, 0x10); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1, 0xc8, 0x10, 0x02, 0x00, + 0x00, 0xb0, 0xb1, 0x11, 0x31, 0x23, 0x28, 0x80, + 0xb0, 0xb1, 0x27, 0x08, 0x00, 0x04, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, + 0x88, 0x88, 0xba, 0x60, 0x24, 0x08, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0xba, 0x71, 0x35, + 0x18, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2, 0x97, 0x0a, 0x82, 0x02, + 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x81, 0x88, 0xba, 0x17, 0x53, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x80, 0x88, 0xba, 0x06, 0x42, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x23, 0x00, + 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00); + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_EF, 0xff, 0xff, 0x01); + + return 0; +} + +static const struct drm_display_mode rg353v2_mode = { + .hdisplay = 640, + .hsync_start = 640 + 40, + .hsync_end = 640 + 40 + 2, + .htotal = 640 + 40 + 2 + 80, + .vdisplay = 480, + .vsync_start = 480 + 18, + .vsync_end = 480 + 18 + 2, + .vtotal = 480 + 18 + 2 + 28, + .clock = 24150, + .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, + .width_mm = 70, + .height_mm = 57, +}; + +static const struct st7703_panel_desc rg353v2_desc = { + .mode = &rg353v2_mode, + .lanes = 4, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM, + .format = MIPI_DSI_FMT_RGB888, + .init_sequence = rg353v2_init_sequence, +}; + static int st7703_enable(struct drm_panel *panel) { struct st7703 *ctx = panel_to_st7703(panel); @@ -597,6 +693,7 @@ static void st7703_remove(struct mipi_dsi_device *dsi) } static const struct of_device_id st7703_of_match[] = { + { .compatible = "anbernic,rg353v-panel-v2", .data = &rg353v2_desc }, { .compatible = "rocktech,jh057n00900", .data = &jh057n00900_panel_desc }, { .compatible = "xingbangda,xbd599", .data = &xbd599_desc }, { /* sentinel */ }