From patchwork Thu Dec 7 14:16:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13483350 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 367A2C4167B for ; Thu, 7 Dec 2023 14:17:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D4F210E8A8; Thu, 7 Dec 2023 14:17:48 +0000 (UTC) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEC9110E8D0 for ; Thu, 7 Dec 2023 14:17:40 +0000 (UTC) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ca1e6a94a4so10504551fa.0 for ; Thu, 07 Dec 2023 06:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1701958659; x=1702563459; 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=9POmGM8FFxQ0phKiYUCTqq/2h5caBL36ATB9vcbhedE=; b=QNuQerayP6uH0Qa9DJMSrFyG6iPTlIJhnk/qYEN2DEtzv61/i4L6kM43MXcgg3Di3n 1WRlHXEb9bfFqETuIWyZnJW7RwXH4bXEDBmKAYhSNOdjkD/a6227eFLrLwtKsnyutSwl XuGYWxU+GMeYE24Xadmkd6uxA0t/ih2+iyZl8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701958659; x=1702563459; 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=9POmGM8FFxQ0phKiYUCTqq/2h5caBL36ATB9vcbhedE=; b=fLY3c1REpVfv16BSKs5YLs0UKoCfKL0a+rDF2lCnGClL3rjhlqKiq28mZoX9xKa8sG hsH6I7r2/bPolIoJGuhBNdsWVU3jBKt7eVMKn69qpk8rhk2aCeh6FRKDaPTG1iL+TqDR S3zCDWPVsgobB5Lx6NzcM3ODIrb+ZmRlLiI1a8rsnc3QxfdjKmu5bn1ok3dIgDyC5IuS oveZxXQmV9VZ9a0L/Y/H5s3FWUMVFAEQfmXq7D18kfzzngF+gCSQRZXrbW9MI4Ix0hq2 lqSMqkEkhiqpSoYv9bRcXR/iUyGkUSlAbt3F+I6cJ/89RPsl638QmnQC9Paf63DSt+KS 9nig== X-Gm-Message-State: AOJu0YzQLGJGURsbGAXuwWouktbzzYFk+dRzsZG5qK9H6ywU0xHmS3v+ L+nY6bc+3xYpzWbCNRR3rsambA== X-Google-Smtp-Source: AGHT+IF0rcetHY7XsVlKyJSutTPF8Sf6dQa4iwg2cLSaJcL2XX0czyaRGE7Hi6uTkpbsEI6hj8mR0Q== X-Received: by 2002:a2e:9194:0:b0:2c9:fc3b:da2b with SMTP id f20-20020a2e9194000000b002c9fc3bda2bmr1638701ljg.104.1701958658970; Thu, 07 Dec 2023 06:17:38 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6474:ebbf:9bf:959c:3c66:46c2]) by smtp.gmail.com with ESMTPSA id f24-20020a170906c09800b00a1e814b7155sm885421ejz.62.2023.12.07.06.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:17:38 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Subject: [PATCH v5 09/10] drm/panel: ilitek-ili9805: add support for Tianma TM041XDHG01 panel Date: Thu, 7 Dec 2023 15:16:38 +0100 Message-ID: <20231207141723.108004-10-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231207141723.108004-1-dario.binacchi@amarulasolutions.com> References: <20231207141723.108004-1-dario.binacchi@amarulasolutions.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: Neil Armstrong , Dario Binacchi , Thomas Zimmermann , Sam Ravnborg , Amarula patchwork , Maxime Ripard , dri-devel@lists.freedesktop.org, Jessica Zhang , michael@amarulasolutions.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Michael Trimarchi Tianma TM041XDHG01 utilizes the Ilitek ILI9805 controller. Add this panel's initialzation sequence and timing to ILI9805 driver. Signed-off-by: Michael Trimarchi Reviewed-by: Neil Armstrong Signed-off-by: Dario Binacchi --- (no changes since v4) Changes in v4: - Add Reviewed-by tag of Neil Armstrong drivers/gpu/drm/panel/panel-ilitek-ili9805.c | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9805.c b/drivers/gpu/drm/panel/panel-ilitek-ili9805.c index e36984b46e14..5054d1a2b2f5 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9805.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9805.c @@ -87,6 +87,36 @@ static const struct ili9805_instr gpm1780a0_init[] = { ILI9805_INSTR(0, 0xB9, 0x02, 0x00), }; +static const struct ili9805_instr tm041xdhg01_init[] = { + ILI9805_INSTR(100, ILI9805_EXTCMD_CMD_SET_ENABLE_REG, ILI9805_SETEXTC_PARAMETER1, + ILI9805_SETEXTC_PARAMETER2, ILI9805_SETEXTC_PARAMETER3), + ILI9805_INSTR(100, 0xFD, 0x0F, 0x13, 0x44, 0x00), + ILI9805_INSTR(0, 0xf8, 0x18, 0x02, 0x02, 0x18, 0x02, 0x02, 0x30, 0x01, + 0x01, 0x30, 0x01, 0x01, 0x30, 0x01, 0x01), + ILI9805_INSTR(0, 0xB8, 0x74), + ILI9805_INSTR(0, 0xF1, 0x00), + ILI9805_INSTR(0, 0xF2, 0x00, 0x58, 0x40), + ILI9805_INSTR(0, 0xFC, 0x04, 0x0F, 0x01), + ILI9805_INSTR(0, 0xEB, 0x08, 0x0F), + ILI9805_INSTR(0, 0xe0, 0x01, 0x0d, 0x15, 0x0e, 0x0f, 0x0f, 0x0b, 0x08, 0x04, + 0x07, 0x0a, 0x0d, 0x0c, 0x15, 0x0f, 0x08), + ILI9805_INSTR(0, 0xe1, 0x01, 0x0d, 0x15, 0x0e, 0x0f, 0x0f, 0x0b, 0x08, 0x04, + 0x07, 0x0a, 0x0d, 0x0c, 0x15, 0x0f, 0x08), + ILI9805_INSTR(10, 0xc1, 0x15, 0x03, 0x03, 0x31), + ILI9805_INSTR(10, 0xB1, 0x00, 0x12, 0x14), + ILI9805_INSTR(10, 0xB4, 0x02), + ILI9805_INSTR(0, 0xBB, 0x14, 0x55), + ILI9805_INSTR(0, MIPI_DCS_SET_ADDRESS_MODE, 0x0a), + ILI9805_INSTR(0, MIPI_DCS_SET_PIXEL_FORMAT, 0x77), + ILI9805_INSTR(0, 0x20), + ILI9805_INSTR(0, 0xB0, 0x00), + ILI9805_INSTR(0, 0xB6, 0x01), + ILI9805_INSTR(0, 0xc2, 0x11), + ILI9805_INSTR(0, 0x51, 0xFF), + ILI9805_INSTR(0, 0x53, 0x24), + ILI9805_INSTR(0, 0x55, 0x00), +}; + static inline struct ili9805 *panel_to_ili9805(struct drm_panel *panel) { return container_of(panel, struct ili9805, panel); @@ -227,6 +257,20 @@ static const struct drm_display_mode gpm1780a0_timing = { .vtotal = 480 + 2 + 4 + 10, }; +static const struct drm_display_mode tm041xdhg01_timing = { + .clock = 26227, + + .hdisplay = 480, + .hsync_start = 480 + 10, + .hsync_end = 480 + 10 + 2, + .htotal = 480 + 10 + 2 + 36, + + .vdisplay = 768, + .vsync_start = 768 + 2, + .vsync_end = 768 + 10 + 4, + .vtotal = 768 + 2 + 4 + 10, +}; + static int ili9805_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -331,8 +375,17 @@ static const struct ili9805_desc gpm1780a0_desc = { .height_mm = 65, }; +static const struct ili9805_desc tm041xdhg01_desc = { + .init = tm041xdhg01_init, + .init_length = ARRAY_SIZE(tm041xdhg01_init), + .mode = &tm041xdhg01_timing, + .width_mm = 42, + .height_mm = 96, +}; + static const struct of_device_id ili9805_of_match[] = { { .compatible = "giantplus,gpm1790a0", .data = &gpm1780a0_desc }, + { .compatible = "tianma,tm041xdhg01", .data = &tm041xdhg01_desc }, { } }; MODULE_DEVICE_TABLE(of, ili9805_of_match);