From patchwork Fri Apr 21 15:43:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2861 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CF1AA3F07F for ; Fri, 21 Apr 2023 17:43:44 +0200 (CEST) Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-2fe3fb8e32asf738634f8f.1 for ; Fri, 21 Apr 2023 08:43:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682091824; cv=pass; d=google.com; s=arc-20160816; b=wmvLTvIGf9XcjB9qvTp856H2H9VKiJTdxiSvdRf3tiKR0PYE0Sbu4xOH9fH288ECUo z61dt7YlI4oXVYT0FZcG3q/xthft2St8MJLOH0QC8drjdCZwS37Xh/eN4p6gycbhZ6B8 rPsOfoHTv0ntLo0Pr4oX22xDxX/MAHL4RqaLOZO+6RU49TpEk2lVioNdjlwTYzxPo7Fr JVHJIDEr9VZXfiu+8066ZahJs5MRWd+7n15s2GrHleB90Ekf9Ss1F4ZOMu1N0azrv1QD 40DJmfQ0PFl/NfN1kbhurKjnHh4TBWRxL/ahrQU79cssORsnS0FdTi58EPLjMWKr8r/6 2+Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3vj1abdtmQOPxJNnEBlo0EqNYYo/V4SZAcIyTpNKzzg=; b=QoM+SXj5DVbBiLW0nWbVTLHnvbmUkGaTH4yNHaZdy7Y2UHcYgPWM+PXxOoCeaqt0IJ cb5HDan/FcMz4FziGvIaws79fst0fRRgR/hrT6UsBRR1FRnNzJbvpJ5AjcJ+c8Q39yn4 OxodkluDggsXOrbq0qyK+V3G2Qju+SJDWGsium1tPYl9S1SNaXop/bq24Zx02sdK9ywa Ubs671uo75jGilYP8S82gJMT2pq1Hni8s22tHhnU0jha1Gd5rwaEXgn0S1mkKR/qPT8S 1V0FTpPUMRps2eLLDbSdM5e9Hr0O8Ox8Im3suvnDDILwQnaiOVEuT9Rx0pAti/FbXaRg YH4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nb+hBMdc; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1682091824; x=1684683824; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=3vj1abdtmQOPxJNnEBlo0EqNYYo/V4SZAcIyTpNKzzg=; b=K6rDDYSBDLhVbFMGYre4f9LhGxg/YR/howagQP50lfR7m6CmuOvPuUc4bjD12cwgCj IdHcne9Kwzf9JBXLqYWIRtTMUfPkyjeOfg6Ln3oSj4m4wVsVYBvuYacgPff45W6DAUJo QXP8os7pcoeGMS3wTH4+XjsBvdH8OTgOsBsms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682091824; x=1684683824; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3vj1abdtmQOPxJNnEBlo0EqNYYo/V4SZAcIyTpNKzzg=; b=EVywxNmFufBpIfdPrbsmIW3BIE535sLMC3xZ5+iMf0NdsLefMPWE6eQdFxiVNeVjpU g3jhKqgtcxx5vWJTuHShCl2C1bONGvEBnCCYeyEy9nGehSnZmvv58FKq5VQSuk9r6jNT V8mI21bJ1jyEPjn6KpTDeWFImE88zD+jOg1IOVsydm11Hx9pK+F7jnsU6vRjcBOys/ly jyyKHwget/UNqGo6zeeIXcLhFkxynTZzKYLsPozTx0T65rZlpESyvo6QD3kpsP3d3dgm t/qpZ2e0BDBXk5pbACjvIBF84NXNTRUxmibxM89mrExamSqMpmwcyEmvcUpXWwZLuIdZ pnNw== X-Gm-Message-State: AAQBX9cOQDwZ4x4vbIbkIGrWtL3l2sadapa22URCQ/yazFx3BtS2S26k 8ngyXr7T/zoX/mJ8IEYPHX3onI45 X-Google-Smtp-Source: AKy350bfLygcitpUuVmEYRmMBzhJvU79TujImtP25VDkG+peXQtgpy60l1kCKyVoZIDtdHbMOZmSuw== X-Received: by 2002:a5d:5232:0:b0:2f7:bf42:6726 with SMTP id i18-20020a5d5232000000b002f7bf426726mr956099wra.7.1682091824403; Fri, 21 Apr 2023 08:43:44 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:6f0f:0:b0:2f8:883:9c9c with SMTP id ay15-20020a5d6f0f000000b002f808839c9cls7742537wrb.0.-pod-prod-gmail; Fri, 21 Apr 2023 08:43:43 -0700 (PDT) X-Received: by 2002:a5d:49c6:0:b0:2f9:9911:93d1 with SMTP id t6-20020a5d49c6000000b002f9991193d1mr4250448wrs.24.1682091822828; Fri, 21 Apr 2023 08:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682091822; cv=none; d=google.com; s=arc-20160816; b=wbP/oR8B45agHj/6287HH6CHIg5Dz4GxkSHxi9/VPPGNiuh6TsjDtKUQcd7NoQ/E90 mqAkJB78l9EYk7ndt/rlnPXHWZrsCf3TgCREnwp71P3tPVupVDD9AUf2Wfz9JccMkcwd /HHvFL8X327MV1PlQwf5XTdLtcpV7U4FQwRD4JYXkXOzjBOItuStRY5K9POys/5u0zq0 YzSCyrzMKlsis3RVe+QAjlkXFvE3TGN934Il+SAm33deKTkwDJ2j8OCCnYXzChv6pyR2 E2gE4iAGTXkE+YnvPOhHyRuZnbFGqGAat3CWDiDk6QIaKbWV58jdYyJd5ozJYEaJVMrK oT/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BW+ZUAXLkCPmnHoH/QEWH9O+WPgZx65WOCCFjz1CHAM=; b=lpSvXYs5jbDpDBZp4RHXkweZf04QyKLLNfeJ8/0U/9SeWJLaS5DEjViG6YpDL/tknP qI7+2xIljUYMC9ZTGSODD3IStglQXTUjqFXouDFRMNntvkf1VXB90hBaef5+xjIMZ+Tj o0ZzP8gZiuKK8R0mjhRX0+1+SQqqTDM6VLciQCYJ5GL1kOBN7ZtxNNeYxxvjIchOUUva +tw36l/HRePs1K3IEx4c0vC4+AoJdVvwtaGxk8jSd70L32dC2/QjLlOBAzjIB46R7mII q8HEPSyBnQDz7RFibm1uooRzgb4P+jM0Qjp6pT+kLBYsN+Wci3okPMSaygIegUyHBS7w ZBiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nb+hBMdc; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id l8-20020a5d6688000000b002fc3015d527sor2051750wru.24.2023.04.21.08.43.42 for (Google Transport Security); Fri, 21 Apr 2023 08:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a5d:6e02:0:b0:2fd:98a8:e800 with SMTP id h2-20020a5d6e02000000b002fd98a8e800mr4176367wrz.7.1682091822487; Fri, 21 Apr 2023 08:43:42 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.. ([37.159.127.129]) by smtp.gmail.com with ESMTPSA id g18-20020a5d5552000000b002e51195a3e2sm4651609wrw.79.2023.04.21.08.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 08:43:41 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: michael@amarulasolutions.com, Amarula patchwork , Dario Binacchi , Daniel Vetter , David Airlie , Sam Ravnborg , Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 7/7] drm/panel: ilitek-ili9805: add support for Tianma TM041XDHG01 panel Date: Fri, 21 Apr 2023 17:43:08 +0200 Message-Id: <20230421154308.527128-8-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230421154308.527128-1-dario.binacchi@amarulasolutions.com> References: <20230421154308.527128-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nb+hBMdc; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Signed-off-by: Dario Binacchi --- 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 749959e10d92..cd187b0b1998 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9805.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9805.c @@ -89,6 +89,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); @@ -239,6 +269,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) { @@ -343,8 +387,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);