Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1015227rwb; Sat, 17 Sep 2022 21:48:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JwbljdwMnBtbMi2/6YQPEFhijiofZQAyq3/I8c7uPMLMZxMNZISBGV0UrQw8oB1sncp7J X-Received: by 2002:a17:907:2d88:b0:781:44ff:443f with SMTP id gt8-20020a1709072d8800b0078144ff443fmr210301ejc.358.1663476494916; Sat, 17 Sep 2022 21:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663476494; cv=none; d=google.com; s=arc-20160816; b=dIX53X8NjuaZyWqJO7AdZGiQHWCZ5NdbRMIiOU5CDg9SQ/BhZxzvEx1IF4zrXuDlO4 fCWSOVzL8x8rwqCpNfZ6ISuZ1j41iMaMi5LyCnRPq/13MOMAQtI1YaV5Pj9HFZWkA4S/ a3omv523il1nPKF43HK0Sz1gdEUWFtO8wpXJkNVn5Q0E7f8YqjD4vbXfcqLs1sbAvhWs b2FiQYHAQZBaoLidf0QKfHyQxdddEctGu7d/iyK9D5D+/c8J1toLmFzaP+HfpmUseebH DSh2AfodfB6eC30iY+UVtOwtwCuy6wZlZ42naKgj4tpDek+YsLhCnWRB6eEGTinbvrpW 0Mjw== 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=WJEEJfSNbdBAJEMqOdqwQyCDj6VXhdsd7pte4aCp22A=; b=ncC/oYmW+tp/edw8FJW4ALZqUoP3DTFpT0yX7F/kZiXZXfwjYxsMnnvhCSpChfuT56 J1w7XoRfRBz748V8ukbApp/EbnWNYsXQl/bdhEmYxAFCh680JGcuQX/f85TdZVmiZ9qD l8wegWy6Bh/47kIpBsO0AmdLe9/lpJJgQp5G0uSEdFzcv44k7dR6/qthM5yvGORBo3B4 PbAUPUixSc3CtQSZXgcnA0qngOHGKPexNNJmIOavxZi+YcKEoriFruiRqRcV9pdpRyBH jbpP2cErwmfzoyN+U+hPMmdSDFsgT1gSHqt9jWQcjfWrvNGo/+SNVyp1SG/GV5+F8mvj YT4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maxfierke.com header.s=fm2 header.b=4Y2CPAIK; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=1Zn7LoVV; 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 q20-20020a170906b29400b007313bdfb98bsi13518604ejz.18.2022.09.17.21.47.48; Sat, 17 Sep 2022 21:48:14 -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=fm2 header.b=4Y2CPAIK; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=1Zn7LoVV; 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 S229628AbiIRDor (ORCPT + 99 others); Sat, 17 Sep 2022 23:44:47 -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 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,SPF_HELO_PASS, SPF_PASS 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 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