From patchwork Mon Feb 5 19:20:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10201579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96A99602CA for ; Mon, 5 Feb 2018 19:31:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D08128807 for ; Mon, 5 Feb 2018 19:31:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A1ED2886A; Mon, 5 Feb 2018 19:31:48 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 22C4E2897B for ; Mon, 5 Feb 2018 19:31:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0CEC6E245; Mon, 5 Feb 2018 19:31:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 282316E230 for ; Mon, 5 Feb 2018 19:31:07 +0000 (UTC) Received: by mail-lf0-x235.google.com with SMTP id k19so43425579lfj.1 for ; Mon, 05 Feb 2018 11:31:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xe/DH6J5Uma4kQt21eLSiwrPfbvJ52sBga6VHXe9wdI=; b=J/J4HneGwzrcXjEreNHZbm0Na2BrcfYdhqxonILz2g5YMLSK5/R62xCh3C8aNrXX9T nYFFBcXVKTyCfU+VPFjhQpLxemlgl7A5H08MwOOQG80NdZRXH6/4zkzwobt7lt4iDp78 6tV8+O9eXLz85pN2A/O0m2LEdIroXeBFGKiTw= 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:in-reply-to :references; bh=xe/DH6J5Uma4kQt21eLSiwrPfbvJ52sBga6VHXe9wdI=; b=CkD033AUR+yUBBJbJWSb4p9AXQ28LOh1wgQU/YOvWFEHGFcR4NcLENoEInX1C0iIgI gWmf2zbYrlm4ZAHiI6tY71fg0qbQiDvSxL5NwTsy+bRKY5BLG3qy1Uw1loskR0yHoPLs xVL4cSkWBpJSQuBNAqlymWn23JHFWM0/u8RUUwv2txPpsjNtEwEyWgIWi8x5SvExXiGc 1Vjm+8cqsmFBQrNFzFnCMpLYBkQkVhwxdrCUbpoABv7WsbQ+7NIBABAyvtD4AQCbUem8 XXPsW3tSwk5jadSn9jcZiwPOdGNyH35t2ZU7oAECvxTAJuK3b3dBZkA2WM9rn72+1y95 8fpg== X-Gm-Message-State: APf1xPDsmrJ2ii3Ow4KGtgGjH6mfjrWmCFhouUR6RQbAqzdXrWH6nvMw 87wLLeSHkpeCesJLgOGZZV+Jmye+T5c= X-Google-Smtp-Source: AH8x225PaTyw4YRWi7JNolPnlEmwj0h0iamV5On6C+pD86sXC5Z/SRSjT8RXdQcme9hWUYX5Asbhuw== X-Received: by 10.25.31.200 with SMTP id f191mr8431407lff.68.1517859065370; Mon, 05 Feb 2018 11:31:05 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id e21sm1958820lfb.51.2018.02.05.11.31.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Feb 2018 11:31:04 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2 v2] drm/panel: Add support for ARM Versatile panels Date: Mon, 5 Feb 2018 20:20:13 +0100 Message-Id: <20180205192013.5349-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180205192013.5349-1-linus.walleij@linaro.org> References: <20180205192013.5349-1-linus.walleij@linaro.org> 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ARM reference designs "Versatile AB" and "Versatile PB" contain panel connectors with autodetection of the connected panel type. This adds a small driver utilizing the MFD syscon look-up to read the autodetection register and set up the corresponding panel appropriately. In the source file there is a bit of elaboration of the panel types and interfaces on these boards. This was tested with the PL111 DRM driver on the ARM Versatile AB with the IB2 daughterboard. Reviewed-by: Eric Anholt Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Use inline documentation style for the structs. - Explicit positive hsync and vsync on the panels requiring it - Convert two dev_info() to dev_dbg() - Collect Eric's Review tag. --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-arm-versatile.c | 377 ++++++++++++++++++++++++++++ 4 files changed, 395 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-arm-versatile.c diff --git a/MAINTAINERS b/MAINTAINERS index 18994806e441..e4fc490fa320 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4442,6 +4442,13 @@ T: git git://anongit.freedesktop.org/drm/drm-misc S: Supported F: drivers/gpu/drm/pl111/ +DRM DRIVER FOR ARM VERSATILE TFT PANELS +M: Linus Walleij +T: git git://anongit.freedesktop.org/drm/drm-misc +S: Maintained +F: drivers/gpu/drm/panel/panel-arm-versatile.c +F: Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.txt + DRM DRIVER FOR AST SERVER GRAPHICS CHIPS M: Dave Airlie S: Odd Fixes diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 726f3fb3312d..04732adbb48f 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -7,6 +7,16 @@ config DRM_PANEL menu "Display Panels" depends on DRM && DRM_PANEL +config DRM_PANEL_ARM_VERSATILE + tristate "ARM Versatile panel driver" + depends on OF + depends on MFD_SYSCON + select VIDEOMODE_HELPERS + help + This driver supports the ARM Versatile panels connected to ARM + reference designs. The panel is detected using special registers + in the Versatile family syscon registers. + 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 2c4e1a93e05f..091fa6647769 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c new file mode 100644 index 000000000000..3930b4925b15 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -0,0 +1,377 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Panel driver for the ARM Versatile family reference designs from + * ARM Limited. + * + * Author: + * Linus Walleij + * + * On the Versatile AB, these panels come mounted on daughterboards + * named "IB1" or "IB2" (Interface Board 1 & 2 respectively.) They + * are documented in ARM DUI 0225D Appendix C and D. These daughter + * boards support TFT display panels. + * + * - The IB1 is a passive board where the display connector defines a + * few wires for encoding the display type for autodetection, + * suitable display settings can then be looked up from this setting. + * The magic bits can be read out from the system controller. + * + * - The IB2 is a more complex board intended for GSM phone development + * with some logic and a control register, which needs to be accessed + * and the board display needs to be turned on explicitly. + * + * On the Versatile PB, a special CLCD adaptor board is available + * supporting the same displays as the Versatile AB, plus one more + * Epson QCIF display. + * + */ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include