From patchwork Thu Apr 25 03:27:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Han X-Patchwork-Id: 10916195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E660B161F for ; Thu, 25 Apr 2019 07:40:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D69E528BA6 for ; Thu, 25 Apr 2019 07:40:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C99AB28BDE; Thu, 25 Apr 2019 07:40:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C04E428BA6 for ; Thu, 25 Apr 2019 07:40:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1DA21892A4; Thu, 25 Apr 2019 07:40:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by gabe.freedesktop.org (Postfix) with ESMTPS id AAC9B89190 for ; Thu, 25 Apr 2019 03:27:47 +0000 (UTC) Received: by mail-pl1-x644.google.com with SMTP id y12so7762180plk.11 for ; Wed, 24 Apr 2019 20:27:47 -0700 (PDT) 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=vbVQQjXy0YimOBpOVJbkoEJBcCzK8DIIPtP1Qx8GqZY=; b=RrPjTxbsIV5Jsso4vWfqEpUT4tYLTwZVWXkZ5dg/Gwfa3VElgOlvbadHX7Jc7eEGB/ m541UMpqa4s4VV7A82qRkAdXAXKddMAc7jKpXhr16LTIfKwO+P3fj31g7hYL9F81I7L5 fSQ5q0zM7LgNOTBAsYxZFKLJqiWe9i18q8rOoJDCs0mRpNXEjhApAD33XEVLN0+LMDUJ T9ouNrrAKt6FCTBD0R1wdpFdGYVA2HFi58HOsSKHd/7uSLk2j0jctLg7aicVmHe7L9hq Ilk0jxzLWz05nEd0mH0oYPbfzyWbTZb2xpu8tNG2sADaRWrKTqpHbWWKJ229pkr4MHa7 NDTA== X-Gm-Message-State: APjAAAV+PzuWLONNuNfCoGaHh9sCpW0/aU9YkK0Z5pb2iqamIZZyPNfm FvcZqzXONatKiwcGZAjzZwuiRvcq X-Google-Smtp-Source: APXvYqyoblfjwaTCfIV2F3zbAzgQ5Skgqs62wq3aZy+i14QZqyn2GX9S+1Kk8t9BVgxuYAXthmo4Vw== X-Received: by 2002:a17:902:f24:: with SMTP id 33mr29949648ply.44.1556162866381; Wed, 24 Apr 2019 20:27:46 -0700 (PDT) Received: from super-sugar.huaqin.com ([220.232.156.66]) by smtp.gmail.com with ESMTPSA id 129sm35691919pgc.24.2019.04.24.20.27.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 20:27:45 -0700 (PDT) From: Jerry Han To: dri-devel@lists.freedesktop.org Subject: [PATCH] [v8,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel Date: Thu, 25 Apr 2019 11:27:12 +0800 Message-Id: <20190425032712.26011-1-jerry.han.hq@gmail.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Thu, 25 Apr 2019 07:40:14 +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=vbVQQjXy0YimOBpOVJbkoEJBcCzK8DIIPtP1Qx8GqZY=; b=RUctkke3SpBs67BbR90SW62k8RWUvK6NlDYgHWzvwSPJrjYlieAexxSvmXFHcvR3ke bWK+jCW8hePSMXy+w/VIAWh0BhOTE3LhsAQmLS2NwjUWXTub/adUQxXb8mVecju2Taya eN0wGmBNK8crVWKW3k4PCHIrDu4yELnTn6QbcFvYRGjeswNP8XDQJ8Fi2+GJqIx/z/lG S2uHFJG4XUNGGA+omDSRgTREupVQKe5bLbwVBJyuo3BOZAHanLkVqsYRKtchDtKKnLg5 DPn+XAqo3l7zs29TkaEE/knj+Yt0EgPENpylHIihj2ym3JEi+F0Tn4aSI5gfaZsgkEo3 L9Rw== 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" X-Virus-Scanned: ClamAV using ClamSMTP Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI panel. V8: - Modify communication address V7: - 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) V6: - 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) V5: - Added changelog 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) Signed-off-by: Jerry Han Reviewed-by: Sam Ravnborg Reviewed-by: Derek Basehore Cc: Jitao Shi Cc: Rock wang Signed-off-by: Jerry Han <jerry.han.hq@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
--- MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1050 ++++++++++++++++++ 4 files changed, 1068 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c diff --git a/MAINTAINERS b/MAINTAINERS index f8e63bcc4c1c..267468ca72bb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4816,6 +4816,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 f53f817356db..fe2f87cc6627 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -17,6 +17,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 7834947a53b0..c4814b6f069e 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_ILITEK_IL9322) += panel-ilitek-ili9322.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..9c8ece4fa30a --- /dev/null +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c @@ -0,0 +1,1050 @@ +// 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