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: 175175 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4814930vqy; Thu, 7 Dec 2023 06:22:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4ZYtVrpQ5EljdKOCdjjY2PqI3zTjt2oZ/xVb9+V9RijG04iJ5rVii4TW4EuNurzCACi0y X-Received: by 2002:a17:90b:224b:b0:286:8a9c:6825 with SMTP id hk11-20020a17090b224b00b002868a9c6825mr2372769pjb.12.1701958965083; Thu, 07 Dec 2023 06:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701958965; cv=none; d=google.com; s=arc-20160816; b=J5495WsRTj7XUF2sXN3SYexDEVOjNSyulyYi+xJQcj1SAqslpcQrVb6avNSGVF9dET wdt1TuAe1ce5kfMNsl86ffOptejwX0ute3B2UGPeQY1C8UfC3ImqDhC7AmuYAKey+Ojr qWEi57mCpCbBJxL1VysTZAGYpMZ1DpZMk96HtCJM8UW5VUJBaugqfWbBIYxNG+x2S0MO z7T0VB5KQBnv4yCryQJax5tde/V3ZviqUWAE9Ok2CuFu2sDbKtBEnQPRl+XoJ0xULACh BreC7TyHeGcRVp5PwLtPBWKPCmyQuqBNL0vomfC7RYY5zNCTLOhBe0PfT/Ct+4nBOrIS 2oUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9POmGM8FFxQ0phKiYUCTqq/2h5caBL36ATB9vcbhedE=; fh=y1fXrBUKlqGQCDdSYbtLPaiU6gujiWSXREEDyMsumc0=; b=T1gV4bOgpt0CSrpuxnOehx33EmKAvKR4092J7Y24wactspwSF+GcMfR1KwC+P/umRg uqRTAlAj1JXUKMi2fMuxMbY81QeFEkQ/KuXX5W5wLfCCuPa0f1mJGY2w2EMksKlENTsj UFawU46yyMTGBrNTBOqq7tuRC4UlIDgL5fANwippMI8FIJh+z+ui1sOyhfWc144Dglc0 gj97ArxKEnc53HgjqIEo7v4o/kboE+GF8iCUosEcHZaFzvJPtKbIT8HZ/dVpruxTa5Fe 5bLKR6LDI60pk1sfR6yq/YzSkoblFlqrr/GzEegQIw58cLy2usDTBERJEssZKZ4sZwaU NSKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UB5D7iyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ep15-20020a17090ae64f00b0028656e422f2si1243126pjb.55.2023.12.07.06.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:22:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UB5D7iyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 93891803C965; Thu, 7 Dec 2023 06:22:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443353AbjLGOW0 (ORCPT + 99 others); Thu, 7 Dec 2023 09:22:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443366AbjLGOWB (ORCPT ); Thu, 7 Dec 2023 09:22:01 -0500 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25506273B for ; Thu, 7 Dec 2023 06:17:55 -0800 (PST) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ca0c36f5beso10309771fa.1 for ; Thu, 07 Dec 2023 06:17:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1701958659; x=1702563459; 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=9POmGM8FFxQ0phKiYUCTqq/2h5caBL36ATB9vcbhedE=; b=UB5D7iytgjdf9HTk28WRv6tWXdJfpZVg00OQaQEEFmbMmlocnEYoK27AePWdJL5FVC zUnS0Sg4Q1xS4C4VvWzu7Wtqlsi28ujnBPiPvQWpudRER8C2kTbEWv7zEpG9HZ+RIN/q owuvMQPR+BXzoyKEmVm4BWR6uXzREqqiresYI= 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=UD45zUc8Tl2W4Lj6J6P6NqbEDc8VpMt/TfZDLW4EIzXujCWG15scd+s5OzS5HVGgr+ iDb3UbAF6G0k0l73CHjBvgOn55p/FvUD01E97GrWLgwqVkxFy2Jjk9nGWlumLbP3jV7p URL/bfwZuf9cgGmcq+mKSzHogwUSPe+oMYeAmEZoI0jPjjwHGywk0K/zYW4nJfMG/1td Huw7ejnRIopRXKyGjAsPtBI1amYCkuyE+HKM6vhdmHTgVHsAAmWkHBGDbCxa8WVng2Dn wdL/yBQ4Ucu5zBWMd3jfx0BOSlK7W/3ppTs6T522hMgAlIWJqvwZPBm6+zLgjvzA0Pmx 3dLA== X-Gm-Message-State: AOJu0YyDvQCCUXM29cCRd8A/kIvcwO1rftNxj6WsvdKfZWRw1PkNB46+ FmCY/Ukj6bi+6K+IYJijCyBKF9o5iMRF/zGDEyTb8w== 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 Cc: Amarula patchwork , michael@amarulasolutions.com, Neil Armstrong , Dario Binacchi , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Sam Ravnborg , Thomas Zimmermann , dri-devel@lists.freedesktop.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-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:22:42 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784633323860867671 X-GMAIL-MSGID: 1784633323860867671 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);