From patchwork Fri Jan 26 13:33:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10185787 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 29046602C8 for ; Fri, 26 Jan 2018 13:33:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 162C92932E for ; Fri, 26 Jan 2018 13:33:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A3C729332; Fri, 26 Jan 2018 13:33:50 +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 430352932E for ; Fri, 26 Jan 2018 13:33:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8EC1E6E21F; Fri, 26 Jan 2018 13:33:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6910D6E23C for ; Fri, 26 Jan 2018 13:33:45 +0000 (UTC) Received: by mail-lf0-x242.google.com with SMTP id 63so715395lfv.4 for ; Fri, 26 Jan 2018 05:33:45 -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=HnXvIgw2QQShZ8wuk95UaexoO1rJkgao/EaQWb4PMwc=; b=XMNhQ0qZdxb1wBMyTaY+AT9eb2D/fNeklhGzIJTQSHFEI5PPdswf8Foif7qjDYMvBS /Vvcwrdv7uHZE3sAMg090NaCpDrhHWw0DM4TCPLUfwdl2C8EVHe+mAXf2IhSESi8LccW owtECBP7mT6BzQqSYmOLmfZLwEkxZksYh9g0Y= 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=HnXvIgw2QQShZ8wuk95UaexoO1rJkgao/EaQWb4PMwc=; b=gHf3q3XTsZlOOANdFcPe99W+QAX3uuAMWZLo0Uoq7c4ms+5ye6R4+cgwKjtcK9PlU3 VTY3Qol211FOEr0dzmSn9A29PVBXq7n90UtGdMIKl83vDU3/sJryqjIu0LzXESEJZq86 qB+lyw0SkZAVtstGSKa+PvwdfZK0ZAFM8fbZj+o86vBJ7D+2DK9reb7HyFmKtcdDF8hR TVxIYYQhp1jAILKkKr5mfd7u61BrRQLkdvncJdNhEr8tFbWTJFfNU6ZsbySgZGc9J3x9 apbUADDmq9fKT2u6HP8TW0NasiDzKzpmcHQrs9wXOQUPnl/gv4hcFOPXxJ4rgX3CW440 Lz5g== X-Gm-Message-State: AKwxytdAwxRunYNok+lmG1RrMkGkSVdd4hsIRs485lMcVupL28u141VG agUb7PmPpU42iEtF8GwFrrUTZVyNFnk= X-Google-Smtp-Source: AH8x225cifFjm578ZnRCSbnkzexwKR69gL1ecz/GxSob6O2sitOkrCbRYHfRm+y+KC8J6VLogheqOQ== X-Received: by 10.25.212.68 with SMTP id l65mr7954650lfg.5.1516973623518; Fri, 26 Jan 2018 05:33:43 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id f3sm928911lja.63.2018.01.26.05.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 05:33:42 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/panel: Add support for ARM Versatile panels Date: Fri, 26 Jan 2018 14:33:36 +0100 Message-Id: <20180126133336.21343-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180126133336.21343-1-linus.walleij@linaro.org> References: <20180126133336.21343-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. Signed-off-by: Linus Walleij Reviewed-by: Eric Anholt --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-arm-versatile.c | 353 ++++++++++++++++++++++++++++ 4 files changed, 371 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..ce778ca20f3f --- /dev/null +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -0,0 +1,353 @@ +// 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