From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BA46ECAAD5 for ; Sat, 3 Sep 2022 18:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232815AbiICSlB (ORCPT ); Sat, 3 Sep 2022 14:41:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232026AbiICSkg (ORCPT ); Sat, 3 Sep 2022 14:40:36 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AF9725283; Sat, 3 Sep 2022 11:40:34 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5AF885C0102; Sat, 3 Sep 2022 14:40:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 03 Sep 2022 14:40:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maxfierke.com; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1662230433; x= 1662316833; bh=Vmp/m2SOSrYeg1NPC14JnXeYfJ66hVvqGFqVu2RV7w0=; b=R w2WCoLYRY3mg2hmeqyG5sFx20wyf1rVAbU/4jBUikeGyUYwdpFdr5WiC6Xigxqni NUvfFPAfSd5+dN267dzwVfrpwNQdlvm5bdLm1b+QxRCXLkCAleHsOZJKkwJVmIbp pciYrHiQurzsXM93csP4/s1G0+sAYDGyj/By4Gw4F3cKkzA9/FU6t2w/pjxDcztY dfyNf/hryROfm65b9zZ/lLYDJPZjmhv2MfI3cjdkPn6ln56VJIoKt037Z85Ad9Zo o85DmZ+/KkaHe/1MBJJDvV5lI9bWHFUE5DH43LySNvYBqr9/6ANfa9XYCQa2JFrK aa8W69HnQTQzLMS88KnaQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1662230433; x=1662316833; bh=Vmp/m2SOSrYeg 1NPC14JnXeYfJ66hVvqGFqVu2RV7w0=; b=AXxXI+QQyVMjU/Q8K3rmx2R44iq4j c2nU7yQtjb4/vgelsL3p2En93c+Ul+K7WeXLqDznDNwEKAUrqTiLobFDQuOIqxc1 2VMpyk8WUlRSfWnJrY2wiKNsJDOv4QZ1rAX9/lXIxItLJwHe6uKPkGaEVwCH6KOe 7GSmPN178D8SD0TJkpujix9xjDllOst3v2smzprtn2dldlUAUje7MhciOA620Qsk lG74Di+p25mxxJVIi7GjWrqxQqnGKHUYJ9wwBwF3D14iBDGjWd2qKHsEW5WT5hqa lQ2oEwqIFNJklKW6kDJbueVjwkqKoWKuQUYrv5GuWelhXi5B/xQyjao2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdelvddgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestd ekredtredttdenucfhrhhomhepofgrgicuhfhivghrkhgvuceomhgrgiesmhgrgihfihgv rhhkvgdrtghomheqnecuggftrfgrthhtvghrnhepjeelkeeluddtieegheduvdetudejie dvfeevkeeuhedvueeuudefueetfeefvedvnecuffhomhgrihhnpehgihhthhhusgdrtgho mhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igsehmrgigfhhivghrkhgvrdgtohhm X-ME-Proxy: Feedback-ID: idee9475d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 3 Sep 2022 14:40:32 -0400 (EDT) From: Max Fierke To: thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Max Fierke Subject: [PATCH v2 3/4] drm: panel: Add driver for ClockworkPi cwd686 panel Date: Sat, 3 Sep 2022 13:37:52 -0500 Message-Id: <20220903183753.25736-4-max@maxfierke.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220903183753.25736-1-max@maxfierke.com> References: <20220903183753.25736-1-max@maxfierke.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ClockworkPi DevTerm (all models) uses a 6.86" IPS display of unknown provenance, which uses the Chipone ICNL9707 IC driver. The display panel I have has two model numbers: TXW686001 and WTL068601G, but cannot find any manufacturer associated with either, so opting for the ClockworkPi model number. This driver is based on the GPL-licensed driver released by ClockworkPi, authored by Pinfan Zhu, with some additional cleanup, rotation support, and display sleep re-enabling done by me. Original driver here for reference: https://github.com/clockworkpi/DevTerm/blob/main/Code/patch/armbian_build_a06/patch/kernel-004-panel.patch Display IC datasheet provided here: https://github.com/clockworkpi/DevTerm/blob/main/Schematics/ICNL9707_Datasheet.pdf Signed-off-by: Max Fierke --- Changes in v2: (Sam Ravnborg's suggestions) - remove some unused properties from definition (e.g. enable_gpio, supply) - add missing regulators - reorder includes - remove redundant ctx->backlight in favor of backlight through drm_panel_of_backlight - remove now-unneeded ctx->enabled and enable/disable hooks - replace ICNL9707_DCS macro with mipi_dsi_dcs_write_seq - use dev_err_probe instead of checking EPROBE_DEFER - fixed return type of cwd686_remove to be void following changes to mipi_dsi_driver drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-clockworkpi-cwd686.c | 445 ++++++++++++++++++ 3 files changed, 458 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 584a69f99af6..a93c697867f9 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -68,6 +68,18 @@ config DRM_PANEL_BOE_TV101WUM_NL6 Say Y here if you want to support for BOE TV101WUM and AUO KD101N80 45NA WUXGA PANEL DSI Video Mode panel +config DRM_PANEL_CLOCKWORKPI_CWD686 + tristate "ClockworkPi CWD686 panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for the ClockworkPi CWD686 + ICNL9707-based panel, e.g. as used within the ClockworkPi DevTerm. + The panel has a 480x1280 resolution and uses 24 bit RGB per pixel. + + To compile this driver as a module, choose M here. + config DRM_PANEL_DSI_CM tristate "Generic DSI command mode panels" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 34e717382dbb..6c3ed2acaa6b 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596) += panel-asus-z00t-tm5p5-n35596. obj-$(CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0) += panel-boe-bf060y8m-aj0.o obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o +obj-$(CONFIG_DRM_PANEL_CLOCKWORKPI_CWD686) += panel-clockworkpi-cwd686.o obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o diff --git a/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c b/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c new file mode 100644 index 000000000000..87d20d784596 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c @@ -0,0 +1,445 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2021 Clockwork Tech LLC + * Copyright (c) 2021-2022 Max Fierke + * + * Based on Pinfan Zhu's work on panel-cwd686.c for ClockworkPi's 5.10 BSP + */ + +#include +#include +#include +#include +#include + +#include