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 787E8C6FA82 for ; Sun, 18 Sep 2022 03:44:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbiIRDos (ORCPT ); Sat, 17 Sep 2022 23:44:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiIRDof (ORCPT ); Sat, 17 Sep 2022 23:44:35 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A9FDC04; Sat, 17 Sep 2022 20:44:33 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 094DF32009A1; Sat, 17 Sep 2022 23:44:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 17 Sep 2022 23:44:32 -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=fm2; t=1663472671; x= 1663559071; bh=WJEEJfSNbdBAJEMqOdqwQyCDj6VXhdsd7pte4aCp22A=; b=4 Y2CPAIK2lXngjg/ZgV/zWTSEXXmjQINUfL8ylCDIxiyMu9416AdHZYgt0zNo5omy HEc0iF1PgEC0uswyfOdtgLFWGPk5UQe+XxxyVphSLE2T18A/EC22zBITBFNU+LyI XmE8daTgYpYiNhkBP+sEjiajpQm4+RswrcLtfKnu+gWlN+JzH/y0+bLS/ctsdw2t MayUqien4E+kHZyuaJhfqZkmcM0qGD6RflOrw3k3pgimsHcTf8aWhvFAf1wfgCnp bdRaULTOLMuYazuP4CHFM2Ds3aWHFB4ycrXMdLhxN05GVwp/COjcOcqvvniYP2N1 9QAM6KaVphpN8IJv+2qkw== 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=fm2; t=1663472671; x=1663559071; bh=WJEEJfSNbdBAJ EMqOdqwQyCDj6VXhdsd7pte4aCp22A=; b=1Zn7LoVVlPNrgHBY4dlhr6Q0EiNtF 20VQafhRkfLaOmC7wrurYeHjg4K+enHe8S5GHVWYl6lG766KR5Ko5dKWiKA1X0Pc kA/4RFLSnWJOybvQSYsJcYmWrFbFE8PJ/V1hIcj12CU4JhzdlvUTcRwYLNPfbRnY Ghp+EE4KZFNTmfovmIO75li6YEsKb6Is6tMcypGxUhdqKZm+zQjFqTPQDD2EO0oA svTdpuoJ1WS8TZcj75GzCgTphpOuP5n5ipo/OggGC2h6JwFqX/pVAJ3JSbbtGPcT E3JX9tNwaoS0yp4E826zxueu1hGYF4gQyxR8isAnp+humm9w0jfeXrAaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvfedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeforgigucfhihgvrhhkvgcuoehmrgigsehmrgigfhhivghr khgvrdgtohhmqeenucggtffrrghtthgvrhhnpeejleekledutdeigeehuddvtedujeeivd efveekueehvdeuuedufeeuteeffeevvdenucffohhmrghinhepghhithhhuhgsrdgtohhm necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgi esmhgrgihfihgvrhhkvgdrtghomh X-ME-Proxy: Feedback-ID: idee9475d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 17 Sep 2022 23:44:30 -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 v3 3/4] drm: panel: Add driver for ClockworkPi cwd686 panel Date: Sat, 17 Sep 2022 22:44:14 -0500 Message-Id: <20220918034415.74641-4-max@maxfierke.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220918034415.74641-1-max@maxfierke.com> References: <20220918034415.74641-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 v3: - no changes 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 a582ddd583c2..e6b3d4f091f9 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