Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp1277429rwb; Sat, 3 Sep 2022 11:59:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR65zr1cNCJlfeJFT9SMchvvUsewi3aShLt8b14bIOj8lxUyrq14xLvW9oJT8SRFpFYBWrpE X-Received: by 2002:a17:902:b58a:b0:16e:f91a:486b with SMTP id a10-20020a170902b58a00b0016ef91a486bmr42572011pls.119.1662231572551; Sat, 03 Sep 2022 11:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662231572; cv=none; d=google.com; s=arc-20160816; b=C/cKOP2PTIYtoGZYYUr+y1AM3bBvmJ9Yv2B6TexcFx/D+Fnopygm+DvkFJ8Q9XRx4m oj32hyIZI5PEtPCKZEkSaodpi4zv9n8MB3siJXvP1sGk82LrXq1x2NhJok1CgROA2YOP k+9bn7LBu3MacKxX8yuxCopKZospTka14DiJ2aeocq/OGpGiIVty/eU1uQ9ODo5aexBI yGxD/t7H0EqPEIVTN/KuO+1FkTa2I+n7SUPJpap7EJ7bV2pTxdxVXU9Cx7KuvqH49gbK 51BANLg9pgdsJk8IXkjx6+4Gun/DPKk0oTMyrgQitNT0oWAbF8F06F4fcIAB93z9oz1U zrXg== 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 :feedback-id:dkim-signature:dkim-signature; bh=Vmp/m2SOSrYeg1NPC14JnXeYfJ66hVvqGFqVu2RV7w0=; b=kBjuHHp3gX+CErit8aSoNvhfGsq1jh4cD104WKOxNoM0OeQPsvYyfk2+ue4wd4FfGb fVUrYiMaSpy8125SaksaXqg+70k1ujYdcrmYq8xLLlqo2ZJ5my+9kb8lYkplYUEQ7gfB E37rQ+IKN7cpplwgTUPb8Ewthbstrz6LmRyaq2NGlMYu0yHEzjfH47RonA1ZNhWnwtcs +jGhL/lOjg+6IHJWt3T7k4n6GJylVvUMYFDgXYNnQ/Fy16480rFk2XmzkU4GEp9Ovh1n jjNwZiyUvOSd/aRZPAACIYVYvUznAhteYKpjE2gEq2fKKfN6dtqft72nf+eY3f1uv7ej Meag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maxfierke.com header.s=fm1 header.b=Rw2WCoLY; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=AXxXI+QQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a63d60c000000b0042a59ebf9ffsi4941115pgg.118.2022.09.03.11.59.21; Sat, 03 Sep 2022 11:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@maxfierke.com header.s=fm1 header.b=Rw2WCoLY; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=AXxXI+QQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232702AbiICSk4 (ORCPT + 99 others); Sat, 3 Sep 2022 14:40:56 -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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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