From patchwork Fri Dec 29 13:51:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 183913 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2580114dyb; Fri, 29 Dec 2023 05:54:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBMEt405jsJ5TrXBHqgeC3kKktfD0o0kRMllq1WENUNzSj8UwgHJMfziqqt8/aFA0/nZXl X-Received: by 2002:a17:906:100c:b0:a27:45a2:e5f5 with SMTP id 12-20020a170906100c00b00a2745a2e5f5mr1093839ejm.258.1703858074874; Fri, 29 Dec 2023 05:54:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703858074; cv=none; d=google.com; s=arc-20160816; b=G1hKoEI6hbBanuMsLdvM8AcgxGD+vHNJ8vX36YPgaALDAqz4vVoDkPeFPfDyjsBrbZ vhJnTiTxlEMPlmhwsvn4EijeLXAgZRpXCFecj43Imo2Xzq4h4vTHvmifhKPBlbZ564ML lmTwB84Tu0bn2eZYVdPjWfZjtLg2c10jeeSy8FylGAk7csgpKUJVGVsMoKg5Gsj+uq/Y Z0dLCN7AYHYC/pA6h4tjWxEi39tb91wQmd7tF4+/eZIIjujfiDVvmVNk0y8HJ7XRyC7f yhHEzQzw5VnfA335K8tmODho6YlXqfDB7e5D+Eq7BmkCCEl48pQzV6fQDxwdszgRzodB Nceg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=I04AycXU2gthDovU4fhTPLpGwaRhcBOoWll3dN0DmSw=; fh=LxW2lm9EXaAAWVYvTkRHJEwtDqo5+5rTSh+cuVdTysw=; b=b7SR17cxpX4uE5VS3jdojplqCH03kQrGZt9hPka7/KsEkXaXlnvd13xOC7DVl4FYnf SvLNyDueHvoEyqa2kTevpMI44cLUvw1Yi/AyQrbT1kwbmG1c8aIUOzJY/rGBmasK5PSx iGE8CAsxLghI7Xq7rDChYr7qry/+BnS8Ufoga5IT4vVLPU5EncJBvCBWrOUigYS4VEMp prK+O8K93F2TsU6Gqq+otTeg1OwY9/gho5Jt7UNqjOxbIs7z5ILEvuqnrciBgEYQcvWm vtYxzmpdNPo0bxz1RG1GuVmChWJA5h46bVODjsXBZl5gY49HHB+Vmkrws5r8tQOtjaVt Dc4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="CFfUtJ/W"; spf=pass (google.com: domain of linux-kernel+bounces-13113-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13113-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z4-20020a1709063a0400b00a268888de48si7747455eje.443.2023.12.29.05.54.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 05:54:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13113-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="CFfUtJ/W"; spf=pass (google.com: domain of linux-kernel+bounces-13113-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13113-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 43B241F21F39 for ; Fri, 29 Dec 2023 13:54:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F9F711738; Fri, 29 Dec 2023 13:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="CFfUtJ/W" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6206D134A9 for ; Fri, 29 Dec 2023 13:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2ccebd0377fso9287371fa.3 for ; Fri, 29 Dec 2023 05:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1703857949; x=1704462749; darn=vger.kernel.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=I04AycXU2gthDovU4fhTPLpGwaRhcBOoWll3dN0DmSw=; b=CFfUtJ/WP6Yl21Yn9J7mNsctuMeS7Mk8+AMzKP4/Q3Ap1JFStnfBnAK3ibgoHQj1vA BgGkgYTYF1YGK8bHv4+1ZAHLp/bMGNuivxRA/ozG0lFbOob+YGXrQMHNr85vgoHRTKyF MQSiu+VsZRE80Kst4ujygQnsc55v8sRHgv0Q0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703857949; x=1704462749; 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=I04AycXU2gthDovU4fhTPLpGwaRhcBOoWll3dN0DmSw=; b=bBEtKFMeQhe5LTahgFYlQ5VPuTxjyvv6tP2JbiVxEND+s1n/bDrEH6R8Y9D1/WCsbb HRj+XDOqyndlwQdhjXklq2UgVdhzK3x8e4kPlVmbV03s2BnWxXfSmfLxpoaMCyUYDc/j 2ABzetZuzV4RXPmrAm0MsqM2/mlIdVcJ2+9ZbSKOK+flZyhTd2zdp2UitbB34ogd3Ke8 HgNgjooU3qLxjyVNy15XeeYajYhNgbzkwFXhpMhV8SL97BxTfrpOE1F84PQkrU/i5j/5 mcVxMP3UiCYjAIf48ke5GGXjhOwiUUBhfxPpKCcmKSFiiyxLZ19czNDmj0/SKSK+zzwE 8ocQ== X-Gm-Message-State: AOJu0YwndEbWm1xtzgGUfvmEcDSYJv91A2ZcoWlLyWnDj5+4Qa3A1Izz VNhIugj1jfvveJps4s1Fqbh+xc9j9qf5RQckO7L1z4P/Q9o= X-Received: by 2002:a2e:3c19:0:b0:2cc:df53:5309 with SMTP id j25-20020a2e3c19000000b002ccdf535309mr798204lja.91.1703857949279; Fri, 29 Dec 2023 05:52:29 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-49-57-70.retail.telecomitalia.it. [79.49.57.70]) by smtp.gmail.com with ESMTPSA id i16-20020aa7c710000000b00553b243b1a8sm11019160edq.92.2023.12.29.05.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 05:52:28 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Alexandre Torgue , Dario Binacchi , Daniel Vetter , David Airlie , Jessica Zhang , Linus Walleij , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Sam Ravnborg , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: [PATCH 8/8] drm/panel: nt35510: support FRIDA FRD400B25025-A-CTK Date: Fri, 29 Dec 2023 14:51:23 +0100 Message-ID: <20231229135154.675946-9-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231229135154.675946-1-dario.binacchi@amarulasolutions.com> References: <20231229135154.675946-1-dario.binacchi@amarulasolutions.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786624684725458694 X-GMAIL-MSGID: 1786624684725458694 The initialization commands are taken from the STMicroelectronics driver found at https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Drivers/BSP/Components/nt35510/ Signed-off-by: Dario Binacchi --- drivers/gpu/drm/panel/panel-novatek-nt35510.c | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c index 2a5a624fe447..3cdcc75c4c76 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Novatek NT35510 panel driver + * Copyright (C) 2023 Dario Binacchi + * Add support to Frida FRD400B25025-A-CTK panel. + * Based on code by MCD Application Team (C) 2020 STMicroelectronics * Copyright (C) 2020 Linus Walleij * Based on code by Robert Teather (C) 2012 Samsung * @@ -165,6 +168,49 @@ static const struct panel_init_cmd hydis_hva40wv1_init_cmds[] = { {}, }; +static const struct panel_init_cmd frida_frd400b25025_init_cmds[] = { + _INIT_DCS_CMD(0xF0, 0x55, 0xAA, 0x52, 0x08, 0x01), + _INIT_DCS_CMD(0xB0, 0x03, 0x03, 0x03), + _INIT_DCS_CMD(0xB6, 0x46, 0x46, 0x46), + _INIT_DCS_CMD(0xB1, 0x03, 0x03, 0x03), + _INIT_DCS_CMD(0xB7, 0x36, 0x36, 0x36), + _INIT_DCS_CMD(0xB2, 0x00, 0x00, 0x02), + _INIT_DCS_CMD(0xB8, 0x26, 0x26, 0x26), + _INIT_DCS_CMD(0xBF, 0x01), + _INIT_DCS_CMD(0xB3, 0x09, 0x09, 0x09), + _INIT_DCS_CMD(0xB9, 0x36, 0x36, 0x36), + _INIT_DCS_CMD(0xB5, 0x08, 0x08, 0x08), + _INIT_DCS_CMD(0xBA, 0x26, 0x26, 0x26), + _INIT_DCS_CMD(0xBC, 0x00, 0x80, 0x00), + _INIT_DCS_CMD(0xBD, 0x00, 0x80, 0x00), + _INIT_DCS_CMD(0xBE, 0x00, 0x50), + _INIT_DCS_CMD(0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00), + _INIT_DCS_CMD(0xB1, 0xFC, 0x00), + _INIT_DCS_CMD(0xB6, 0x03), + _INIT_DCS_CMD(0xB5, 0x50), + _INIT_DCS_CMD(0xB7, 0x00, 0x00), + _INIT_DCS_CMD(0xB8, 0x01, 0x02, 0x02, 0x02), + _INIT_DCS_CMD(0xBC, 0x00, 0x00, 0x00), + _INIT_DCS_CMD(0xCC, 0x03, 0x00, 0x00), + _INIT_DCS_CMD(0xBA, 0x01), + _INIT_DCS_CMD(0x35, 0x00), + _INIT_DCS_CMD(0x3A, 0x77), + _INIT_DELAY_CMD(0xC8), + _INIT_DCS_CMD(0x36, 0x00), + _INIT_DCS_CMD(0x2A, 0x00, 0x00, 0x01, 0xDF), + _INIT_DCS_CMD(0x2B, 0x00, 0x00, 0x03, 0x1F), + _INIT_DCS_CMD(0x11), + _INIT_DELAY_CMD(0x78), + _INIT_DCS_CMD(0x3A, 0x77), + _INIT_DCS_CMD(0x51, 0x7F, 0x00), + _INIT_DCS_CMD(0x53, 0x2C), + _INIT_DCS_CMD(0x55, 0x02), + _INIT_DCS_CMD(0x5E, 0xFF), + _INIT_DCS_CMD(0x29), + _INIT_DCS_CMD(0x2C), + {}, +}; + /** * struct nt35510 - state container for the NT35510 panel */ @@ -606,7 +652,36 @@ static const struct nt35510_config nt35510_hydis_hva40wv1 = { .init_cmds = hydis_hva40wv1_init_cmds, }; +/* + * The Frida FRD400B25025-A-CTK panel + */ +static const struct nt35510_config nt35510_frida_frd400b25025 = { + .width_mm = 52, + .height_mm = 86, + .mode = { + .clock = 23000, + .hdisplay = 480, + .hsync_start = 480 + 34, /* HFP = 34 */ + .hsync_end = 480 + 34 + 2, /* HSync = 2 */ + .htotal = 480 + 34 + 2 + 34, /* HBP = 34 */ + .vdisplay = 800, + .vsync_start = 800 + 15, /* VFP = 15 */ + .vsync_end = 800 + 15 + 12, /* VSync = 12 */ + .vtotal = 800 + 15 + 12 + 15, /* VBP = 15 */ + .flags = 0, + }, + .lanes = 2, + .format = MIPI_DSI_FMT_RGB888, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_LPM, + .init_cmds = frida_frd400b25025_init_cmds, +}; + static const struct of_device_id nt35510_of_match[] = { + { + .compatible = "frida,frd400b25025", + .data = &nt35510_frida_frd400b25025, + }, { .compatible = "hydis,hva40wv1", .data = &nt35510_hydis_hva40wv1,