From patchwork Fri Dec 6 07:45:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Han X-Patchwork-Id: 11275753 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81CCB14BD for ; Fri, 6 Dec 2019 08:18:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6A1402467A for ; Fri, 6 Dec 2019 08:18:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A1402467A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE7DD6F987; Fri, 6 Dec 2019 08:17:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7697A6EA21 for ; Fri, 6 Dec 2019 07:46:12 +0000 (UTC) Received: by mail-pj1-x1044.google.com with SMTP id o11so2388351pjp.9 for ; Thu, 05 Dec 2019 23:46:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rFcNN77nLDaE7mPcrOF+qBbMMDJjTFiy2iEDowiCNHU=; b=IIOhktCakeOzgokcICv/iCndnlazHzOd2VqBKxgUb0kGshJx0M6bFav1mBAVtcSbMW hKV6UazyGdRTzg1mgFFSwX/uWU3I4xE4a052kfyD7e1DsdXzzmnHUU3eXRArQc2iEmu2 BsaLC7mFxcwRZxDkJpnctgB6F3MlGoplKeR58rWcjdis1G+eCP+Y3SgCEvj920xVLQgQ gqMQoHkmJJd/jm0GBYZI3xjWiNDb737+CdaVKjNQfZXwpP64tLn+xfMYP/6ixGC7pCc2 LhFK8Ut2Sw3nXy55RGzqcWYNRYVsTflaKrs/Hy3rzcY65TipMhK5xz7dyGWNKRdqaC9p i1yw== X-Gm-Message-State: APjAAAVibVVY13Sf7K7ayqMx73x+W8mZA5rp2DtCZznWUkwZy8bLQ9yj n/nXvQTS4vmwtuLUrxti30FiQSnkfO8= X-Google-Smtp-Source: APXvYqzViCtAvCK10BpI4qElZSEpPKm/a+k0YJNcJ9dM7GkJxj1TD9lsRfTXPKRTjZOGH+lFfq2YZw== X-Received: by 2002:a17:90a:db0b:: with SMTP id g11mr13715423pjv.140.1575618371090; Thu, 05 Dec 2019 23:46:11 -0800 (PST) Received: from super-sugar.huaqin.com ([101.78.151.194]) by smtp.gmail.com with ESMTPSA id u4sm2065226pjb.31.2019.12.05.23.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 23:46:10 -0800 (PST) From: Jerry Han To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel Date: Fri, 6 Dec 2019 15:45:57 +0800 Message-Id: <20191206074557.19221-1-jerry.han.hq@gmail.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Fri, 06 Dec 2019 08:17:34 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=rFcNN77nLDaE7mPcrOF+qBbMMDJjTFiy2iEDowiCNHU=; b=jNRomOYNvVESxehhp9uQhU0NJZB+PK5PEjpOQYTcPecTG4+kiHel9aG2USMgdysj9N +JU1dOhyclmbq6smK1lYGB9YgU0rUdBpahxcukeSf67MuhnQXvXjudMU+hTSOxcdIbHd PPiuNndCTqPSvAUDbr6JTkAzw72DhUxdVYS3Y153HQuPwYDpumP/D5Oju4Ry7EHi8/ro 8VrI6Lui+jaS2jAaWzVwmExWmC3ZKJL3eHgpss9fUgZ2AQbn9janFlD/uAr3GvNXK7dq vT41xBbfyM7Wjs3ln0qBwVsnCJGVFbeHYzoaK+MC25FRjGXswXPkgaN0Wb+far6WCJom ibVQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jerry Han , Jitao Shi , Rock wang MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI panel. V9: - Adjust init code, make the format more concise - kill off default_off_cmds (Emil) - use mipi_dsi_dcs_set_display_{on,off} in their enable/disable callbacks. (Emil) - Adjusting the delay function (Emil) V8: - modify PARENTHESIS_ALIGNMENT format (Sam) - use gpios are required API replace optional gpio API (Emil) V7: - Modify communication address V6: - Add the information of the reviewer - Remove unnecessary delays, The udelay_range code gracefully returns without hitting the scheduler on a delay of 0. (Derek) - Merge the same data structures, like display_mode and off_cmds (Derek) - Optimize the processing of results returned by devm_gpiod_get_optional (Derek) V5: - Add the information of the reviewer (Sam) - Delete unnecessary header files #include (Sam) - The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam) - ADD static, set_gpios function is not used outside this module (Sam) V4: - Frefix all function maes with boe_ (Sam) - Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam) - Sort include lines alphabetically (Sam) - Fixed entries in the makefile must be sorted alphabetically (Sam) - Add send_mipi_cmds function to avoid duplicating the code (Sam) - Add the necessary delay(reset_delay_t5) between reset and sending the initialization command (Rock wang) V3: - Remove unnecessary delays in sending initialization commands (Jitao Shi) V2: - Use SPDX identifier (Sam) - Use necessary header files replace drmP.h (Sam) - Delete unnecessary header files #include (Sam) - Specifies a GPIOs array to control the reset timing, instead of reading "dsi-reset-sequence" data from DTS (Sam) - Delete backlight_disable() function when already disabled (Sam) - Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam) - Move the necessary data in the DTS to the current file, like porch, display_mode and Init code etc. (Sam) - Add compatible device "boe,himax8279d10p" (Sam) V1: - Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI panel. Signed-off-by: Jerry Han Reviewed-by: Sam Ravnborg Reviewed-by: Derek Basehore Reviewed-by: Emil Velikov Cc: Jitao Shi Cc: Rock wang Reported-by: kbuild test robot --- MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-boe-himax8279d.c | 989 +++++++++++++++++++ 4 files changed, 1007 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c diff --git a/MAINTAINERS b/MAINTAINERS index c2b89453805f..295cb214834c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5135,6 +5135,12 @@ T: git git://anongit.freedesktop.org/drm/drm-misc S: Maintained F: drivers/gpu/drm/bochs/ +DRM DRIVER FOR BOE HIMAX8279D PANELS +M: Jerry Han +S: Maintained +F: drivers/gpu/drm/panel/panel-boe-himax8279d.c +F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt + DRM DRIVER FOR FARADAY TVE200 TV ENCODER M: Linus Walleij T: git git://anongit.freedesktop.org/drm/drm-misc diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index f152bc4eeb53..683ff77a3733 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE reference designs. The panel is detected using special registers in the Versatile family syscon registers. +config DRM_PANEL_BOE_HIMAX8279D + tristate "Boe Himax8279d 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 Boe Himax8279d + TFT-LCD modules. The panel has a 1200x1920 resolution and uses + 24 bit RGB per pixel. It provides a MIPI DSI interface to + the host and has a built-in LED backlight. + config DRM_PANEL_LVDS tristate "Generic LVDS panel driver" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index b6cd39fe0f20..8783476110a3 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o +obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c new file mode 100644 index 000000000000..5fcf69b18563 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c @@ -0,0 +1,989 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd + * + * Author: Jerry Han + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include