From patchwork Tue Apr 8 15:27:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 14043228 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 26743C369A2 for ; Tue, 8 Apr 2025 15:47:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 475BB10E6E5; Tue, 8 Apr 2025 15:47:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="UlgbwyNm"; dkim-atps=neutral Received: from mslow3.mail.gandi.net (mslow3.mail.gandi.net [217.70.178.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6DD0110E6E1 for ; Tue, 8 Apr 2025 15:47:03 +0000 (UTC) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by mslow3.mail.gandi.net (Postfix) with ESMTP id B5219580E9F for ; Tue, 8 Apr 2025 15:27:06 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id AE7E843291; Tue, 8 Apr 2025 15:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744126024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b5PsY8isH+UjJ+MTxXst2noiDEN9q4jOAnmVDjsyuK8=; b=UlgbwyNmvvnklgknEmVfg3W7VwujEMBrRRgaRs4C2cV469sNy/iZ7cTl4LpPMK1GMalfZw VwaVn7+68Xax4VDzeXxQzC3fZ6rZEUMFky02GKOy0EbRnvk+5lzNAEb32m14dSwaJEhwSZ jyzlCU3wAy+USiAgZN3Hkw+0kGgo0k+4MKfF60i5QUYqFqo96rsld/mkuYpkA2MWGkAMh/ 6/B1nBdH9KWbFiFJFnJ3QXzkR3QkhJ/YUXPumL/pr6f/izNrHZILx+FCNy1qIGdjWNPfoD ija50DgpzedZkJ+Bi6MLAQCMIF6uNEQ/rn9C1CXyYGs8Uf91wG0zEsT/8ZpDFg== From: Kory Maincent Date: Tue, 08 Apr 2025 17:27:00 +0200 Subject: [PATCH 1/4] dt-bindings: display: panel: ili9881c: Add dsi-lanes property MIME-Version: 1.0 Message-Id: <20250408-feature_sfto340xc-v1-1-f303d1b9a996@bootlin.com> References: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> In-Reply-To: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kory Maincent X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdefgeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeevgfdvgfektefgfefggeekudfggffhtdfffedtueetheejtddvledvvdelhedtveenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeduhedprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheptghonhhorhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrhhiphgrrhgusehkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvl hdrohhrghdprhgtphhtthhopegrihhrlhhivggusehgmhgrihhlrdgtohhmpdhrtghpthhtohepqhhuihgtpghjvghsshiihhgrnhesqhhuihgtihhntgdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: kory.maincent@bootlin.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add the dsi-lanes property to specify the number of DSI lanes used by the panel. This allows configuring the panel for either two, three or four lanes. Signed-off-by: Kory Maincent --- Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml index baf5dfe5f5ebdd92f460a78d0e56e1b45e7dd323..e36550616f6aac86c79832a48132ce8c11ebcf7a 100644 --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml @@ -27,6 +27,11 @@ properties: reg: maxItems: 1 + dsi-lanes: + description: Number of DSI lanes to be used must be <2>, <3> or <4> + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [2, 3, 4] + backlight: true power-supply: true reset-gpios: true From patchwork Tue Apr 8 15:27:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 14043227 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 540C9C369A4 for ; Tue, 8 Apr 2025 15:47:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BDD7910E6E1; Tue, 8 Apr 2025 15:47:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="AOI1r6d7"; dkim-atps=neutral Received: from mslow3.mail.gandi.net (mslow3.mail.gandi.net [217.70.178.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6DD6910E6E4 for ; Tue, 8 Apr 2025 15:47:03 +0000 (UTC) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by mslow3.mail.gandi.net (Postfix) with ESMTP id 034545803CA for ; Tue, 8 Apr 2025 15:27:06 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7940E442C3; Tue, 8 Apr 2025 15:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744126025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q5lFIEycGK+k4tLFyO/zn/JPfNG0fz/9HAV5+pyxxxk=; b=AOI1r6d722aPUJIH+Vjy1dAEt3UDgmiag9ht68hEHaDml3OCEPd1D9920R9ICF2RlhhPH7 Lxxb11rcUafNIN91J+39wyQX6es9itTrKBCgIZ1pU9PvcJDlBuCKPeSH/O5w+dnxnhOWkj zwCewGCgIIrO/KaTRKWI/pApSQ6f3MjC6w47vGmzqdWt0fEqtcHr4xL695XPZjNjNAav7x cA/5qn3BrGmdNM77srSn+3+29EPbKClkSH0lkdXzOt+wpUuvaWjgPGYCaj7kD9PDeFLuZE B9LXPEJFtSb4KhHw2+k7taTbYmThsbM/RvN6QCIYJehWZX2JkJKhQm/sg6GrJA== From: Kory Maincent Date: Tue, 08 Apr 2025 17:27:01 +0200 Subject: [PATCH 2/4] drm/panel: ilitek-ili9881c: Add support for two-lane configuration MIME-Version: 1.0 Message-Id: <20250408-feature_sfto340xc-v1-2-f303d1b9a996@bootlin.com> References: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> In-Reply-To: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kory Maincent X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdefgeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeevgfdvgfektefgfefggeekudfggffhtdfffedtueetheejtddvledvvdelhedtveenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeduhedprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheptghonhhorhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrhhiphgrrhgusehkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvl hdrohhrghdprhgtphhtthhopegrihhrlhhivggusehgmhgrihhlrdgtohhmpdhrtghpthhtohepqhhuihgtpghjvghsshiihhgrnhesqhhuihgtihhntgdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: kory.maincent@bootlin.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Enable support for two-lane configuration which is done by setting the LANSEL_SW_EN and LANSEL_SW bits in the Pad Control register. Use the dsi-lanes device tree parameter to configure the number of lanes. The default configuration remains set to four lanes. Signed-off-by: Kory Maincent --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 35 +++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 28cd7560e5db1d5734b10babdb4e4e553c6e07d0..5c429715159755df2461063dad0971642e2b9041 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -1263,6 +1263,21 @@ static int ili9881c_send_cmd_data(struct ili9881c *ctx, u8 cmd, u8 data) return 0; } +static int ili9881c_set_lanes_cfg(struct ili9881c *ctx) +{ + int ret; + + if (ctx->dsi->lanes != 2) + /* Nothing to do */ + return 0; + + ret = ili9881c_switch_page(ctx, 1); + if (ret) + return ret; + + return ili9881c_send_cmd_data(ctx, 0xB7, 0x3); +} + static int ili9881c_prepare(struct drm_panel *panel) { struct ili9881c *ctx = panel_to_ili9881c(panel); @@ -1295,6 +1310,10 @@ static int ili9881c_prepare(struct drm_panel *panel) return ret; } + ret = ili9881c_set_lanes_cfg(ctx); + if (ret) + return ret; + ret = ili9881c_switch_page(ctx, 0); if (ret) return ret; @@ -1504,7 +1523,7 @@ static const struct drm_panel_funcs ili9881c_funcs = { static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) { struct ili9881c *ctx; - int ret; + int ret, lanes; ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) @@ -1545,11 +1564,23 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) if (ret) return ret; + ret = of_property_read_u32(dsi->dev.of_node, "dsi-lanes", &lanes); + if (ret == -EINVAL) { + lanes = 4; + } else if (ret) { + dev_err(&dsi->dev, "Failed to get dsi-lanes property (%d)\n", + ret); + return ret; + } else if (lanes < 2 || 4 < lanes) { + dev_err(&dsi->dev, "Wrong number of dsi-lanes (%d)\n", lanes); + return -EINVAL; + } + drm_panel_add(&ctx->panel); dsi->mode_flags = ctx->desc->mode_flags; dsi->format = MIPI_DSI_FMT_RGB888; - dsi->lanes = 4; + dsi->lanes = lanes; return mipi_dsi_attach(dsi); } From patchwork Tue Apr 8 15:27:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 14043229 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 70769C369A4 for ; Tue, 8 Apr 2025 15:47:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9FAD10E6DD; Tue, 8 Apr 2025 15:47:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="HpizRBVA"; dkim-atps=neutral Received: from mslow3.mail.gandi.net (mslow3.mail.gandi.net [217.70.178.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E0DB10E6E7 for ; Tue, 8 Apr 2025 15:47:03 +0000 (UTC) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by mslow3.mail.gandi.net (Postfix) with ESMTP id A3655581678 for ; Tue, 8 Apr 2025 15:27:07 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 45C49443C7; Tue, 8 Apr 2025 15:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744126025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rcXfDagnWGodjrLY8rm4oGEwQluwSkfRo86/Yikyi58=; b=HpizRBVA5L/ws3FIlFwztlMaHrGEErygckVcKcBfR+r1cxzp3LKLsc10Fy4iwXovCXsAuN C/n4lKCYkrunmwBVukXFSdoHesWk6M8CA1NSQyD94NvnGJ+YQFi1VPPAGZgrZ8RMoVh3VU o7P93LgQDnxuHKN9ZiJid7oi28LEzHUAWLQI8J9rSnPTusI0W8/JQ21hgby4ZSmIesIrzc JuYQ6oFS9oZlpZO4M1WGi841OeLfSzutlWyWeXiXvQsajsuAI/bX0whGM9rELy+PiZJaSo QcEOJVwMSC97lEfStuNjAg6RT3J3nT5yLj4kXodDb4aLkXxWCNG37uN/h0YiXg== From: Kory Maincent Date: Tue, 08 Apr 2025 17:27:02 +0200 Subject: [PATCH 3/4] dt-bindings: ili9881c: Add Saef SFTO340XC support MIME-Version: 1.0 Message-Id: <20250408-feature_sfto340xc-v1-3-f303d1b9a996@bootlin.com> References: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> In-Reply-To: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kory Maincent X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdefgeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeevgfdvgfektefgfefggeekudfggffhtdfffedtueetheejtddvledvvdelhedtveenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeduhedprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheptghonhhorhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrhhiphgrrhgusehkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvl hdrohhrghdprhgtphhtthhopegrihhrlhhivggusehgmhgrihhlrdgtohhmpdhrtghpthhtohepqhhuihgtpghjvghsshiihhgrnhesqhhuihgtihhntgdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: kory.maincent@bootlin.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Document the compatible value for Saef SFTO340XC panels. Signed-off-by: Kory Maincent Acked-by: Conor Dooley --- Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml index e36550616f6aac86c79832a48132ce8c11ebcf7a..7e47564cf1f18a9ea9e64deded7a7edbff133406 100644 --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml @@ -19,6 +19,7 @@ properties: - ampire,am8001280g - bananapi,lhr050h41 - feixin,k101-im2byl02 + - saef,sfto340xc - startek,kd050hdfia020 - tdo,tl050hdv35 - wanchanglong,w552946aba From patchwork Tue Apr 8 15:27:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 14043226 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 DE144C369A2 for ; Tue, 8 Apr 2025 15:47:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 492D510E6DF; Tue, 8 Apr 2025 15:47:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="gpPYVBdA"; dkim-atps=neutral Received: from mslow3.mail.gandi.net (mslow3.mail.gandi.net [217.70.178.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D27110E6DF for ; Tue, 8 Apr 2025 15:47:03 +0000 (UTC) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by mslow3.mail.gandi.net (Postfix) with ESMTP id 231C658110C for ; Tue, 8 Apr 2025 15:27:08 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0DF7D443CC; Tue, 8 Apr 2025 15:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744126026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F/5v60gJJHkMrEag5xzAucStc/MoeQ+6IzPW3ZUFp7k=; b=gpPYVBdAgZo42CAaw6AxTofq9dqOGOtS9TxJrX/PeM1znlmX6P92+vO4L3A58TlGZj0zkw 6oIuRpBjDvA4GGp5gW/awXT2+X+iH6a8x15JvU7Va1ZhLGz/46K45zg2MHIY/REJnTf0yV V/RiJAsLZdh7VY+Z8LiFAsAVOK+YJ0Jga/VDNyg4bROhL/f7UEOVHyXB+4Vzp2amKK/OEl WNW+eN9He4P53uf1iYlzGiitKtWXM8M3yDnBPzHimbtKzTXa4smWF5/b9vWlPToTzEPnJa GkIgO3GSkUjQUdILTOuiNy59PDlv4jxQDNb1LTKBg3pQdQlP0b3jnLMMQ1O+0w== From: Kory Maincent Date: Tue, 08 Apr 2025 17:27:03 +0200 Subject: [PATCH 4/4] drm: panel: Add Saef SFTO340XC LCD panel MIME-Version: 1.0 Message-Id: <20250408-feature_sfto340xc-v1-4-f303d1b9a996@bootlin.com> References: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> In-Reply-To: <20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kory Maincent X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdefgeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeevgfdvgfektefgfefggeekudfggffhtdfffedtueetheejtddvledvvdelhedtveenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeduhedprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheptghonhhorhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrhhiphgrrhgusehkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvl hdrohhrghdprhgtphhtthhopegrihhrlhhivggusehgmhgrihhlrdgtohhmpdhrtghpthhtohepqhhuihgtpghjvghsshiihhgrnhesqhhuihgtihhntgdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: kory.maincent@bootlin.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add support for Saef Technology Limited SFTO340XC LCD panel. Signed-off-by: Kory Maincent --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 232 ++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 5c429715159755df2461063dad0971642e2b9041..8ea837ff3f7ad1f4b8ba5f2e9f50472a16afcbae 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -43,6 +43,7 @@ struct ili9881c_desc { const struct drm_display_mode *mode; const unsigned long mode_flags; u8 default_address_mode; + const unsigned int msleep_delay; }; struct ili9881c { @@ -457,6 +458,207 @@ static const struct ili9881c_instr k101_im2byl02_init[] = { ILI9881C_COMMAND_INSTR(0xD3, 0x3F), /* VN0 */ }; +static const struct ili9881c_instr sfto340xc_init[] = { + ILI9881C_SWITCH_PAGE_INSTR(3), + ILI9881C_COMMAND_INSTR(0x01, 0x00), + ILI9881C_COMMAND_INSTR(0x02, 0x01), + ILI9881C_COMMAND_INSTR(0x03, 0x73), + ILI9881C_COMMAND_INSTR(0x04, 0x03), + ILI9881C_COMMAND_INSTR(0x05, 0x00), + ILI9881C_COMMAND_INSTR(0x06, 0x0A), + ILI9881C_COMMAND_INSTR(0x07, 0x05), + ILI9881C_COMMAND_INSTR(0x08, 0x00), + ILI9881C_COMMAND_INSTR(0x09, 0x40), + ILI9881C_COMMAND_INSTR(0x0a, 0x00), + ILI9881C_COMMAND_INSTR(0x0B, 0x00), + ILI9881C_COMMAND_INSTR(0x0C, 0x00), + ILI9881C_COMMAND_INSTR(0x0D, 0x40), + ILI9881C_COMMAND_INSTR(0x0E, 0x00), + ILI9881C_COMMAND_INSTR(0x0f, 0x3c), + ILI9881C_COMMAND_INSTR(0x10, 0x3c), + ILI9881C_COMMAND_INSTR(0x11, 0x00), + ILI9881C_COMMAND_INSTR(0x12, 0x00), + ILI9881C_COMMAND_INSTR(0x13, 0x00), + ILI9881C_COMMAND_INSTR(0x14, 0x00), + ILI9881C_COMMAND_INSTR(0x15, 0x00), + ILI9881C_COMMAND_INSTR(0x16, 0x00), + ILI9881C_COMMAND_INSTR(0x17, 0x00), + ILI9881C_COMMAND_INSTR(0x18, 0x00), + ILI9881C_COMMAND_INSTR(0x19, 0x00), + ILI9881C_COMMAND_INSTR(0x1A, 0x00), + ILI9881C_COMMAND_INSTR(0x1B, 0x00), + ILI9881C_COMMAND_INSTR(0x1C, 0x00), + ILI9881C_COMMAND_INSTR(0x1D, 0x00), + ILI9881C_COMMAND_INSTR(0x1E, 0xC0), + ILI9881C_COMMAND_INSTR(0x1F, 0x80), + ILI9881C_COMMAND_INSTR(0x20, 0x06), + ILI9881C_COMMAND_INSTR(0x21, 0x01), + ILI9881C_COMMAND_INSTR(0x22, 0x00), + ILI9881C_COMMAND_INSTR(0x23, 0x00), + ILI9881C_COMMAND_INSTR(0x24, 0x00), + ILI9881C_COMMAND_INSTR(0x25, 0x00), + ILI9881C_COMMAND_INSTR(0x26, 0x00), + ILI9881C_COMMAND_INSTR(0x27, 0x00), + ILI9881C_COMMAND_INSTR(0x28, 0xB3), + ILI9881C_COMMAND_INSTR(0x29, 0x03), + ILI9881C_COMMAND_INSTR(0x2A, 0x00), + ILI9881C_COMMAND_INSTR(0x2B, 0x00), + ILI9881C_COMMAND_INSTR(0x2C, 0x00), + ILI9881C_COMMAND_INSTR(0x2D, 0x00), + ILI9881C_COMMAND_INSTR(0x2E, 0x00), + ILI9881C_COMMAND_INSTR(0x2F, 0x00), + ILI9881C_COMMAND_INSTR(0x30, 0x00), + ILI9881C_COMMAND_INSTR(0x31, 0x00), + ILI9881C_COMMAND_INSTR(0x32, 0x00), + ILI9881C_COMMAND_INSTR(0x33, 0x00), + ILI9881C_COMMAND_INSTR(0x34, 0x23), + ILI9881C_COMMAND_INSTR(0x35, 0x00), + ILI9881C_COMMAND_INSTR(0x36, 0x00), + ILI9881C_COMMAND_INSTR(0x37, 0x08), + ILI9881C_COMMAND_INSTR(0x38, 0x3C), + ILI9881C_COMMAND_INSTR(0x39, 0x00), + ILI9881C_COMMAND_INSTR(0x3A, 0x00), + ILI9881C_COMMAND_INSTR(0x3B, 0x00), + ILI9881C_COMMAND_INSTR(0x3C, 0x00), + ILI9881C_COMMAND_INSTR(0x3D, 0x00), + ILI9881C_COMMAND_INSTR(0x3E, 0x00), + ILI9881C_COMMAND_INSTR(0x3F, 0x00), + ILI9881C_COMMAND_INSTR(0x40, 0x00), + ILI9881C_COMMAND_INSTR(0x41, 0x00), + ILI9881C_COMMAND_INSTR(0x42, 0x00), + ILI9881C_COMMAND_INSTR(0x43, 0x00), + ILI9881C_COMMAND_INSTR(0x44, 0x00), + ILI9881C_COMMAND_INSTR(0x50, 0x01), + ILI9881C_COMMAND_INSTR(0x51, 0x23), + ILI9881C_COMMAND_INSTR(0x52, 0x44), + ILI9881C_COMMAND_INSTR(0x53, 0x67), + ILI9881C_COMMAND_INSTR(0x54, 0x89), + ILI9881C_COMMAND_INSTR(0x55, 0xAB), + ILI9881C_COMMAND_INSTR(0x56, 0x01), + ILI9881C_COMMAND_INSTR(0x57, 0x23), + ILI9881C_COMMAND_INSTR(0x58, 0x45), + ILI9881C_COMMAND_INSTR(0x59, 0x67), + ILI9881C_COMMAND_INSTR(0x5A, 0x89), + ILI9881C_COMMAND_INSTR(0x5B, 0xAB), + ILI9881C_COMMAND_INSTR(0x5C, 0xCD), + ILI9881C_COMMAND_INSTR(0x5D, 0xEF), + ILI9881C_COMMAND_INSTR(0x5E, 0x01), + ILI9881C_COMMAND_INSTR(0x5F, 0x00), + ILI9881C_COMMAND_INSTR(0x60, 0x00), + ILI9881C_COMMAND_INSTR(0x61, 0x01), + ILI9881C_COMMAND_INSTR(0x62, 0x01), + ILI9881C_COMMAND_INSTR(0x63, 0x08), + ILI9881C_COMMAND_INSTR(0x64, 0x0E), + ILI9881C_COMMAND_INSTR(0x65, 0x0E), + ILI9881C_COMMAND_INSTR(0x66, 0x0F), + ILI9881C_COMMAND_INSTR(0x67, 0x0F), + ILI9881C_COMMAND_INSTR(0x68, 0x0C), + ILI9881C_COMMAND_INSTR(0x69, 0x0C), + ILI9881C_COMMAND_INSTR(0x6A, 0x0D), + ILI9881C_COMMAND_INSTR(0x6B, 0x0D), + ILI9881C_COMMAND_INSTR(0x6C, 0x02), + ILI9881C_COMMAND_INSTR(0x6D, 0x02), + ILI9881C_COMMAND_INSTR(0x6E, 0x14), + ILI9881C_COMMAND_INSTR(0x6F, 0x14), + ILI9881C_COMMAND_INSTR(0x70, 0x15), + ILI9881C_COMMAND_INSTR(0x71, 0x15), + ILI9881C_COMMAND_INSTR(0x72, 0x06), + ILI9881C_COMMAND_INSTR(0x73, 0x07), + ILI9881C_COMMAND_INSTR(0x74, 0x02), + ILI9881C_COMMAND_INSTR(0x75, 0x00), + ILI9881C_COMMAND_INSTR(0x76, 0x00), + ILI9881C_COMMAND_INSTR(0x77, 0x01), + ILI9881C_COMMAND_INSTR(0x78, 0x01), + ILI9881C_COMMAND_INSTR(0x79, 0x08), + ILI9881C_COMMAND_INSTR(0x7A, 0x0D), + ILI9881C_COMMAND_INSTR(0x7B, 0x0D), + ILI9881C_COMMAND_INSTR(0x7C, 0x0C), + ILI9881C_COMMAND_INSTR(0x7D, 0x0C), + ILI9881C_COMMAND_INSTR(0x7E, 0x0F), + ILI9881C_COMMAND_INSTR(0x7F, 0x0F), + ILI9881C_COMMAND_INSTR(0x80, 0x0E), + ILI9881C_COMMAND_INSTR(0x81, 0x0E), + ILI9881C_COMMAND_INSTR(0x82, 0x02), + ILI9881C_COMMAND_INSTR(0x83, 0x02), + ILI9881C_COMMAND_INSTR(0x84, 0x14), + ILI9881C_COMMAND_INSTR(0x85, 0x14), + ILI9881C_COMMAND_INSTR(0x86, 0x15), + ILI9881C_COMMAND_INSTR(0x87, 0x15), + ILI9881C_COMMAND_INSTR(0x88, 0x07), + ILI9881C_COMMAND_INSTR(0x89, 0x06), + ILI9881C_COMMAND_INSTR(0x8A, 0x02), + ILI9881C_SWITCH_PAGE_INSTR(4), + ILI9881C_COMMAND_INSTR(0x6C, 0x15), + ILI9881C_COMMAND_INSTR(0x6E, 0x1a), + ILI9881C_COMMAND_INSTR(0x6F, 0x35), + ILI9881C_COMMAND_INSTR(0x8D, 0x1f), + ILI9881C_COMMAND_INSTR(0x87, 0xBA), + ILI9881C_COMMAND_INSTR(0x26, 0x76), + ILI9881C_COMMAND_INSTR(0xB2, 0xD1), + ILI9881C_COMMAND_INSTR(0x3B, 0x98), + ILI9881C_COMMAND_INSTR(0x3A, 0x24), + ILI9881C_COMMAND_INSTR(0x35, 0x1F), + ILI9881C_COMMAND_INSTR(0xB5, 0x27), + ILI9881C_COMMAND_INSTR(0x31, 0x75), + ILI9881C_COMMAND_INSTR(0x30, 0x03), + ILI9881C_COMMAND_INSTR(0x33, 0x14), + ILI9881C_COMMAND_INSTR(0x38, 0x01), + ILI9881C_COMMAND_INSTR(0x39, 0x00), + ILI9881C_SWITCH_PAGE_INSTR(1), + ILI9881C_COMMAND_INSTR(0x22, 0x0a), + ILI9881C_COMMAND_INSTR(0x2E, 0x50), + ILI9881C_COMMAND_INSTR(0x2F, 0x00), + ILI9881C_COMMAND_INSTR(0x31, 0x00), + ILI9881C_COMMAND_INSTR(0x53, 0x4a), + ILI9881C_COMMAND_INSTR(0x55, 0x65), + ILI9881C_COMMAND_INSTR(0x50, 0xbf), + ILI9881C_COMMAND_INSTR(0x51, 0xbf), + ILI9881C_COMMAND_INSTR(0x60, 0x14), + ILI9881C_COMMAND_INSTR(0x61, 0x00), + ILI9881C_COMMAND_INSTR(0x62, 0x20), + ILI9881C_COMMAND_INSTR(0x63, 0x10), + ILI9881C_COMMAND_INSTR(0xA0, 0x04), + ILI9881C_COMMAND_INSTR(0xA1, 0x39), + ILI9881C_COMMAND_INSTR(0xA2, 0x48), + ILI9881C_COMMAND_INSTR(0xA3, 0x13), + ILI9881C_COMMAND_INSTR(0xA4, 0x17), + ILI9881C_COMMAND_INSTR(0xA5, 0x29), + ILI9881C_COMMAND_INSTR(0xA6, 0x1c), + ILI9881C_COMMAND_INSTR(0xA7, 0x1d), + ILI9881C_COMMAND_INSTR(0xA8, 0xbb), + ILI9881C_COMMAND_INSTR(0xA9, 0x16), + ILI9881C_COMMAND_INSTR(0xAA, 0x24), + ILI9881C_COMMAND_INSTR(0xAB, 0x9e), + ILI9881C_COMMAND_INSTR(0xAC, 0x16), + ILI9881C_COMMAND_INSTR(0xAD, 0x14), + ILI9881C_COMMAND_INSTR(0xAE, 0x48), + ILI9881C_COMMAND_INSTR(0xAF, 0x1c), + ILI9881C_COMMAND_INSTR(0xB0, 0x22), + ILI9881C_COMMAND_INSTR(0xB1, 0x51), + ILI9881C_COMMAND_INSTR(0xB2, 0x60), + ILI9881C_COMMAND_INSTR(0xB3, 0x32), + ILI9881C_COMMAND_INSTR(0xC0, 0x04), + ILI9881C_COMMAND_INSTR(0xC1, 0x39), + ILI9881C_COMMAND_INSTR(0xC2, 0x48), + ILI9881C_COMMAND_INSTR(0xC3, 0x13), + ILI9881C_COMMAND_INSTR(0xC4, 0x17), + ILI9881C_COMMAND_INSTR(0xC5, 0x29), + ILI9881C_COMMAND_INSTR(0xC6, 0x1c), + ILI9881C_COMMAND_INSTR(0xC7, 0x1d), + ILI9881C_COMMAND_INSTR(0xC8, 0xbb), + ILI9881C_COMMAND_INSTR(0xC9, 0x16), + ILI9881C_COMMAND_INSTR(0xCA, 0x24), + ILI9881C_COMMAND_INSTR(0xCB, 0x9e), + ILI9881C_COMMAND_INSTR(0xCC, 0x16), + ILI9881C_COMMAND_INSTR(0xCD, 0x14), + ILI9881C_COMMAND_INSTR(0xCE, 0x48), + ILI9881C_COMMAND_INSTR(0xCF, 0x1c), + ILI9881C_COMMAND_INSTR(0xD0, 0x22), + ILI9881C_COMMAND_INSTR(0xD1, 0x51), + ILI9881C_COMMAND_INSTR(0xD2, 0x60), + ILI9881C_COMMAND_INSTR(0xD3, 0x32), +}; + static const struct ili9881c_instr kd050hdfia020_init[] = { ILI9881C_SWITCH_PAGE_INSTR(3), ILI9881C_COMMAND_INSTR(0x01, 0x00), @@ -1334,6 +1536,9 @@ static int ili9881c_prepare(struct drm_panel *panel) if (ret) return ret; + if (ctx->desc->msleep_delay) + msleep(ctx->desc->msleep_delay); + return 0; } @@ -1400,6 +1605,23 @@ static const struct drm_display_mode k101_im2byl02_default_mode = { .height_mm = 217, }; +static const struct drm_display_mode sfto340xc_default_mode = { + .clock = 34000, + + .hdisplay = 800, + .hsync_start = 800 + 10, + .hsync_end = 800 + 10 + 5, + .htotal = 800 + 10 + 5 + 10, + + .vdisplay = 800, + .vsync_start = 800 + 10, + .vsync_end = 800 + 10 + 5, + .vtotal = 800 + 10 + 5 + 10, + + .width_mm = 87, + .height_mm = 87, +}; + static const struct drm_display_mode kd050hdfia020_default_mode = { .clock = 62000, @@ -1607,6 +1829,15 @@ static const struct ili9881c_desc k101_im2byl02_desc = { .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE, }; +static const struct ili9881c_desc sfto340xc_desc = { + .init = sfto340xc_init, + .init_length = ARRAY_SIZE(sfto340xc_init), + .mode = &sfto340xc_default_mode, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS, + .msleep_delay = 100, +}; + static const struct ili9881c_desc kd050hdfia020_desc = { .init = kd050hdfia020_init, .init_length = ARRAY_SIZE(kd050hdfia020_init), @@ -1643,6 +1874,7 @@ static const struct ili9881c_desc am8001280g_desc = { static const struct of_device_id ili9881c_of_match[] = { { .compatible = "bananapi,lhr050h41", .data = &lhr050h41_desc }, { .compatible = "feixin,k101-im2byl02", .data = &k101_im2byl02_desc }, + { .compatible = "saef,sfto340xc", .data = &sfto340xc_desc }, { .compatible = "startek,kd050hdfia020", .data = &kd050hdfia020_desc }, { .compatible = "tdo,tl050hdv35", .data = &tl050hdv35_desc }, { .compatible = "wanchanglong,w552946aba", .data = &w552946aba_desc },